@fixback/expo 0.8.3 → 0.9.1

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.
Files changed (46) hide show
  1. package/README.md +5 -7
  2. package/dist/FeedbackModal.d.ts +7 -2
  3. package/dist/FeedbackModal.js +30 -3
  4. package/dist/FeedbackModal.js.map +1 -1
  5. package/dist/FixbackProvider.js +5 -1
  6. package/dist/FixbackProvider.js.map +1 -1
  7. package/dist/adapters.js +5 -4
  8. package/dist/adapters.js.map +1 -1
  9. package/dist/breadcrumbs.d.ts +15 -51
  10. package/dist/breadcrumbs.js +22 -169
  11. package/dist/breadcrumbs.js.map +1 -1
  12. package/dist/client-boot.d.ts +40 -0
  13. package/dist/client-boot.js +269 -0
  14. package/dist/client-boot.js.map +1 -0
  15. package/dist/client-connect.d.ts +33 -0
  16. package/dist/client-connect.js +306 -0
  17. package/dist/client-connect.js.map +1 -0
  18. package/dist/client-replay.d.ts +31 -0
  19. package/dist/client-replay.js +165 -0
  20. package/dist/client-replay.js.map +1 -0
  21. package/dist/client-state.d.ts +131 -0
  22. package/dist/client-state.js +158 -0
  23. package/dist/client-state.js.map +1 -0
  24. package/dist/client.d.ts +10 -245
  25. package/dist/client.js +80 -787
  26. package/dist/client.js.map +1 -1
  27. package/dist/error-capture.js +6 -26
  28. package/dist/error-capture.js.map +1 -1
  29. package/dist/identity.d.ts +0 -2
  30. package/dist/identity.js +0 -3
  31. package/dist/identity.js.map +1 -1
  32. package/dist/options.d.ts +263 -0
  33. package/dist/options.js +12 -0
  34. package/dist/options.js.map +1 -0
  35. package/dist/report.d.ts +13 -12
  36. package/dist/report.js +19 -38
  37. package/dist/report.js.map +1 -1
  38. package/dist/submit.d.ts +10 -37
  39. package/dist/submit.js +14 -64
  40. package/dist/submit.js.map +1 -1
  41. package/dist/tokens.d.ts +8 -3
  42. package/dist/tokens.js +12 -6
  43. package/dist/tokens.js.map +1 -1
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../src/breadcrumbs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;AA8BH,sCAGC;AAsBD,8BAGC;AAwDD,sCAuIC;AA8BD,sDAwCC;AA7TD,gDAiB2B;AAE3B,+CAAgF;AAIhF,SAAS,IAAI;IACX,uBAAuB;AACzB,CAAC;AAED,qDAAqD;AACrD,SAAgB,aAAa;IAC3B,MAAM,CAAC,GAAG,UAAuC,CAAC;IAClD,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5E,CAAC;AAqBD,4DAA4D;AAC5D,SAAgB,SAAS;IACvB,MAAM,CAAC,GAAG,UAAiD,CAAC;IAC5D,OAAO,OAAO,CAAC,CAAC,cAAc,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC;AAgBD,0FAA0F;AAC1F,SAAS,aAAa,CAAC,GAAgB,EAAE,IAAY;IACnD,IAAI,CAAC;QACH,OAAO,OAAO,GAAG,CAAC,iBAAiB,KAAK,UAAU;YAChD,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAC7B,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,uFAAuF;AACvF,SAAS,iBAAiB,CAAC,GAAgB;IACzC,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,UAAU,IAAI,SAAS,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAm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A,wBAAa,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,SAAS;YACT,GAAG;YACH,IAAI;YACJ,yEAAyE;YACzE,8EAA8E;YAC9E,SAAS,EAAE,IAAA,qCAAuB,EAAC,OAAO,CAAC,WAAW,CAAC;YACvD,WAAW,EAAE,aAAa;SAC3B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,QAAQ,EAAE,CAAC;YACb,CAAC;YAAC,MAAM,CAAC;gBACP,6BAA6B;YAC/B,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Boot, and the capture its answer arms (spec 0003 §G ported to mobile, spec 0004).
3
+ *
4
+ * {@link Boot.bootAndArm} is the round trip `start`, `signIn` and `signOut` all end in:
5
+ * it swaps in the refreshed Reporter session, records the Account and tier for the
6
+ * identity row, raises or lowers maintenance mode's notice (and schedules its
7
+ * recheck), and arms capture only while a submission would be accepted — the trace
8
+ * hooks, mobile replay (`./client-replay`), and automatic error capture — or says why
9
+ * the SDK is dormant.
10
+ *
11
+ * One piece of the headless client (`./client`), created over the state every piece
12
+ * shares (`./client-state`).
13
+ */
14
+ import { type CaptureConfig, type MaintenanceNotice } from "@fixback/sdk-core";
15
+ import type { ReplayArming } from "./client-replay";
16
+ import { type ClientState } from "./client-state";
17
+ /** The per-stream trace flags capture is armed with. */
18
+ export interface TraceStreams {
19
+ readonly console: boolean;
20
+ readonly network: boolean;
21
+ }
22
+ /** Boot and capture arming, as {@link createBoot} builds them. */
23
+ export interface Boot {
24
+ /** Boot with the current identity and reconcile capture + the identity row. */
25
+ bootAndArm(gen: number, options?: {
26
+ readonly recheck?: boolean;
27
+ }): Promise<void>;
28
+ /** The effective per-stream capture flags for a served config (or none yet). */
29
+ resolveStreams(served: CaptureConfig | undefined): TraceStreams;
30
+ /** Install the trace instrumentation for the given flags, replacing what is installed. */
31
+ armTrace(streams: TraceStreams): void;
32
+ /** Tear down the trace, replay and auto-capture hooks (best-effort). */
33
+ disarmCapture(): void;
34
+ /** Raise, change or lower maintenance mode's notice, telling its listeners. */
35
+ setMaintenance(next: MaintenanceNotice | null): void;
36
+ /** Cancel the pending maintenance recheck, if any. */
37
+ clearMaintenanceRecheck(): void;
38
+ }
39
+ /** Boot and capture arming over the client's shared state, with replay's arming. */
40
+ export declare function createBoot(s: ClientState, replay: ReplayArming): Boot;
@@ -0,0 +1,269 @@
1
+ "use strict";
2
+ /**
3
+ * Boot, and the capture its answer arms (spec 0003 §G ported to mobile, spec 0004).
4
+ *
5
+ * {@link Boot.bootAndArm} is the round trip `start`, `signIn` and `signOut` all end in:
6
+ * it swaps in the refreshed Reporter session, records the Account and tier for the
7
+ * identity row, raises or lowers maintenance mode's notice (and schedules its
8
+ * recheck), and arms capture only while a submission would be accepted — the trace
9
+ * hooks, mobile replay (`./client-replay`), and automatic error capture — or says why
10
+ * the SDK is dormant.
11
+ *
12
+ * One piece of the headless client (`./client`), created over the state every piece
13
+ * shares (`./client-state`).
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.createBoot = createBoot;
17
+ const sdk_core_1 = require("@fixback/sdk-core");
18
+ const breadcrumbs_1 = require("./breadcrumbs");
19
+ const client_connect_1 = require("./client-connect");
20
+ const client_state_1 = require("./client-state");
21
+ const error_capture_1 = require("./error-capture");
22
+ const reporter_session_store_1 = require("./reporter-session-store");
23
+ const submit_1 = require("./submit");
24
+ const version_1 = require("./version");
25
+ /** Boot and capture arming over the client's shared state, with replay's arming. */
26
+ function createBoot(s, replay) {
27
+ const { options, adapters, warn, now, readEnvironment } = s;
28
+ const { key, origin, apiUrl, release, propagateTo, buffer } = s;
29
+ const { armReplay, disarmReplay, freezeAndEncodeReplay } = replay;
30
+ function setMaintenance(next) {
31
+ const changed = (s.maintenance === null) !== (next === null) ||
32
+ s.maintenance?.message !== next?.message ||
33
+ s.maintenance?.until !== next?.until;
34
+ s.maintenance = next;
35
+ if (next !== null)
36
+ scheduleMaintenanceRecheck();
37
+ if (!changed)
38
+ return;
39
+ for (const listener of s.maintenanceListeners) {
40
+ try {
41
+ listener(next);
42
+ }
43
+ catch {
44
+ /* a listener must never break the client */
45
+ }
46
+ }
47
+ }
48
+ /** Ask boot again in a minute, once, so the notice comes down on its own (the maintenance-mode ADR). */
49
+ function scheduleMaintenanceRecheck() {
50
+ if (!s.running)
51
+ return;
52
+ const gen = s.generation;
53
+ s.maintenanceRecheck.schedule(() => {
54
+ if (gen === s.generation)
55
+ void bootAndArm(gen, { recheck: true }).catch(() => undefined);
56
+ });
57
+ }
58
+ function clearMaintenanceRecheck() {
59
+ s.maintenanceRecheck.cancel();
60
+ }
61
+ /** Tear down the trace hooks (best-effort), so they can be re-armed. */
62
+ function disarmTrace() {
63
+ try {
64
+ s.teardownTrace?.();
65
+ }
66
+ catch {
67
+ /* teardown is best-effort */
68
+ }
69
+ s.teardownTrace = null;
70
+ }
71
+ /** Tear down the trace + auto-capture hooks (best-effort), so they can be re-armed. */
72
+ function disarmCapture() {
73
+ disarmTrace();
74
+ disarmReplay();
75
+ try {
76
+ s.autoCapture?.destroy();
77
+ }
78
+ catch {
79
+ /* teardown is best-effort */
80
+ }
81
+ s.autoCapture = null;
82
+ }
83
+ /**
84
+ * The effective per-stream capture flags: an init option overrides the served
85
+ * config, and an absent (or malformed) served value means **on** — the default-on
86
+ * rule (spec 0003 §C, ported). Called with no answer before boot has one, which is
87
+ * how the pre-boot arming lands on "both streams on".
88
+ */
89
+ function resolveStreams(served) {
90
+ return {
91
+ console: (0, sdk_core_1.streamEnabled)(options.capture?.console, served?.console),
92
+ network: (0, sdk_core_1.streamEnabled)(options.capture?.network, served?.network),
93
+ };
94
+ }
95
+ /**
96
+ * Install the trace instrumentation for the given per-stream flags, replacing
97
+ * whatever is installed — the teardown runs first, so a re-arm can never double-wrap
98
+ * `console` or `XMLHttpRequest`.
99
+ */
100
+ function armTrace(streams) {
101
+ disarmTrace();
102
+ s.teardownTrace = (0, breadcrumbs_1.instrumentBreadcrumbs)(buffer, {
103
+ consoleObj: adapters.consoleObj,
104
+ xhr: adapters.xhr,
105
+ ignoreUrl: (url) => (0, sdk_core_1.isFixbackApiRequest)(apiUrl, url),
106
+ now,
107
+ captureConsole: streams.console,
108
+ captureNetwork: streams.network,
109
+ propagateTo,
110
+ });
111
+ }
112
+ /**
113
+ * Boot with the current identity and reconcile capture + the identity row. Shared by
114
+ * `start`, `signIn`, and `signOut`: it swaps in the refreshed Reporter session token
115
+ * (30-day sliding), records the Account / tier / connect URL the boot answer carries,
116
+ * and arms capture only while a submission would be accepted — so a gated Project's
117
+ * shake gesture arms exactly when the Account becomes eligible, and drops when it signs
118
+ * out. `gen` is the caller's lifecycle generation; every await re-checks it so a
119
+ * destroyed (or restarted) client abandons this in-flight boot.
120
+ */
121
+ async function bootAndArm(gen, { recheck = false } = {}) {
122
+ // Boots are last-one-wins. Two can be in flight at once — a deep link redeemed
123
+ // while `start`'s boot is still out, a `signOut` racing a Connect — and they carry
124
+ // *different* identities, so an older answer landing last would undo a newer one:
125
+ // the shake gesture would stay withheld from a Reporter the server had just
126
+ // accepted, with the session sitting unused in SecureStore until the next launch.
127
+ const seq = ++s.bootSequence;
128
+ let failure = null;
129
+ const answer = await (0, sdk_core_1.requestBoot)(apiUrl, { key, ...(0, sdk_core_1.compactIdentity)(s.identity) }, {
130
+ fetch: adapters.fetch,
131
+ origin,
132
+ onFailure: (reason) => {
133
+ failure = reason;
134
+ },
135
+ });
136
+ if (gen !== s.generation || seq !== s.bootSequence)
137
+ return;
138
+ // Mid-maintenance, an unanswered boot is Fixback restarting, not a reason to disarm:
139
+ // keep the notice up and ask again (the maintenance-mode ADR).
140
+ if (!answer && s.maintenance !== null && s.status === "ready") {
141
+ scheduleMaintenanceRecheck();
142
+ return;
143
+ }
144
+ s.boot = answer;
145
+ // What the answer settles, read the way every capture SDK reads it (`reconcileBoot`).
146
+ const settled = (0, sdk_core_1.reconcileBoot)(answer);
147
+ // Swap in the refreshed session token (30-day sliding) when boot returned one.
148
+ if (settled.reporterSession) {
149
+ s.reporterSessionToken = settled.reporterSession;
150
+ s.identity = { ...s.identity, reporterSession: s.reporterSessionToken };
151
+ await (0, reporter_session_store_1.writeReporterSession)(adapters.secureStore, key, s.reporterSessionToken);
152
+ if (gen !== s.generation || seq !== s.bootSequence)
153
+ return;
154
+ }
155
+ s.currentTier = settled.tier;
156
+ s.account = settled.account;
157
+ s.connectUrl = settled.connectUrl;
158
+ (0, client_state_1.notifyIdentity)(s);
159
+ // Maintenance mode's notice (the maintenance-mode ADR) — sent only to a caller who could
160
+ // otherwise report, so it arms the composer as a yes does: it opens onto the notice.
161
+ const notice = settled.maintenance;
162
+ // A maintenance recheck on a client already armed changes only the notice: re-arming would
163
+ // restart the replay recorder every minute and drop the lead-up the next report should carry.
164
+ if (recheck && s.status === "ready" && settled.arm) {
165
+ setMaintenance(notice);
166
+ return;
167
+ }
168
+ if (answer && settled.arm) {
169
+ // Re-arm from a clean slate (the shared trace buffer persists across a re-arm, so
170
+ // no lead-up is lost) — a Connect that just made the Account eligible arms here.
171
+ disarmCapture();
172
+ armCapture(answer);
173
+ s.lastDormancyWarning = null;
174
+ setMaintenance(notice);
175
+ (0, client_state_1.setStatus)(s, "ready");
176
+ }
177
+ else {
178
+ setMaintenance(null);
179
+ // Say why, once per dormant boot, in a development build (`warn` is silent in
180
+ // production). A dormant SDK is otherwise indistinguishable on the device from
181
+ // one that was never installed — and the reason is right here in the answer the
182
+ // client already holds, or in the failure that stopped one arriving.
183
+ warnDormant(answer, failure);
184
+ // Not eligible (a gated Project the Account cannot yet report on, or a signed-out
185
+ // visitor): nothing armed, but `connectUrl` is retained so `signIn` still works.
186
+ // What the pre-boot arming optimistically recorded is dropped with it — this
187
+ // Account cannot submit, so holding its console and network lead-up in memory
188
+ // serves nothing. A later `signIn` re-arms and starts a fresh lead-up.
189
+ disarmCapture();
190
+ buffer.clear();
191
+ (0, client_state_1.setStatus)(s, "disabled");
192
+ }
193
+ }
194
+ /** Explain a dormant boot to the developer, at most once per distinct reason. */
195
+ function warnDormant(answer, failure) {
196
+ const message = (0, sdk_core_1.explainDormancy)({
197
+ answer,
198
+ failure,
199
+ apiUrl,
200
+ origin: origin || undefined,
201
+ // Connect needs a door this app can actually open — an auth session it can
202
+ // return through, or an in-app browser plus the seam the redirect comes back
203
+ // on. With neither, naming `signIn()` would send the developer down a dead end.
204
+ signInCall: (0, client_connect_1.canSignIn)(s) ? "Fixback.signIn()" : undefined,
205
+ });
206
+ if (!message || message === s.lastDormancyWarning)
207
+ return;
208
+ s.lastDormancyWarning = message;
209
+ warn(message);
210
+ }
211
+ /**
212
+ * Step two of `start`: with a boot answer that says a submission would be
213
+ * accepted, reconcile the trace instrumentation against the Project's served
214
+ * capture config and install (unless turned off) automatic error capture.
215
+ * Reaching here means the Gate is already satisfied, so an auto-error inherits
216
+ * the very tier boot derived.
217
+ *
218
+ * The trace was already armed optimistically at `start()`, so this is a
219
+ * **reconciliation**, not the first arming: a stream the Project turns off is both
220
+ * uninstrumented and **purged**, so what the optimistic window recorded for it can
221
+ * never ship.
222
+ */
223
+ function armCapture(answer) {
224
+ const streams = resolveStreams(answer.capture);
225
+ armTrace(streams);
226
+ if (!streams.console)
227
+ buffer.clearStream("console");
228
+ if (!streams.network)
229
+ buffer.clearStream("network");
230
+ // Replay arms **here and only here** — never optimistically before boot, the way
231
+ // the trace does. A trace that turns out to be unwanted is purged; frames already
232
+ // written to the cache are a recording that should not have started (ADR-0044).
233
+ armReplay(answer.capture);
234
+ if (options.autoCapture === false)
235
+ return;
236
+ s.autoCapture = (0, error_capture_1.installErrorCapture)({
237
+ apiUrl,
238
+ key,
239
+ origin,
240
+ identity: s.identity,
241
+ sdkVersion: version_1.EXPO_SDK_VERSION,
242
+ release,
243
+ buffer,
244
+ beforeSend: options.beforeSend,
245
+ scrub: options.scrub,
246
+ environment: readEnvironment,
247
+ currentUrl: () => (0, client_state_1.currentUrl)(s),
248
+ // The replay window as it stood at the throw (ADR-0044): frozen and encoded at
249
+ // filing time, on the rich first report only — a flush is a count update, and
250
+ // re-encoding the same window for it would be pure cost.
251
+ captureReplay: () => freezeAndEncodeReplay(),
252
+ errorUtils: adapters.errorUtils,
253
+ appState: adapters.appState,
254
+ deps: {
255
+ submitReport: (url, input) => (0, submit_1.submitReport)(url, input, (0, client_state_1.submitDeps)(s)),
256
+ },
257
+ now,
258
+ });
259
+ }
260
+ return {
261
+ bootAndArm,
262
+ resolveStreams,
263
+ armTrace,
264
+ disarmCapture,
265
+ setMaintenance,
266
+ clearMaintenanceRecheck,
267
+ };
268
+ }
269
+ //# sourceMappingURL=client-boot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-boot.js","sourceRoot":"","sources":["../src/client-boot.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAqDH,gCAwPC;AA3SD,gDAW2B;AAE3B,+CAAsD;AACtD,qDAA6C;AAE7C,iDAMwB;AACxB,mDAAsD;AACtD,qEAAgE;AAChE,qCAAwC;AACxC,uCAA6C;AAwB7C,oFAAoF;AACpF,SAAgB,UAAU,CAAC,CAAc,EAAE,MAAoB;IAC7D,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAChE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAElE,SAAS,cAAc,CAAC,IAA8B;QACpD,MAAM,OAAO,GACX,CAAC,CAAC,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;YAC5C,CAAC,CAAC,WAAW,EAAE,OAA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Y,EAAC,GAAG,EAAE,KAAK,EAAE,IAAA,yBAAU,EAAC,CAAC,CAAC,CAAC;aACtE;YACD,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,UAAU;QACV,cAAc;QACd,QAAQ;QACR,aAAa;QACb,cAAc;QACd,uBAAuB;KACxB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * **Connect** on the headless client (ADR-0066): the two doors `signIn()` opens
3
+ * (ADR-0052), the inbound deep links that finish a Connect started outside the app
4
+ * (ADR-0046), and `signOut()`.
5
+ *
6
+ * One piece of the headless client (`./client`), created over the state every piece
7
+ * shares (`./client-state`): the Reporter session token, the connect URL boot
8
+ * returned, the last inbound code, and the callers waiting on one. A Connect that lands
9
+ * re-boots as the Account through the boot it is handed (`./client-boot`), so a gated
10
+ * Project's shake gesture arms once the Account is eligible.
11
+ */
12
+ import { type ReporterIdentity } from "@fixback/sdk-core";
13
+ import { type ClientState } from "./client-state";
14
+ /** Whether `signIn()` can open a door at all — what the dormancy hint is gated on. */
15
+ export declare function canSignIn(s: ClientState): boolean;
16
+ /** Connect on the client, as {@link createConnect} builds it. */
17
+ export interface Connect {
18
+ /** Start a Connect through whichever door this app can open. Never throws. */
19
+ signIn(): Promise<ReporterIdentity>;
20
+ /** Revoke the Reporter session, clear it from SecureStore, and re-boot as anonymous. */
21
+ signOut(): Promise<void>;
22
+ /** Listen for Connect deep links that arrive while the app runs. */
23
+ armConnectLinking(gen: number): void;
24
+ /** Redeem the code on the URL the app was launched with, before the first boot. */
25
+ redeemLaunchUrl(gen: number): Promise<void>;
26
+ /** Resolve everyone waiting on an inbound Connect, and stop waiting. */
27
+ settleInboundWaiters(landed: boolean): void;
28
+ }
29
+ /**
30
+ * Connect over the client's shared state. `bootAndArm` is the client's boot: a Connect
31
+ * that lands re-boots through it, as the Account.
32
+ */
33
+ export declare function createConnect(s: ClientState, bootAndArm: (gen: number) => Promise<void>): Connect;