@mushi-mushi/core 1.39.0 → 1.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1125,6 +1125,29 @@ interface MushiReporterStatusTone {
1125
1125
  border: string;
1126
1126
  }
1127
1127
  declare const MUSHI_REPORTER_STATUS: Record<MushiThemeMode, Record<'sent' | 'review' | 'fixing' | 'fixed', MushiReporterStatusTone>>;
1128
+ /**
1129
+ * Report-type tile colours (web widget report screen, ADR 0070). One hue per
1130
+ * type, so a reporter recognises the type by colour and icon before reading:
1131
+ * bug red, slow amber, looks-wrong violet, confusing blue, idea green, other grey.
1132
+ *
1133
+ * - `solid`: tile border and the panel header stripe; ≥ 3:1 on the panel.
1134
+ * - `ink`: the tile icon and tinted text; ≥ 4.5:1 on both washes.
1135
+ * - The tile fill is `solid` at MUSHI_REPORT_TYPE_WASH (unpicked / picked).
1136
+ *
1137
+ * Measured on `#FFFFFF` (light) and `#121212` (dark), the system Canvas the
1138
+ * panel defaults to; `design-tokens.test.ts` asserts every ratio.
1139
+ */
1140
+ type MushiReportTypeId = 'bug' | 'slow' | 'visual' | 'confusing' | 'idea' | 'other';
1141
+ interface MushiReportTypeTone {
1142
+ solid: string;
1143
+ ink: string;
1144
+ }
1145
+ declare const MUSHI_REPORT_TYPE_COLORS: Record<MushiThemeMode, Record<MushiReportTypeId, MushiReportTypeTone>>;
1146
+ /** Tile fill opacity of `solid`: unpicked (`wash`) and picked (`strong`). */
1147
+ declare const MUSHI_REPORT_TYPE_WASH: Record<MushiThemeMode, {
1148
+ wash: number;
1149
+ strong: number;
1150
+ }>;
1128
1151
  /** Resolve the palette for a theme mode. */
1129
1152
  declare function mushiPalette(mode: MushiThemeMode): MushiColorPalette;
1130
1153
  /**
@@ -1348,10 +1371,16 @@ interface ProjectFaviconSource {
1348
1371
  project_slug: string;
1349
1372
  /** Operator override — wins over inferred domain when set. */
1350
1373
  icon_url?: string | null;
1351
- /** e.g. https://kensaur.us — from SDK heartbeat or API key last_seen_origin */
1374
+ /** e.g. https://app.example.com — from SDK heartbeat or API key last_seen_origin */
1352
1375
  sdk_origin?: string | null;
1353
1376
  /** Connected GitHub/GitLab repo — used when SDK has not heartbeated yet. */
1354
1377
  repo_url?: string | null;
1378
+ /**
1379
+ * Hosts that serve many apps under paths (the caller's own hosting origin),
1380
+ * so their root favicon belongs to the parent site, not this app. Data from
1381
+ * the caller's config, never a list of tenants here.
1382
+ */
1383
+ shared_hosts?: readonly string[] | null;
1355
1384
  }
1356
1385
  declare function isUntrustedFaviconUrl(url: string): boolean;
1357
1386
  /** Per-domain favicon URLs — first-party assets only (no CDN globes). */
@@ -1385,4 +1414,4 @@ declare function projectInitialsThemeIndex(projectId: string): number;
1385
1414
  */
1386
1415
  declare function readPageFaviconHref(): string | null;
1387
1416
 
1388
- export { ACTIVATION_EVENT, type AnalyticsBlockReason, type AnalyticsConsentState, type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, EVENT_NAME_RE, EVENT_PROPERTY_LIMITS, type EnvConfigDiagnostics, type EnvNearMiss, type EventTrackerOptions, HABIT_EVENTS, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_ACCENT_SHADOW, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_BEACON_MAX_BYTES, MUSHI_BORDER, MUSHI_COLORS_DARK, MUSHI_COLORS_LIGHT, MUSHI_CONTROL_DISABLED, MUSHI_COPY, MUSHI_DURATION, MUSHI_EVENTS, MUSHI_EVENT_NAMES, MUSHI_GEOMETRY, MUSHI_IDENTITY_TOKEN_PREFIX, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INVERSE, MUSHI_LETTER_SPACING, MUSHI_MOTION, MUSHI_ON_ACCENT, MUSHI_OPACITY, MUSHI_PROJECT_HEADER, MUSHI_RADIUS, MUSHI_REPORTER_STATUS, MUSHI_SDK_PACKAGE_HEADER, MUSHI_SDK_VERSION_HEADER, MUSHI_SHADOW_INK, MUSHI_SPACING, MUSHI_SURFACES, MUSHI_TIER_COLORS, MUSHI_TYPE, MUSHI_USER_TOKEN_HEADER, MUSHI_Z, MushiAnalyticsConfig, MushiApiClient, type MushiBeaconEnvelope, MushiBreadcrumb, type MushiColorPalette, MushiConfig, MushiEnvironment, type MushiErrorFilter, type MushiEventName, type MushiEventProperties, type MushiIdentityClaims, type MushiInternalRequestKind, MushiOfflineConfig, MushiPreFilterConfig, MushiPropertyValue, type MushiRegion, MushiReport, type MushiSurface, type MushiThemeMode, type MushiTokenSnapshot, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, type ProjectFaviconSource, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, type ResolvedEnvConfig, type SessionTrackerOptions, analyticsBlockReason, buildBeaconEnvelope, buildIdentityClaims, buildSdkIngestHeaders, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, destroyEventTracker, destroySessionTracker, diagnoseEnvConfig, dntActive, estimateJsonBytes, expandPreset, extractTunnelPath, faviconUrlCandidates, flushEvents, flushLastOutboundOnUnload, formatBytes, getBackoffDelay, getDeviceFingerprintHash, getEventAnonymousId, getReporterToken, getSessionId, githubRepoDomainHint, hmacSha256Hex, initEventTracker, initSessionTracker, isAutomatedBrowser, isEventTrackingActive, isLikelyGenericFavicon, isMushiBeaconEnvelope, isPageUnloading, isSameOriginOrRelative, isUntrustedFaviconUrl, isValidEventName, markPageUnloading, matchesErrorFilter, mushiPalette, mushiTokens, newUuid, noopLogger, normaliseThrown, onAnalyticsConsentChange, originToDomain, parseIdentityToken, parseRetryAfter, projectFaviconUrlCandidates, projectInitials, projectInitialsThemeIndex, propertiesWithinByteLimit, readPageFaviconHref, resolveAnalyticsConsent, resolveEnvConfig, resolveProjectDomain, resolveProjectFaviconDomains, resolveRegionEndpoint, resolveRequestBaseUrl, resolveWidgetAccent, safeWidgetHex, sanitizeEventProperties, scrubPii, scrubUrl, sendOnUnload, setAnalyticsConsent, setEventConsent, sha256Hex, shouldDropCapturedError, trackEvent, trackPageView, updateEventIdentity, updateSessionIdentity, validateConfig };
1417
+ export { ACTIVATION_EVENT, type AnalyticsBlockReason, type AnalyticsConsentState, type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, EVENT_NAME_RE, EVENT_PROPERTY_LIMITS, type EnvConfigDiagnostics, type EnvNearMiss, type EventTrackerOptions, HABIT_EVENTS, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_ACCENT_SHADOW, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_BEACON_MAX_BYTES, MUSHI_BORDER, MUSHI_COLORS_DARK, MUSHI_COLORS_LIGHT, MUSHI_CONTROL_DISABLED, MUSHI_COPY, MUSHI_DURATION, MUSHI_EVENTS, MUSHI_EVENT_NAMES, MUSHI_GEOMETRY, MUSHI_IDENTITY_TOKEN_PREFIX, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INVERSE, MUSHI_LETTER_SPACING, MUSHI_MOTION, MUSHI_ON_ACCENT, MUSHI_OPACITY, MUSHI_PROJECT_HEADER, MUSHI_RADIUS, MUSHI_REPORTER_STATUS, MUSHI_REPORT_TYPE_COLORS, MUSHI_REPORT_TYPE_WASH, MUSHI_SDK_PACKAGE_HEADER, MUSHI_SDK_VERSION_HEADER, MUSHI_SHADOW_INK, MUSHI_SPACING, MUSHI_SURFACES, MUSHI_TIER_COLORS, MUSHI_TYPE, MUSHI_USER_TOKEN_HEADER, MUSHI_Z, MushiAnalyticsConfig, MushiApiClient, type MushiBeaconEnvelope, MushiBreadcrumb, type MushiColorPalette, MushiConfig, MushiEnvironment, type MushiErrorFilter, type MushiEventName, type MushiEventProperties, type MushiIdentityClaims, type MushiInternalRequestKind, MushiOfflineConfig, MushiPreFilterConfig, MushiPropertyValue, type MushiRegion, MushiReport, type MushiReportTypeId, type MushiReportTypeTone, type MushiSurface, type MushiThemeMode, type MushiTokenSnapshot, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, type ProjectFaviconSource, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, type ResolvedEnvConfig, type SessionTrackerOptions, analyticsBlockReason, buildBeaconEnvelope, buildIdentityClaims, buildSdkIngestHeaders, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, destroyEventTracker, destroySessionTracker, diagnoseEnvConfig, dntActive, estimateJsonBytes, expandPreset, extractTunnelPath, faviconUrlCandidates, flushEvents, flushLastOutboundOnUnload, formatBytes, getBackoffDelay, getDeviceFingerprintHash, getEventAnonymousId, getReporterToken, getSessionId, githubRepoDomainHint, hmacSha256Hex, initEventTracker, initSessionTracker, isAutomatedBrowser, isEventTrackingActive, isLikelyGenericFavicon, isMushiBeaconEnvelope, isPageUnloading, isSameOriginOrRelative, isUntrustedFaviconUrl, isValidEventName, markPageUnloading, matchesErrorFilter, mushiPalette, mushiTokens, newUuid, noopLogger, normaliseThrown, onAnalyticsConsentChange, originToDomain, parseIdentityToken, parseRetryAfter, projectFaviconUrlCandidates, projectInitials, projectInitialsThemeIndex, propertiesWithinByteLimit, readPageFaviconHref, resolveAnalyticsConsent, resolveEnvConfig, resolveProjectDomain, resolveProjectFaviconDomains, resolveRegionEndpoint, resolveRequestBaseUrl, resolveWidgetAccent, safeWidgetHex, sanitizeEventProperties, scrubPii, scrubUrl, sendOnUnload, setAnalyticsConsent, setEventConsent, sha256Hex, shouldDropCapturedError, trackEvent, trackPageView, updateEventIdentity, updateSessionIdentity, validateConfig };
package/dist/index.d.ts CHANGED
@@ -1125,6 +1125,29 @@ interface MushiReporterStatusTone {
1125
1125
  border: string;
1126
1126
  }
1127
1127
  declare const MUSHI_REPORTER_STATUS: Record<MushiThemeMode, Record<'sent' | 'review' | 'fixing' | 'fixed', MushiReporterStatusTone>>;
1128
+ /**
1129
+ * Report-type tile colours (web widget report screen, ADR 0070). One hue per
1130
+ * type, so a reporter recognises the type by colour and icon before reading:
1131
+ * bug red, slow amber, looks-wrong violet, confusing blue, idea green, other grey.
1132
+ *
1133
+ * - `solid`: tile border and the panel header stripe; ≥ 3:1 on the panel.
1134
+ * - `ink`: the tile icon and tinted text; ≥ 4.5:1 on both washes.
1135
+ * - The tile fill is `solid` at MUSHI_REPORT_TYPE_WASH (unpicked / picked).
1136
+ *
1137
+ * Measured on `#FFFFFF` (light) and `#121212` (dark), the system Canvas the
1138
+ * panel defaults to; `design-tokens.test.ts` asserts every ratio.
1139
+ */
1140
+ type MushiReportTypeId = 'bug' | 'slow' | 'visual' | 'confusing' | 'idea' | 'other';
1141
+ interface MushiReportTypeTone {
1142
+ solid: string;
1143
+ ink: string;
1144
+ }
1145
+ declare const MUSHI_REPORT_TYPE_COLORS: Record<MushiThemeMode, Record<MushiReportTypeId, MushiReportTypeTone>>;
1146
+ /** Tile fill opacity of `solid`: unpicked (`wash`) and picked (`strong`). */
1147
+ declare const MUSHI_REPORT_TYPE_WASH: Record<MushiThemeMode, {
1148
+ wash: number;
1149
+ strong: number;
1150
+ }>;
1128
1151
  /** Resolve the palette for a theme mode. */
1129
1152
  declare function mushiPalette(mode: MushiThemeMode): MushiColorPalette;
1130
1153
  /**
@@ -1348,10 +1371,16 @@ interface ProjectFaviconSource {
1348
1371
  project_slug: string;
1349
1372
  /** Operator override — wins over inferred domain when set. */
1350
1373
  icon_url?: string | null;
1351
- /** e.g. https://kensaur.us — from SDK heartbeat or API key last_seen_origin */
1374
+ /** e.g. https://app.example.com — from SDK heartbeat or API key last_seen_origin */
1352
1375
  sdk_origin?: string | null;
1353
1376
  /** Connected GitHub/GitLab repo — used when SDK has not heartbeated yet. */
1354
1377
  repo_url?: string | null;
1378
+ /**
1379
+ * Hosts that serve many apps under paths (the caller's own hosting origin),
1380
+ * so their root favicon belongs to the parent site, not this app. Data from
1381
+ * the caller's config, never a list of tenants here.
1382
+ */
1383
+ shared_hosts?: readonly string[] | null;
1355
1384
  }
1356
1385
  declare function isUntrustedFaviconUrl(url: string): boolean;
1357
1386
  /** Per-domain favicon URLs — first-party assets only (no CDN globes). */
@@ -1385,4 +1414,4 @@ declare function projectInitialsThemeIndex(projectId: string): number;
1385
1414
  */
1386
1415
  declare function readPageFaviconHref(): string | null;
1387
1416
 
1388
- export { ACTIVATION_EVENT, type AnalyticsBlockReason, type AnalyticsConsentState, type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, EVENT_NAME_RE, EVENT_PROPERTY_LIMITS, type EnvConfigDiagnostics, type EnvNearMiss, type EventTrackerOptions, HABIT_EVENTS, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_ACCENT_SHADOW, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_BEACON_MAX_BYTES, MUSHI_BORDER, MUSHI_COLORS_DARK, MUSHI_COLORS_LIGHT, MUSHI_CONTROL_DISABLED, MUSHI_COPY, MUSHI_DURATION, MUSHI_EVENTS, MUSHI_EVENT_NAMES, MUSHI_GEOMETRY, MUSHI_IDENTITY_TOKEN_PREFIX, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INVERSE, MUSHI_LETTER_SPACING, MUSHI_MOTION, MUSHI_ON_ACCENT, MUSHI_OPACITY, MUSHI_PROJECT_HEADER, MUSHI_RADIUS, MUSHI_REPORTER_STATUS, MUSHI_SDK_PACKAGE_HEADER, MUSHI_SDK_VERSION_HEADER, MUSHI_SHADOW_INK, MUSHI_SPACING, MUSHI_SURFACES, MUSHI_TIER_COLORS, MUSHI_TYPE, MUSHI_USER_TOKEN_HEADER, MUSHI_Z, MushiAnalyticsConfig, MushiApiClient, type MushiBeaconEnvelope, MushiBreadcrumb, type MushiColorPalette, MushiConfig, MushiEnvironment, type MushiErrorFilter, type MushiEventName, type MushiEventProperties, type MushiIdentityClaims, type MushiInternalRequestKind, MushiOfflineConfig, MushiPreFilterConfig, MushiPropertyValue, type MushiRegion, MushiReport, type MushiSurface, type MushiThemeMode, type MushiTokenSnapshot, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, type ProjectFaviconSource, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, type ResolvedEnvConfig, type SessionTrackerOptions, analyticsBlockReason, buildBeaconEnvelope, buildIdentityClaims, buildSdkIngestHeaders, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, destroyEventTracker, destroySessionTracker, diagnoseEnvConfig, dntActive, estimateJsonBytes, expandPreset, extractTunnelPath, faviconUrlCandidates, flushEvents, flushLastOutboundOnUnload, formatBytes, getBackoffDelay, getDeviceFingerprintHash, getEventAnonymousId, getReporterToken, getSessionId, githubRepoDomainHint, hmacSha256Hex, initEventTracker, initSessionTracker, isAutomatedBrowser, isEventTrackingActive, isLikelyGenericFavicon, isMushiBeaconEnvelope, isPageUnloading, isSameOriginOrRelative, isUntrustedFaviconUrl, isValidEventName, markPageUnloading, matchesErrorFilter, mushiPalette, mushiTokens, newUuid, noopLogger, normaliseThrown, onAnalyticsConsentChange, originToDomain, parseIdentityToken, parseRetryAfter, projectFaviconUrlCandidates, projectInitials, projectInitialsThemeIndex, propertiesWithinByteLimit, readPageFaviconHref, resolveAnalyticsConsent, resolveEnvConfig, resolveProjectDomain, resolveProjectFaviconDomains, resolveRegionEndpoint, resolveRequestBaseUrl, resolveWidgetAccent, safeWidgetHex, sanitizeEventProperties, scrubPii, scrubUrl, sendOnUnload, setAnalyticsConsent, setEventConsent, sha256Hex, shouldDropCapturedError, trackEvent, trackPageView, updateEventIdentity, updateSessionIdentity, validateConfig };
1417
+ export { ACTIVATION_EVENT, type AnalyticsBlockReason, type AnalyticsConsentState, type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, EVENT_NAME_RE, EVENT_PROPERTY_LIMITS, type EnvConfigDiagnostics, type EnvNearMiss, type EventTrackerOptions, HABIT_EVENTS, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_ACCENT_SHADOW, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_BEACON_MAX_BYTES, MUSHI_BORDER, MUSHI_COLORS_DARK, MUSHI_COLORS_LIGHT, MUSHI_CONTROL_DISABLED, MUSHI_COPY, MUSHI_DURATION, MUSHI_EVENTS, MUSHI_EVENT_NAMES, MUSHI_GEOMETRY, MUSHI_IDENTITY_TOKEN_PREFIX, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INVERSE, MUSHI_LETTER_SPACING, MUSHI_MOTION, MUSHI_ON_ACCENT, MUSHI_OPACITY, MUSHI_PROJECT_HEADER, MUSHI_RADIUS, MUSHI_REPORTER_STATUS, MUSHI_REPORT_TYPE_COLORS, MUSHI_REPORT_TYPE_WASH, MUSHI_SDK_PACKAGE_HEADER, MUSHI_SDK_VERSION_HEADER, MUSHI_SHADOW_INK, MUSHI_SPACING, MUSHI_SURFACES, MUSHI_TIER_COLORS, MUSHI_TYPE, MUSHI_USER_TOKEN_HEADER, MUSHI_Z, MushiAnalyticsConfig, MushiApiClient, type MushiBeaconEnvelope, MushiBreadcrumb, type MushiColorPalette, MushiConfig, MushiEnvironment, type MushiErrorFilter, type MushiEventName, type MushiEventProperties, type MushiIdentityClaims, type MushiInternalRequestKind, MushiOfflineConfig, MushiPreFilterConfig, MushiPropertyValue, type MushiRegion, MushiReport, type MushiReportTypeId, type MushiReportTypeTone, type MushiSurface, type MushiThemeMode, type MushiTokenSnapshot, type NormalisedException, type OfflineQueue, type PayloadGuardResult, type PiiScrubberConfig, type PreFilterResult, type ProjectFaviconSource, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, type ResolvedEnvConfig, type SessionTrackerOptions, analyticsBlockReason, buildBeaconEnvelope, buildIdentityClaims, buildSdkIngestHeaders, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, destroyEventTracker, destroySessionTracker, diagnoseEnvConfig, dntActive, estimateJsonBytes, expandPreset, extractTunnelPath, faviconUrlCandidates, flushEvents, flushLastOutboundOnUnload, formatBytes, getBackoffDelay, getDeviceFingerprintHash, getEventAnonymousId, getReporterToken, getSessionId, githubRepoDomainHint, hmacSha256Hex, initEventTracker, initSessionTracker, isAutomatedBrowser, isEventTrackingActive, isLikelyGenericFavicon, isMushiBeaconEnvelope, isPageUnloading, isSameOriginOrRelative, isUntrustedFaviconUrl, isValidEventName, markPageUnloading, matchesErrorFilter, mushiPalette, mushiTokens, newUuid, noopLogger, normaliseThrown, onAnalyticsConsentChange, originToDomain, parseIdentityToken, parseRetryAfter, projectFaviconUrlCandidates, projectInitials, projectInitialsThemeIndex, propertiesWithinByteLimit, readPageFaviconHref, resolveAnalyticsConsent, resolveEnvConfig, resolveProjectDomain, resolveProjectFaviconDomains, resolveRegionEndpoint, resolveRequestBaseUrl, resolveWidgetAccent, safeWidgetHex, sanitizeEventProperties, scrubPii, scrubUrl, sendOnUnload, setAnalyticsConsent, setEventConsent, sha256Hex, shouldDropCapturedError, trackEvent, trackPageView, updateEventIdentity, updateSessionIdentity, validateConfig };
package/dist/index.js CHANGED
@@ -2958,6 +2958,28 @@ var MUSHI_REPORTER_STATUS = {
2958
2958
  fixed: { fg: "#8FE3B0", bg: "rgba(80,200,130,0.12)", border: "rgba(80,200,130,0.22)" }
2959
2959
  }
2960
2960
  };
2961
+ var MUSHI_REPORT_TYPE_COLORS = {
2962
+ light: {
2963
+ bug: { solid: "#D92D20", ink: "#B42318" },
2964
+ slow: { solid: "#B54708", ink: "#93370D" },
2965
+ visual: { solid: "#7A3FE4", ink: "#6427C9" },
2966
+ confusing: { solid: "#2160E0", ink: "#1849A9" },
2967
+ idea: { solid: "#14803C", ink: "#0E6630" },
2968
+ other: { solid: "#667085", ink: "#475467" }
2969
+ },
2970
+ dark: {
2971
+ bug: { solid: "#F97066", ink: "#FDA29B" },
2972
+ slow: { solid: "#F79009", ink: "#FEC84B" },
2973
+ visual: { solid: "#A48AFB", ink: "#C9B8FD" },
2974
+ confusing: { solid: "#5B9BF8", ink: "#9EC5FC" },
2975
+ idea: { solid: "#3CCB7F", ink: "#8DE8B4" },
2976
+ other: { solid: "#98A2B3", ink: "#D0D5DD" }
2977
+ }
2978
+ };
2979
+ var MUSHI_REPORT_TYPE_WASH = {
2980
+ light: { wash: 0.08, strong: 0.14 },
2981
+ dark: { wash: 0.14, strong: 0.24 }
2982
+ };
2961
2983
  function mushiPalette(mode) {
2962
2984
  return mode === "dark" ? MUSHI_COLORS_DARK : MUSHI_COLORS_LIGHT;
2963
2985
  }
@@ -3132,28 +3154,6 @@ function parseIdentityToken(token) {
3132
3154
  }
3133
3155
 
3134
3156
  // src/favicon.ts
3135
- var MULTI_TENANT_PARENT_HOSTS = /* @__PURE__ */ new Set(["kensaur.us", "www.kensaur.us"]);
3136
- var SLUG_DOMAIN_HINTS = {
3137
- "glot-it": "glot.it",
3138
- glotit: "glot.it",
3139
- "solo-boss-cloud": "solo-boss.kensaur.us",
3140
- "mushi-mushi": "kensaur.us",
3141
- "how-to-talk-to-girls": "talk.kensaur.us",
3142
- htttg: "talk.kensaur.us",
3143
- tsumagoi: "tsumagoi.kensaur.us"
3144
- };
3145
- var SLUG_ICON_URL_HINTS = {
3146
- "mushi-mushi": "https://kensaur.us/mushi-mushi/admin/favicon.svg",
3147
- "solo-boss-cloud": "https://solo-boss.kensaur.us/favicon.svg",
3148
- "glot-it": "https://kensaur.us/glot-it/apple-touch-icon.png",
3149
- glotit: "https://kensaur.us/glot-it/apple-touch-icon.png",
3150
- "the-wanting-mind": "https://kensaur.us/the-wanting-mind/pwa-512x512.png",
3151
- "how-to-talk-to-girls": "https://talk.kensaur.us/pwa-192.png",
3152
- htttg: "https://talk.kensaur.us/pwa-192.png",
3153
- tsumagoi: "https://tsumagoi.kensaur.us/apple-touch-icon.png",
3154
- "help-her-take-photo": "https://kensaur.us/help-her-take-photo/assets/apple-touch-icon.png",
3155
- "yen-yen": "https://kensaur.us/yen-yen/icon.svg"
3156
- };
3157
3157
  var UNTRUSTED_FAVICON_HOSTS = [
3158
3158
  "www.google.com",
3159
3159
  "icons.duckduckgo.com",
@@ -3183,9 +3183,9 @@ function resolveProjectFaviconDomains(source) {
3183
3183
  out.push(n);
3184
3184
  };
3185
3185
  add(githubRepoDomainHint(source.repo_url));
3186
- add(SLUG_DOMAIN_HINTS[source.project_slug.toLowerCase()]);
3187
- const fromOrigin = source.sdk_origin ? originToDomain(source.sdk_origin) : null;
3188
- if (fromOrigin && !MULTI_TENANT_PARENT_HOSTS.has(fromOrigin)) {
3186
+ const fromOrigin = source.sdk_origin && !mountedUnderPath(source.sdk_origin) ? originToDomain(source.sdk_origin) : null;
3187
+ const shared = new Set((source.shared_hosts ?? []).map((h) => h.trim().toLowerCase()).filter(Boolean));
3188
+ if (fromOrigin && !shared.has(fromOrigin) && !shared.has(fromOrigin.replace(/^www\./, ""))) {
3189
3189
  add(fromOrigin);
3190
3190
  }
3191
3191
  return out;
@@ -3199,8 +3199,6 @@ function projectFaviconUrlCandidates(source, size = 32) {
3199
3199
  seen.add(url);
3200
3200
  urls.push(url);
3201
3201
  };
3202
- const slugHint = SLUG_ICON_URL_HINTS[source.project_slug.toLowerCase()];
3203
- if (slugHint) push(slugHint);
3204
3202
  for (const domain of resolveProjectFaviconDomains(source)) {
3205
3203
  for (const url of faviconUrlCandidates(domain, size)) {
3206
3204
  push(url);
@@ -3208,6 +3206,14 @@ function projectFaviconUrlCandidates(source, size = 32) {
3208
3206
  }
3209
3207
  return urls;
3210
3208
  }
3209
+ function mountedUnderPath(origin) {
3210
+ try {
3211
+ const url = new URL(origin.includes("://") ? origin : `https://${origin}`);
3212
+ return url.pathname.replace(/\/+$/, "") !== "";
3213
+ } catch {
3214
+ return false;
3215
+ }
3216
+ }
3211
3217
  function originToDomain(origin) {
3212
3218
  const trimmed = origin.trim();
3213
3219
  if (!trimmed) return null;
@@ -3324,6 +3330,6 @@ function isSafeFaviconHref(href) {
3324
3330
  }
3325
3331
  }
3326
3332
 
3327
- export { ACTIVATION_EVENT, DEFAULT_API_ENDPOINT, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, EVENT_NAME_RE, EVENT_PROPERTY_LIMITS, HABIT_EVENTS, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_ACCENT_SHADOW, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_BEACON_MAX_BYTES, MUSHI_BORDER, MUSHI_COLORS_DARK, MUSHI_COLORS_LIGHT, MUSHI_CONTROL_DISABLED, MUSHI_COPY, MUSHI_DURATION, MUSHI_EVENTS, MUSHI_EVENT_NAMES, MUSHI_GEOMETRY, MUSHI_IDENTITY_TOKEN_PREFIX, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INVERSE, MUSHI_LETTER_SPACING, MUSHI_MOTION, MUSHI_ON_ACCENT, MUSHI_OPACITY, MUSHI_PROJECT_HEADER, MUSHI_RADIUS, MUSHI_REPORTER_STATUS, MUSHI_SDK_PACKAGE_HEADER, MUSHI_SDK_VERSION_HEADER, MUSHI_SHADOW_INK, MUSHI_SPACING, MUSHI_SURFACES, MUSHI_TIER_COLORS, MUSHI_TYPE, MUSHI_USER_TOKEN_HEADER, MUSHI_Z, REGION_ENDPOINTS, analyticsBlockReason, buildBeaconEnvelope, buildIdentityClaims, buildSdkIngestHeaders, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, destroyEventTracker, destroySessionTracker, diagnoseEnvConfig, dntActive, estimateJsonBytes, expandPreset, extractTunnelPath, faviconUrlCandidates, flushEvents, flushLastOutboundOnUnload, formatBytes, getBackoffDelay, getDeviceFingerprintHash, getEventAnonymousId, getReporterToken, getSessionId, githubRepoDomainHint, hmacSha256Hex, initEventTracker, initSessionTracker, isAutomatedBrowser, isEventTrackingActive, isLikelyGenericFavicon, isMushiBeaconEnvelope, isPageUnloading, isSameOriginOrRelative, isUntrustedFaviconUrl, isValidEventName, markPageUnloading, matchesErrorFilter, mushiPalette, mushiTokens, newUuid, noopLogger, normaliseThrown, onAnalyticsConsentChange, originToDomain, parseIdentityToken, parseRetryAfter, projectFaviconUrlCandidates, projectInitials, projectInitialsThemeIndex, propertiesWithinByteLimit, readPageFaviconHref, resolveAnalyticsConsent, resolveEnvConfig, resolveProjectDomain, resolveProjectFaviconDomains, resolveRegionEndpoint, resolveRequestBaseUrl, resolveWidgetAccent, safeWidgetHex, sanitizeEventProperties, scrubPii, scrubUrl, sendOnUnload, setAnalyticsConsent, setEventConsent, sha256Hex, shouldDropCapturedError, trackEvent, trackPageView, updateEventIdentity, updateSessionIdentity, validateConfig };
3333
+ export { ACTIVATION_EVENT, DEFAULT_API_ENDPOINT, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, EVENT_NAME_RE, EVENT_PROPERTY_LIMITS, HABIT_EVENTS, MAX_REPORT_PAYLOAD_BYTES, MAX_SCREENSHOT_DATA_URL_BYTES, MUSHI_ACCENT_SHADOW, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_BEACON_MAX_BYTES, MUSHI_BORDER, MUSHI_COLORS_DARK, MUSHI_COLORS_LIGHT, MUSHI_CONTROL_DISABLED, MUSHI_COPY, MUSHI_DURATION, MUSHI_EVENTS, MUSHI_EVENT_NAMES, MUSHI_GEOMETRY, MUSHI_IDENTITY_TOKEN_PREFIX, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INVERSE, MUSHI_LETTER_SPACING, MUSHI_MOTION, MUSHI_ON_ACCENT, MUSHI_OPACITY, MUSHI_PROJECT_HEADER, MUSHI_RADIUS, MUSHI_REPORTER_STATUS, MUSHI_REPORT_TYPE_COLORS, MUSHI_REPORT_TYPE_WASH, MUSHI_SDK_PACKAGE_HEADER, MUSHI_SDK_VERSION_HEADER, MUSHI_SHADOW_INK, MUSHI_SPACING, MUSHI_SURFACES, MUSHI_TIER_COLORS, MUSHI_TYPE, MUSHI_USER_TOKEN_HEADER, MUSHI_Z, REGION_ENDPOINTS, analyticsBlockReason, buildBeaconEnvelope, buildIdentityClaims, buildSdkIngestHeaders, captureEnvironment, checkReportPayloadSize, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, destroyEventTracker, destroySessionTracker, diagnoseEnvConfig, dntActive, estimateJsonBytes, expandPreset, extractTunnelPath, faviconUrlCandidates, flushEvents, flushLastOutboundOnUnload, formatBytes, getBackoffDelay, getDeviceFingerprintHash, getEventAnonymousId, getReporterToken, getSessionId, githubRepoDomainHint, hmacSha256Hex, initEventTracker, initSessionTracker, isAutomatedBrowser, isEventTrackingActive, isLikelyGenericFavicon, isMushiBeaconEnvelope, isPageUnloading, isSameOriginOrRelative, isUntrustedFaviconUrl, isValidEventName, markPageUnloading, matchesErrorFilter, mushiPalette, mushiTokens, newUuid, noopLogger, normaliseThrown, onAnalyticsConsentChange, originToDomain, parseIdentityToken, parseRetryAfter, projectFaviconUrlCandidates, projectInitials, projectInitialsThemeIndex, propertiesWithinByteLimit, readPageFaviconHref, resolveAnalyticsConsent, resolveEnvConfig, resolveProjectDomain, resolveProjectFaviconDomains, resolveRegionEndpoint, resolveRequestBaseUrl, resolveWidgetAccent, safeWidgetHex, sanitizeEventProperties, scrubPii, scrubUrl, sendOnUnload, setAnalyticsConsent, setEventConsent, sha256Hex, shouldDropCapturedError, trackEvent, trackPageView, updateEventIdentity, updateSessionIdentity, validateConfig };
3328
3334
  //# sourceMappingURL=index.js.map
3329
3335
  //# sourceMappingURL=index.js.map