@941design/marmot 0.0.0-stage → 0.2.0-alpha.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/CHANGELOG.md +709 -0
- package/LICENSE +21 -0
- package/README.md +33 -2
- package/dist/account/admin.d.ts +72 -0
- package/dist/account/admin.js +209 -0
- package/dist/account/device-deps.d.ts +379 -0
- package/dist/account/device-deps.js +36 -0
- package/dist/account/device-lineage.d.ts +199 -0
- package/dist/account/device-lineage.js +390 -0
- package/dist/account/device-registry.d.ts +93 -0
- package/dist/account/device-registry.js +1290 -0
- package/dist/account/device-rotation.d.ts +61 -0
- package/dist/account/device-rotation.js +827 -0
- package/dist/account/enrolment.d.ts +339 -0
- package/dist/account/enrolment.js +1247 -0
- package/dist/account/identity-proof.d.ts +79 -0
- package/dist/account/identity-proof.js +264 -0
- package/dist/account/index.d.ts +17 -0
- package/dist/account/index.js +16 -0
- package/dist/account/restore-rotation.d.ts +21 -0
- package/dist/account/restore-rotation.js +22 -0
- package/dist/account/same-account-authorization.d.ts +86 -0
- package/dist/account/same-account-authorization.js +180 -0
- package/dist/account/teardown.d.ts +127 -0
- package/dist/account/teardown.js +856 -0
- package/dist/client/before-create-group.d.ts +18 -0
- package/dist/client/before-create-group.js +65 -0
- package/dist/client/before-publish-hooks.d.ts +121 -0
- package/dist/client/before-publish-hooks.js +180 -0
- package/dist/client/client-config.d.ts +42 -0
- package/dist/client/client-config.js +13 -0
- package/dist/client/commit-redrive.d.ts +68 -0
- package/dist/client/commit-redrive.js +221 -0
- package/dist/client/component-update.d.ts +43 -0
- package/dist/client/component-update.js +53 -0
- package/dist/client/confirm-hooks.d.ts +50 -0
- package/dist/client/confirm-hooks.js +59 -0
- package/dist/client/create-client.d.ts +1022 -0
- package/dist/client/create-client.js +1125 -0
- package/dist/client/group-disband.d.ts +28 -0
- package/dist/client/group-disband.js +64 -0
- package/dist/client/group-history.d.ts +435 -0
- package/dist/client/group-history.js +1295 -0
- package/dist/client/group-profile.d.ts +31 -0
- package/dist/client/group-profile.js +62 -0
- package/dist/client/group-records.d.ts +485 -0
- package/dist/client/group-records.js +1034 -0
- package/dist/client/group-removal.d.ts +36 -0
- package/dist/client/group-removal.js +127 -0
- package/dist/client/group-remove-member.d.ts +49 -0
- package/dist/client/group-remove-member.js +163 -0
- package/dist/client/group-runtime.d.ts +388 -0
- package/dist/client/group-runtime.js +2701 -0
- package/dist/client/group-snapshot.d.ts +98 -0
- package/dist/client/group-snapshot.js +453 -0
- package/dist/client/history-pages.d.ts +107 -0
- package/dist/client/history-pages.js +194 -0
- package/dist/client/inbox-send.d.ts +19 -0
- package/dist/client/inbox-send.js +71 -0
- package/dist/client/index.d.ts +21 -0
- package/dist/client/index.js +13 -0
- package/dist/client/ingest.d.ts +82 -0
- package/dist/client/ingest.js +1550 -0
- package/dist/client/lifecycle-events.d.ts +63 -0
- package/dist/client/lifecycle-events.js +35 -0
- package/dist/client/opaque-candidates.d.ts +81 -0
- package/dist/client/opaque-candidates.js +169 -0
- package/dist/client/own-change-outbox.d.ts +66 -0
- package/dist/client/own-change-outbox.js +156 -0
- package/dist/client/pending-leaf.d.ts +116 -0
- package/dist/client/pending-leaf.js +378 -0
- package/dist/client/permissions.d.ts +9 -0
- package/dist/client/permissions.js +12 -0
- package/dist/client/pipeline.d.ts +554 -0
- package/dist/client/pipeline.js +3545 -0
- package/dist/client/reentrancy-guard.d.ts +96 -0
- package/dist/client/reentrancy-guard.js +153 -0
- package/dist/client/rekey.d.ts +58 -0
- package/dist/client/rekey.js +149 -0
- package/dist/client/transport-policy.d.ts +181 -0
- package/dist/client/transport-policy.js +214 -0
- package/dist/history/equivocation.d.ts +55 -0
- package/dist/history/equivocation.js +113 -0
- package/dist/history/fencing.d.ts +25 -0
- package/dist/history/fencing.js +61 -0
- package/dist/history/hex.d.ts +3 -0
- package/dist/history/hex.js +10 -0
- package/dist/history/index.d.ts +73 -0
- package/dist/history/index.js +31 -0
- package/dist/history/notifications.d.ts +270 -0
- package/dist/history/notifications.js +264 -0
- package/dist/history/ordering-key.d.ts +24 -0
- package/dist/history/ordering-key.js +101 -0
- package/dist/history/own-change-fork.d.ts +112 -0
- package/dist/history/own-change-fork.js +196 -0
- package/dist/history/own-change.d.ts +106 -0
- package/dist/history/own-change.js +146 -0
- package/dist/history/policy.d.ts +48 -0
- package/dist/history/policy.js +52 -0
- package/dist/history/retained-window.d.ts +215 -0
- package/dist/history/retained-window.js +565 -0
- package/dist/inbox/demux.d.ts +90 -0
- package/dist/inbox/demux.js +78 -0
- package/dist/inbox/handler-registry.d.ts +42 -0
- package/dist/inbox/handler-registry.js +37 -0
- package/dist/inbox/index.d.ts +11 -0
- package/dist/inbox/index.js +10 -0
- package/dist/inbox/seen-set.d.ts +82 -0
- package/dist/inbox/seen-set.js +202 -0
- package/dist/inbox/subscription.d.ts +236 -0
- package/dist/inbox/subscription.js +644 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/invitations/competing-welcome.d.ts +223 -0
- package/dist/invitations/competing-welcome.js +128 -0
- package/dist/invitations/decline.d.ts +61 -0
- package/dist/invitations/decline.js +143 -0
- package/dist/invitations/expect-welcome.d.ts +66 -0
- package/dist/invitations/expect-welcome.js +138 -0
- package/dist/invitations/index.d.ts +16 -0
- package/dist/invitations/index.js +16 -0
- package/dist/invitations/invite.d.ts +303 -0
- package/dist/invitations/invite.js +966 -0
- package/dist/invitations/offers.d.ts +79 -0
- package/dist/invitations/offers.js +115 -0
- package/dist/invitations/on-proposal.d.ts +47 -0
- package/dist/invitations/on-proposal.js +40 -0
- package/dist/invitations/pending-proposal-policy.d.ts +52 -0
- package/dist/invitations/pending-proposal-policy.js +139 -0
- package/dist/invitations/proposal-deadline.d.ts +133 -0
- package/dist/invitations/proposal-deadline.js +164 -0
- package/dist/invitations/relay-planes.d.ts +43 -0
- package/dist/invitations/relay-planes.js +70 -0
- package/dist/invitations/welcome-processor.d.ts +253 -0
- package/dist/invitations/welcome-processor.js +1180 -0
- package/dist/key-packages/device-key.d.ts +131 -0
- package/dist/key-packages/device-key.js +272 -0
- package/dist/key-packages/device-rotation-records.d.ts +83 -0
- package/dist/key-packages/device-rotation-records.js +173 -0
- package/dist/key-packages/group-refs.d.ts +40 -0
- package/dist/key-packages/group-refs.js +79 -0
- package/dist/key-packages/index.d.ts +18 -0
- package/dist/key-packages/index.js +18 -0
- package/dist/key-packages/key-package-ref.d.ts +16 -0
- package/dist/key-packages/key-package-ref.js +21 -0
- package/dist/key-packages/observation-stream.d.ts +4 -0
- package/dist/key-packages/observation-stream.js +120 -0
- package/dist/key-packages/offer-rumor.d.ts +26 -0
- package/dist/key-packages/offer-rumor.js +69 -0
- package/dist/key-packages/publisher.d.ts +174 -0
- package/dist/key-packages/publisher.js +1247 -0
- package/dist/key-packages/select-key-package.d.ts +24 -0
- package/dist/key-packages/select-key-package.js +90 -0
- package/dist/key-packages/slot-manager.d.ts +167 -0
- package/dist/key-packages/slot-manager.js +327 -0
- package/dist/key-packages/validate-key-package-event.d.ts +3 -0
- package/dist/key-packages/validate-key-package-event.js +49 -0
- package/dist/media/cache.d.ts +14 -0
- package/dist/media/cache.js +10 -0
- package/dist/media/index.d.ts +52 -0
- package/dist/media/index.js +71 -0
- package/dist/mls.d.ts +15 -0
- package/dist/mls.js +15 -0
- package/dist/shared/account-pubkey.d.ts +4 -0
- package/dist/shared/account-pubkey.js +10 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.js +85 -0
- package/dist/shared/hex.d.ts +4 -0
- package/dist/shared/hex.js +13 -0
- package/dist/shared/index.d.ts +14 -0
- package/dist/shared/index.js +14 -0
- package/dist/shared/kinds.d.ts +8 -0
- package/dist/shared/kinds.js +28 -0
- package/dist/shared/publish-classification.d.ts +26 -0
- package/dist/shared/publish-classification.js +31 -0
- package/dist/storage/envelope.d.ts +39 -0
- package/dist/storage/envelope.js +201 -0
- package/dist/storage/index.d.ts +227 -0
- package/dist/storage/index.js +459 -0
- package/dist/storage/indexeddb/idb-types.d.ts +68 -0
- package/dist/storage/indexeddb/idb-types.js +1 -0
- package/dist/storage/indexeddb/index.d.ts +17 -0
- package/dist/storage/indexeddb/index.js +141 -0
- package/dist/storage/lease.d.ts +41 -0
- package/dist/storage/lease.js +117 -0
- package/dist/storage/memory/deterministic-signer.d.ts +27 -0
- package/dist/storage/memory/deterministic-signer.js +65 -0
- package/dist/storage/memory/index.d.ts +32 -0
- package/dist/storage/memory/index.js +87 -0
- package/dist/storage/memory/lock-manager.d.ts +8 -0
- package/dist/storage/memory/lock-manager.js +71 -0
- package/package.json +66 -3
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-account inbox (S6): the ONE kind-1059 subscription of a client
|
|
3
|
+
* (AC-INBOX-1), the persisted bounded seen-set (AC-INBOX-3/4, `seen-set.ts`)
|
|
4
|
+
* and the verifier gate in front of every decryption (AC-PIPE-12).
|
|
5
|
+
*
|
|
6
|
+
* An inbox PASS is: the maintenance hook (`beforePass`), a paginated
|
|
7
|
+
* backfill of the account's wraps since the stored floor (discarded whole
|
|
8
|
+
* when it timed out, AC-PIPE-7), then every wrap still `deferred`. `start()`
|
|
9
|
+
* runs one pass and then opens the live subscription; a subscription the
|
|
10
|
+
* transport ends is replaced after a backoff pass, never duplicated.
|
|
11
|
+
*
|
|
12
|
+
* Every wrap, from the backfill or the live subscription:
|
|
13
|
+
*
|
|
14
|
+
* 1. in-flight dedup by wrap id (the same wrap from two sources at once);
|
|
15
|
+
* 2. seen-set check — a seen wrap is never unwrapped again;
|
|
16
|
+
* 3. the consumer `verifier`, before any signer call: false (or a throw)
|
|
17
|
+
* → `rejected('verifier')`, id marked seen;
|
|
18
|
+
* 4. NIP-59 unwrap with the account signer, outside any transaction (a
|
|
19
|
+
* remote signer may wait on its user). A transient failure
|
|
20
|
+
* ({@link classifyUnwrapFailure}) → `deferred`: not marked seen, kept
|
|
21
|
+
* for the next pass; any other failure → `rejected(code)`, marked seen;
|
|
22
|
+
* 5. the rumor DISPATCH POINT, on the inbox's serial queue (seen-set
|
|
23
|
+
* re-checked first): `deps.dispatch` returns the disposition and may
|
|
24
|
+
* mark the wrap seen inside its own final transaction
|
|
25
|
+
* (`ctx.markSeen(tx)`), atomically with its own records; otherwise the
|
|
26
|
+
* wrap is marked seen here — unless the disposition is `deferred`.
|
|
27
|
+
*
|
|
28
|
+
* S6's dispatch handled Welcome rumors only; S7's demux (`demux.ts`: native
|
|
29
|
+
* kinds, registered handlers, application rumors) is the dispatch function
|
|
30
|
+
* now — the subscription and seen-set are still created once, here. A
|
|
31
|
+
* dispatcher's `deferred` may be `counted` (a consumer handler that threw):
|
|
32
|
+
* such deferrals count toward the processing-failure cap like a throwing
|
|
33
|
+
* dispatch.
|
|
34
|
+
*/
|
|
35
|
+
import { type Filter, type NostrEvent, type Rumor } from '@941design/nostr-events/event';
|
|
36
|
+
import type { Subscribable } from '@941design/nostr-events/transport/contract';
|
|
37
|
+
import type { AccountStoreTx } from '../storage/index.js';
|
|
38
|
+
export declare const GIFT_WRAP_KIND = 1059;
|
|
39
|
+
/**
|
|
40
|
+
* How far below a pass's start the next backfill (and the live
|
|
41
|
+
* subscription) reaches: NIP-59 randomises a wrap's `created_at` up to two
|
|
42
|
+
* days into the past, so a wrap published after a pass began can carry an
|
|
43
|
+
* older stamp.
|
|
44
|
+
*/
|
|
45
|
+
export declare const INBOX_BACKFILL_OVERLAP_S: number;
|
|
46
|
+
/**
|
|
47
|
+
* How long the "live covers it" shortcut may stand in for a newer-window walk (seconds). Within one live
|
|
48
|
+
* session a resumed continuation skips re-walking `[startedAt - overlap, now]`: the live subscription saw
|
|
49
|
+
* everything published meanwhile — unless the transport dropped and silently re-established its socket
|
|
50
|
+
* (an `autoReconnect` adapter re-issues the `limit: 0` filter without telling the observer), in which case
|
|
51
|
+
* wraps published during the outage reached neither path. The shortcut is therefore trusted for at most
|
|
52
|
+
* this long since the newer window was last walked; past it the newer window is walked again, so an
|
|
53
|
+
* outage hidden by a silent reconnect delays a wrap by at most this much (plus the retry backoff), never
|
|
54
|
+
* until the next restart. Must stay well below one day: the newer window's `startedAt - overlap` reach
|
|
55
|
+
* covers every wrap published after `now - (overlap - NIP-59's two days)`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const INBOX_LIVE_COVERS_MAX_AGE_S: number;
|
|
58
|
+
/** The backfill floor stays this far below the oldest deferred wrap's `created_at`. */
|
|
59
|
+
export declare const INBOX_DEFERRED_MARGIN_S = 60;
|
|
60
|
+
/**
|
|
61
|
+
* Default cap on a wrap's non-transient deferrals (a dispatch that keeps
|
|
62
|
+
* throwing, a malformed record): past it the wrap is `rejected('processing-
|
|
63
|
+
* failed')` and marked seen, so a poison wrap costs a bounded number of
|
|
64
|
+
* signer unwraps. Transient failures (AC-WEL-3) never count toward it.
|
|
65
|
+
*/
|
|
66
|
+
export declare const DEFAULT_MAX_PROCESSING_FAILURES = 10;
|
|
67
|
+
/**
|
|
68
|
+
* The `deferred` reason of a consumer handler that threw (demux.ts). Its counted deferral keeps the unwrapped rumor
|
|
69
|
+
* with the wrap (seen-set.ts `DeferredWrap.rumor`), so the retry does not unwrap again (handler-retry-reunwraps-wrap).
|
|
70
|
+
*/
|
|
71
|
+
export declare const HANDLER_FAILED_REASON = "handler-failed";
|
|
72
|
+
/** Outcome of one rumor at the dispatch point (the wrap id is added by the subscription). */
|
|
73
|
+
export type RumorDisposition = {
|
|
74
|
+
readonly kind: 'joined';
|
|
75
|
+
readonly invitationId: string;
|
|
76
|
+
readonly groupId: string;
|
|
77
|
+
} | {
|
|
78
|
+
readonly kind: 'already-member';
|
|
79
|
+
readonly invitationId: string;
|
|
80
|
+
readonly groupId?: string;
|
|
81
|
+
}
|
|
82
|
+
/** A competing Welcome of a held group won the members' ranking and the group was switched to it (confirmation tags `from` to `to`). */
|
|
83
|
+
| {
|
|
84
|
+
readonly kind: 'branch-switched';
|
|
85
|
+
readonly invitationId: string;
|
|
86
|
+
readonly groupId: string;
|
|
87
|
+
readonly from: string;
|
|
88
|
+
readonly to: string;
|
|
89
|
+
} | {
|
|
90
|
+
readonly kind: 'pending';
|
|
91
|
+
readonly invitationId: string;
|
|
92
|
+
readonly groupId: string;
|
|
93
|
+
} | {
|
|
94
|
+
readonly kind: 'no-matching-keypackage';
|
|
95
|
+
readonly invitationId: string;
|
|
96
|
+
} | {
|
|
97
|
+
readonly kind: 'rejected';
|
|
98
|
+
readonly reason: string;
|
|
99
|
+
readonly invitationId?: string;
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: 'deferred';
|
|
102
|
+
readonly reason: string;
|
|
103
|
+
readonly counted?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/** S7: handed to a `registerInboxHandler` handler or `onApplicationRumor`, which resolved. */
|
|
106
|
+
| {
|
|
107
|
+
readonly kind: 'delivered';
|
|
108
|
+
readonly rumorKind: number;
|
|
109
|
+
readonly to: 'handler' | 'application';
|
|
110
|
+
}
|
|
111
|
+
/** S8: a native handler recorded it (`id`: an enrolment request / approval's request id, a KeyPackage offer's id). */
|
|
112
|
+
| {
|
|
113
|
+
readonly kind: 'recorded';
|
|
114
|
+
readonly rumorKind: number;
|
|
115
|
+
readonly id: string;
|
|
116
|
+
} | {
|
|
117
|
+
readonly kind: 'unhandled';
|
|
118
|
+
readonly rumorKind: number;
|
|
119
|
+
};
|
|
120
|
+
/** What happened to one inbound kind-1059 wrap (the client's `inboxDisposition` event). */
|
|
121
|
+
export type InboxDisposition = RumorDisposition & {
|
|
122
|
+
readonly wrapId: string;
|
|
123
|
+
};
|
|
124
|
+
export interface DispatchContext {
|
|
125
|
+
/** Marks the wrap seen inside the dispatcher's own account transaction (atomically with its records). */
|
|
126
|
+
markSeen(tx: AccountStoreTx): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* The relays the wrap arrived from (S8, AC-DEV-9's arrival relay; BACKLOG `marmot-use-relay-provenance`): every
|
|
129
|
+
* inbox relay whose backfill walk returned it, or the relay a live subscription delivered it on (the transport's
|
|
130
|
+
* `DeliveryMeta`). Falls back to the relay set of the pass (or live subscription) only when the delivery carries
|
|
131
|
+
* no provenance — a transport whose live observer passes no `meta`, or a deferred wrap retried from the store.
|
|
132
|
+
*/
|
|
133
|
+
readonly relays: readonly string[];
|
|
134
|
+
}
|
|
135
|
+
export interface InboxSubscriptionDeps {
|
|
136
|
+
readonly clock: {
|
|
137
|
+
now(): number;
|
|
138
|
+
};
|
|
139
|
+
readonly timers: {
|
|
140
|
+
set(callback: () => void, ms: number): unknown;
|
|
141
|
+
clear(handle: unknown): void;
|
|
142
|
+
};
|
|
143
|
+
/** Most wrap ids the seen-set keeps (AC-INBOX-4). */
|
|
144
|
+
readonly seenSetCap: number;
|
|
145
|
+
/** Non-transient deferrals after which a wrap is rejected (default {@link DEFAULT_MAX_PROCESSING_FAILURES}). */
|
|
146
|
+
readonly maxProcessingFailures?: number;
|
|
147
|
+
/** The account's pubkey (the wraps' `p` tag). */
|
|
148
|
+
account(): Promise<string>;
|
|
149
|
+
/**
|
|
150
|
+
* The account's own inbox relays. `transient`: the resolution was not
|
|
151
|
+
* conclusive (a timed-out relay-list lookup) — `relays` is a stand-in, the
|
|
152
|
+
* pass does not advance the backfill floor and a retry pass re-resolves.
|
|
153
|
+
*/
|
|
154
|
+
relays(): Promise<{
|
|
155
|
+
readonly relays: readonly string[];
|
|
156
|
+
readonly transient: boolean;
|
|
157
|
+
}>;
|
|
158
|
+
/** One paginated history walk (client/history-pages.ts `fetchHistoryPages`). */
|
|
159
|
+
backfill(relays: readonly string[], filter: Filter): Promise<{
|
|
160
|
+
readonly events: readonly NostrEvent[];
|
|
161
|
+
/** Per event id, the relays that delivered it (`fetchHistoryPages`' provenance); absent = unknown. */
|
|
162
|
+
readonly eventRelays?: ReadonlyMap<string, readonly string[]>;
|
|
163
|
+
readonly timedOut: boolean;
|
|
164
|
+
readonly complete: boolean;
|
|
165
|
+
readonly resumeUntil?: number;
|
|
166
|
+
}>;
|
|
167
|
+
subscription(relays: readonly string[], filter: Filter): Subscribable<NostrEvent>;
|
|
168
|
+
/** `AccountStore.transaction`, already routed through the re-entrancy guard. */
|
|
169
|
+
transaction<T>(fn: (tx: AccountStoreTx) => Promise<T> | T): Promise<T>;
|
|
170
|
+
/** The consumer verifier, already routed through the re-entrancy guard. */
|
|
171
|
+
readonly verifier: ((event: NostrEvent) => boolean | Promise<boolean>) | undefined;
|
|
172
|
+
/** NIP-59 unwrap with the account signer (already routed through the re-entrancy guard). */
|
|
173
|
+
unwrap(wrap: NostrEvent): Promise<Rumor>;
|
|
174
|
+
/** The rumor dispatch point; runs on the inbox's serial queue. */
|
|
175
|
+
dispatch(rumor: Rumor, wrap: NostrEvent, ctx: DispatchContext): Promise<RumorDisposition>;
|
|
176
|
+
/**
|
|
177
|
+
* Maintenance run at the start of every pass (a throw is swallowed and
|
|
178
|
+
* retried by the next pass). Resolves `true` while durable maintenance is
|
|
179
|
+
* outstanding (a rotation or decline delivery not done yet): the pass then
|
|
180
|
+
* schedules a retry pass on the backoff.
|
|
181
|
+
*/
|
|
182
|
+
beforePass(): Promise<boolean>;
|
|
183
|
+
/**
|
|
184
|
+
* Run once the pass's backfill and deferred retries were dispatched (so a
|
|
185
|
+
* redelivered wrap completes its own interrupted join first). Resolves
|
|
186
|
+
* `true` while work is outstanding, like {@link beforePass}.
|
|
187
|
+
*/
|
|
188
|
+
afterBackfill(): Promise<boolean>;
|
|
189
|
+
isDisposed(): boolean;
|
|
190
|
+
onDisposition(disposition: InboxDisposition): void;
|
|
191
|
+
}
|
|
192
|
+
export interface InboxSubscription {
|
|
193
|
+
/** Runs one inbox pass, then opens the live subscription. Idempotent while started. */
|
|
194
|
+
start(): Promise<void>;
|
|
195
|
+
/** Closes the live subscription and cancels scheduled passes. */
|
|
196
|
+
stop(): Promise<void>;
|
|
197
|
+
/** Runs `task` on the inbox's serial queue (after every dispatch already queued). */
|
|
198
|
+
serialize<T>(task: () => Promise<T>): Promise<T>;
|
|
199
|
+
/** Schedules a pass on the backoff (outstanding maintenance failed); a no-op while stopped or one is scheduled. */
|
|
200
|
+
requestPass(): void;
|
|
201
|
+
/**
|
|
202
|
+
* Runs a pass now — a retry pending on the backoff is cancelled, a pass running is followed by one — for
|
|
203
|
+
* outstanding work whose blocker just cleared (a deferred Welcome join whose group restore settled). A no-op
|
|
204
|
+
* while stopped.
|
|
205
|
+
*/
|
|
206
|
+
passNow(): void;
|
|
207
|
+
dispose(): void;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Why a maintenance attempt (a rotation, a decline delivery, completing an
|
|
211
|
+
* interrupted join) failed, when the failure COUNTS toward the retry cap —
|
|
212
|
+
* or `undefined` for an explicitly transient one: a `SignerError` timeout /
|
|
213
|
+
* cancelled / transport / auth-required / disposed / key-unavailable (a
|
|
214
|
+
* locked bunker comes back) anywhere in the cause chain; a store lease-held /
|
|
215
|
+
* no-lease / transaction-closed / reentrant / disposed; S4's publish-failed
|
|
216
|
+
* or a busy slot (`pending-intent`); a Welcome join deferred by a restore in
|
|
217
|
+
* flight (`commit-pending`, `restore-in-flight`). Everything else counts — a refusal, a
|
|
218
|
+
* malformed record, and any error nobody classified — so a failure retrying
|
|
219
|
+
* cannot fix never prompts a signer forever.
|
|
220
|
+
*/
|
|
221
|
+
export declare function maintenanceFailureReason(error: unknown): string | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* AC-WEL-3: `deferred` for a transient failure — a `SignerError` timeout
|
|
224
|
+
* (the budget's timeout/lease), cancelled (aborted), transport,
|
|
225
|
+
* auth-required or disposed anywhere in the cause chain (the gift-wrap layer
|
|
226
|
+
* wraps the signer's error), or a store `lease-held` / `no-lease` /
|
|
227
|
+
* `store-failed` / `transaction-closed` / `reentrant`; `rejected(code)` for
|
|
228
|
+
* everything else — a bad MAC (`GiftWrapError('decrypt')` over the signer's
|
|
229
|
+
* `crypto` error), a malformed wrap or seal, an invalid seal signature, a
|
|
230
|
+
* pubkey or id mismatch.
|
|
231
|
+
*/
|
|
232
|
+
export declare function classifyUnwrapFailure(error: unknown): {
|
|
233
|
+
readonly kind: 'deferred' | 'rejected';
|
|
234
|
+
readonly reason: string;
|
|
235
|
+
};
|
|
236
|
+
export declare function createInboxSubscription(deps: InboxSubscriptionDeps): InboxSubscription;
|