@marktiderman/genesis-native 0.10.1 → 0.12.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/README.md +11 -5
- package/dist/{block-CQz1pOnm.d.ts → block-DlGnjjps.d.ts} +1 -1
- package/dist/{blocks-dppiMmy-.d.ts → blocks-CF0agqxk.d.ts} +54 -4
- package/dist/{chunk-6BT4PTGH.js → chunk-5STOXRTS.js} +11 -4
- package/dist/chunk-5STOXRTS.js.map +1 -0
- package/dist/{chunk-65P7RU4V.js → chunk-M7S7F6L5.js} +2 -2
- package/dist/chunk-M7S7F6L5.js.map +1 -0
- package/dist/{chunk-EWHO5WQU.js → chunk-ZQVRCW5J.js} +20 -8
- package/dist/chunk-ZQVRCW5J.js.map +1 -0
- package/dist/devtools.d.ts +69 -6
- package/dist/devtools.js +48 -12
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +12 -6
- package/dist/observability.js +2 -2
- package/dist/push.d.ts +3 -3
- package/dist/push.js +1 -1
- package/dist/push.js.map +1 -1
- package/dist/updates.d.ts +2 -2
- package/dist/updates.js +6 -6
- package/dist/updates.js.map +1 -1
- package/package.json +50 -8
- package/src/app.tsx +12 -6
- package/src/blocks.tsx +2 -2
- package/src/devtools/block.tsx +38 -9
- package/src/devtools/index.ts +3 -2
- package/src/devtools/settings.ts +50 -0
- package/src/devtools/slots.ts +15 -0
- package/src/observability/block.tsx +1 -1
- package/src/observability/index.ts +1 -1
- package/src/observability/scrub.ts +22 -4
- package/src/push/block.tsx +1 -1
- package/src/updates/block.tsx +7 -5
- package/src/updates/index.ts +1 -1
- package/src/updates/signature.ts +40 -2
- package/dist/chunk-65P7RU4V.js.map +0 -1
- package/dist/chunk-6BT4PTGH.js.map +0 -1
- package/dist/chunk-EWHO5WQU.js.map +0 -1
package/README.md
CHANGED
|
@@ -66,8 +66,9 @@ From the outside in:
|
|
|
66
66
|
development, `keyboardScroll` without `keyboardProvider` logs an error.
|
|
67
67
|
`keyboardToolbar` (`KeyboardToolbar`) adds the previous / next / done bar
|
|
68
68
|
above the keyboard on Genesis's form layouts (`AuthScreen`,
|
|
69
|
-
`SettingsSubPage`); it needs `keyboardScroll`, and logs an error in
|
|
70
|
-
development without it.
|
|
69
|
+
`SettingsSubPage`, `FormPage`); it needs `keyboardScroll`, and logs an error in
|
|
70
|
+
development without it. `keyboardSticky` (`KeyboardStickyView`) keeps
|
|
71
|
+
`FormPage`'s Save / Cancel bar above the keyboard; it needs `keyboardScroll` too.
|
|
71
72
|
Then `modules`, the optional native modules your app installed
|
|
72
73
|
(`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`: FlashList,
|
|
73
74
|
expo-image, Reanimated, expo-glass-effect, expo-symbols, a lucide icon
|
|
@@ -205,6 +206,7 @@ From the outside in:
|
|
|
205
206
|
| `updateBanner` | `UpdateBanner` (with `updates`) | `{ reload, dismiss, canReload, blocked, reloading }` |
|
|
206
207
|
| `whatsNew` | `WhatsNewSheet` (with `updates`) | `{ notes, version, dismiss }` |
|
|
207
208
|
| `devtoolsFeedback` | nothing (in the devtools overlay; the support block fills it) | `{ debugInfo, close }` (`close()` resolves once the sheet has slid away) |
|
|
209
|
+
| `devtoolsDiagnostics` | nothing (beside "Copy debug info"; the support block fills it with "Send diagnostics" when it has `diagnostics`) | `{ debugInfo, close, copy }` |
|
|
208
210
|
|
|
209
211
|
The last four render only when the `updates` prop is given. Ejecting a
|
|
210
212
|
blocking one (`forceUpgrade: null`, `maintenance: null`) shows your screens
|
|
@@ -294,7 +296,9 @@ service role).
|
|
|
294
296
|
Each part on its own: `ForceUpgradeScreen`, `MaintenanceScreen`,
|
|
295
297
|
`UpdateBanner`, `WhatsNewSheet`; `createPolicyStore` + `evaluatePolicy`,
|
|
296
298
|
`createUpdateChecker` + `createReloadGuard`, `createWhatsNewStore`,
|
|
297
|
-
`versionSignature
|
|
299
|
+
`versionSignature` (with `buildMetadata`, the commit, OTA number and release the app stamps at
|
|
300
|
+
publish time, it also carries `commit`, `otaNumber` and `release`; `createUpdates` takes the same
|
|
301
|
+
option), `createChannelSwitcher`, `compareVersions`; and the hooks
|
|
298
302
|
under `UpdatesProvider` (or the shell): `useForceUpgrade`, `useMaintenance`,
|
|
299
303
|
`useUpdateBanner`, `useWhatsNew`, `useVersionSignature`, `useBlockReload`,
|
|
300
304
|
`useCanReload`, `useUpdatePolicy`, `useUpdateCheck`.
|
|
@@ -484,7 +488,9 @@ builds. It opens with a three-finger hold (every build, no native module), a sha
|
|
|
484
488
|
- the `devtoolsFeedback` slot, which the support block fills with "Send feedback" (an annotated
|
|
485
489
|
screenshot); empty by default. `close()` (the block's, and the slot's) resolves once the sheet
|
|
486
490
|
has finished sliding away (its `onDismiss`, iOS), or after 800 ms where the platform doesn't
|
|
487
|
-
report it (Android), so a screenshot taken after it shows the app, not the sheet
|
|
491
|
+
report it (Android), so a screenshot taken after it shows the app, not the sheet;
|
|
492
|
+
- the `devtoolsDiagnostics` slot beside "Copy debug info", which the support block fills with
|
|
493
|
+
"Send diagnostics" (the context dump, with its short id to copy) when it is given `diagnostics`.
|
|
488
494
|
|
|
489
495
|
**Keep it out of production.** Import the entry only behind a condition Metro folds at build time.
|
|
490
496
|
Metro inlines `__DEV__`, babel-preset-expo inlines `process.env.EXPO_PUBLIC_*`, and in a
|
|
@@ -806,7 +812,7 @@ await openOnWeb("/clients/1/forms", {
|
|
|
806
812
|
|
|
807
813
|
## Blocks
|
|
808
814
|
|
|
809
|
-
`blocks` takes `defineBlock` declarations (`@marktiderman/genesis-
|
|
815
|
+
`blocks` takes `defineBlock` declarations (`@marktiderman/genesis-config/blocks`) a native shell
|
|
810
816
|
can run: a `NativeBlock` may also carry `bootSteps` (run behind the splash after your `steps`,
|
|
811
817
|
before the session) and a `Root` (mounted around your screens, inside the error boundary). The
|
|
812
818
|
updates block is one, so these are the same:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ReactNode } from 'react';
|
|
3
3
|
import { c as ScreenErrorProps } from './screen-boundary-B8DlsLwb.js';
|
|
4
|
-
import { N as NativeBlock,
|
|
4
|
+
import { N as NativeBlock, s as NativeBlockRootProps } from './blocks-CF0agqxk.js';
|
|
5
5
|
import { b as ErrorReport } from './query--ihYsJWC.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
3
|
import { Slots, SlotPropsFor } from '@marktiderman/genesis-core/slots';
|
|
4
|
-
import { BlockDef, Contributed, BlockSettingsRow, ResolvedBlocks } from '@marktiderman/genesis-
|
|
4
|
+
import { BlockDef, Contributed, BlockSettingsRow, ResolvedBlocks } from '@marktiderman/genesis-config/blocks';
|
|
5
5
|
import { e as FatalScreenProps, g as GenesisErrorBoundaryProps, j as QueryPersistence, c as ErrorUtilsLike, E as EnableRejectionTracker, i as QueryLifecycleOptions, O as OnError, b as ErrorReport } from './query--ihYsJWC.js';
|
|
6
6
|
import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
|
7
7
|
import { CanonicalBrand } from '@marktiderman/genesis-design-system';
|
|
8
8
|
import { SupabaseClientInput, DataProvider } from '@marktiderman/genesis-core/provider';
|
|
9
|
-
import { KeyboardScrollProps, KeyboardToolbarProps } from '@marktiderman/genesis-ui-native/layouts';
|
|
9
|
+
import { KeyboardScrollProps, KeyboardToolbarProps, KeyboardStickyProps } from '@marktiderman/genesis-ui-native/layouts';
|
|
10
10
|
import { GenesisNavigationTheme, GenesisModules, NativeSheetLibrary, NativeToastProviderProps } from '@marktiderman/genesis-ui-native/components';
|
|
11
11
|
|
|
12
12
|
interface BootStepContext {
|
|
@@ -170,9 +170,23 @@ interface DevtoolsFeedbackProps {
|
|
|
170
170
|
*/
|
|
171
171
|
close: () => Promise<void> | void;
|
|
172
172
|
}
|
|
173
|
+
/** What the `devtoolsDiagnostics` slot is given: the support block's "Send diagnostics" fills it. */
|
|
174
|
+
interface DevtoolsDiagnosticsProps {
|
|
175
|
+
/** The overlay's debug report, as text (what "Copy debug info" copies). */
|
|
176
|
+
debugInfo: string;
|
|
177
|
+
/** Closes the overlay. */
|
|
178
|
+
close: () => Promise<void> | void;
|
|
179
|
+
/** Copies text, as the overlay's own "Copy debug info" does (the app's `copy` option, or the share sheet). */
|
|
180
|
+
copy: (text: string) => unknown;
|
|
181
|
+
}
|
|
173
182
|
type DevtoolsSlots = {
|
|
174
183
|
/** A "send feedback" action in the devtools overlay. Default nothing; the support block fills it. */
|
|
175
184
|
devtoolsFeedback: DevtoolsFeedbackProps;
|
|
185
|
+
/**
|
|
186
|
+
* A "Send diagnostics" action beside "Copy debug info": sends the context dump and shows its
|
|
187
|
+
* short id. Default nothing; the support block fills it when it has `diagnostics`.
|
|
188
|
+
*/
|
|
189
|
+
devtoolsDiagnostics: DevtoolsDiagnosticsProps;
|
|
176
190
|
};
|
|
177
191
|
|
|
178
192
|
/** A tiny external store for `useSyncExternalStore`: immutable state, one notify per change. */
|
|
@@ -484,6 +498,11 @@ declare function evaluatePolicy(state: PolicyState, options: EvaluatePolicyOptio
|
|
|
484
498
|
* (an empty string counts as not given: expo-updates gives `""` for the
|
|
485
499
|
* runtime version in a development build); one that doesn't apply, with
|
|
486
500
|
* updates off, as `none`.
|
|
501
|
+
*
|
|
502
|
+
* With `buildMetadata` (a module the app writes at publish time: the commit,
|
|
503
|
+
* the OTA number, the release), the signature also carries `commit`,
|
|
504
|
+
* `otaNumber` and `release`, and the text names them. Without it they are
|
|
505
|
+
* null and the text is as before.
|
|
487
506
|
*/
|
|
488
507
|
|
|
489
508
|
interface VersionSignature {
|
|
@@ -500,19 +519,43 @@ interface VersionSignature {
|
|
|
500
519
|
launch: "update" | "embedded" | "off";
|
|
501
520
|
/** expo-updates fell back to the embedded code after a failed launch. */
|
|
502
521
|
emergency: boolean;
|
|
522
|
+
/** The commit the bundle was built from (`buildMetadata`), or null. Optional for signatures made by hand. */
|
|
523
|
+
commit?: string | null;
|
|
524
|
+
/** The OTA number (`buildMetadata`), or null. */
|
|
525
|
+
otaNumber?: string | null;
|
|
526
|
+
/** The release's name (`buildMetadata`), or null. */
|
|
527
|
+
release?: string | null;
|
|
503
528
|
/** One line, for an About row. */
|
|
504
529
|
short: string;
|
|
505
530
|
/** Several lines, for a support report. */
|
|
506
531
|
text: string;
|
|
507
532
|
}
|
|
533
|
+
/**
|
|
534
|
+
* What the app stamps into its bundle when it publishes (a generated `build-metadata.ts` or JSON):
|
|
535
|
+
* every field optional.
|
|
536
|
+
*/
|
|
537
|
+
interface BuildMetadata {
|
|
538
|
+
/** The commit the bundle was built from, full or short. */
|
|
539
|
+
commit?: string | null;
|
|
540
|
+
commitMessage?: string | null;
|
|
541
|
+
branch?: string | null;
|
|
542
|
+
/** The over-the-air update's number on its channel. */
|
|
543
|
+
otaNumber?: string | number | null;
|
|
544
|
+
/** The release's name (a tag, a date, a version). */
|
|
545
|
+
release?: string | null;
|
|
546
|
+
/** When the release or update was published, ISO. */
|
|
547
|
+
publishedAt?: string | null;
|
|
548
|
+
}
|
|
508
549
|
interface VersionSignatureInput {
|
|
509
550
|
application?: ApplicationLike;
|
|
510
551
|
updates?: UpdatesModuleLike;
|
|
511
552
|
/** `Platform.OS`. */
|
|
512
553
|
platform: string;
|
|
513
554
|
requestedChannel?: string | null;
|
|
555
|
+
/** The commit, OTA number and release the app stamped at publish time. */
|
|
556
|
+
buildMetadata?: BuildMetadata | null;
|
|
514
557
|
}
|
|
515
|
-
declare function versionSignature({ application, updates, platform, requestedChannel }: VersionSignatureInput): VersionSignature;
|
|
558
|
+
declare function versionSignature({ application, updates, platform, requestedChannel, buildMetadata }: VersionSignatureInput): VersionSignature;
|
|
516
559
|
|
|
517
560
|
/**
|
|
518
561
|
* What's new: release notes shown once per version, remembered in storage.
|
|
@@ -620,6 +663,8 @@ interface UpdatesOptions {
|
|
|
620
663
|
application?: ApplicationLike;
|
|
621
664
|
/** `expo-updates`. Without it (or with updates off), no banner and no channel switching. */
|
|
622
665
|
updates?: UpdatesModuleLike;
|
|
666
|
+
/** The commit, OTA number and release the app stamped at publish time: shown in the signature. */
|
|
667
|
+
buildMetadata?: BuildMetadata | null;
|
|
623
668
|
/** Min versions, maintenance and notes. Without it, only `notes` and the banner. */
|
|
624
669
|
policy?: UpdatePolicySource;
|
|
625
670
|
/** AsyncStorage: the policy cache, the version whose notes were seen, the picked channel. */
|
|
@@ -1376,6 +1421,11 @@ interface GenesisNativeAppProps {
|
|
|
1376
1421
|
* (and so `keyboardProvider`); without them it is ignored.
|
|
1377
1422
|
*/
|
|
1378
1423
|
keyboardToolbar?: ComponentType<KeyboardToolbarProps>;
|
|
1424
|
+
/**
|
|
1425
|
+
* `KeyboardStickyView` from react-native-keyboard-controller: keeps FormPage's Save / Cancel
|
|
1426
|
+
* bar above the keyboard. Needs `keyboardScroll`; without it, the bar ends the scrolling form.
|
|
1427
|
+
*/
|
|
1428
|
+
keyboardSticky?: ComponentType<KeyboardStickyProps>;
|
|
1379
1429
|
/**
|
|
1380
1430
|
* The optional native modules the app installed, for Genesis components to
|
|
1381
1431
|
* use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):
|
|
@@ -1538,4 +1588,4 @@ declare function useBlockSettings<R extends SettingsRowLike>(sections: readonly
|
|
|
1538
1588
|
/** The merge `useBlockSettings` does, without hooks (subtitles already read). @stability Beta */
|
|
1539
1589
|
declare function mergeBlockSettings<R extends SettingsRowLike>(sections: readonly BlockSettingsSection<R>[], rows: readonly Contributed<BlockSettingsRow>[], subtitles?: readonly (string | null | undefined)[], options?: UseBlockSettingsOptions): BlockSettingsSection<R | SettingsRowLike>[];
|
|
1540
1590
|
|
|
1541
|
-
export { type
|
|
1591
|
+
export { type QuietHours as $, type AuthClientLike as A, type BlockSettingsSection as B, type SplashModule as C, type DevtoolsDiagnosticsProps as D, type UseBlockSettingsOptions as E, type UseBootReturn as F, GenesisNativeApp as G, type HeldLinkAuth as H, type UseHeldLinkOptions as I, createBoot as J, createLinkHold as K, type LinkHold as L, createSessionStore as M, type NativeBlock as N, mergeBlockSettings as O, normalizeLink as P, useBlockSettings as Q, useBlocks as R, SessionProvider as S, useBoot as T, type UpdatesBlock as U, type VersionSignature as V, useHeldLink as W, useSession as X, type PushPermissionStatus as Y, type NotificationResponseLike as Z, type NotificationLike as _, type DevtoolsFeedbackProps as a, type ForceUpgradeProps as a$, type ChannelImportance as a0, type ChannelInputLike as a1, DEFAULT_PREFERENCES as a2, type NotificationActionLike as a3, type NotificationBehaviorLike as a4, type NotificationCategory as a5, type NotificationPreferences as a6, type NotificationsModuleLike as a7, type PermissionRequestLike as a8, type PermissionState as a9, type RegistrationState as aA, type RegistrationStatus as aB, type SubscriptionLike as aC, canPush as aD, createPermissionStore as aE, createPreferencesStore as aF, createPromptStore as aG, createPush as aH, createRegistration as aI, statusOf as aJ, supabasePushBackend as aK, useBadge as aL, useNotificationPreferences as aM, useOptionalPush as aN, usePush as aO, usePushPermissionState as aP, usePushPrompt as aQ, usePushRegistration as aR, useSuppressNotifications as aS, validPreferences as aT, type ApplicationLike as aU, type BuildMetadata as aV, CLOCK_SKEW_MS as aW, type ChannelSwitchResult as aX, type ChannelSwitcher as aY, type ChannelSwitcherOptions as aZ, type EvaluatePolicyOptions as a_, type PermissionStatusLike as aa, type PermissionStore as ab, type PreferencesState as ac, type PreferencesStatus as ad, type PreferencesStore as ae, type PromptOptions as af, type PromptState as ag, type PromptStore as ah, type PushAppStateLike as ai, type PushBackend as aj, PushBackendError as ak, type PushBlock as al, type PushChannel as am, type PushDeviceCategory as an, type PushErrorSource as ao, type PushOnError as ap, type PushOptions as aq, type PushPromptProps as ar, PushPromptSheet as as, PushProvider as at, PushRoot as au, type PushRootProps as av, type PushSlots as aw, type PushStorageLike as ax, type PushSupabaseLike as ay, type Registration as az, type DevtoolsSlots as b, ForceUpgradeScreen as b0, type MaintenanceProps as b1, MaintenanceScreen as b2, type PolicyClientLike as b3, type PolicyOrigin as b4, type PolicyState as b5, type PolicyStore as b6, type PolicyStoreOptions as b7, type ReleaseNote as b8, type ReloadGuard as b9, WhatsNewSheet as bA, type WhatsNewState as bB, type WhatsNewStore as bC, createChannelSwitcher as bD, createPolicyStore as bE, createReloadGuard as bF, createUpdateChecker as bG, createUpdates as bH, createWhatsNewStore as bI, evaluatePolicy as bJ, notesSince as bK, sanitizePolicy as bL, staticPolicySource as bM, supabasePolicySource as bN, useBlockReload as bO, useCanReload as bP, useForceUpgrade as bQ, useMaintenance as bR, useUpdateBanner as bS, useUpdateCheck as bT, useUpdatePolicy as bU, useUpdateVerdict as bV, useUpdates as bW, useVersionSignature as bX, useWhatsNew as bY, versionSignature as bZ, type SupabasePolicySourceOptions as ba, UPDATES_BLOCK_ID as bb, UpdateBanner as bc, type UpdateBannerProps as bd, type UpdateCheckState as be, type UpdateCheckStatus as bf, type UpdateChecker as bg, type UpdateCheckerOptions as bh, type UpdatePlatform as bi, type UpdatePolicy as bj, type UpdatePolicySource as bk, type UpdateVerdict as bl, type UpdatesAppStateLike as bm, type UpdatesErrorSource as bn, type UpdatesModuleLike as bo, type UpdatesOnError as bp, type UpdatesOptions as bq, UpdatesProvider as br, UpdatesRoot as bs, type UpdatesRootProps as bt, type UpdatesSlots as bu, type UpdatesStorageLike as bv, type VersionSignatureInput as bw, WEEK_MS as bx, type WhatsNewOptions as by, type WhatsNewProps as bz, AuthGate as c, type AuthGateProps as d, type BootController as e, type BootOptions as f, BootProvider as g, BootScreen as h, type BootScreenProps as i, type BootState as j, type BootStatus as k, type BootStep as l, type BootStepContext as m, BootTimeoutError as n, type GenesisNativeAppProps as o, type LinkOptions as p, type LinkTarget as q, type NativeAppSlots as r, type NativeBlockRootProps as s, type NativeQueryClientOptions as t, type SessionState as u, type SessionStatus as v, type SessionStore as w, type SessionStoreOptions as x, type SettingsRowLike as y, type SignedOutProps as z };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// src/updates/signature.ts
|
|
2
2
|
var UNKNOWN = "unknown";
|
|
3
3
|
var given = (value) => typeof value === "string" && value.trim() !== "" ? value : null;
|
|
4
|
-
|
|
4
|
+
var metaText = (value) => typeof value === "number" && Number.isFinite(value) ? String(value) : given(typeof value === "string" ? value : null);
|
|
5
|
+
function versionSignature({ application, updates, platform, requestedChannel = null, buildMetadata = null }) {
|
|
5
6
|
const version = given(application?.nativeApplicationVersion);
|
|
6
7
|
const build = given(application?.nativeBuildVersion);
|
|
7
8
|
const on = Boolean(updates?.isEnabled);
|
|
@@ -29,9 +30,15 @@ function versionSignature({ application, updates, platform, requestedChannel = n
|
|
|
29
30
|
`Update ${launch === "off" ? "updates off" : launch === "embedded" ? "embedded" : updateId ?? UNKNOWN}`
|
|
30
31
|
];
|
|
31
32
|
if (emergency) lines.push(`Emergency launch: ${updates?.emergencyLaunchReason ?? UNKNOWN}`);
|
|
32
|
-
|
|
33
|
+
const commit = metaText(buildMetadata?.commit);
|
|
34
|
+
const otaNumber = metaText(buildMetadata?.otaNumber);
|
|
35
|
+
const release = metaText(buildMetadata?.release);
|
|
36
|
+
if (commit) lines.push(`Commit ${commit}`);
|
|
37
|
+
if (otaNumber) lines.push(`OTA ${otaNumber}`);
|
|
38
|
+
if (release) lines.push(`Release ${release}`);
|
|
39
|
+
return { version, build, platform, channel, requestedChannel, runtimeVersion, updateId, launch, emergency, commit, otaNumber, release, short, text: lines.join("\n") };
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
export { versionSignature };
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-5STOXRTS.js.map
|
|
44
|
+
//# sourceMappingURL=chunk-5STOXRTS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/updates/signature.ts"],"names":[],"mappings":";AAyEA,IAAM,OAAA,GAAU,SAAA;AAG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AAA;AACnD,EAAA,MAAM,OAAA,GAAU,QAAA,CAAS,aAAA,EAAe,OAAO,CAAA;AAC/C,EAAA,IAAI,MAAA,EAAQ,KAAA,CAAM,IAAA,CAAK,CAAA,OAAA,EAAU,MAAM,CAAA,CAAE,CAAA;AACzC,EAAA,IAAI,SAAA,EAAW,KAAA,CAAM,IAAA,CAAK,CAAA,IAAA,EAAO,SAAS,CAAA,CAAE,CAAA;AAC5C,EAAA,IAAI,OAAA,EAAS,KAAA,CAAM,IAAA,CAAK,CAAA,QAAA,EAAW,OAAO,CAAA,CAAE,CAAA;AAC5C,EAAA,OAAO,EAAE,OAAA,EAAS,KAAA,EAAO,UAAU,OAAA,EAAS,gBAAA,EAAkB,gBAAgB,QAAA,EAAU,MAAA,EAAQ,SAAA,EAAW,MAAA,EAAQ,WAAW,OAAA,EAAS,KAAA,EAAO,MAAM,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,EAAE;AACvK","file":"chunk-5STOXRTS.js","sourcesContent":["/**\n * The version signature: which binary and which update this is, in one\n * line for Settings \"About\" and in a few lines for a support report.\n *\n * 1.4.0 (37) · preview · 3f2a9c1b\n * 1.4.0 (37) · production · embedded\n * 1.4.0 (37) · updates off\n *\n * A value the modules can't give is printed as `unknown`, never left out\n * (an empty string counts as not given: expo-updates gives `\"\"` for the\n * runtime version in a development build); one that doesn't apply, with\n * updates off, as `none`.\n *\n * With `buildMetadata` (a module the app writes at publish time: the commit,\n * the OTA number, the release), the signature also carries `commit`,\n * `otaNumber` and `release`, and the text names them. Without it they are\n * null and the text is as before.\n */\nimport type { ApplicationLike, UpdatesModuleLike } from \"./modules\";\n\nexport interface VersionSignature {\n version: string | null;\n build: string | null;\n platform: string;\n /** The build's channel (expo-updates). */\n channel: string | null;\n /** A channel picked on this device (a test build switched channels); `null` when it follows the build. */\n requestedChannel: string | null;\n runtimeVersion: string | null;\n updateId: string | null;\n /** `update`: a downloaded update runs. `embedded`: the binary's own code. `off`: updates are off (development, Expo Go). */\n launch: \"update\" | \"embedded\" | \"off\";\n /** expo-updates fell back to the embedded code after a failed launch. */\n emergency: boolean;\n /** The commit the bundle was built from (`buildMetadata`), or null. Optional for signatures made by hand. */\n commit?: string | null;\n /** The OTA number (`buildMetadata`), or null. */\n otaNumber?: string | null;\n /** The release's name (`buildMetadata`), or null. */\n release?: string | null;\n /** One line, for an About row. */\n short: string;\n /** Several lines, for a support report. */\n text: string;\n}\n\n/**\n * What the app stamps into its bundle when it publishes (a generated `build-metadata.ts` or JSON):\n * every field optional.\n */\nexport interface BuildMetadata {\n /** The commit the bundle was built from, full or short. */\n commit?: string | null;\n commitMessage?: string | null;\n branch?: string | null;\n /** The over-the-air update's number on its channel. */\n otaNumber?: string | number | null;\n /** The release's name (a tag, a date, a version). */\n release?: string | null;\n /** When the release or update was published, ISO. */\n publishedAt?: string | null;\n}\n\nexport interface VersionSignatureInput {\n application?: ApplicationLike;\n updates?: UpdatesModuleLike;\n /** `Platform.OS`. */\n platform: string;\n requestedChannel?: string | null;\n /** The commit, OTA number and release the app stamped at publish time. */\n buildMetadata?: BuildMetadata | null;\n}\n\nconst UNKNOWN = \"unknown\";\n\n/** A module's value, or null when it gave none (undefined, null or an empty string). */\nconst given = (value: string | null | undefined): string | null => (typeof value === \"string\" && value.trim() !== \"\" ? value : null);\n\nconst metaText = (value: string | number | null | undefined): string | null => (typeof value === \"number\" && Number.isFinite(value) ? String(value) : given(typeof value === \"string\" ? value : null));\n\nexport function versionSignature({ application, updates, platform, requestedChannel = null, buildMetadata = null }: VersionSignatureInput): VersionSignature {\n const version = given(application?.nativeApplicationVersion);\n const build = given(application?.nativeBuildVersion);\n const on = Boolean(updates?.isEnabled);\n const channel = on ? given(updates?.channel) : null;\n const updateId = on ? given(updates?.updateId) : null;\n const runtimeVersion = given(updates?.runtimeVersion);\n const launch: VersionSignature[\"launch\"] = !on ? \"off\" : updates?.isEmbeddedLaunch ? \"embedded\" : \"update\";\n const emergency = on && updates?.isEmergencyLaunch === true;\n const shownChannel = requestedChannel ?? channel;\n\n const head = `${version ?? UNKNOWN} (${build ?? UNKNOWN})`;\n const parts = [head];\n if (launch === \"off\") {\n parts.push(\"updates off\");\n } else {\n parts.push(shownChannel ?? \"no channel\");\n parts.push(launch === \"embedded\" ? \"embedded\" : (updateId?.slice(0, 8) ?? UNKNOWN));\n }\n if (emergency) parts.push(\"emergency launch\");\n const short = parts.join(\" · \");\n\n const lines = [\n `Version ${head}`,\n `Platform ${platform}`,\n `Channel ${channel ?? (on ? UNKNOWN : \"none\")}${requestedChannel && requestedChannel !== channel ? ` (switched to ${requestedChannel})` : \"\"}`,\n `Runtime ${runtimeVersion ?? (on ? UNKNOWN : \"none\")}`,\n `Update ${launch === \"off\" ? \"updates off\" : launch === \"embedded\" ? \"embedded\" : (updateId ?? UNKNOWN)}`,\n ];\n if (emergency) lines.push(`Emergency launch: ${updates?.emergencyLaunchReason ?? UNKNOWN}`);\n const commit = metaText(buildMetadata?.commit);\n const otaNumber = metaText(buildMetadata?.otaNumber);\n const release = metaText(buildMetadata?.release);\n if (commit) lines.push(`Commit ${commit}`);\n if (otaNumber) lines.push(`OTA ${otaNumber}`);\n if (release) lines.push(`Release ${release}`);\n return { version, build, platform, channel, requestedChannel, runtimeVersion, updateId, launch, emergency, commit, otaNumber, release, short, text: lines.join(\"\\n\") };\n}\n"]}
|
|
@@ -45,5 +45,5 @@ function mergeBlockSettings(sections, rows, subtitles = [], options = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export { BlocksProvider, mergeBlockSettings, reportToBlocks, useBlockSettings, useBlocks };
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-M7S7F6L5.js.map
|
|
49
|
+
//# sourceMappingURL=chunk-M7S7F6L5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/blocks.tsx"],"names":[],"mappings":";;;AA0CO,SAAS,cAAA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AM,CAAA,CAAE,EAAA,KAAO,IAAI,OAAO,CAAA;AAClD,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAA,GAAU,EAAE,EAAA,EAAI,GAAA,CAAI,OAAA,EAAS,OAAO,OAAA,CAAQ,aAAA,GAAgB,GAAA,CAAI,OAAO,CAAA,IAAK,GAAA,CAAI,OAAA,EAAS,IAAA,EAAM,EAAC,EAAE;AAClG,MAAA,GAAA,CAAI,KAAK,OAAO,CAAA;AAAA,IAClB;AACA,IAAA,MAAM,EAAE,UAAS,GAAI,OAAA;AACrB,IAAA,MAAM,OAAO,GAAA,CAAI,IAAA;AACjB,IAAA,OAAA,CAAQ,KAAK,IAAA,CAAK;AAAA,MAChB,IAAI,GAAA,CAAI,EAAA;AAAA,MACR,OAAO,GAAA,CAAI,KAAA;AAAA,MACX,QAAA,EAAU,SAAA,CAAU,CAAC,CAAA,IAAK,GAAA,CAAI,QAAA;AAAA,MAC9B,QAAQ,GAAA,CAAI,MAAA;AAAA,MACZ,GAAI,IAAA,IAAQ,QAAA,GAAW,EAAE,WAAA,EAAa,IAAA,EAAM,OAAA,EAAS,MAAM,QAAA,CAAS,IAAI,CAAA,EAAE,GAAI;AAAC,KAChF,CAAA;AAAA,EACH,CAAC,CAAA;AACD,EAAA,OAAO,GAAA;AACT","file":"chunk-M7S7F6L5.js","sourcesContent":["/**\n * Blocks on native: `defineBlock` declarations (from\n * `@marktiderman/genesis-config/blocks`) with the two things only a native\n * shell can run, boot steps behind the splash and a root around the screens.\n * `<GenesisNativeApp blocks={[…]}>` resolves them once, runs their steps,\n * mounts their roots, puts their slot fills under the app's own `slots`, and\n * hands their Settings rows to `useBlockSettings`.\n */\nimport { createContext, useContext, type ComponentType, type ReactNode } from \"react\";\nimport type { SlotPropsFor, Slots } from \"@marktiderman/genesis-core/slots\";\nimport type { BlockDef, BlockSettingsRow, Contributed, ResolvedBlocks } from \"@marktiderman/genesis-config/blocks\";\nimport type { BootStep } from \"./boot\";\nimport type { ErrorReport } from \"./errors\";\nimport type { NativeAppSlots } from \"./app\";\n\n/** What a block's `Root` is given: the app's slots, with every block's fills merged under them. @stability Beta */\nexport interface NativeBlockRootProps {\n slots?: Slots<NativeAppSlots>;\n slotProps?: SlotPropsFor<NativeAppSlots>;\n children?: ReactNode;\n}\n\n/**\n * A block a native shell can run. `contributes.slots` fills `GenesisNativeApp`\n * slots by name (the app's own `slots` win).\n *\n * @stability Beta\n */\nexport interface NativeBlock<Id extends string = string> extends BlockDef<Id, ComponentType<never>> {\n /** Run behind the splash after the app's own `steps`, before the session. A step that fails fails the boot, so keep them bounded. */\n readonly bootSteps?: readonly BootStep[];\n /** Mounted around the screens, inside the shell's error boundary. The first block's root is the outermost. */\n readonly Root?: ComponentType<NativeBlockRootProps>;\n /**\n * Every error the shell catches (render, global, boot, rejection), before\n * the app's own `onError`. The observability block reports them here. A\n * throw is ignored.\n */\n readonly onError?: (error: Error, report: ErrorReport) => void;\n}\n\n/** @internal Hand an error to each block's `onError`; one that throws never stops the rest. */\nexport function reportToBlocks(blocks: readonly NativeBlock[], error: Error, report: ErrorReport): void {\n for (const block of blocks) {\n if (!block.onError) continue;\n try {\n block.onError(error, report);\n } catch {\n // A failing reporter must not take the error path down with it.\n }\n }\n}\n\nconst BlocksContext = createContext<ResolvedBlocks<NativeBlock> | null>(null);\n\n/** @internal Provided by GenesisNativeApp. */\nexport const BlocksProvider = BlocksContext.Provider;\n\n/**\n * The resolved blocks: their ids, nav entries, Settings rows, routes and the\n * rest, each tagged with its FeatureId. Throws outside `GenesisNativeApp`.\n *\n * @stability Beta\n */\nexport function useBlocks(): ResolvedBlocks<NativeBlock> {\n const blocks = useContext(BlocksContext);\n if (!blocks) throw new Error(\"useBlocks: no blocks. Render inside <GenesisNativeApp>.\");\n return blocks;\n}\n\n/** A Settings section as `SettingsPage` from `@marktiderman/genesis-ui-native` takes it. @stability Beta */\nexport interface BlockSettingsSection<R extends { id: string; title: string } = SettingsRowLike> {\n id: string;\n title?: string;\n footnote?: string;\n rows: R[];\n}\n\n/** The row fields a block can fill. @stability Beta */\nexport interface SettingsRowLike {\n id: string;\n title: string;\n subtitle?: string;\n showChevron?: boolean;\n onPress?: () => void;\n testID?: string;\n}\n\n/** @stability Beta */\nexport interface UseBlockSettingsOptions {\n /** Open a row's `href` (expo-router's `router.push`). Without it, rows with an `href` aren't pressable. */\n navigate?: (href: string) => void;\n /** Titles for sections a block names that `sections` doesn't have. Default the section id. */\n sectionTitles?: Readonly<Record<string, string>>;\n}\n\n/**\n * The app's Settings sections with every block's rows added: each row goes\n * at the end of the section its `section` names (by `order`, then block\n * order), and a section no one has yet is added after the rest.\n *\n * Calls each row's `useSubtitle` hook, so call it unconditionally at the top\n * of the Settings screen. The blocks are fixed for the life of the app, so\n * the hooks run in the same order on every render.\n *\n * @stability Beta\n */\nexport function useBlockSettings<R extends SettingsRowLike>(\n sections: readonly BlockSettingsSection<R>[],\n options: UseBlockSettingsOptions = {},\n): BlockSettingsSection<R | SettingsRowLike>[] {\n const blocks = useContext(BlocksContext);\n const rows = blocks?.settings ?? [];\n // The same hooks in the same order every render: `rows` never changes once the shell has resolved it.\n const subtitles = rows.map((row) => row.useSubtitle?.());\n return mergeBlockSettings(sections, rows, subtitles, options);\n}\n\n/** The merge `useBlockSettings` does, without hooks (subtitles already read). @stability Beta */\nexport function mergeBlockSettings<R extends SettingsRowLike>(\n sections: readonly BlockSettingsSection<R>[],\n rows: readonly Contributed<BlockSettingsRow>[],\n subtitles: readonly (string | null | undefined)[] = [],\n options: UseBlockSettingsOptions = {},\n): BlockSettingsSection<R | SettingsRowLike>[] {\n const out: BlockSettingsSection<R | SettingsRowLike>[] = sections.map((s) => ({ ...s, rows: [...s.rows] }));\n rows.forEach((row, i) => {\n let section = out.find((s) => s.id === row.section);\n if (!section) {\n section = { id: row.section, title: options.sectionTitles?.[row.section] ?? row.section, rows: [] };\n out.push(section);\n }\n const { navigate } = options;\n const href = row.href;\n section.rows.push({\n id: row.id,\n title: row.title,\n subtitle: subtitles[i] ?? row.subtitle,\n testID: row.testID,\n ...(href && navigate ? { showChevron: true, onPress: () => navigate(href) } : {}),\n });\n });\n return out;\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { createScreenErrorBoundary } from './chunk-YIF4BFQH.js';
|
|
|
2
2
|
import { onBeforeReload } from './chunk-VIC2KXMA.js';
|
|
3
3
|
import { useSession } from './chunk-NGYNYJPL.js';
|
|
4
4
|
import { createContext, useContext, useSyncExternalStore, useEffect, useRef } from 'react';
|
|
5
|
-
import { defineBlock } from '@marktiderman/genesis-
|
|
5
|
+
import { defineBlock } from '@marktiderman/genesis-config/blocks';
|
|
6
6
|
import { setErrorReporter } from '@marktiderman/genesis-core/errors';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
|
|
@@ -83,6 +83,15 @@ var PATTERNS = [
|
|
|
83
83
|
// Phone numbers: international (`+1 555 555 0101`) and North American (`555-555-0101`).
|
|
84
84
|
[/\+\d[\d\s().-]{6,18}\d/g, "[phone]"],
|
|
85
85
|
[/\b\(?\d{3}\)?[-.\s]\d{3}[-.\s]\d{4}\b/g, "[phone]"],
|
|
86
|
+
// …national numbers in space-separated groups, which start with a trunk 0 (`020 7946 0958`), and
|
|
87
|
+
// international ones without the + (`44 20 7946 0958`: a country code, then two groups of 4).
|
|
88
|
+
// Plain counts, durations and dates (`120 340 560`, `2024 11 19`) don't have either shape.
|
|
89
|
+
[/\b0\d{2,4} \d{3,4} \d{3,4}\b/g, "[phone]"],
|
|
90
|
+
[/\b\d{2,3} \d{1,4} \d{4} \d{4}\b/g, "[phone]"],
|
|
91
|
+
// …and North American numbers with no separator (`5555550101`, `15555550101`): an area code and an
|
|
92
|
+
// exchange that start with 2-9. A whole word only, so a hex id, a longer number or an epoch
|
|
93
|
+
// time (which starts with 1) is left alone.
|
|
94
|
+
[/\b1?[2-9]\d{2}[2-9]\d{6}\b/g, "[phone]"],
|
|
86
95
|
// Long opaque hex runs: API keys, refresh tokens, DSN secrets. Linear: a run starts only after a non-hex character.
|
|
87
96
|
[/(^|[^A-Fa-f0-9])[A-Fa-f0-9]{32,}(?![A-Fa-f0-9])/g, "$1[hex]"]
|
|
88
97
|
];
|
|
@@ -97,10 +106,10 @@ function scrubUrl(value) {
|
|
|
97
106
|
}
|
|
98
107
|
var URL_KEY = /^(url|href|from|to|uri|description|http\.url|url\.full)$/i;
|
|
99
108
|
var MAX_DEPTH = 8;
|
|
100
|
-
function scrubValue(value, key = "", depth = 0, seen = /* @__PURE__ */ new WeakSet()) {
|
|
109
|
+
function scrubValue(value, key = "", depth = 0, seen = /* @__PURE__ */ new WeakSet(), keepIds = true) {
|
|
101
110
|
if (key && isSecretKey(key)) return value === void 0 || value === null || value === "" ? value : FILTERED;
|
|
102
111
|
if (typeof value === "string") {
|
|
103
|
-
if (key && ID_KEY.test(key)) return value;
|
|
112
|
+
if (keepIds && key && ID_KEY.test(key)) return value;
|
|
104
113
|
return URL_KEY.test(key) ? scrubUrl(value) : scrubString(value);
|
|
105
114
|
}
|
|
106
115
|
if (value === null || typeof value !== "object") return value;
|
|
@@ -110,15 +119,18 @@ function scrubValue(value, key = "", depth = 0, seen = /* @__PURE__ */ new WeakS
|
|
|
110
119
|
if (value instanceof Error) return { name: value.name, message: scrubString(value.message) };
|
|
111
120
|
if (Array.isArray(value)) {
|
|
112
121
|
if (value.length === 2 && typeof value[0] === "string" && isSecretKey(value[0])) return [value[0], FILTERED];
|
|
113
|
-
return value.map((item) => scrubValue(item, "", depth + 1, seen));
|
|
122
|
+
return value.map((item) => scrubValue(item, "", depth + 1, seen, keepIds));
|
|
114
123
|
}
|
|
115
124
|
const out = {};
|
|
116
125
|
for (const [k, v] of Object.entries(value)) {
|
|
117
126
|
if (DROPPED_KEY.test(k)) continue;
|
|
118
|
-
out[k] = scrubValue(v, k, depth + 1, seen);
|
|
127
|
+
out[k] = scrubValue(v, k, depth + 1, seen, keepIds);
|
|
119
128
|
}
|
|
120
129
|
return out;
|
|
121
130
|
}
|
|
131
|
+
function scrubValueStrict(value) {
|
|
132
|
+
return scrubValue(value, "", 0, /* @__PURE__ */ new WeakSet(), false);
|
|
133
|
+
}
|
|
122
134
|
function scrubEvent(event) {
|
|
123
135
|
try {
|
|
124
136
|
const { user, request, sdkProcessingMetadata, ...rest } = event;
|
|
@@ -457,6 +469,6 @@ var EMPTY = { breadcrumbs: [], errors: [] };
|
|
|
457
469
|
var EMPTY_STORE = { getState: () => EMPTY, subscribe: () => () => {
|
|
458
470
|
}};
|
|
459
471
|
|
|
460
|
-
export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubbedError, useObservability, useRecentActivity };
|
|
461
|
-
//# sourceMappingURL=chunk-
|
|
462
|
-
//# sourceMappingURL=chunk-
|
|
472
|
+
export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubValueStrict, scrubbedError, useObservability, useRecentActivity };
|
|
473
|
+
//# sourceMappingURL=chunk-ZQVRCW5J.js.map
|
|
474
|
+
//# sourceMappingURL=chunk-ZQVRCW5J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/observability/events.ts","../src/observability/scrub.ts","../src/observability/sink.ts","../src/observability/block.tsx"],"names":[],"mappings":";;;;;;;;;AAkCA,IAAM,UAAA,GAAa,yCAAA;AACnB,IAAM,SAAA,GAAY,mBAAA;AAClB,IAAM,SAAA,GAAY,EAAA;AAClB,IAAM,WAAA,GAAc,EAAA;AASb,SAAS,aAA0C,MAAA,EAAc;AACtE,EAAA,MAAM,WAAqB,EAAC;AAC5B,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,KAAK,KAAK,MAAA,CA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,MAAM,KAAA,EAAO,SAAA,EAAW,MAAM,MAAM;AAAC,CAAmB,CAAA","file":"chunk-ZQVRCW5J.js","sourcesContent":["/**\n * Typed analytics events: the app lists every event and the props each may\n * carry once, and `track(name, props)` accepts nothing else. A prop is a\n * closed list of strings, a number or a boolean, never free text, so an\n * event can't carry a name, an email or a message someone typed.\n *\n * ```ts\n * export const events = defineEvents({\n * \"auth.signed_in\": { method: [\"email\", \"apple\"] },\n * \"settings.opened\": {},\n * \"checkin.saved\": { mood: \"number\", first: \"boolean\" },\n * });\n * ```\n *\n * At run time an unknown event, an unknown prop or a value outside its list\n * is dropped and reported (a `console.warn` in development, `onInvalid`\n * always), so a bad call is loud and still sends nothing.\n */\n\n/** A closed list of strings, `\"number\"` (finite) or `\"boolean\"`. */\nexport type EventPropSpec = readonly string[] | \"number\" | \"boolean\";\n\n/** Every event, by name, with the props it may carry. */\nexport type EventSchema = Readonly<Record<string, Readonly<Record<string, EventPropSpec>>>>;\n\ntype PropValue<S> = S extends readonly (infer L)[] ? L : S extends \"number\" ? number : S extends \"boolean\" ? boolean : never;\n\n/** The props of one event: every prop optional, each its spec's type. */\nexport type EventProps<S extends Readonly<Record<string, EventPropSpec>>> = { readonly [K in keyof S]?: PropValue<S[K]> };\n\n/** What a sink receives: the checked props. */\nexport type EventValues = Readonly<Record<string, string | number | boolean>>;\n\n// Lower-case words joined by `.` or `_`: `auth.signed_in`, `checkin.saved`.\nconst EVENT_NAME = /^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)*$/;\nconst PROP_NAME = /^[a-z][a-z0-9_]*$/;\nconst MAX_PROPS = 25;\nconst MAX_LITERAL = 64;\n\n/**\n * Declare the app's events. Checks names (lower-case, dot-separated), prop\n * names, and that each list has at least one short value, and throws listing\n * every problem, so a bad schema fails where it is written.\n *\n * @stability Beta\n */\nexport function defineEvents<const E extends EventSchema>(schema: E): E {\n const problems: string[] = [];\n for (const [name, props] of Object.entries(schema)) {\n if (!EVENT_NAME.test(name)) problems.push(`\"${name}\": an event name is lower-case words joined by \".\" (auth.signed_in)`);\n const keys = Object.keys(props);\n if (keys.length > MAX_PROPS) problems.push(`\"${name}\": at most ${MAX_PROPS} props`);\n for (const key of keys) {\n const spec = props[key];\n if (!PROP_NAME.test(key)) problems.push(`\"${name}\".${key}: a prop name is lower-case letters, digits and \"_\"`);\n if (Array.isArray(spec)) {\n if (spec.length === 0) problems.push(`\"${name}\".${key}: an empty list allows nothing`);\n for (const v of spec) if (typeof v !== \"string\" || v.length === 0 || v.length > MAX_LITERAL) problems.push(`\"${name}\".${key}: \"${String(v)}\" must be 1-${MAX_LITERAL} characters`);\n } else if (spec !== \"number\" && spec !== \"boolean\") {\n problems.push(`\"${name}\".${key}: a prop is a list of strings, \"number\" or \"boolean\" (free text is not allowed)`);\n }\n }\n }\n if (problems.length) throw new Error(`Invalid events:\\n${problems.map((p) => ` - ${p}`).join(\"\\n\")}`);\n return Object.freeze(schema);\n}\n\nexport type EventCheck = { ok: true; props: EventValues } | { ok: false; problem: string };\n\n/** Check one call against the schema: the props to send, or why nothing is sent. */\nexport function checkEvent(schema: EventSchema, name: string, props: Readonly<Record<string, unknown>> | undefined): EventCheck {\n if (!Object.prototype.hasOwnProperty.call(schema, name)) return { ok: false, problem: `\"${name}\" is not in the event schema` };\n const specs = schema[name] ?? {};\n const out: Record<string, string | number | boolean> = {};\n for (const [key, value] of Object.entries(props ?? {})) {\n if (value === undefined) continue;\n if (!Object.prototype.hasOwnProperty.call(specs, key)) return { ok: false, problem: `\"${name}\" has no prop \"${key}\"` };\n const spec = specs[key];\n const fits =\n spec === \"number\"\n ? typeof value === \"number\" && Number.isFinite(value)\n : spec === \"boolean\"\n ? typeof value === \"boolean\"\n : typeof value === \"string\" && (spec as readonly string[]).includes(value);\n if (!fits) return { ok: false, problem: `\"${name}\".${key}: ${JSON.stringify(value)} is not allowed` };\n out[key] = value as string | number | boolean;\n }\n return { ok: true, props: out };\n}\n","/**\n * The PII scrubber every sink's input goes through by default: text is\n * rewritten by pattern (an email, a phone number, a JWT, a Supabase key, a\n * bearer token, a token in a query string, row values in a database error),\n * values under a key that names a secret or a contact detail are replaced\n * whole, and URLs lose their query and fragment (PostgREST filters carry\n * record ids, auth callbacks carry codes). Strings are cut at 4 KB first, so\n * a huge log line can't stall the JS thread.\n *\n * What it can't know: a person's name in free text. Keep names out of error\n * messages and breadcrumbs; touch breadcrumbs lose their labels in\n * `sentrySink` for this reason.\n *\n * Pattern-based on values, not an allowlist of keys: a key allowlist misses\n * `refresh failed: eyJhbGciOi…`, which is the shape that actually occurs.\n *\n * Fail closed: `scrubEvent` and `scrubRecord` return `null` (drop it) when\n * scrubbing itself throws, never the unscrubbed input.\n */\n\n/** What replaces a value under a secret-looking key. */\nexport const FILTERED = \"[Filtered]\";\n\n// Keys whose value is a secret (or a contact detail) whatever it looks like.\n// Matched case-insensitively with `-`, `_`, `.` and spaces removed: exactly\n// for the short, ambiguous ones, as a part of the key for the rest\n// (`x-supabase-api-key`, `user.email`, `refresh_token_hash`).\nconst SECRET_KEY_EXACT = /^(session|sessionid|dsn|otp|code|verifier|codeverifier|privatekey|refresh|pwd|key)$/;\nconst SECRET_KEY_PART = /(authoriz|cookie|passw|secret|token|apikey|credential|jwt|email|phone|servicerole)/;\n\n/** True when a value under `key` is a secret (or contact detail) whatever it looks like. */\nexport function isSecretKey(key: string): boolean {\n const k = key.replace(/[-_.\\s]/g, \"\").toLowerCase();\n return SECRET_KEY_EXACT.test(k) || SECRET_KEY_PART.test(k);\n}\n\n// Sentry's own ids and envelope fields: 32-hex values the hex rule would break, never PII.\nconst ID_KEY = /^(event_id|trace_id|span_id|parent_span_id|profile_id|replay_id|debug_id|code_id|public_key|segment_id|sampled|release|dist|environment)$/;\n\n// Fields dropped whole: query strings travel as their own fields too (Sentry's http breadcrumbs,\n// spans and requests), and bodies and PostgREST `details` carry row values.\nconst DROPPED_KEY = /^(query_string|http\\.query|http\\.fragment|url\\.query|url\\.fragment|request_body|response_body|body|cookies|details)$/i;\n\n/** Longest string scrubbed in full; the rest is cut off (the patterns stay fast on huge logs). */\nexport const MAX_STRING = 4096;\n\nconst PATTERNS: readonly [RegExp, string][] = [\n // The query string and fragment of a URL with a scheme anywhere in text (a span's\n // \"GET https://…?id=eq.42\", a deep link \"myapp://reset?token_hash=…\").\n [/\\b([a-z][a-z0-9+.-]{0,31}:\\/\\/[^\\s?#\"'<>]{0,2048})[?#][^\\s\"'<>]*/gi, \"$1\"],\n // …and of a path (\"POST /rest/v1/rpc/find?email=eq.…\").\n [/(^|[\\s\"'(=])(\\/[^\\s?#\"'<>]{0,2048})\\?[^\\s\"'<>]*/g, \"$1$2\"],\n // JWTs: Supabase access tokens and the legacy anon / service_role keys.\n [/\\beyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*/g, \"[jwt]\"],\n // Supabase's API keys (sb_secret_…, sb_publishable_…).\n [/\\bsb_(?:secret|publishable)_[A-Za-z0-9_-]{8,}/g, \"[supabase-key]\"],\n // `Authorization: Bearer …` copied into a message.\n [/\\b(Bearer|Basic)\\s+[A-Za-z0-9._~+/=-]+/gi, \"$1 [token]\"],\n // Tokens in a query string or a fragment left without a scheme.\n [\n /([?&#](?:access_token|refresh_token|id_token|provider_token|provider_refresh_token|token|token_hash|code|apikey|api_key|key|password|secret|email|phone)=)[^&#\\s\"']+/gi,\n \"$1[Filtered]\",\n ],\n // Row values in PostgreSQL errors: `Failing row contains (…)`, `Key (email)=(…)`.\n [/(Failing row contains )\\([^)]*\\)/g, \"$1(…)\"],\n [/(Key \\([^)]{0,256}\\)=)\\([^)]*\\)/g, \"$1(…)\"],\n // Email addresses, also percent-encoded (`a%40b.co`). Bounded, so a long run of letters can't backtrack.\n [/[A-Za-z0-9._%+-]{1,64}(?:@|%40)(?:[A-Za-z0-9-]{1,63}\\.){1,8}[A-Za-z]{2,24}/g, \"[email]\"],\n // Phone numbers: international (`+1 555 555 0101`) and North American (`555-555-0101`).\n [/\\+\\d[\\d\\s().-]{6,18}\\d/g, \"[phone]\"],\n [/\\b\\(?\\d{3}\\)?[-.\\s]\\d{3}[-.\\s]\\d{4}\\b/g, \"[phone]\"],\n // …national numbers in space-separated groups, which start with a trunk 0 (`020 7946 0958`), and\n // international ones without the + (`44 20 7946 0958`: a country code, then two groups of 4).\n // Plain counts, durations and dates (`120 340 560`, `2024 11 19`) don't have either shape.\n [/\\b0\\d{2,4} \\d{3,4} \\d{3,4}\\b/g, \"[phone]\"],\n [/\\b\\d{2,3} \\d{1,4} \\d{4} \\d{4}\\b/g, \"[phone]\"],\n // …and North American numbers with no separator (`5555550101`, `15555550101`): an area code and an\n // exchange that start with 2-9. A whole word only, so a hex id, a longer number or an epoch\n // time (which starts with 1) is left alone.\n [/\\b1?[2-9]\\d{2}[2-9]\\d{6}\\b/g, \"[phone]\"],\n // Long opaque hex runs: API keys, refresh tokens, DSN secrets. Linear: a run starts only after a non-hex character.\n [/(^|[^A-Fa-f0-9])[A-Fa-f0-9]{32,}(?![A-Fa-f0-9])/g, \"$1[hex]\"],\n];\n\n/** A string with every URL query, email, phone number, JWT, Supabase key, bearer token and query-string token replaced. */\nexport function scrubString(value: string): string {\n let out = value.length > MAX_STRING ? `${value.slice(0, MAX_STRING)}…[truncated]` : value;\n for (const [pattern, replacement] of PATTERNS) out = out.replace(pattern, replacement);\n return out;\n}\n\n/** A URL without its query string and fragment, then scrubbed (an email in a path). */\nexport function scrubUrl(value: string): string {\n const cut = value.search(/[?#]/);\n return scrubString(cut === -1 ? value : value.slice(0, cut));\n}\n\n// Keys whose string value is cut at `?` when it is a URL.\nconst URL_KEY = /^(url|href|from|to|uri|description|http\\.url|url\\.full)$/i;\nconst MAX_DEPTH = 8;\n\n/**\n * A deep copy of `value` with every string scrubbed and every value under a\n * secret key replaced. Cycles become `\"[Circular]\"`; past 8 levels,\n * `\"[Truncated]\"`. Errors become `{ name, message }`. Header lists\n * (`[[\"authorization\", \"…\"]]`) are treated like objects.\n */\nexport function scrubValue(value: unknown, key = \"\", depth = 0, seen: WeakSet<object> = new WeakSet(), keepIds = true): unknown {\n if (key && isSecretKey(key)) return value === undefined || value === null || value === \"\" ? value : FILTERED;\n if (typeof value === \"string\") {\n if (keepIds && key && ID_KEY.test(key)) return value;\n return URL_KEY.test(key) ? scrubUrl(value) : scrubString(value);\n }\n if (value === null || typeof value !== \"object\") return value;\n if (seen.has(value)) return \"[Circular]\";\n if (depth >= MAX_DEPTH) return \"[Truncated]\";\n seen.add(value);\n if (value instanceof Error) return { name: value.name, message: scrubString(value.message) };\n if (Array.isArray(value)) {\n // A `[name, value]` pair (fetch's header lists): the name decides, as for an object key.\n if (value.length === 2 && typeof value[0] === \"string\" && isSecretKey(value[0])) return [value[0], FILTERED];\n return value.map((item) => scrubValue(item, \"\", depth + 1, seen, keepIds));\n }\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value)) {\n if (DROPPED_KEY.test(k)) continue;\n out[k] = scrubValue(v, k, depth + 1, seen, keepIds);\n }\n return out;\n}\n\n/**\n * `scrubValue` without the pass for Sentry's own id fields (`release`, `environment`,\n * `event_id`, …): for data that isn't a Sentry envelope (a support dump, an app's own\n * object), where a key named like one can hold anything.\n */\nexport function scrubValueStrict(value: unknown): unknown {\n return scrubValue(value, \"\", 0, new WeakSet(), false);\n}\n\n/** The fields of a Sentry-shaped event `scrubEvent` treats specially. Anything else is scrubbed by value. */\nexport interface ScrubbableEvent {\n user?: { id?: unknown; [key: string]: unknown } | null;\n request?: { url?: unknown; method?: unknown; headers?: unknown; [key: string]: unknown };\n [key: string]: unknown;\n}\n\n/**\n * The event with the user reduced to its id, the request reduced to its\n * method, URL (cut at `?`) and scrubbed headers, and every other value\n * scrubbed. `null` when scrubbing threw: fail closed, send nothing rather\n * than PII.\n */\nexport function scrubEvent<E extends ScrubbableEvent>(event: E): E | null {\n try {\n // Sentry's processing metadata (scopes, the sampling context its envelope header is built\n // from) is never sent as part of the event: pass it through, or the envelope breaks.\n const { user, request, sdkProcessingMetadata, ...rest } = event;\n const out = scrubValue(rest) as E;\n if (sdkProcessingMetadata !== undefined) (out as ScrubbableEvent).sdkProcessingMetadata = sdkProcessingMetadata;\n if (user !== undefined) {\n (out as ScrubbableEvent).user = user && user.id !== undefined && user.id !== null ? { id: scrubString(String(user.id)) } : null;\n }\n if (request && typeof request === \"object\") {\n const safe: Record<string, unknown> = {};\n if (typeof request.url === \"string\") safe.url = scrubUrl(request.url);\n if (typeof request.method === \"string\") safe.method = request.method;\n if (request.headers && typeof request.headers === \"object\") safe.headers = scrubValue(request.headers);\n (out as ScrubbableEvent).request = safe;\n }\n return out;\n } catch {\n return null;\n }\n}\n\n/** A breadcrumb, span or any record, scrubbed by value. `null` when scrubbing threw (fail closed). */\nexport function scrubRecord<R extends object>(record: R): R | null {\n try {\n return scrubValue(record) as R;\n } catch {\n return null;\n }\n}\n","/**\n * The vendor-neutral seam: a sink is where errors, breadcrumbs, the user id,\n * analytics events and timings go. `createObservability` fans every call out\n * to its sinks, scrubbed first; a sink that throws is reported to\n * `onSinkError` and never takes the others (or the app) down with it.\n *\n * Shipped sinks: `sentrySink` (Sentry), `observeSink` (EAS Observe) and\n * `consoleSink` (development). A vendor adapter (PostHog, Datadog…) is one\n * object with the methods it supports.\n */\nimport type { ComponentType } from \"react\";\nimport { scrubString, scrubValue } from \"./scrub\";\nimport type { EventValues } from \"./events\";\n\n/** Where a caught error came from and whether the app could go on. */\nexport interface ErrorContext {\n /** True when the app could not go on (a render error, a failed boot, a fatal global error). */\n fatal: boolean;\n /**\n * `boundary`, `global`, `boot`, `rejection`, `screen`, `query`, `mutation`\n * (the shell's), a package's (`chat:attachment-action`, through\n * `reportError` from genesis-core) or the app's own (`updates:policy`, `sync`).\n */\n source: string;\n componentStack?: string;\n /** The route pattern on screen (`/(app)/settings`), when known. */\n route?: string | null;\n /**\n * False when nothing caught it (an unhandled promise rejection): release\n * health counts it. Default: handled unless `fatal`.\n */\n handled?: boolean;\n /** Low-cardinality labels (`query.key: \"tasks\"`), scrubbed like everything else. */\n tags?: Readonly<Record<string, string>>;\n}\n\nexport type BreadcrumbLevel = \"debug\" | \"info\" | \"warning\" | \"error\";\n\n/** One step that led up to an error: a navigation, a tap, a request. */\nexport interface Breadcrumb {\n /** `navigation`, `ui`, `http`, `event`, or the app's own. */\n category: string;\n message?: string;\n level?: BreadcrumbLevel;\n data?: Readonly<Record<string, unknown>>;\n /** Milliseconds since the epoch. Default now. */\n timestamp?: number;\n}\n\n/** Low-cardinality labels on a timing (`route`, `step`), never ids or text someone typed. */\nexport type TimingTags = Readonly<Record<string, string>>;\n\n/**\n * One destination. Every method is optional: a sink takes what its vendor\n * supports. Errors arrive as an `Error` whose message is already scrubbed,\n * unless the sink sets `scrubsErrors` (it scrubs the whole event itself and\n * needs the original object, as Sentry does to deduplicate).\n *\n * @stability Beta\n */\nexport interface ObservabilitySink {\n readonly name: string;\n /** The sink scrubs error events itself; give it the original `Error`. */\n readonly scrubsErrors?: boolean;\n captureError?(error: Error, context: ErrorContext): void;\n breadcrumb?(crumb: Breadcrumb): void;\n /** The signed-in login's id, or `null` when signed out. Never an email or a name. */\n setUser?(id: string | null): void;\n /** An analytics event, its props checked against the schema. */\n event?(name: string, props: EventValues): void;\n timing?(name: string, ms: number, tags?: TimingTags): void;\n /** Wraps the root layout (Sentry's `wrap`, EAS Observe's `ObserveRoot.wrap`). */\n wrap?<P extends Record<string, unknown>>(root: ComponentType<P>): ComponentType<P>;\n /**\n * Wraps an Expo Router per-route `ErrorBoundary` (Sentry's\n * `wrapExpoRouterErrorBoundary`). A sink that wraps reports the route's\n * error itself, so the block's screen boundary doesn't send it to that sink again.\n */\n wrapRouteErrorBoundary?(boundary: ComponentType<RouteErrorBoundaryProps>): ComponentType<RouteErrorBoundaryProps>;\n /** Send what is queued, within `timeoutMs`; resolves false when it didn't finish. Called before an update reloads the app. */\n flush?(timeoutMs: number): PromiseLike<boolean> | boolean | void;\n /** The id of the last error event this sink sent, for a support request or feedback. */\n lastEventId?(): string | undefined;\n /** The current session replay's id, when replay is on. */\n replayId?(): string | undefined;\n}\n\n/** What Expo Router gives a route's `ErrorBoundary`: the error, and `retry` to render the route again. */\nexport interface RouteErrorBoundaryProps {\n error: Error;\n retry: () => Promise<void>;\n}\n\n/** A copy of `error` whose message and stack have been scrubbed (for sinks that don't scrub themselves). */\nexport function scrubbedError(error: Error): Error {\n const copy = new Error(scrubString(error.message));\n copy.name = error.name;\n if (error.stack) copy.stack = scrubString(error.stack);\n return copy;\n}\n\nexport interface ConsoleSinkOptions {\n /** Default `console`. */\n console?: Pick<Console, \"log\" | \"warn\" | \"error\">;\n /** Also log breadcrumbs (noisy). Default false. */\n breadcrumbs?: boolean;\n}\n\n/**\n * Logs what would be sent, for development: fatal errors with `console.error`, others with `console.warn`,\n * events and timings with `console.log`. Already scrubbed, so what you read\n * is what a vendor sink would get.\n *\n * @stability Beta\n */\nexport function consoleSink(options: ConsoleSinkOptions = {}): ObservabilitySink {\n const out = options.console ?? console;\n return {\n name: \"console\",\n // `warn` for what the app survives: `console.error` would raise a LogBox error for every one in development.\n captureError: (error, context) => {\n const line = `[observability] ${context.fatal ? \"fatal \" : \"\"}${context.source}: ${error.message}`;\n if (context.fatal) out.error(line);\n else out.warn(line);\n },\n breadcrumb: options.breadcrumbs ? (crumb) => out.log(`[observability] · ${crumb.category} ${crumb.message ?? \"\"}`) : undefined,\n setUser: (id) => out.log(`[observability] user ${id ?? \"(signed out)\"}`),\n event: (name, props) => out.log(`[observability] event ${name}`, props),\n timing: (name, ms, tags) => out.log(`[observability] timing ${name} ${Math.round(ms)}ms`, tags ?? {}),\n };\n}\n\n/**\n * `expo-observe`'s `Observe` (SDK 56+), or a stand-in: the calls `observeSink`\n * uses. Pass `import { Observe } from \"expo-observe\"`.\n */\nexport interface ObserveLike {\n logEvent(name: string, options?: { severity?: \"debug\" | \"info\" | \"warn\" | \"error\"; body?: string; attributes?: Record<string, unknown> }): void;\n /** Error reporting, in preview on SDK 57+. */\n reportError?(error: unknown): void;\n}\n\nexport interface ObserveSinkOptions {\n /** Report caught errors with `Observe.reportError` (in preview). Default false: Sentry is the error tracker. */\n errors?: boolean;\n}\n\n/**\n * EAS Observe. It measures launch (cold, warm, bundle load, first render),\n * time to interactive and, with its Expo Router integration, per-route\n * render times on its own; it has no API for a custom timing metric, so\n * `timing` is logged as an event (`timing.<name>` with `duration_ms`) and\n * shows on the Events page, not as a metric. Analytics events go to\n * `Observe.logEvent` as they are.\n *\n * @stability Beta\n */\nexport function observeSink(observe: ObserveLike, options: ObserveSinkOptions = {}): ObservabilitySink {\n return {\n name: \"eas-observe\",\n event: (name, props) => observe.logEvent(name, { attributes: { ...props } }),\n timing: (name, ms, tags) => observe.logEvent(`timing.${name}`, { severity: \"info\", attributes: { duration_ms: Math.round(ms), ...(tags ?? {}) } }),\n captureError: options.errors && observe.reportError ? (error) => observe.reportError?.(error) : undefined,\n };\n}\n\n/** Breadcrumb data scrubbed and made plain (for sinks and the devtools overlay). */\nexport function scrubBreadcrumb(crumb: Breadcrumb): Breadcrumb {\n return {\n category: scrubString(crumb.category),\n level: crumb.level,\n timestamp: crumb.timestamp,\n ...(crumb.message !== undefined ? { message: scrubString(crumb.message) } : {}),\n ...(crumb.data ? { data: scrubValue(crumb.data) as Record<string, unknown> } : {}),\n };\n}\n","/**\n * `createObservability(options)`: the observability block. Build it once at\n * module scope (it starts the sinks, Sentry's `init` included), then:\n *\n * <GenesisNativeApp blocks={[observability]}> every error the shell catches → captureError\n * export default observability.wrap(RootLayout) Sentry's `wrap` (touch and profiler boundaries)\n * observability.track(\"auth.signed_in\", { method: \"email\" })\n *\n * Its root (inside the shell) sets the user to the signed-in login's id and,\n * with `useSegments` from expo-router, leaves a breadcrumb per route change\n * and a `route.time_on_screen` timing for the route left. Route patterns\n * (`/(app)/clients/[id]`) are used, never the values in them.\n *\n * Creating it also:\n * - registers it as genesis-core's error reporter (`setErrorReporter`), so a\n * package's `reportError(e, \"chat:…\")` reaches the sinks as a non-fatal error;\n * - registers a before-reload hook (`onBeforeReload`) that flushes the sinks\n * before an update reloads the app.\n *\n * `observability.screenBoundary()` is an Expo Router `ErrorBoundary` for a\n * route (reported non-fatal, wrapped by Sentry's route wrapper), and\n * `lastEventId()` / `replayId()` let a support or feedback screen point at\n * the event.\n *\n * Everything a sink receives has been scrubbed (see `scrub.ts`), and the\n * last breadcrumbs and errors are kept, scrubbed, for the devtools overlay\n * (`recent`).\n */\nimport { createContext, useContext, useEffect, useRef, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\nimport { defineBlock } from \"@marktiderman/genesis-config/blocks\";\nimport { setErrorReporter } from \"@marktiderman/genesis-core/errors\";\nimport { useSession } from \"../auth\";\nimport { onBeforeReload } from \"../reload\";\nimport { createScreenErrorBoundary, type ScreenErrorProps } from \"../screen-boundary\";\nimport type { NativeBlock, NativeBlockRootProps } from \"../blocks\";\nimport type { ErrorReport } from \"../errors\";\nimport { checkEvent, type EventProps, type EventSchema } from \"./events\";\nimport { scrubString, scrubValue } from \"./scrub\";\nimport { scrubBreadcrumb, scrubbedError, type Breadcrumb, type ErrorContext, type ObservabilitySink, type TimingTags } from \"./sink\";\n\n/** The FeatureId of the observability block. */\nexport const OBSERVABILITY_BLOCK_ID = \"observability\";\n\n/** A caught error as the devtools overlay shows it (scrubbed). */\nexport interface RecentError {\n at: number;\n name: string;\n message: string;\n source: string;\n fatal: boolean;\n}\n\nexport interface RecentActivity {\n /** Oldest first. Navigation, events and the app's breadcrumbs. */\n breadcrumbs: readonly Breadcrumb[];\n /** Oldest first. */\n errors: readonly RecentError[];\n}\n\nexport interface RecentStore {\n getState(): RecentActivity;\n subscribe(listener: () => void): () => void;\n clear(): void;\n}\n\nexport interface ObservabilityOptions<E extends EventSchema = EventSchema> {\n /** Where everything goes: `sentrySink(Sentry, …)`, `consoleSink()` in development, `observeSink(Observe)`. */\n sinks: readonly (ObservabilitySink | null | undefined | false)[];\n /** The app's analytics events (`defineEvents`). Without it, `track` accepts nothing. */\n events?: E;\n /** `useSegments` from expo-router: route breadcrumbs and `route.time_on_screen` timings. */\n useSegments?: () => readonly string[];\n /** How many breadcrumbs and errors `recent` keeps. Default 50 and 20. */\n recent?: { breadcrumbs?: number; errors?: number };\n /** A sink threw, or `track` was called with something the schema doesn't allow. Default `console.warn` in development. */\n onProblem?: (problem: string, error?: unknown) => void;\n /**\n * Become genesis-core's error reporter, so packages' `reportError` calls\n * reach the sinks. Default true; the last block created wins.\n */\n reportErrors?: boolean;\n /** Flush the sinks before an update reloads the app, within this many milliseconds. Default 2000; 0 turns it off. */\n flushBeforeReloadMs?: number;\n now?: () => number;\n}\n\nexport interface ObservabilityBlock<E extends EventSchema = EventSchema> extends NativeBlock<typeof OBSERVABILITY_BLOCK_ID> {\n readonly sinks: readonly ObservabilitySink[];\n readonly events: E | undefined;\n /** Report an error. The shell calls it for every error it catches. */\n captureError(error: unknown, context?: Partial<ErrorContext>): void;\n breadcrumb(crumb: Breadcrumb): void;\n /** The login's id only. The block's root sets it from the session. */\n setUser(id: string | null): void;\n /** An analytics event from the schema. Anything else is dropped and reported. */\n track<N extends keyof E & string>(name: N, props?: EventProps<E[N]>): void;\n timing(name: string, ms: number, tags?: TimingTags): void;\n /** The root layout wrapped by each sink that wraps (Sentry's `wrap`). Use once: `export default observability.wrap(RootLayout)`. */\n wrap<P extends Record<string, unknown>>(root: ComponentType<P>): ComponentType<P>;\n /** The last breadcrumbs and errors, scrubbed, for the devtools overlay. */\n readonly recent: RecentStore;\n /** Send what every sink has queued; resolves false when one didn't finish within `timeoutMs` (default 2000). */\n flush(timeoutMs?: number): Promise<boolean>;\n /** The id of the last error event a sink sent (Sentry's), for a support request or feedback. */\n lastEventId(): string | undefined;\n /** The current session replay's id, when a sink records replays. */\n replayId(): string | undefined;\n /**\n * An Expo Router `ErrorBoundary` for a route: reports the error non-fatal\n * (source `screen`), shows `fallback` (default `<FatalScreen kind=\"screen\" />`) with\n * \"Try again\", and is wrapped by each sink's route wrapper (Sentry's\n * `wrapExpoRouterErrorBoundary`). Build it once, at module scope.\n */\n screenBoundary(fallback?: ComponentType<ScreenErrorProps>): ComponentType<ScreenErrorProps>;\n /** For the shell: every error it catches. */\n readonly onError: (error: Error, report: ErrorReport) => void;\n readonly Root: ComponentType<NativeBlockRootProps>;\n}\n\ndeclare const __DEV__: boolean | undefined;\n\nlet releaseReloadHook: (() => void) | undefined;\n\nconst TIMING_NAME = /^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)*$/;\n\nfunction createRecentStore(maxCrumbs: number, maxErrors: number): RecentStore & { addCrumb(c: Breadcrumb): void; addError(e: RecentError): void } {\n let state: RecentActivity = { breadcrumbs: [], errors: [] };\n const listeners = new Set<() => void>();\n const emit = () => listeners.forEach((l) => l());\n const push = <T,>(list: readonly T[], item: T, max: number) => (list.length >= max ? [...list.slice(list.length - max + 1), item] : [...list, item]);\n return {\n getState: () => state,\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n clear() {\n state = { breadcrumbs: [], errors: [] };\n emit();\n },\n addCrumb(crumb) {\n state = { ...state, breadcrumbs: push(state.breadcrumbs, crumb, maxCrumbs) };\n emit();\n },\n addError(error) {\n state = { ...state, errors: push(state.errors, error, maxErrors) };\n emit();\n },\n };\n}\n\nfunction toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(typeof value === \"string\" ? value : \"Unknown error\");\n}\n\n/** Build the block once, at module scope, before the root layout renders. @stability Beta */\nexport function createObservability<const E extends EventSchema = EventSchema>(options: ObservabilityOptions<E>): ObservabilityBlock<E> {\n const sinks = options.sinks.filter((s): s is ObservabilitySink => Boolean(s));\n const now = options.now ?? Date.now;\n const problem =\n options.onProblem ??\n ((message: string, error?: unknown) => {\n // genesis-allow-console: the block's own development warning; it can't report to itself.\n if (typeof __DEV__ !== \"undefined\" && __DEV__) console.warn(`[observability] ${message}`, error ?? \"\");\n });\n const recent = createRecentStore(options.recent?.breadcrumbs ?? 50, options.recent?.errors ?? 20);\n let route: string | null = null;\n let user: string | null | undefined;\n\n // One sink failing never stops the others, and never throws into the caller (an error handler, a render).\n const each = (method: string, call: (sink: ObservabilitySink) => void) => {\n for (const sink of sinks) {\n try {\n call(sink);\n } catch (error) {\n try {\n problem(`${sink.name}.${method} threw`, error);\n } catch {\n // ignore a failing reporter\n }\n }\n }\n };\n\n // Never throws into the caller (an effect, a handler): a record that can't be scrubbed is dropped.\n const breadcrumb = (input: Breadcrumb) => {\n let crumb: Breadcrumb;\n try {\n crumb = scrubBreadcrumb({ ...input, timestamp: input.timestamp ?? now() });\n } catch (error) {\n problem(\"breadcrumb dropped: it could not be scrubbed\", error);\n return;\n }\n recent.addCrumb(crumb);\n each(\"breadcrumb\", (s) => s.breadcrumb?.(crumb));\n };\n\n const captureError = (value: unknown, context: Partial<ErrorContext> = {}, skip?: ReadonlySet<ObservabilitySink>) => {\n const error = toError(value);\n const full: ErrorContext = {\n fatal: context.fatal ?? false,\n source: context.source ?? \"app\",\n route: context.route ?? route,\n componentStack: context.componentStack,\n ...(context.handled !== undefined ? { handled: context.handled } : {}),\n ...(context.tags ? { tags: context.tags } : {}),\n };\n let safe: Error | undefined;\n const scrubbed = () => (safe ??= scrubbedError(error));\n try {\n recent.addError({ at: now(), name: error.name, message: scrubString(error.message), source: full.source, fatal: full.fatal });\n } catch {\n // never let the overlay's list stop a report\n }\n let forSinks: ErrorContext = full;\n try {\n forSinks = {\n ...full,\n ...(full.componentStack ? { componentStack: scrubString(full.componentStack) } : {}),\n ...(full.tags ? { tags: scrubValue(full.tags) as Record<string, string> } : {}),\n };\n } catch {\n // Tags that can't be scrubbed are dropped, never sent raw.\n forSinks = { ...full, componentStack: undefined, tags: undefined };\n }\n each(\"captureError\", (s) => {\n if (skip?.has(s)) return;\n s.captureError?.(s.scrubsErrors ? error : scrubbed(), s.scrubsErrors ? full : forSinks);\n });\n };\n\n const flush = async (timeoutMs = 2000): Promise<boolean> => {\n const results = sinks.map(async (sink) => {\n if (!sink.flush) return true;\n try {\n return (await sink.flush(timeoutMs)) !== false;\n } catch (error) {\n problem(`${sink.name}.flush threw`, error);\n return false;\n }\n });\n let timer: ReturnType<typeof setTimeout> | undefined;\n const deadline = new Promise<boolean>((resolve) => {\n timer = setTimeout(() => resolve(false), timeoutMs);\n });\n try {\n return await Promise.race([Promise.all(results).then((all) => all.every(Boolean)), deadline]);\n } finally {\n if (timer !== undefined) clearTimeout(timer);\n }\n };\n\n const firstOf = (read: (sink: ObservabilitySink) => string | undefined): string | undefined => {\n for (const sink of sinks) {\n try {\n const value = read(sink);\n if (value) return value;\n } catch (error) {\n problem(`${sink.name} threw reading an id`, error);\n }\n }\n return undefined;\n };\n\n const setUser = (id: string | null) => {\n if (id === user) return;\n user = id;\n each(\"setUser\", (s) => s.setUser?.(id));\n };\n\n const track = (name: string, props?: Readonly<Record<string, unknown>>) => {\n const check = options.events ? checkEvent(options.events, name, props) : ({ ok: false, problem: \"no event schema: pass `events: defineEvents({…})`\" } as const);\n if (!check.ok) {\n problem(`track dropped: ${check.problem}`);\n return;\n }\n recent.addCrumb({ category: \"event\", message: name, level: \"info\", data: check.props, timestamp: now() });\n each(\"event\", (s) => s.event?.(name, check.props));\n };\n\n const timing = (name: string, ms: number, tags?: TimingTags) => {\n if (!Number.isFinite(ms) || ms < 0) return;\n // A name like an event's (`route.time_on_screen`), never text with values in it.\n if (!TIMING_NAME.test(name)) {\n problem(`timing dropped: \"${scrubString(name)}\" is not lower-case words joined by \".\"`);\n return;\n }\n let safeTags: TimingTags | undefined;\n try {\n safeTags = tags ? (scrubValue(tags) as TimingTags) : undefined;\n } catch (error) {\n problem(\"timing dropped: its tags could not be scrubbed\", error);\n return;\n }\n each(\"timing\", (s) => s.timing?.(name, ms, safeTags));\n };\n\n const declaration = defineBlock<typeof OBSERVABILITY_BLOCK_ID, ComponentType<never>>({\n id: OBSERVABILITY_BLOCK_ID,\n platforms: [\"native\"],\n contributes: {\n privacy: {\n collects: [\n // genesis-cli's PRIVACY_BLOCKS.observability mirrors this (with events) for the iOS\n // privacy manifest; observability/block.test.tsx keeps the two the same.\n { type: \"crash data\", purposes: [\"app functionality\"], linked: true, tracking: false },\n { type: \"performance data\", purposes: [\"app functionality\"], linked: true, tracking: false },\n // Sentry's device and OS details, breadcrumbs and sessions.\n { type: \"other diagnostic data\", purposes: [\"app functionality\"], linked: true, tracking: false },\n { type: \"user id\", purposes: options.events ? [\"app functionality\", \"analytics\"] : [\"app functionality\"], linked: true, tracking: false },\n ...(options.events ? [{ type: \"product interaction\", purposes: [\"analytics\"], linked: true, tracking: false }] : []),\n ],\n notes: [\n \"Crash reports, timings and analytics events carry the login's id only; emails, tokens, keys and query strings are removed on the device before anything is sent.\",\n ],\n },\n },\n });\n\n const useSegments = options.useSegments;\n function RouteTracker() {\n const segments = (useSegments as () => readonly string[])();\n const path = `/${segments.join(\"/\")}`;\n const last = useRef<{ path: string; at: number } | null>(null);\n useEffect(() => {\n const at = now();\n const previous = last.current;\n if (previous?.path === path) return;\n route = path;\n breadcrumb({ category: \"navigation\", message: path, data: previous ? { from: previous.path } : undefined, timestamp: at });\n if (previous) timing(\"route.time_on_screen\", at - previous.at, { route: previous.path });\n last.current = { path, at };\n }, [path]);\n return null;\n }\n\n function UserTracker() {\n const { userId } = useSession();\n useEffect(() => setUser(userId ?? null), [userId]);\n return null;\n }\n\n const block: ObservabilityBlock<E> = {\n ...declaration,\n sinks,\n events: options.events,\n captureError,\n breadcrumb,\n setUser,\n track: track as ObservabilityBlock<E>[\"track\"],\n timing,\n recent,\n wrap(root) {\n return sinks.reduce((wrapped, sink) => (sink.wrap ? sink.wrap(wrapped) : wrapped), root);\n },\n onError: (error, report) =>\n captureError(error, {\n fatal: report.fatal,\n source: report.source,\n componentStack: report.componentStack,\n ...(report.handled !== undefined ? { handled: report.handled } : {}),\n ...(report.tags ? { tags: report.tags } : {}),\n }),\n flush,\n lastEventId: () => firstOf((s) => s.lastEventId?.()),\n replayId: () => firstOf((s) => s.replayId?.()),\n screenBoundary(fallback) {\n const wrapping = sinks.filter((s) => s.wrapRouteErrorBoundary);\n // A sink whose wrapper reports the route's error (Sentry's) isn't sent it a second time.\n const skip = new Set(wrapping);\n return createScreenErrorBoundary({\n fallback,\n onError: (error, report) => captureError(error, { fatal: report.fatal, source: report.source }, skip),\n wrap: wrapping.map((sink) => (boundary: ComponentType<ScreenErrorProps>) => {\n try {\n return sink.wrapRouteErrorBoundary!(boundary);\n } catch (error) {\n problem(`${sink.name}.wrapRouteErrorBoundary threw`, error);\n skip.delete(sink);\n return boundary;\n }\n }),\n });\n },\n Root: function ObservabilityRoot({ children }: NativeBlockRootProps) {\n return (\n <ObservabilityContext.Provider value={block as ObservabilityBlock}>\n <UserTracker />\n {useSegments ? <RouteTracker /> : null}\n {children}\n </ObservabilityContext.Provider>\n );\n },\n };\n if (options.reportErrors !== false) {\n setErrorReporter((value, context) =>\n captureError(value, { fatal: context.fatal ?? false, source: context.source, ...(context.tags ? { tags: context.tags } : {}) }),\n );\n }\n const flushMs = options.flushBeforeReloadMs ?? 2000;\n // The newest block replaces the last one's hook (Fast Refresh builds the block again).\n releaseReloadHook?.();\n releaseReloadHook = flushMs > 0 && sinks.some((s) => s.flush) ? onBeforeReload(() => flush(flushMs)) : undefined;\n return block;\n}\n\nconst ObservabilityContext = createContext<ObservabilityBlock | null>(null);\n\n/** Provides a block to the hooks without its root (rung 4). @stability Beta */\nexport function ObservabilityProvider({ block, children }: { block: ObservabilityBlock; children?: ReactNode }) {\n return <ObservabilityContext.Provider value={block}>{children}</ObservabilityContext.Provider>;\n}\n\n/** The block, or `null` when it is off (so a screen can call it whether or not the block is on). @stability Beta */\nexport function useObservability(): ObservabilityBlock | null {\n return useContext(ObservabilityContext);\n}\n\n/** The last breadcrumbs and errors, scrubbed; empty when the block is off. @stability Beta */\nexport function useRecentActivity(block?: ObservabilityBlock | null): RecentActivity {\n const fromContext = useObservability();\n const store = (block ?? fromContext)?.recent ?? EMPTY_STORE;\n return useSyncExternalStore(store.subscribe, store.getState, store.getState);\n}\n\nconst EMPTY: RecentActivity = { breadcrumbs: [], errors: [] };\nconst EMPTY_STORE: RecentStore = { getState: () => EMPTY, subscribe: () => () => {}, clear: () => {} };\n"]}
|
package/dist/devtools.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import * as _marktiderman_genesis_config_settings from '@marktiderman/genesis-config/settings';
|
|
2
|
+
import { ResolvedSettings } from '@marktiderman/genesis-config/settings';
|
|
3
|
+
import { N as NativeBlock, U as UpdatesBlock, V as VersionSignature } from './blocks-CF0agqxk.js';
|
|
4
|
+
export { D as DevtoolsDiagnosticsProps, a as DevtoolsFeedbackProps, b as DevtoolsSlots } from './blocks-CF0agqxk.js';
|
|
5
|
+
import { O as ObservabilityBlock, R as RecentActivity } from './block-DlGnjjps.js';
|
|
4
6
|
import 'react';
|
|
5
7
|
import '@marktiderman/genesis-core/slots';
|
|
6
|
-
import '@marktiderman/genesis-
|
|
8
|
+
import '@marktiderman/genesis-config/blocks';
|
|
7
9
|
import './query--ihYsJWC.js';
|
|
8
10
|
import '@tanstack/react-query';
|
|
9
11
|
import '@marktiderman/genesis-design-system';
|
|
@@ -107,6 +109,15 @@ interface DevtoolsOptions {
|
|
|
107
109
|
clearCache?: () => unknown;
|
|
108
110
|
/** Sign out (`supabase.auth.signOut()`). Without it, the action is hidden. */
|
|
109
111
|
signOut?: () => unknown;
|
|
112
|
+
/**
|
|
113
|
+
* Genesis settings (`resolveSettings`' result, or the values alone): `devtools.overlay` off
|
|
114
|
+
* mounts nothing (it never turns the overlay on: `enabled` does); `devtools.shakeToOpen`,
|
|
115
|
+
* `devtools.hold`, `devtools.flags` and `devtools.signOut` off take that part away. Without
|
|
116
|
+
* them, everything the options give.
|
|
117
|
+
*/
|
|
118
|
+
appSettings?: Pick<ResolvedSettings, "values"> | {
|
|
119
|
+
readonly [key: string]: unknown;
|
|
120
|
+
} | null;
|
|
110
121
|
}
|
|
111
122
|
interface DevtoolsState {
|
|
112
123
|
open: boolean;
|
|
@@ -121,7 +132,7 @@ interface DevtoolsBlock extends NativeBlock<typeof DEVTOOLS_BLOCK_ID> {
|
|
|
121
132
|
subscribe(listener: () => void): () => void;
|
|
122
133
|
}
|
|
123
134
|
/** Build the overlay once, at module scope. @stability Beta */
|
|
124
|
-
declare function createDevtools(
|
|
135
|
+
declare function createDevtools(given: DevtoolsOptions): DevtoolsBlock;
|
|
125
136
|
|
|
126
137
|
/**
|
|
127
138
|
* The overlay's report, as text for "Copy debug info" and the feedback slot.
|
|
@@ -142,4 +153,56 @@ interface DebugInfoInput {
|
|
|
142
153
|
/** Several lines a person can paste into a bug report. Unknown values are written `unknown`, never left out. */
|
|
143
154
|
declare function buildDebugInfo(input: DebugInfoInput): string;
|
|
144
155
|
|
|
145
|
-
|
|
156
|
+
/** `devtools.*`, as declared. @stability Beta */
|
|
157
|
+
declare const DEVTOOLS_SETTING_SPECS: {
|
|
158
|
+
readonly overlay: {
|
|
159
|
+
readonly type: "boolean";
|
|
160
|
+
readonly default: true;
|
|
161
|
+
readonly summary: "The Development overlay in development and preview builds. Off hides it; no setting turns it on in a production build.";
|
|
162
|
+
};
|
|
163
|
+
readonly shakeToOpen: {
|
|
164
|
+
readonly type: "boolean";
|
|
165
|
+
readonly default: true;
|
|
166
|
+
readonly requires: readonly ["devtools.overlay"];
|
|
167
|
+
readonly summary: "Shake to open the overlay (development and preview builds).";
|
|
168
|
+
};
|
|
169
|
+
readonly hold: {
|
|
170
|
+
readonly type: "boolean";
|
|
171
|
+
readonly default: true;
|
|
172
|
+
readonly requires: readonly ["devtools.overlay"];
|
|
173
|
+
readonly summary: "A three-finger hold opens the overlay.";
|
|
174
|
+
};
|
|
175
|
+
readonly flags: {
|
|
176
|
+
readonly type: "boolean";
|
|
177
|
+
readonly default: true;
|
|
178
|
+
readonly requires: readonly ["devtools.overlay"];
|
|
179
|
+
readonly summary: "Show the app's switches and flags in the overlay.";
|
|
180
|
+
};
|
|
181
|
+
readonly signOut: {
|
|
182
|
+
readonly type: "boolean";
|
|
183
|
+
readonly default: true;
|
|
184
|
+
readonly requires: readonly ["devtools.overlay"];
|
|
185
|
+
readonly summary: "Offer Sign out in the overlay.";
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
/** @stability Beta */
|
|
189
|
+
declare const devtoolsSettings: _marktiderman_genesis_config_settings.SettingsDeclaration<"devtools", "overlay" | "shakeToOpen" | "hold" | "flags" | "signOut">;
|
|
190
|
+
/** The devtools overlay's settings, typed. @stability Beta */
|
|
191
|
+
interface DevtoolsSettingValues {
|
|
192
|
+
overlay: boolean;
|
|
193
|
+
shakeToOpen: boolean;
|
|
194
|
+
hold: boolean;
|
|
195
|
+
flags: boolean;
|
|
196
|
+
signOut: boolean;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The overlay's settings from `resolveSettings`' result (or the values alone, by full key). A key
|
|
200
|
+
* that's missing, or whose value doesn't fit, takes its default (every one on).
|
|
201
|
+
*
|
|
202
|
+
* @stability Beta
|
|
203
|
+
*/
|
|
204
|
+
declare function devtoolsSettingValues(input?: Pick<ResolvedSettings, "values"> | {
|
|
205
|
+
readonly [key: string]: unknown;
|
|
206
|
+
} | null): DevtoolsSettingValues;
|
|
207
|
+
|
|
208
|
+
export { type AccelerometerLike, DEVTOOLS_BLOCK_ID, DEVTOOLS_SETTING_SPECS, type DebugInfoInput, type DevSettingsLike, type DevtoolsBlock, type DevtoolsOptions, type DevtoolsSettingValues, type DevtoolsState, type HoldDetector, type HoldDetectorOptions, type ShakeDetector, type ShakeDetectorOptions, buildDebugInfo, createDevtools, createHoldDetector, createShakeDetector, devtoolsSettingValues, devtoolsSettings };
|