ftown 0.20.9 → 0.24.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/attention-events.d.ts +1 -1
- package/dist/attention-store.d.ts +3 -0
- package/dist/attention-store.js +25 -1
- package/dist/attention-store.js.map +1 -1
- package/dist/centrifugo-client.d.ts +28 -11
- package/dist/centrifugo-client.js +84 -70
- package/dist/centrifugo-client.js.map +1 -1
- package/dist/cli-client.d.ts +11 -1
- package/dist/cli-client.js +23 -3
- package/dist/cli-client.js.map +1 -1
- package/dist/command-rpc.d.ts +2 -0
- package/dist/command-rpc.js +59 -17
- package/dist/command-rpc.js.map +1 -1
- package/dist/identity-reset.d.ts +4 -1
- package/dist/identity-reset.js +54 -6
- package/dist/identity-reset.js.map +1 -1
- package/dist/index.js +194 -288
- package/dist/index.js.map +1 -1
- package/dist/ledger-pairing-client.d.ts +28 -0
- package/dist/ledger-pairing-client.js +154 -0
- package/dist/ledger-pairing-client.js.map +1 -0
- package/dist/ledger-relay.d.ts +159 -0
- package/dist/ledger-relay.js +595 -0
- package/dist/ledger-relay.js.map +1 -0
- package/dist/ledger-reoffer.d.ts +56 -0
- package/dist/ledger-reoffer.js +210 -0
- package/dist/ledger-reoffer.js.map +1 -0
- package/dist/ledger-startup.d.ts +176 -0
- package/dist/ledger-startup.js +233 -0
- package/dist/ledger-startup.js.map +1 -0
- package/dist/local-api-server.d.ts +3 -0
- package/dist/local-api-server.js +68 -6
- package/dist/local-api-server.js.map +1 -1
- package/dist/mail-delivery.d.ts +26 -3
- package/dist/mail-delivery.js +65 -7
- package/dist/mail-delivery.js.map +1 -1
- package/dist/preview-protocol.d.ts +19 -3
- package/dist/preview-protocol.js +14 -0
- package/dist/preview-protocol.js.map +1 -1
- package/dist/relay-token.d.ts +45 -0
- package/dist/relay-token.js +138 -0
- package/dist/relay-token.js.map +1 -0
- package/dist/revocation-gating.d.ts +0 -13
- package/dist/revocation-gating.js +0 -16
- package/dist/revocation-gating.js.map +1 -1
- package/dist/security/bridge/identity.d.ts +2 -47
- package/dist/security/bridge/identity.js +3 -3
- package/dist/security/bridge/identity.js.map +1 -1
- package/dist/security/bridge/ledger-identity.d.ts +48 -0
- package/dist/security/bridge/ledger-identity.js +342 -0
- package/dist/security/bridge/ledger-identity.js.map +1 -0
- package/dist/security/bridge/ledger-rpc.d.ts +34 -0
- package/dist/security/bridge/ledger-rpc.js +58 -0
- package/dist/security/bridge/ledger-rpc.js.map +1 -0
- package/dist/security/bridge/ledger-store.d.ts +153 -0
- package/dist/security/bridge/ledger-store.js +825 -0
- package/dist/security/bridge/ledger-store.js.map +1 -0
- package/dist/security/bridge/metadata.d.ts +2 -2
- package/dist/security/bridge/permissions.js +4 -3
- package/dist/security/bridge/permissions.js.map +1 -1
- package/dist/security/bridge/policy.d.ts +43 -23
- package/dist/security/bridge/policy.js +214 -146
- package/dist/security/bridge/policy.js.map +1 -1
- package/dist/security/bridge/security.d.ts +212 -33
- package/dist/security/bridge/security.js +437 -165
- package/dist/security/bridge/security.js.map +1 -1
- package/dist/security/crypto.js +1 -1
- package/dist/security/crypto.js.map +1 -1
- package/dist/security/ledger/announce.d.ts +32 -0
- package/dist/security/ledger/announce.js +101 -0
- package/dist/security/ledger/announce.js.map +1 -0
- package/dist/security/ledger/channels.d.ts +5 -0
- package/dist/security/ledger/channels.js +21 -0
- package/dist/security/ledger/channels.js.map +1 -0
- package/dist/security/ledger/ledger.d.ts +154 -0
- package/dist/security/ledger/ledger.js +878 -0
- package/dist/security/ledger/ledger.js.map +1 -0
- package/dist/security/ledger/pairing.d.ts +81 -0
- package/dist/security/ledger/pairing.js +414 -0
- package/dist/security/ledger/pairing.js.map +1 -0
- package/dist/security/ledger/proof.d.ts +36 -0
- package/dist/security/ledger/proof.js +193 -0
- package/dist/security/ledger/proof.js.map +1 -0
- package/dist/security/ledger/protocol.d.ts +113 -0
- package/dist/security/ledger/protocol.js +16 -0
- package/dist/security/ledger/protocol.js.map +1 -0
- package/dist/security/ledger/testing.d.ts +27 -0
- package/dist/security/ledger/testing.js +70 -0
- package/dist/security/ledger/testing.js.map +1 -0
- package/dist/security/ledger/webauthn.d.ts +12 -0
- package/dist/security/ledger/webauthn.js +147 -0
- package/dist/security/ledger/webauthn.js.map +1 -0
- package/dist/security/protocol.d.ts +5 -10
- package/dist/security-cli.d.ts +5 -0
- package/dist/security-cli.js +28 -16
- package/dist/security-cli.js.map +1 -1
- package/dist/session-controller.d.ts +9 -3
- package/dist/session-controller.js +120 -20
- package/dist/session-controller.js.map +1 -1
- package/dist/session-inbox-protocol.d.ts +2 -0
- package/dist/session-preview.d.ts +20 -5
- package/dist/session-preview.js +185 -37
- package/dist/session-preview.js.map +1 -1
- package/dist/session-store.js +19 -1
- package/dist/session-store.js.map +1 -1
- package/dist/sessions-commands.js +41 -7
- package/dist/sessions-commands.js.map +1 -1
- package/dist/token-provider.d.ts +39 -0
- package/dist/token-provider.js +101 -0
- package/dist/token-provider.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/opencode-plugin/ftown.js +15 -2
- package/package.json +2 -2
- package/skills/ftown/SKILL.md +18 -7
- package/skills/ftown/references/sessions.md +38 -12
- package/dist/bridge-auth.d.ts +0 -31
- package/dist/bridge-auth.js +0 -70
- package/dist/bridge-auth.js.map +0 -1
- package/dist/pairing-client.d.ts +0 -62
- package/dist/pairing-client.js +0 -469
- package/dist/pairing-client.js.map +0 -1
- package/dist/rotating-token-refresher.d.ts +0 -42
- package/dist/rotating-token-refresher.js +0 -91
- package/dist/rotating-token-refresher.js.map +0 -1
- package/dist/security/account-crypto.d.ts +0 -33
- package/dist/security/account-crypto.js +0 -649
- package/dist/security/account-crypto.js.map +0 -1
- package/dist/security/account-protocol.d.ts +0 -228
- package/dist/security/account-protocol.js +0 -2
- package/dist/security/account-protocol.js.map +0 -1
- package/dist/security/bridge/account-client.d.ts +0 -7
- package/dist/security/bridge/account-client.js +0 -101
- package/dist/security/bridge/account-client.js.map +0 -1
- package/dist/security/bridge/account-state.d.ts +0 -105
- package/dist/security/bridge/account-state.js +0 -79
- package/dist/security/bridge/account-state.js.map +0 -1
- package/dist/security/bridge/pending-approval.d.ts +0 -21
- package/dist/security/bridge/pending-approval.js +0 -80
- package/dist/security/bridge/pending-approval.js.map +0 -1
- package/dist/security/bridge/pending-enrollment.d.ts +0 -33
- package/dist/security/bridge/pending-enrollment.js +0 -177
- package/dist/security/bridge/pending-enrollment.js.map +0 -1
- package/dist/security/bridge/revocation.d.ts +0 -14
- package/dist/security/bridge/revocation.js +0 -40
- package/dist/security/bridge/revocation.js.map +0 -1
- package/dist/security/pending-approval-crypto.d.ts +0 -29
- package/dist/security/pending-approval-crypto.js +0 -716
- package/dist/security/pending-approval-crypto.js.map +0 -1
- package/dist/security/pending-approval-protocol.d.ts +0 -329
- package/dist/security/pending-approval-protocol.js +0 -2
- package/dist/security/pending-approval-protocol.js.map +0 -1
- package/dist/security/security-nudge.d.ts +0 -31
- package/dist/security/security-nudge.js +0 -98
- package/dist/security/security-nudge.js.map +0 -1
|
@@ -1,15 +1,101 @@
|
|
|
1
1
|
import type { ApplicationJson, ApprovedEndpoint, BridgeInvitation, BridgeSecurity, EndpointIdentity, EnrollmentPacket, InboundTransportContext, InvitationOptions, LocalRecoveryAuthority, SecureApplication, SecureEnvelope, SecurePublication, VerifiedApplication, VerifiedPrincipal } from '../protocol.js';
|
|
2
|
-
import { BridgePolicyStore, type PolicyOptions } from './policy.js';
|
|
3
|
-
import type {
|
|
2
|
+
import { BridgePolicyStore, type LedgerOwnStatus, type PolicyOptions } from './policy.js';
|
|
3
|
+
import type { LedgerHeadRelation, LedgerRelation } from '../ledger/ledger.js';
|
|
4
|
+
import type { Ledger } from '../ledger/protocol.js';
|
|
5
|
+
import { type HeadAnnouncement } from '../ledger/announce.js';
|
|
6
|
+
import type { BridgeLedgerStore, LedgerSource } from './ledger-store.js';
|
|
4
7
|
export declare const applicationJson: (value: unknown) => ApplicationJson;
|
|
8
|
+
/** Account mode: the local ledger replica is the only source of browser authority. */
|
|
9
|
+
export interface BridgeLedgerOptions {
|
|
10
|
+
store: BridgeLedgerStore;
|
|
11
|
+
/** Must equal the service's bridgeId. */
|
|
12
|
+
bridgeId: string;
|
|
13
|
+
/** This bridge's auth key (raw P-256, base64url) as listed in its add_bridge. */
|
|
14
|
+
authPublicKey: string;
|
|
15
|
+
/** The server's copy of the ledger (GET /api/account/ledger), read by startLedger and refreshLedger. Bound it with a timeout. */
|
|
16
|
+
fetchLedger: () => Promise<unknown>;
|
|
17
|
+
/** Wall clock for offline grace and server contact; defaults to the policy clock. */
|
|
18
|
+
now?: () => number;
|
|
19
|
+
/** Monotonic clock for the in-process grace bound; defaults to performance.now(). */
|
|
20
|
+
monotonic?: () => number;
|
|
21
|
+
}
|
|
5
22
|
export interface BridgeSecurityOptions extends PolicyOptions {
|
|
6
23
|
relayUserId: string;
|
|
7
24
|
browserOrigin?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
25
|
+
/** Absent for Solo and --local: their devices come only from invitations and the local CLI. */
|
|
26
|
+
ledger?: BridgeLedgerOptions;
|
|
27
|
+
}
|
|
28
|
+
/** A refused history (the store's divergence entry, server preferred), as the status shows it: heads cut to 8 characters. */
|
|
29
|
+
export interface LedgerDivergenceStatus {
|
|
30
|
+
source: LedgerSource;
|
|
31
|
+
otherHead: string;
|
|
32
|
+
otherRevision: number;
|
|
33
|
+
ourRevision: number;
|
|
34
|
+
firstSeen: number;
|
|
35
|
+
/** The revision both histories last share; null when unknown. */
|
|
36
|
+
forkRevision: number | null;
|
|
37
|
+
/** That history removes this computer (status only: this bridge keeps its own history and is never reset by it). */
|
|
38
|
+
removedOnOtherHistory: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** What this bridge holds that the server lacks (its records after the fork point, or after the server's revision when the server is
|
|
41
|
+
* behind): the removals (revoke_device / revoke_bridge) and passkeys (add_authority) among them. */
|
|
42
|
+
export interface UniqueHistory {
|
|
43
|
+
afterRevision: number;
|
|
44
|
+
records: number;
|
|
45
|
+
removals: number;
|
|
46
|
+
passkeys: number;
|
|
47
|
+
}
|
|
48
|
+
export interface LedgerStatus {
|
|
49
|
+
accountId: string | null;
|
|
50
|
+
revision: number | null;
|
|
51
|
+
head: string | null;
|
|
52
|
+
own: LedgerOwnStatus;
|
|
53
|
+
/** Another valid history of this account was refused (CONTRACT §5); null when none is recorded. */
|
|
54
|
+
divergence: LedgerDivergenceStatus | null;
|
|
55
|
+
/** The last server chain this bridge evaluated was a strict prefix of its own (the bridge re-offers its chain). */
|
|
56
|
+
serverBehind: boolean;
|
|
57
|
+
/** A refused history (from the server or the relay) removes this computer. Status only. */
|
|
58
|
+
removedOnOtherHistory: boolean;
|
|
59
|
+
/** Head announcements from the ledger channel since start: verified against the trusted checkpoint ('accepted'), or refused ('dropped':
|
|
60
|
+
* bad signature, unknown or revoked member, other account, stale, or no trusted chain yet). This bridge's own echoes are not counted. */
|
|
61
|
+
announcements: {
|
|
62
|
+
accepted: number;
|
|
63
|
+
dropped: number;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
type OfferDecision = 'adopt' | 'keep' | 'reject';
|
|
67
|
+
/** An offer's decision, the candidate's relation to the stored chain (null: none, e.g. malformed) and its tip (null: unparseable). */
|
|
68
|
+
export interface LedgerOfferOutcome {
|
|
69
|
+
decision: OfferDecision;
|
|
70
|
+
relation: LedgerRelation | null;
|
|
71
|
+
head: string | null;
|
|
72
|
+
revision: number | null;
|
|
73
|
+
}
|
|
74
|
+
/** readServerLedger: the server's chain was read and offered ('read'), the server does not know the account (404), or the read failed. */
|
|
75
|
+
export type ServerLedgerRead = {
|
|
76
|
+
kind: 'read';
|
|
77
|
+
outcome: LedgerOfferOutcome;
|
|
78
|
+
} | {
|
|
79
|
+
kind: 'unknown_account';
|
|
80
|
+
reason: string;
|
|
81
|
+
} | {
|
|
82
|
+
kind: 'failed';
|
|
83
|
+
reason: string;
|
|
84
|
+
};
|
|
85
|
+
/** The stored chain as a trusted browser may read it (ledger_head / ledger_chain). */
|
|
86
|
+
export interface MemberLedger {
|
|
87
|
+
ledger: Ledger;
|
|
88
|
+
accountId: string;
|
|
89
|
+
head: string;
|
|
90
|
+
revision: number;
|
|
91
|
+
}
|
|
92
|
+
/** ledger_head: the stored tip only. */
|
|
93
|
+
export interface MemberHead {
|
|
94
|
+
accountId: string;
|
|
95
|
+
head: string;
|
|
96
|
+
revision: number;
|
|
11
97
|
}
|
|
12
|
-
export declare class BridgeSecurityService implements BridgeSecurity {
|
|
98
|
+
export declare class BridgeSecurityService implements Omit<BridgeSecurity, 'adoptAccount'> {
|
|
13
99
|
readonly identity: EndpointIdentity;
|
|
14
100
|
readonly bridgeId: string;
|
|
15
101
|
readonly options: BridgeSecurityOptions;
|
|
@@ -24,13 +110,26 @@ export declare class BridgeSecurityService implements BridgeSecurity {
|
|
|
24
110
|
private bridgeRevokedEmitted;
|
|
25
111
|
private readonly verified;
|
|
26
112
|
private closed;
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private readonly
|
|
113
|
+
private readonly ledgerNow;
|
|
114
|
+
/** Ledger offers and their projections run one at a time, so the policy never sees an older view after a newer one. */
|
|
115
|
+
private ledgerTail;
|
|
116
|
+
private status;
|
|
117
|
+
private readonly announcements;
|
|
118
|
+
private readonly headListeners;
|
|
119
|
+
private readonly ledgerMonotonic;
|
|
120
|
+
/** The trusted view of the last projection (null: none yet, or another account's). */
|
|
121
|
+
private trustedView;
|
|
122
|
+
/** The state of the last projection (null: none yet, or an empty store), and the record heads of its chain (null: not computed). */
|
|
123
|
+
private held;
|
|
124
|
+
private heads;
|
|
125
|
+
private readonly approvalListeners;
|
|
126
|
+
private readonly approvalEmitted;
|
|
127
|
+
private readonly pendingOffers;
|
|
128
|
+
private serverBehind;
|
|
129
|
+
/** The server's revision when it was last seen behind us (null: unknown). */
|
|
130
|
+
private serverRevision;
|
|
131
|
+
private refreshing;
|
|
132
|
+
private refreshQueued;
|
|
34
133
|
constructor(identity: EndpointIdentity, bridgeId: string, dataDir: string, options: BridgeSecurityOptions);
|
|
35
134
|
private context;
|
|
36
135
|
private freshness;
|
|
@@ -49,31 +148,111 @@ export declare class BridgeSecurityService implements BridgeSecurity {
|
|
|
49
148
|
createInvitation(actor: VerifiedPrincipal | LocalRecoveryAuthority, options: InvitationOptions): Promise<BridgeInvitation>;
|
|
50
149
|
listDevices(actor: VerifiedPrincipal): Promise<ApprovedEndpoint[]>;
|
|
51
150
|
revokeEndpoint(actor: VerifiedPrincipal, endpointId: string): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Account mode only (no-op without a ledger). Loads the replica, projects it and checks this bridge's own status; a stored chain that
|
|
153
|
+
* already revokes this bridge is signed proof on its own, so it emits and nothing is fetched. Otherwise offers the server's ledger
|
|
154
|
+
* once; a fetch failure is logged, not fatal, and a successful read that is not rejected counts as server contact.
|
|
155
|
+
* Throws when the local replica cannot be read (corrupted, another account's, or unreadable; it is never reset) or the policy
|
|
156
|
+
* cannot be written.
|
|
157
|
+
*/
|
|
158
|
+
startLedger(): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Reads the server's ledger and offers it ('server') through readServerLedger. A result that is not 'reject' counts as server contact;
|
|
161
|
+
* a fetch failure is logged, never thrown. Single in flight: calls during a read share one trailing read, so a change announced
|
|
162
|
+
* mid-read is not missed. The wiring calls it on every relay (re)subscribe and on a `ledger_head` that differs from ledgerStatus().head,
|
|
163
|
+
* and checks ledgerStatus().serverBehind afterwards.
|
|
164
|
+
*/
|
|
165
|
+
refreshLedger(): Promise<void>;
|
|
166
|
+
private refreshOnce;
|
|
167
|
+
/**
|
|
168
|
+
* One read of the server's ledger (not coalesced), offered as 'server'; a result that is not 'reject' counts as server contact. Never
|
|
169
|
+
* throws: a 404 is 'unknown_account' (the server does not know this account), any other failure 'failed'. The re-offer runs it right
|
|
170
|
+
* before it posts; refreshLedger runs it for everything else.
|
|
171
|
+
*/
|
|
172
|
+
readServerLedger(): Promise<ServerLedgerRead>;
|
|
173
|
+
/** offerLedgerResult(candidate, source).decision. */
|
|
174
|
+
offerLedger(candidate: unknown, source: LedgerSource): Promise<OfferDecision>;
|
|
175
|
+
/**
|
|
176
|
+
* Offers an untrusted chain (the relay, a relay-token response, a server read or answer) to the replica, then projects the result and
|
|
177
|
+
* checks this bridge's own status. Never throws: an invalid candidate, a closed service and a local storage failure all return 'reject'.
|
|
178
|
+
* Per source at most one offer waits behind the one in flight; a newer one replaces it, and the replaced caller gets the newer outcome.
|
|
179
|
+
* A chain equal to the stored one or a prefix of it is answered keep/same or keep/behind from record heads alone (no signature check),
|
|
180
|
+
* unless a divergence is recorded for that source (the store clears it). The outcome of a 'server' chain sets serverBehind. Offers never
|
|
181
|
+
* count as server contact: readServerLedger and noteServerContact decide that.
|
|
182
|
+
*/
|
|
183
|
+
offerLedgerResult(candidate: unknown, source: LedgerSource): Promise<LedgerOfferOutcome>;
|
|
184
|
+
private evaluate;
|
|
185
|
+
/** Records what a non-rejected 'server' chain says about the server: behind (a strict prefix of ours) or not. */
|
|
186
|
+
private observed;
|
|
187
|
+
private setServerBehind;
|
|
188
|
+
/**
|
|
189
|
+
* A relay-token answer that carried no chain: the server's head is `head` (at `revision` when the answer named one, else the head the
|
|
190
|
+
* request sent). Classified against the stored chain from record heads alone: 'same', 'behind' (sets serverBehind), or 'unknown'
|
|
191
|
+
* (ahead, diverged, or not a head of ours: the caller reads the server). null without a ledger, a head, or a stored chain.
|
|
192
|
+
*/
|
|
193
|
+
noteServerHead(server: {
|
|
194
|
+
head: string | null;
|
|
195
|
+
revision: number | null;
|
|
196
|
+
}): LedgerHeadRelation | null;
|
|
197
|
+
/**
|
|
198
|
+
* What this bridge holds that the server does not (for the startup message when the server refuses our key): our records after the
|
|
199
|
+
* fork point of a recorded server divergence, or after the server's revision when it was seen behind us; null when neither is known.
|
|
200
|
+
*/
|
|
201
|
+
uniqueHistory(): UniqueHistory | null;
|
|
202
|
+
/**
|
|
203
|
+
* Account mode, read-only (ledger_head / ledger_chain): the stored chain, for a BROWSER that is a member of this bridge's trusted
|
|
204
|
+
* checkpoint (listed with exactly this endpoint key, not revoked; policy access, offline grace and own status included). Throws
|
|
205
|
+
* BridgeSecurityError('permission_denied') for anyone else, Solo, --local and the local CLI.
|
|
206
|
+
*/
|
|
207
|
+
memberLedger(principal: VerifiedPrincipal): Promise<MemberLedger>;
|
|
208
|
+
/** ledger_head: like memberLedger, but answers the tip only, without touching the chain. */
|
|
209
|
+
memberHead(principal: VerifiedPrincipal): Promise<MemberHead>;
|
|
210
|
+
private memberState;
|
|
211
|
+
/** A successful server contact (the token provider calls this after a relay-token response): re-anchors offline grace at now and
|
|
212
|
+
* persists it (the replica's lastServerReadAt and the clock high-water). An invalid time is ignored. */
|
|
213
|
+
noteServerContact(now?: number): void;
|
|
214
|
+
ledgerStatus(): LedgerStatus;
|
|
215
|
+
/**
|
|
216
|
+
* A head announcement from the ledger channel (parsed, from an owner publication), judged against this bridge's TRUSTED checkpoint (sticky
|
|
217
|
+
* revocations applied) and the record heads of its stored chain: its relation ('same', 'behind' or 'unknown': the caller runs a paced server
|
|
218
|
+
* read) when it verifies, else null. This bridge's own announcements (kind bridge, its bridgeId) return null before any work and are not
|
|
219
|
+
* counted; every other null is counted as dropped, every relation as accepted. At most one signature verification, then an O(1) compare.
|
|
220
|
+
* Never throws. An announcement is never proof: nothing here changes the replica.
|
|
221
|
+
*/
|
|
222
|
+
judgeHeadAnnouncement(announcement: HeadAnnouncement): Promise<LedgerHeadRelation | null>;
|
|
223
|
+
/** Account mode: fires (synchronously, after the projection) whenever the stored head or this bridge's own status changes, e.g. after an
|
|
224
|
+
* adopt. Listener errors are logged. */
|
|
225
|
+
onLedgerHead(listener: () => void): () => void;
|
|
226
|
+
private ledgerTask;
|
|
227
|
+
/** This bridge's keys, exactly as its add_bridge lists them. */
|
|
228
|
+
private ownKeys;
|
|
229
|
+
/**
|
|
230
|
+
* This bridge in `trusted` (applyRevocations of the projected RAW chain `ledger`). 'active' = listed with exactly its keys. 'revoked' =
|
|
231
|
+
* the RAW chain proves the removal of THIS bridge (ledgerRemovesBridge: it added these keys, then revoked the id), the only status that
|
|
232
|
+
* resets the identity, decided exactly like the startup check (store.ownBridgeStatus). A sticky-only id, a removal seen on a refused
|
|
233
|
+
* history (C1c `seen`, never merged for our own id anyway) or a tombstone of our id is 'absent': fail closed, never a reset.
|
|
234
|
+
*/
|
|
235
|
+
private ownOf;
|
|
236
|
+
/** `trusted` is always the store's applyRevocations output, never its raw checkpoint. Own status acts before the policy write, so
|
|
237
|
+
* neither the revocation nor its emission waits on (or is lost to) a policy storage failure. */
|
|
238
|
+
private projectState;
|
|
239
|
+
private project;
|
|
240
|
+
private emitLedgerHead;
|
|
65
241
|
private emitRevoked;
|
|
66
|
-
private pinnedCheckpoint;
|
|
67
|
-
/** A refused fetched history is still evidence, but only against the pin as it stands now: adoption is not serialized
|
|
68
|
-
* with reads, and a fork from an older pin must never confirm. Pins only move forward by verified extension. */
|
|
69
|
-
private adoptFetched;
|
|
70
|
-
confirmRevocationEvidence(evidence: AccountHistory): Promise<boolean>;
|
|
71
242
|
private emitBridgeRevoked;
|
|
72
243
|
private notifyBridgeRevoked;
|
|
73
|
-
refreshAccount(): Promise<void>;
|
|
74
|
-
adoptAccount(actor: VerifiedPrincipal, head: AccountHead): Promise<AccountHead>;
|
|
75
244
|
onRevoked(listener: (endpointId: string) => void): () => void;
|
|
245
|
+
/**
|
|
246
|
+
* Account mode only: fires when a request (hello or application) is refused with approval_required for an endpoint the trusted
|
|
247
|
+
* ledger does not know, e.g. a browser whose add_device this replica has not seen yet (the wiring refreshes the ledger). Never for
|
|
248
|
+
* a revoked endpoint, never in Solo/local, never for the provisioned local CLI. At most once per endpoint per 2 s; listener errors
|
|
249
|
+
* are logged; the refusal itself is unchanged.
|
|
250
|
+
*/
|
|
251
|
+
onApprovalRequired(listener: (endpointId: string) => void): () => void;
|
|
252
|
+
private senderPrincipal;
|
|
253
|
+
private noteApprovalRequired;
|
|
76
254
|
/** Fires at most once per instance, only on signed proof that this bridge was revoked. */
|
|
77
255
|
onBridgeRevoked(listener: () => void): () => void;
|
|
78
256
|
close(): Promise<void>;
|
|
79
257
|
}
|
|
258
|
+
export {};
|