@mushi-mushi/core 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -129,6 +129,51 @@ interface MushiWidgetConfig {
129
129
  * avoidSelectors: ['[data-mobile-header]', '#sign-in-cta']
130
130
  */
131
131
  avoidSelectors?: string[];
132
+ /**
133
+ * Override the default five-category picker with a custom category list.
134
+ * When set, the widget renders these categories instead of the built-in
135
+ * `bug / slow / visual / confusing / other` set.
136
+ *
137
+ * Each custom category maps onto one of the five built-in `MushiReportCategory`
138
+ * values via `baseCategory` (defaults to `'other'`). The custom id is
139
+ * preserved as `userCategory` on the report so the Mushi console can filter
140
+ * by it independently of the LLM-assigned `category`.
141
+ *
142
+ * Deep-link helpers (`open`, `openWith`, `report`) accept the custom `id`
143
+ * in addition to the built-in enum values when this option is set.
144
+ *
145
+ * When absent, behaviour is identical to the historical defaults (backward-compatible).
146
+ */
147
+ categories?: MushiCustomCategory[];
148
+ }
149
+ /**
150
+ * Descriptor for a single entry in a host-app custom category list.
151
+ * Passed as `widget.categories` to `Mushi.init()`.
152
+ */
153
+ interface MushiCustomCategory {
154
+ /** Unique identifier used in `openWith(id)` / `report({ category: id })`. */
155
+ id: string;
156
+ /** Human-readable label shown in the category picker step. */
157
+ label: string;
158
+ /** Optional helper text shown beneath the label. */
159
+ description?: string;
160
+ /**
161
+ * Localised intent options displayed on the second step ("What happened?").
162
+ * When omitted, the widget skips the intent step and goes straight to
163
+ * the description.
164
+ */
165
+ intents?: string[];
166
+ /**
167
+ * Emoji or single-character icon rendered next to the label in the picker.
168
+ * Falls back to a neutral bubble when absent.
169
+ */
170
+ icon?: string;
171
+ /**
172
+ * Which built-in `MushiReportCategory` value this custom category maps to
173
+ * for server-side classification. Defaults to `'other'`.
174
+ * The custom `id` is always preserved in `report.userCategory`.
175
+ */
176
+ baseCategory?: MushiReportCategory;
132
177
  }
133
178
  /** Optional flat link in the rich banner action row (admin-console BetaBanner style). */
134
179
  interface MushiBannerLink {
@@ -543,6 +588,13 @@ interface MushiReport {
543
588
  id: string;
544
589
  projectId: string;
545
590
  category: MushiReportCategory;
591
+ /**
592
+ * Custom category identifier set by the host app via `widget.categories`.
593
+ * Preserved as `reports.user_category` on the server so the Mushi console
594
+ * can filter by it independently of the LLM-assigned `category`.
595
+ * Not set when the host uses the default built-in category set.
596
+ */
597
+ userCategory?: string;
546
598
  description: string;
547
599
  userIntent?: string;
548
600
  environment: MushiEnvironment;
@@ -957,9 +1009,12 @@ interface MushiSDKInstance {
957
1009
  * feature-request shortcut. Pass `{ category }` to deep-link into a
958
1010
  * specific bug intent, or `{ featureRequest: true }` to deep-link into
959
1011
  * the feature-request description step (skips intent picker).
1012
+ *
1013
+ * When `widget.categories` is configured, `category` also accepts a
1014
+ * custom category `id` from that list.
960
1015
  */
961
1016
  report(options?: {
962
- category?: MushiReportCategory;
1017
+ category?: MushiReportCategory | string;
963
1018
  featureRequest?: boolean;
964
1019
  }): void;
965
1020
  on(event: MushiEventType, handler: MushiEventHandler): () => void;
@@ -976,7 +1031,12 @@ interface MushiSDKInstance {
976
1031
  }): void;
977
1032
  isOpen(): boolean;
978
1033
  open(): void;
979
- openWith(category: MushiReportCategory): void;
1034
+ /**
1035
+ * Open the widget deep-linked to a specific category. Accepts a built-in
1036
+ * `MushiReportCategory` value or a custom category `id` when
1037
+ * `widget.categories` is configured.
1038
+ */
1039
+ openWith(category: MushiReportCategory | string): void;
980
1040
  show(): void;
981
1041
  hide(): void;
982
1042
  attachTo(selectorOrElement: string | Element, options?: MushiWidgetConfig): () => void;
@@ -1649,4 +1709,4 @@ declare function createLogger(options: LoggerOptions): Logger;
1649
1709
  */
1650
1710
  declare const noopLogger: Logger;
1651
1711
 
1652
- export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBannerConfig, type MushiBannerLink, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiHallOfFameEntry, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiTracePropagationConfig, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, estimateJsonBytes, formatBytes, getDeviceFingerprintHash, getReporterToken, getSessionId, newUuid, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
1712
+ export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBannerConfig, type MushiBannerLink, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiCustomCategory, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiHallOfFameEntry, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiTracePropagationConfig, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, estimateJsonBytes, formatBytes, getDeviceFingerprintHash, getReporterToken, getSessionId, newUuid, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
package/dist/index.d.ts CHANGED
@@ -129,6 +129,51 @@ interface MushiWidgetConfig {
129
129
  * avoidSelectors: ['[data-mobile-header]', '#sign-in-cta']
130
130
  */
131
131
  avoidSelectors?: string[];
132
+ /**
133
+ * Override the default five-category picker with a custom category list.
134
+ * When set, the widget renders these categories instead of the built-in
135
+ * `bug / slow / visual / confusing / other` set.
136
+ *
137
+ * Each custom category maps onto one of the five built-in `MushiReportCategory`
138
+ * values via `baseCategory` (defaults to `'other'`). The custom id is
139
+ * preserved as `userCategory` on the report so the Mushi console can filter
140
+ * by it independently of the LLM-assigned `category`.
141
+ *
142
+ * Deep-link helpers (`open`, `openWith`, `report`) accept the custom `id`
143
+ * in addition to the built-in enum values when this option is set.
144
+ *
145
+ * When absent, behaviour is identical to the historical defaults (backward-compatible).
146
+ */
147
+ categories?: MushiCustomCategory[];
148
+ }
149
+ /**
150
+ * Descriptor for a single entry in a host-app custom category list.
151
+ * Passed as `widget.categories` to `Mushi.init()`.
152
+ */
153
+ interface MushiCustomCategory {
154
+ /** Unique identifier used in `openWith(id)` / `report({ category: id })`. */
155
+ id: string;
156
+ /** Human-readable label shown in the category picker step. */
157
+ label: string;
158
+ /** Optional helper text shown beneath the label. */
159
+ description?: string;
160
+ /**
161
+ * Localised intent options displayed on the second step ("What happened?").
162
+ * When omitted, the widget skips the intent step and goes straight to
163
+ * the description.
164
+ */
165
+ intents?: string[];
166
+ /**
167
+ * Emoji or single-character icon rendered next to the label in the picker.
168
+ * Falls back to a neutral bubble when absent.
169
+ */
170
+ icon?: string;
171
+ /**
172
+ * Which built-in `MushiReportCategory` value this custom category maps to
173
+ * for server-side classification. Defaults to `'other'`.
174
+ * The custom `id` is always preserved in `report.userCategory`.
175
+ */
176
+ baseCategory?: MushiReportCategory;
132
177
  }
133
178
  /** Optional flat link in the rich banner action row (admin-console BetaBanner style). */
134
179
  interface MushiBannerLink {
@@ -543,6 +588,13 @@ interface MushiReport {
543
588
  id: string;
544
589
  projectId: string;
545
590
  category: MushiReportCategory;
591
+ /**
592
+ * Custom category identifier set by the host app via `widget.categories`.
593
+ * Preserved as `reports.user_category` on the server so the Mushi console
594
+ * can filter by it independently of the LLM-assigned `category`.
595
+ * Not set when the host uses the default built-in category set.
596
+ */
597
+ userCategory?: string;
546
598
  description: string;
547
599
  userIntent?: string;
548
600
  environment: MushiEnvironment;
@@ -957,9 +1009,12 @@ interface MushiSDKInstance {
957
1009
  * feature-request shortcut. Pass `{ category }` to deep-link into a
958
1010
  * specific bug intent, or `{ featureRequest: true }` to deep-link into
959
1011
  * the feature-request description step (skips intent picker).
1012
+ *
1013
+ * When `widget.categories` is configured, `category` also accepts a
1014
+ * custom category `id` from that list.
960
1015
  */
961
1016
  report(options?: {
962
- category?: MushiReportCategory;
1017
+ category?: MushiReportCategory | string;
963
1018
  featureRequest?: boolean;
964
1019
  }): void;
965
1020
  on(event: MushiEventType, handler: MushiEventHandler): () => void;
@@ -976,7 +1031,12 @@ interface MushiSDKInstance {
976
1031
  }): void;
977
1032
  isOpen(): boolean;
978
1033
  open(): void;
979
- openWith(category: MushiReportCategory): void;
1034
+ /**
1035
+ * Open the widget deep-linked to a specific category. Accepts a built-in
1036
+ * `MushiReportCategory` value or a custom category `id` when
1037
+ * `widget.categories` is configured.
1038
+ */
1039
+ openWith(category: MushiReportCategory | string): void;
980
1040
  show(): void;
981
1041
  hide(): void;
982
1042
  attachTo(selectorOrElement: string | Element, options?: MushiWidgetConfig): () => void;
@@ -1649,4 +1709,4 @@ declare function createLogger(options: LoggerOptions): Logger;
1649
1709
  */
1650
1710
  declare const noopLogger: Logger;
1651
1711
 
1652
- export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBannerConfig, type MushiBannerLink, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiHallOfFameEntry, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiTracePropagationConfig, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, estimateJsonBytes, formatBytes, getDeviceFingerprintHash, getReporterToken, getSessionId, newUuid, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
1712
+ export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBannerConfig, type MushiBannerLink, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiCustomCategory, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiHallOfFameEntry, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiTracePropagationConfig, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, estimateJsonBytes, formatBytes, getDeviceFingerprintHash, getReporterToken, getSessionId, newUuid, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/core",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Core types, API client, and pre-filter for Mushi Mushi SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",