@mushi-mushi/core 1.33.6 → 1.35.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 { 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
+ 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-c6R3idzB.cjs';
@@ -1 +1 @@
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';
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-c6R3idzB.js';
@@ -177,12 +177,17 @@ interface MushiConfig {
177
177
  */
178
178
  analytics?: MushiAnalyticsConfig;
179
179
  /**
180
- * Session lifecycle tracking for the console's Activity and Users views
181
- * (session start / heartbeat / end, page views). Default true. Runs only
182
- * while the `analytics` gate allows tracking; `false` turns it off even
183
- * then.
180
+ * Session lifecycle tracking for the console's Activity, Users and
181
+ * Journeys views (session start / heartbeat / end, page views). Default
182
+ * true. Runs only while the `analytics` gate allows tracking; `false` turns
183
+ * it off even then.
184
+ *
185
+ * `'on-demand'` sends nothing until you ask: while the console's Journeys
186
+ * page has a recording window open, its share of visitors is recorded; a
187
+ * tab opened with `?mushi_journeys=1` is always recorded (for you or a
188
+ * tester). Use it when every request on every visit costs too much.
184
189
  */
185
- trackSessions?: boolean;
190
+ trackSessions?: boolean | 'on-demand';
186
191
  sentry?: MushiSentryConfig;
187
192
  widget?: MushiWidgetConfig;
188
193
  /** Reporter updates beyond the in-app badge (Plan 018 §4). */
@@ -1799,7 +1804,10 @@ interface MushiApiClient {
1799
1804
  getReportStatus(reportId: string): Promise<MushiApiResponse<{
1800
1805
  status: MushiReportStatus;
1801
1806
  }>>;
1802
- getSdkConfig(): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1807
+ /** `fresh` bypasses the browser HTTP cache (used by `trackSessions: 'on-demand'`). */
1808
+ getSdkConfig(opts?: {
1809
+ fresh?: boolean;
1810
+ }): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1803
1811
  /**
1804
1812
  * Send one assistant turn. Forwards the page context + thread id; the
1805
1813
  * end-user identity token (when set) travels on the X-Mushi-User-Token
@@ -2064,6 +2072,14 @@ interface MushiRuntimeSdkConfig {
2064
2072
  pushEnabled: boolean;
2065
2073
  vapidPublicKey: string | null;
2066
2074
  };
2075
+ /**
2076
+ * Journey optimizer recording window, present only while open. Read by
2077
+ * `trackSessions: 'on-demand'`; ignored otherwise.
2078
+ */
2079
+ journeys?: {
2080
+ recordUntil: string;
2081
+ sampleRate: number;
2082
+ };
2067
2083
  }
2068
2084
  interface MushiSdkVersionInfo {
2069
2085
  package: string;
@@ -177,12 +177,17 @@ interface MushiConfig {
177
177
  */
178
178
  analytics?: MushiAnalyticsConfig;
179
179
  /**
180
- * Session lifecycle tracking for the console's Activity and Users views
181
- * (session start / heartbeat / end, page views). Default true. Runs only
182
- * while the `analytics` gate allows tracking; `false` turns it off even
183
- * then.
180
+ * Session lifecycle tracking for the console's Activity, Users and
181
+ * Journeys views (session start / heartbeat / end, page views). Default
182
+ * true. Runs only while the `analytics` gate allows tracking; `false` turns
183
+ * it off even then.
184
+ *
185
+ * `'on-demand'` sends nothing until you ask: while the console's Journeys
186
+ * page has a recording window open, its share of visitors is recorded; a
187
+ * tab opened with `?mushi_journeys=1` is always recorded (for you or a
188
+ * tester). Use it when every request on every visit costs too much.
184
189
  */
185
- trackSessions?: boolean;
190
+ trackSessions?: boolean | 'on-demand';
186
191
  sentry?: MushiSentryConfig;
187
192
  widget?: MushiWidgetConfig;
188
193
  /** Reporter updates beyond the in-app badge (Plan 018 §4). */
@@ -1799,7 +1804,10 @@ interface MushiApiClient {
1799
1804
  getReportStatus(reportId: string): Promise<MushiApiResponse<{
1800
1805
  status: MushiReportStatus;
1801
1806
  }>>;
1802
- getSdkConfig(): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1807
+ /** `fresh` bypasses the browser HTTP cache (used by `trackSessions: 'on-demand'`). */
1808
+ getSdkConfig(opts?: {
1809
+ fresh?: boolean;
1810
+ }): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1803
1811
  /**
1804
1812
  * Send one assistant turn. Forwards the page context + thread id; the
1805
1813
  * end-user identity token (when set) travels on the X-Mushi-User-Token
@@ -2064,6 +2072,14 @@ interface MushiRuntimeSdkConfig {
2064
2072
  pushEnabled: boolean;
2065
2073
  vapidPublicKey: string | null;
2066
2074
  };
2075
+ /**
2076
+ * Journey optimizer recording window, present only while open. Read by
2077
+ * `trackSessions: 'on-demand'`; ignored otherwise.
2078
+ */
2079
+ journeys?: {
2080
+ recordUntil: string;
2081
+ sampleRate: number;
2082
+ };
2067
2083
  }
2068
2084
  interface MushiSdkVersionInfo {
2069
2085
  package: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mushi-mushi/core",
3
- "version": "1.33.6",
4
- "description": "Mushi Mushi SDK types, API client, pre-filter. The bug mediator for AI-built apps: plain-English diagnosis + a ready fix, in your editor.",
3
+ "version": "1.35.0",
4
+ "description": "Mushi Mushi SDK types, API client, pre-filter. One place to improve AI-built apps: fix bugs, smooth user journeys and clean up the code.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
@@ -90,7 +90,7 @@
90
90
  "size-limit": [
91
91
  {
92
92
  "path": "dist/index.js",
93
- "limit": "25.9 KB"
93
+ "limit": "26.0 KB"
94
94
  }
95
95
  ],
96
96
  "devDependencies": {