@mushi-mushi/core 1.32.2 → 1.33.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.
@@ -1 +1 @@
1
- export { T as MushiPushSubscriptionJSON, X as MushiReporterChannelUnavailable, ak as MushiReporterChannels, Z as MushiReporterNotificationPrefs, _ as MushiReporterPrefsUpdate, a0 as MushiReporterReportDetail, a1 as MushiReporterTimelineItem, a2 as MushiReporterUpdates, al as reporterChannels, am as subscribeBrowserPush } from './types-CWa7T4bx.cjs';
1
+ export { U as MushiPushSubscriptionJSON, Y as MushiReporterChannelUnavailable, am as MushiReporterChannels, _ as MushiReporterNotificationPrefs, $ as MushiReporterPrefsUpdate, a1 as MushiReporterReportDetail, a2 as MushiReporterTimelineItem, a3 as MushiReporterUpdates, an as reporterChannels, ao as subscribeBrowserPush } from './types-DkC08B8U.cjs';
@@ -1 +1 @@
1
- export { T as MushiPushSubscriptionJSON, X as MushiReporterChannelUnavailable, ak as MushiReporterChannels, Z as MushiReporterNotificationPrefs, _ as MushiReporterPrefsUpdate, a0 as MushiReporterReportDetail, a1 as MushiReporterTimelineItem, a2 as MushiReporterUpdates, al as reporterChannels, am as subscribeBrowserPush } from './types-CWa7T4bx.js';
1
+ export { U as MushiPushSubscriptionJSON, Y as MushiReporterChannelUnavailable, am as MushiReporterChannels, _ as MushiReporterNotificationPrefs, $ as MushiReporterPrefsUpdate, a1 as MushiReporterReportDetail, a2 as MushiReporterTimelineItem, a3 as MushiReporterUpdates, an as reporterChannels, ao as subscribeBrowserPush } from './types-DkC08B8U.js';
@@ -133,6 +133,12 @@ declare function subscribeBrowserPush(channels: Pick<MushiReporterChannels, 'sub
133
133
  reason: string;
134
134
  }>;
135
135
 
136
+ /**
137
+ * What `Mushi.init()` and `<MushiProvider config>` accept: a {@link MushiConfig}
138
+ * whose `projectId` / `apiKey` may instead come from the NEXT_PUBLIC_MUSHI_* /
139
+ * VITE_MUSHI_* / MUSHI_* env vars. Init still throws if neither supplies them.
140
+ */
141
+ type MushiInitConfig = Omit<MushiConfig, 'projectId' | 'apiKey'> & Partial<Pick<MushiConfig, 'projectId' | 'apiKey'>>;
136
142
  interface MushiConfig {
137
143
  projectId: string;
138
144
  apiKey: string;
@@ -311,15 +317,51 @@ interface MushiWidgetConfig {
311
317
  expandedTitle?: string;
312
318
  mode?: 'simple' | 'conversational';
313
319
  locale?: string;
320
+ /**
321
+ * Page-level z-index of the launcher (default `99999`). The panel and toasts
322
+ * sit at `zIndex + 1`. Each surface carries its own z-index and the widget's
323
+ * host element forms no stacking context, so these numbers compare directly
324
+ * with the host page's own layers. The banner has its own setting,
325
+ * `bannerConfig.zIndex`.
326
+ */
314
327
  zIndex?: number;
315
328
  /**
316
329
  * Controls how, or whether, the default trigger is injected.
317
- * `auto` — historical floating stamp FAB.
318
- * `banner` — slim full-width header strip (recommended default; less obtrusive
319
- * than a FAB and visible even when the SDK launcher is `hide()`'d).
320
- * Pair with `bannerConfig` to customise appearance.
330
+ * `auto` — floating stamp FAB; on phones it becomes an edge tab (see `mobileTrigger`).
331
+ * `edge-tab` — a slim tab flush with the screen edge: 22×48px drawn, 44×48px to tap.
332
+ * `banner` — slim full-width header strip (recommended default; less obtrusive
333
+ * than a FAB and visible even when the SDK launcher is `hide()`'d).
334
+ * Pair with `bannerConfig` to customise appearance.
321
335
  */
322
336
  trigger?: 'auto' | 'banner' | 'edge-tab' | 'attach' | 'manual' | 'hidden';
337
+ /**
338
+ * What `trigger: 'auto'` draws at phone widths (≤ 768px). `'edge-tab'`
339
+ * draws the slim edge tab; `'auto'` keeps the round FAB. Default
340
+ * `'edge-tab'`, or `'auto'` when the host shaped the FAB itself (a left or
341
+ * right `anchor` / `inset`, `draggable`, or a word `triggerText`).
342
+ */
343
+ mobileTrigger?: 'edge-tab' | 'auto';
344
+ /**
345
+ * Lift the launcher, panel and toast above fixed or sticky host bars that
346
+ * touch the bottom of the viewport (tab bars, cookie strips, chat composers).
347
+ * Default `true`. The lift is a floor: an explicit `inset.bottom` or
348
+ * `anchor.bottom` that is already higher wins. Set `false` to keep the
349
+ * launcher exactly where `inset` / `anchor` puts it.
350
+ */
351
+ avoidFixedBars?: boolean;
352
+ /**
353
+ * Tuck the launcher toward its edge and fade it while the page scrolls,
354
+ * then bring it back when scrolling stops. Default `true`. Never tucks while
355
+ * the launcher has focus or the panel is open. Ignored when
356
+ * `smartHide.onScroll` is set.
357
+ */
358
+ tuckOnScroll?: boolean;
359
+ /**
360
+ * Show a "Hide the bug button for this visit" action in the report panel.
361
+ * The choice lasts until the tab closes (sessionStorage), including through
362
+ * `Mushi.show()`; `Mushi.open()` still opens the panel. Default `true`.
363
+ */
364
+ dismissible?: boolean;
323
365
  /**
324
366
  * Configuration for the header-banner launcher mode.
325
367
  * Only applies when `trigger === 'banner'`.
@@ -343,7 +385,9 @@ interface MushiWidgetConfig {
343
385
  /**
344
386
  * Allow the FAB to be dragged and repositioned by the user.
345
387
  * - `true` — drag enabled, persisted to localStorage, snaps to nearest edge on release.
346
- * - `false` — fixed position (default).
388
+ * - `false` — fixed position (default for the FAB).
389
+ * - Unset — the edge tab can still be dragged up and down its edge (persisted per site).
390
+ * The edge tab always moves along its edge only (`axis: 'y'`).
347
391
  * - Object — fine-grained control:
348
392
  * - `persist` save position per projectId (default true when draggable).
349
393
  * - `snapToEdge` snap to the nearest left/right edge on release (default true).
@@ -440,10 +484,13 @@ interface MushiWidgetConfig {
440
484
  /**
441
485
  * CSS selectors of host-app elements that the widget trigger and panel must
442
486
  * never visually overlap. At render time the widget queries each selector,
443
- * measures the union bounding rect, and nudges `--mushi-top` / `--mushi-bottom`
444
- * so the panel clears every avoided element by at least 8px.
487
+ * measures its bounding rect, and moves the widget's anchored edge
488
+ * (`--mushi-bottom` for bottom positions, the default; `--mushi-top` for top
489
+ * positions) so it clears every avoided element in that half of the viewport
490
+ * by at least 8px. Elements in the other half are left alone.
445
491
  *
446
- * Typical use: avoid a sticky mobile header or a fixed sign-in CTA.
492
+ * Typical use: a sticky mobile header for a top position, or a bottom tab
493
+ * bar or fixed sign-in CTA for a bottom position.
447
494
  *
448
495
  * @example
449
496
  * avoidSelectors: ['[data-mobile-header]', '#sign-in-cta']
@@ -522,14 +569,17 @@ interface MushiBannerConfig {
522
569
  /** 'top' pins the banner below any existing sticky headers; 'bottom' pins above bottom navs. Defaults to 'top'. */
523
570
  position?: 'top' | 'bottom';
524
571
  /**
525
- * Body copy on the strip — the lime "Beta" announcement line users see in
572
+ * Body copy on the strip — the lime announcement line users see in
526
573
  * the Mushi admin console. When set, the banner switches to the rich layout
527
574
  * (pill + message + flat text actions) instead of button-only CTAs.
528
575
  */
529
576
  message?: string;
530
577
  /**
531
- * Pill label shown before `message` (e.g. "Beta"). Defaults to `"Beta"` when
578
+ * Pill label shown before `message`. Defaults to `"Feedback"` when
532
579
  * `message` is set. Pass `false` to hide the pill.
580
+ *
581
+ * Do not set `"Beta"` in a production App Store or Google Play build: Apple
582
+ * can reject the app under guideline 2.2 (beta testing belongs in TestFlight).
533
583
  */
534
584
  label?: string | false;
535
585
  /** Override the call-to-action text in the banner. Defaults to '🐛 Report a bug'. */
@@ -540,7 +590,11 @@ interface MushiBannerConfig {
540
590
  featureCtaLabel?: string;
541
591
  /** Extra flat links after the bug/feature CTAs (e.g. "My submissions"). */
542
592
  links?: MushiBannerLink[];
543
- /** CSS z-index of the banner element. Defaults to the widget's configured zIndex. */
593
+ /**
594
+ * Page-level z-index of the banner strip. Defaults to the widget's `zIndex`
595
+ * minus one, just under the launcher. Set it below your own overlays (sheets,
596
+ * drawers, dialogs) so they cover the banner, e.g. `130` under a `200` sheet.
597
+ */
544
598
  zIndex?: number;
545
599
  }
546
600
  interface MushiBetaModeConfig {
@@ -598,9 +652,12 @@ interface MushiCaptureConfig {
598
652
  screenshot?: 'on-report' | 'auto' | 'off';
599
653
  /**
600
654
  * Custom screenshot capture function. When provided, the SDK calls this
601
- * instead of its built-in DOM-snapshot capturer. Return a JPEG/PNG data URI
602
- * on success, or `null` to skip attachment. If the function throws the SDK
603
- * falls back to the built-in capturer.
655
+ * instead of its built-in DOM-snapshot capturer. Resolve to a
656
+ * `data:image/jpeg` or `data:image/png` URL on success, or `null` to skip
657
+ * attachment. Any other string (a `file://` or `https://` URI) is ignored
658
+ * with a warning, so a native plugin's file must be read and returned as a
659
+ * data URL. If the function throws the SDK falls back to the built-in
660
+ * capturer.
604
661
  *
605
662
  * Primary use-case: Capacitor / WebView hosts that route through a native
606
663
  * plugin (e.g. `@capawesome/capacitor-screenshot`) to obtain a real pixel-
@@ -610,9 +667,9 @@ interface MushiCaptureConfig {
610
667
  * capture: {
611
668
  * screenshot: 'auto',
612
669
  * screenshotProvider: async () => {
613
- * const { Screenshot } = await import('@capawesome/capacitor-screenshot');
614
- * const { uri } = await Screenshot.take();
615
- * return uri; // data URI on web, file:// on native (SDK handles both)
670
+ * // Base64 PNG from your native screenshot plugin.
671
+ * const base64 = await takeNativeScreenshot();
672
+ * return base64 ? `data:image/png;base64,${base64}` : null;
616
673
  * },
617
674
  * }
618
675
  */
@@ -1910,7 +1967,8 @@ interface MushiDiscoveryEventPayload {
1910
1967
  }
1911
1968
  /** Payload for /v1/sdk/session — lightweight session lifecycle tracking.
1912
1969
  * Best-effort, no offline queue. Privacy-safe: no PII by default;
1913
- * `user_id_hash` is the same device-fingerprint hash used elsewhere. */
1970
+ * `user_id_hash` is a one-way SHA-256 hex of the host's user id, never the
1971
+ * id itself, and stays null until the host identifies the user. */
1914
1972
  interface MushiSessionEventPayload {
1915
1973
  /** Lifecycle event kind. */
1916
1974
  kind: 'session_start' | 'session_heartbeat' | 'session_end' | 'page_view';
@@ -1925,7 +1983,7 @@ interface MushiSessionEventPayload {
1925
1983
  page_view_count?: number;
1926
1984
  /** Device fingerprint hash — same token used in reports. */
1927
1985
  reporter_token_hash?: string | null;
1928
- /** user_id_hash when the host app called Mushi.identify(). */
1986
+ /** SHA-256 hex of the host user id, set after Mushi.identifyWithToken(). */
1929
1987
  user_id_hash?: string | null;
1930
1988
  user_agent?: string | null;
1931
1989
  sdk_version?: string;
@@ -1982,10 +2040,14 @@ interface MushiApiResponse<T> {
1982
2040
  status?: number;
1983
2041
  };
1984
2042
  }
2043
+ /** Widget block of the runtime config: older edge functions send `triggerText: null` for "use the SDK default". */
2044
+ type MushiRuntimeWidgetConfig = Omit<MushiWidgetConfig, 'triggerText'> & {
2045
+ triggerText?: string | null;
2046
+ };
1985
2047
  interface MushiRuntimeSdkConfig {
1986
2048
  enabled?: boolean;
1987
2049
  version?: string | null;
1988
- widget?: MushiWidgetConfig;
2050
+ widget?: MushiRuntimeWidgetConfig;
1989
2051
  capture?: MushiCaptureConfig;
1990
2052
  native?: {
1991
2053
  triggerMode?: 'shake' | 'button' | 'both' | 'none';
@@ -2100,4 +2162,4 @@ interface MushiTesterReputation {
2100
2162
  total_points: number;
2101
2163
  }
2102
2164
 
2103
- export { type MushiReporterReport as $, type MushiDiscoverInventoryConfig as A, type MushiDiscoveryEventPayload as B, type MushiEventHandler as C, type MushiEventType as D, type MushiHallOfFameEntry as E, type MushiIntegrationsConfig as F, type MushiLeaderboardEntry as G, type MushiNetworkEntry as H, type MushiNotificationsConfig as I, type MushiOnDeviceClassifier as J, type MushiOnDeviceClassifierInput as K, type MushiOnDeviceClassifierResult as L, type MushiApiClient as M, type MushiPageContext as N, type MushiPerformanceMetrics as O, type MushiPreset as P, type MushiPrivacyConfig as Q, type MushiProactiveConfig as R, type MushiProductEventPayload as S, type MushiPushSubscriptionJSON as T, type MushiReportBuilder as U, type MushiReportCategory as V, type MushiReportStatus as W, type MushiReporterChannelUnavailable as X, type MushiReporterComment as Y, type MushiReporterNotificationPrefs as Z, type MushiReporterPrefsUpdate as _, type MushiConfig as a, type MushiReporterReportDetail as a0, type MushiReporterTimelineItem as a1, type MushiReporterUpdates as a2, type MushiReputationResult as a3, type MushiRewardsConfig as a4, type MushiRuntimeSdkConfig as a5, type MushiSDKInstance as a6, type MushiSdkVersionInfo as a7, type MushiSelectedElement as a8, type MushiSentryConfig as a9, type MushiSentryContext as aa, type MushiSessionEventPayload as ab, type MushiTesterReputation as ac, type MushiTierResult as ad, type MushiTimelineEntry as ae, type MushiTimelineKind as af, type MushiTracePropagationConfig as ag, type MushiUrlMatcher as ah, type MushiWidgetAnchor as ai, type MushiWidgetConfig as aj, type MushiReporterChannels as ak, reporterChannels as al, subscribeBrowserPush as am, type MushiPreFilterConfig as b, type MushiReport as c, type MushiOfflineConfig as d, type MushiEnvironment as e, type MushiAnalyticsConfig as f, type MushiPropertyValue as g, type MushiBreadcrumb as h, type MushiActivityEvent as i, type MushiApiCascadeConfig as j, type MushiApiResponse as k, type MushiAssistantConfig as l, type MushiAssistantReply as m, type MushiAssistantStep as n, type MushiBannerConfig as o, type MushiBannerLink as p, type MushiBetaChangelogEntry as q, type MushiBetaModeConfig as r, type MushiCaptureConfig as s, type MushiCaptureEventInput as t, type MushiCaptureExceptionOptions as u, type MushiConsoleEntry as v, type MushiCooldownConfig as w, type MushiCrossAppReport as x, type MushiCustomCategory as y, type MushiDiagnosticsResult as z };
2165
+ export { type MushiReporterPrefsUpdate as $, type MushiDiscoverInventoryConfig as A, type MushiDiscoveryEventPayload as B, type MushiEventHandler as C, type MushiEventType as D, type MushiHallOfFameEntry as E, type MushiInitConfig as F, type MushiIntegrationsConfig as G, type MushiLeaderboardEntry as H, type MushiNetworkEntry as I, type MushiNotificationsConfig as J, type MushiOnDeviceClassifier as K, type MushiOnDeviceClassifierInput as L, type MushiApiClient as M, type MushiOnDeviceClassifierResult as N, type MushiPageContext as O, type MushiPerformanceMetrics as P, type MushiPreset as Q, type MushiPrivacyConfig as R, type MushiProactiveConfig as S, type MushiProductEventPayload as T, type MushiPushSubscriptionJSON as U, type MushiReportBuilder as V, type MushiReportCategory as W, type MushiReportStatus as X, type MushiReporterChannelUnavailable as Y, type MushiReporterComment as Z, type MushiReporterNotificationPrefs as _, type MushiConfig as a, type MushiReporterReport as a0, type MushiReporterReportDetail as a1, type MushiReporterTimelineItem as a2, type MushiReporterUpdates as a3, type MushiReputationResult as a4, type MushiRewardsConfig as a5, type MushiRuntimeSdkConfig as a6, type MushiRuntimeWidgetConfig as a7, type MushiSDKInstance as a8, type MushiSdkVersionInfo as a9, type MushiSelectedElement as aa, type MushiSentryConfig as ab, type MushiSentryContext as ac, type MushiSessionEventPayload as ad, type MushiTesterReputation as ae, type MushiTierResult as af, type MushiTimelineEntry as ag, type MushiTimelineKind as ah, type MushiTracePropagationConfig as ai, type MushiUrlMatcher as aj, type MushiWidgetAnchor as ak, type MushiWidgetConfig as al, type MushiReporterChannels as am, reporterChannels as an, subscribeBrowserPush as ao, type MushiPreFilterConfig as b, type MushiReport as c, type MushiOfflineConfig as d, type MushiEnvironment as e, type MushiAnalyticsConfig as f, type MushiPropertyValue as g, type MushiBreadcrumb as h, type MushiActivityEvent as i, type MushiApiCascadeConfig as j, type MushiApiResponse as k, type MushiAssistantConfig as l, type MushiAssistantReply as m, type MushiAssistantStep as n, type MushiBannerConfig as o, type MushiBannerLink as p, type MushiBetaChangelogEntry as q, type MushiBetaModeConfig as r, type MushiCaptureConfig as s, type MushiCaptureEventInput as t, type MushiCaptureExceptionOptions as u, type MushiConsoleEntry as v, type MushiCooldownConfig as w, type MushiCrossAppReport as x, type MushiCustomCategory as y, type MushiDiagnosticsResult as z };
@@ -133,6 +133,12 @@ declare function subscribeBrowserPush(channels: Pick<MushiReporterChannels, 'sub
133
133
  reason: string;
134
134
  }>;
135
135
 
136
+ /**
137
+ * What `Mushi.init()` and `<MushiProvider config>` accept: a {@link MushiConfig}
138
+ * whose `projectId` / `apiKey` may instead come from the NEXT_PUBLIC_MUSHI_* /
139
+ * VITE_MUSHI_* / MUSHI_* env vars. Init still throws if neither supplies them.
140
+ */
141
+ type MushiInitConfig = Omit<MushiConfig, 'projectId' | 'apiKey'> & Partial<Pick<MushiConfig, 'projectId' | 'apiKey'>>;
136
142
  interface MushiConfig {
137
143
  projectId: string;
138
144
  apiKey: string;
@@ -311,15 +317,51 @@ interface MushiWidgetConfig {
311
317
  expandedTitle?: string;
312
318
  mode?: 'simple' | 'conversational';
313
319
  locale?: string;
320
+ /**
321
+ * Page-level z-index of the launcher (default `99999`). The panel and toasts
322
+ * sit at `zIndex + 1`. Each surface carries its own z-index and the widget's
323
+ * host element forms no stacking context, so these numbers compare directly
324
+ * with the host page's own layers. The banner has its own setting,
325
+ * `bannerConfig.zIndex`.
326
+ */
314
327
  zIndex?: number;
315
328
  /**
316
329
  * Controls how, or whether, the default trigger is injected.
317
- * `auto` — historical floating stamp FAB.
318
- * `banner` — slim full-width header strip (recommended default; less obtrusive
319
- * than a FAB and visible even when the SDK launcher is `hide()`'d).
320
- * Pair with `bannerConfig` to customise appearance.
330
+ * `auto` — floating stamp FAB; on phones it becomes an edge tab (see `mobileTrigger`).
331
+ * `edge-tab` — a slim tab flush with the screen edge: 22×48px drawn, 44×48px to tap.
332
+ * `banner` — slim full-width header strip (recommended default; less obtrusive
333
+ * than a FAB and visible even when the SDK launcher is `hide()`'d).
334
+ * Pair with `bannerConfig` to customise appearance.
321
335
  */
322
336
  trigger?: 'auto' | 'banner' | 'edge-tab' | 'attach' | 'manual' | 'hidden';
337
+ /**
338
+ * What `trigger: 'auto'` draws at phone widths (≤ 768px). `'edge-tab'`
339
+ * draws the slim edge tab; `'auto'` keeps the round FAB. Default
340
+ * `'edge-tab'`, or `'auto'` when the host shaped the FAB itself (a left or
341
+ * right `anchor` / `inset`, `draggable`, or a word `triggerText`).
342
+ */
343
+ mobileTrigger?: 'edge-tab' | 'auto';
344
+ /**
345
+ * Lift the launcher, panel and toast above fixed or sticky host bars that
346
+ * touch the bottom of the viewport (tab bars, cookie strips, chat composers).
347
+ * Default `true`. The lift is a floor: an explicit `inset.bottom` or
348
+ * `anchor.bottom` that is already higher wins. Set `false` to keep the
349
+ * launcher exactly where `inset` / `anchor` puts it.
350
+ */
351
+ avoidFixedBars?: boolean;
352
+ /**
353
+ * Tuck the launcher toward its edge and fade it while the page scrolls,
354
+ * then bring it back when scrolling stops. Default `true`. Never tucks while
355
+ * the launcher has focus or the panel is open. Ignored when
356
+ * `smartHide.onScroll` is set.
357
+ */
358
+ tuckOnScroll?: boolean;
359
+ /**
360
+ * Show a "Hide the bug button for this visit" action in the report panel.
361
+ * The choice lasts until the tab closes (sessionStorage), including through
362
+ * `Mushi.show()`; `Mushi.open()` still opens the panel. Default `true`.
363
+ */
364
+ dismissible?: boolean;
323
365
  /**
324
366
  * Configuration for the header-banner launcher mode.
325
367
  * Only applies when `trigger === 'banner'`.
@@ -343,7 +385,9 @@ interface MushiWidgetConfig {
343
385
  /**
344
386
  * Allow the FAB to be dragged and repositioned by the user.
345
387
  * - `true` — drag enabled, persisted to localStorage, snaps to nearest edge on release.
346
- * - `false` — fixed position (default).
388
+ * - `false` — fixed position (default for the FAB).
389
+ * - Unset — the edge tab can still be dragged up and down its edge (persisted per site).
390
+ * The edge tab always moves along its edge only (`axis: 'y'`).
347
391
  * - Object — fine-grained control:
348
392
  * - `persist` save position per projectId (default true when draggable).
349
393
  * - `snapToEdge` snap to the nearest left/right edge on release (default true).
@@ -440,10 +484,13 @@ interface MushiWidgetConfig {
440
484
  /**
441
485
  * CSS selectors of host-app elements that the widget trigger and panel must
442
486
  * never visually overlap. At render time the widget queries each selector,
443
- * measures the union bounding rect, and nudges `--mushi-top` / `--mushi-bottom`
444
- * so the panel clears every avoided element by at least 8px.
487
+ * measures its bounding rect, and moves the widget's anchored edge
488
+ * (`--mushi-bottom` for bottom positions, the default; `--mushi-top` for top
489
+ * positions) so it clears every avoided element in that half of the viewport
490
+ * by at least 8px. Elements in the other half are left alone.
445
491
  *
446
- * Typical use: avoid a sticky mobile header or a fixed sign-in CTA.
492
+ * Typical use: a sticky mobile header for a top position, or a bottom tab
493
+ * bar or fixed sign-in CTA for a bottom position.
447
494
  *
448
495
  * @example
449
496
  * avoidSelectors: ['[data-mobile-header]', '#sign-in-cta']
@@ -522,14 +569,17 @@ interface MushiBannerConfig {
522
569
  /** 'top' pins the banner below any existing sticky headers; 'bottom' pins above bottom navs. Defaults to 'top'. */
523
570
  position?: 'top' | 'bottom';
524
571
  /**
525
- * Body copy on the strip — the lime "Beta" announcement line users see in
572
+ * Body copy on the strip — the lime announcement line users see in
526
573
  * the Mushi admin console. When set, the banner switches to the rich layout
527
574
  * (pill + message + flat text actions) instead of button-only CTAs.
528
575
  */
529
576
  message?: string;
530
577
  /**
531
- * Pill label shown before `message` (e.g. "Beta"). Defaults to `"Beta"` when
578
+ * Pill label shown before `message`. Defaults to `"Feedback"` when
532
579
  * `message` is set. Pass `false` to hide the pill.
580
+ *
581
+ * Do not set `"Beta"` in a production App Store or Google Play build: Apple
582
+ * can reject the app under guideline 2.2 (beta testing belongs in TestFlight).
533
583
  */
534
584
  label?: string | false;
535
585
  /** Override the call-to-action text in the banner. Defaults to '🐛 Report a bug'. */
@@ -540,7 +590,11 @@ interface MushiBannerConfig {
540
590
  featureCtaLabel?: string;
541
591
  /** Extra flat links after the bug/feature CTAs (e.g. "My submissions"). */
542
592
  links?: MushiBannerLink[];
543
- /** CSS z-index of the banner element. Defaults to the widget's configured zIndex. */
593
+ /**
594
+ * Page-level z-index of the banner strip. Defaults to the widget's `zIndex`
595
+ * minus one, just under the launcher. Set it below your own overlays (sheets,
596
+ * drawers, dialogs) so they cover the banner, e.g. `130` under a `200` sheet.
597
+ */
544
598
  zIndex?: number;
545
599
  }
546
600
  interface MushiBetaModeConfig {
@@ -598,9 +652,12 @@ interface MushiCaptureConfig {
598
652
  screenshot?: 'on-report' | 'auto' | 'off';
599
653
  /**
600
654
  * Custom screenshot capture function. When provided, the SDK calls this
601
- * instead of its built-in DOM-snapshot capturer. Return a JPEG/PNG data URI
602
- * on success, or `null` to skip attachment. If the function throws the SDK
603
- * falls back to the built-in capturer.
655
+ * instead of its built-in DOM-snapshot capturer. Resolve to a
656
+ * `data:image/jpeg` or `data:image/png` URL on success, or `null` to skip
657
+ * attachment. Any other string (a `file://` or `https://` URI) is ignored
658
+ * with a warning, so a native plugin's file must be read and returned as a
659
+ * data URL. If the function throws the SDK falls back to the built-in
660
+ * capturer.
604
661
  *
605
662
  * Primary use-case: Capacitor / WebView hosts that route through a native
606
663
  * plugin (e.g. `@capawesome/capacitor-screenshot`) to obtain a real pixel-
@@ -610,9 +667,9 @@ interface MushiCaptureConfig {
610
667
  * capture: {
611
668
  * screenshot: 'auto',
612
669
  * screenshotProvider: async () => {
613
- * const { Screenshot } = await import('@capawesome/capacitor-screenshot');
614
- * const { uri } = await Screenshot.take();
615
- * return uri; // data URI on web, file:// on native (SDK handles both)
670
+ * // Base64 PNG from your native screenshot plugin.
671
+ * const base64 = await takeNativeScreenshot();
672
+ * return base64 ? `data:image/png;base64,${base64}` : null;
616
673
  * },
617
674
  * }
618
675
  */
@@ -1910,7 +1967,8 @@ interface MushiDiscoveryEventPayload {
1910
1967
  }
1911
1968
  /** Payload for /v1/sdk/session — lightweight session lifecycle tracking.
1912
1969
  * Best-effort, no offline queue. Privacy-safe: no PII by default;
1913
- * `user_id_hash` is the same device-fingerprint hash used elsewhere. */
1970
+ * `user_id_hash` is a one-way SHA-256 hex of the host's user id, never the
1971
+ * id itself, and stays null until the host identifies the user. */
1914
1972
  interface MushiSessionEventPayload {
1915
1973
  /** Lifecycle event kind. */
1916
1974
  kind: 'session_start' | 'session_heartbeat' | 'session_end' | 'page_view';
@@ -1925,7 +1983,7 @@ interface MushiSessionEventPayload {
1925
1983
  page_view_count?: number;
1926
1984
  /** Device fingerprint hash — same token used in reports. */
1927
1985
  reporter_token_hash?: string | null;
1928
- /** user_id_hash when the host app called Mushi.identify(). */
1986
+ /** SHA-256 hex of the host user id, set after Mushi.identifyWithToken(). */
1929
1987
  user_id_hash?: string | null;
1930
1988
  user_agent?: string | null;
1931
1989
  sdk_version?: string;
@@ -1982,10 +2040,14 @@ interface MushiApiResponse<T> {
1982
2040
  status?: number;
1983
2041
  };
1984
2042
  }
2043
+ /** Widget block of the runtime config: older edge functions send `triggerText: null` for "use the SDK default". */
2044
+ type MushiRuntimeWidgetConfig = Omit<MushiWidgetConfig, 'triggerText'> & {
2045
+ triggerText?: string | null;
2046
+ };
1985
2047
  interface MushiRuntimeSdkConfig {
1986
2048
  enabled?: boolean;
1987
2049
  version?: string | null;
1988
- widget?: MushiWidgetConfig;
2050
+ widget?: MushiRuntimeWidgetConfig;
1989
2051
  capture?: MushiCaptureConfig;
1990
2052
  native?: {
1991
2053
  triggerMode?: 'shake' | 'button' | 'both' | 'none';
@@ -2100,4 +2162,4 @@ interface MushiTesterReputation {
2100
2162
  total_points: number;
2101
2163
  }
2102
2164
 
2103
- export { type MushiReporterReport as $, type MushiDiscoverInventoryConfig as A, type MushiDiscoveryEventPayload as B, type MushiEventHandler as C, type MushiEventType as D, type MushiHallOfFameEntry as E, type MushiIntegrationsConfig as F, type MushiLeaderboardEntry as G, type MushiNetworkEntry as H, type MushiNotificationsConfig as I, type MushiOnDeviceClassifier as J, type MushiOnDeviceClassifierInput as K, type MushiOnDeviceClassifierResult as L, type MushiApiClient as M, type MushiPageContext as N, type MushiPerformanceMetrics as O, type MushiPreset as P, type MushiPrivacyConfig as Q, type MushiProactiveConfig as R, type MushiProductEventPayload as S, type MushiPushSubscriptionJSON as T, type MushiReportBuilder as U, type MushiReportCategory as V, type MushiReportStatus as W, type MushiReporterChannelUnavailable as X, type MushiReporterComment as Y, type MushiReporterNotificationPrefs as Z, type MushiReporterPrefsUpdate as _, type MushiConfig as a, type MushiReporterReportDetail as a0, type MushiReporterTimelineItem as a1, type MushiReporterUpdates as a2, type MushiReputationResult as a3, type MushiRewardsConfig as a4, type MushiRuntimeSdkConfig as a5, type MushiSDKInstance as a6, type MushiSdkVersionInfo as a7, type MushiSelectedElement as a8, type MushiSentryConfig as a9, type MushiSentryContext as aa, type MushiSessionEventPayload as ab, type MushiTesterReputation as ac, type MushiTierResult as ad, type MushiTimelineEntry as ae, type MushiTimelineKind as af, type MushiTracePropagationConfig as ag, type MushiUrlMatcher as ah, type MushiWidgetAnchor as ai, type MushiWidgetConfig as aj, type MushiReporterChannels as ak, reporterChannels as al, subscribeBrowserPush as am, type MushiPreFilterConfig as b, type MushiReport as c, type MushiOfflineConfig as d, type MushiEnvironment as e, type MushiAnalyticsConfig as f, type MushiPropertyValue as g, type MushiBreadcrumb as h, type MushiActivityEvent as i, type MushiApiCascadeConfig as j, type MushiApiResponse as k, type MushiAssistantConfig as l, type MushiAssistantReply as m, type MushiAssistantStep as n, type MushiBannerConfig as o, type MushiBannerLink as p, type MushiBetaChangelogEntry as q, type MushiBetaModeConfig as r, type MushiCaptureConfig as s, type MushiCaptureEventInput as t, type MushiCaptureExceptionOptions as u, type MushiConsoleEntry as v, type MushiCooldownConfig as w, type MushiCrossAppReport as x, type MushiCustomCategory as y, type MushiDiagnosticsResult as z };
2165
+ export { type MushiReporterPrefsUpdate as $, type MushiDiscoverInventoryConfig as A, type MushiDiscoveryEventPayload as B, type MushiEventHandler as C, type MushiEventType as D, type MushiHallOfFameEntry as E, type MushiInitConfig as F, type MushiIntegrationsConfig as G, type MushiLeaderboardEntry as H, type MushiNetworkEntry as I, type MushiNotificationsConfig as J, type MushiOnDeviceClassifier as K, type MushiOnDeviceClassifierInput as L, type MushiApiClient as M, type MushiOnDeviceClassifierResult as N, type MushiPageContext as O, type MushiPerformanceMetrics as P, type MushiPreset as Q, type MushiPrivacyConfig as R, type MushiProactiveConfig as S, type MushiProductEventPayload as T, type MushiPushSubscriptionJSON as U, type MushiReportBuilder as V, type MushiReportCategory as W, type MushiReportStatus as X, type MushiReporterChannelUnavailable as Y, type MushiReporterComment as Z, type MushiReporterNotificationPrefs as _, type MushiConfig as a, type MushiReporterReport as a0, type MushiReporterReportDetail as a1, type MushiReporterTimelineItem as a2, type MushiReporterUpdates as a3, type MushiReputationResult as a4, type MushiRewardsConfig as a5, type MushiRuntimeSdkConfig as a6, type MushiRuntimeWidgetConfig as a7, type MushiSDKInstance as a8, type MushiSdkVersionInfo as a9, type MushiSelectedElement as aa, type MushiSentryConfig as ab, type MushiSentryContext as ac, type MushiSessionEventPayload as ad, type MushiTesterReputation as ae, type MushiTierResult as af, type MushiTimelineEntry as ag, type MushiTimelineKind as ah, type MushiTracePropagationConfig as ai, type MushiUrlMatcher as aj, type MushiWidgetAnchor as ak, type MushiWidgetConfig as al, type MushiReporterChannels as am, reporterChannels as an, subscribeBrowserPush as ao, type MushiPreFilterConfig as b, type MushiReport as c, type MushiOfflineConfig as d, type MushiEnvironment as e, type MushiAnalyticsConfig as f, type MushiPropertyValue as g, type MushiBreadcrumb as h, type MushiActivityEvent as i, type MushiApiCascadeConfig as j, type MushiApiResponse as k, type MushiAssistantConfig as l, type MushiAssistantReply as m, type MushiAssistantStep as n, type MushiBannerConfig as o, type MushiBannerLink as p, type MushiBetaChangelogEntry as q, type MushiBetaModeConfig as r, type MushiCaptureConfig as s, type MushiCaptureEventInput as t, type MushiCaptureExceptionOptions as u, type MushiConsoleEntry as v, type MushiCooldownConfig as w, type MushiCrossAppReport as x, type MushiCustomCategory as y, type MushiDiagnosticsResult as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/core",
3
- "version": "1.32.2",
3
+ "version": "1.33.0",
4
4
  "description": "Types, API client and pre-filter for Mushi SDKs. The bug mediator for AI-built apps: plain-English diagnosis + a ready fix, in your editor.",
5
5
  "license": "MIT",
6
6
  "type": "module",