@mushi-mushi/core 1.34.0 → 1.37.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-Nv_WYhjE.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-DGCkdOm1.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-Nv_WYhjE.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-DGCkdOm1.js';
@@ -1554,6 +1554,15 @@ interface MushiSDKInstance {
1554
1554
  name?: string;
1555
1555
  }): void;
1556
1556
  setMetadata(key: string, value: unknown): void;
1557
+ /**
1558
+ * Diagnostics read when the reporter presses Send (load timings, the last
1559
+ * errors your app logged, connection state). Its keys merge into the report's
1560
+ * metadata; triage reads `screenLoading` / `timings` lines. Gets 300 ms, is
1561
+ * PII-scrubbed and size-capped; a slow or throwing provider never blocks or
1562
+ * drops the report. Keep amounts, names and other personal data out.
1563
+ * Pass `null` to remove it.
1564
+ */
1565
+ setDiagnosticsProvider(provider: (() => Record<string, unknown> | null | undefined | Promise<Record<string, unknown> | null | undefined>) | null): void;
1557
1566
  setScreen(screen: {
1558
1567
  name: string;
1559
1568
  route?: string;
@@ -1804,7 +1813,10 @@ interface MushiApiClient {
1804
1813
  getReportStatus(reportId: string): Promise<MushiApiResponse<{
1805
1814
  status: MushiReportStatus;
1806
1815
  }>>;
1807
- getSdkConfig(): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1816
+ /** `fresh` bypasses the browser HTTP cache (used by `trackSessions: 'on-demand'`). */
1817
+ getSdkConfig(opts?: {
1818
+ fresh?: boolean;
1819
+ }): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1808
1820
  /**
1809
1821
  * Send one assistant turn. Forwards the page context + thread id; the
1810
1822
  * end-user identity token (when set) travels on the X-Mushi-User-Token
@@ -1554,6 +1554,15 @@ interface MushiSDKInstance {
1554
1554
  name?: string;
1555
1555
  }): void;
1556
1556
  setMetadata(key: string, value: unknown): void;
1557
+ /**
1558
+ * Diagnostics read when the reporter presses Send (load timings, the last
1559
+ * errors your app logged, connection state). Its keys merge into the report's
1560
+ * metadata; triage reads `screenLoading` / `timings` lines. Gets 300 ms, is
1561
+ * PII-scrubbed and size-capped; a slow or throwing provider never blocks or
1562
+ * drops the report. Keep amounts, names and other personal data out.
1563
+ * Pass `null` to remove it.
1564
+ */
1565
+ setDiagnosticsProvider(provider: (() => Record<string, unknown> | null | undefined | Promise<Record<string, unknown> | null | undefined>) | null): void;
1557
1566
  setScreen(screen: {
1558
1567
  name: string;
1559
1568
  route?: string;
@@ -1804,7 +1813,10 @@ interface MushiApiClient {
1804
1813
  getReportStatus(reportId: string): Promise<MushiApiResponse<{
1805
1814
  status: MushiReportStatus;
1806
1815
  }>>;
1807
- getSdkConfig(): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1816
+ /** `fresh` bypasses the browser HTTP cache (used by `trackSessions: 'on-demand'`). */
1817
+ getSdkConfig(opts?: {
1818
+ fresh?: boolean;
1819
+ }): Promise<MushiApiResponse<MushiRuntimeSdkConfig>>;
1808
1820
  /**
1809
1821
  * Send one assistant turn. Forwards the page context + thread id; the
1810
1822
  * end-user identity token (when set) travels on the X-Mushi-User-Token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/core",
3
- "version": "1.34.0",
3
+ "version": "1.37.0",
4
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",
@@ -37,6 +37,16 @@
37
37
  "types": "./dist/reporter-channels.d.cts",
38
38
  "default": "./dist/reporter-channels.cjs"
39
39
  }
40
+ },
41
+ "./diagnostics": {
42
+ "import": {
43
+ "types": "./dist/diagnostics.d.ts",
44
+ "default": "./dist/diagnostics.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/diagnostics.d.cts",
48
+ "default": "./dist/diagnostics.cjs"
49
+ }
40
50
  }
41
51
  },
42
52
  "typesVersions": {
@@ -46,6 +56,9 @@
46
56
  ],
47
57
  "reporter-channels": [
48
58
  "./dist/reporter-channels.d.ts"
59
+ ],
60
+ "diagnostics": [
61
+ "./dist/diagnostics.d.ts"
49
62
  ]
50
63
  }
51
64
  },
@@ -90,7 +103,7 @@
90
103
  "size-limit": [
91
104
  {
92
105
  "path": "dist/index.js",
93
- "limit": "25.9 KB"
106
+ "limit": "26.0 KB"
94
107
  }
95
108
  ],
96
109
  "devDependencies": {