@wireai/activation 0.13.3 → 0.13.6-next.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.
Files changed (61) hide show
  1. package/AGENTS.md +3 -1
  2. package/CHANGELOG.md +63 -0
  3. package/INTEGRATION_PROMPT.md +7 -1
  4. package/README.md +183 -0
  5. package/dist/analytics/index.d.mts +86 -6
  6. package/dist/analytics/index.d.ts +86 -6
  7. package/dist/analytics/index.js +167 -2
  8. package/dist/analytics/index.js.map +1 -1
  9. package/dist/analytics/index.mjs +167 -3
  10. package/dist/analytics/index.mjs.map +1 -1
  11. package/dist/coachmarks/index.d.mts +1 -1
  12. package/dist/coachmarks/index.d.ts +1 -1
  13. package/dist/coachmarks/index.js.map +1 -1
  14. package/dist/coachmarks/index.mjs.map +1 -1
  15. package/dist/{currentSession-BoWtr3Jp.d.mts → currentSession-Cs3lweFZ.d.mts} +15 -2
  16. package/dist/{currentSession-CCOMlaQ2.d.ts → currentSession-DD6dKB0i.d.ts} +15 -2
  17. package/dist/{decision-Cjw0jbEj.d.mts → decision-Bgo17oH7.d.mts} +1 -1
  18. package/dist/{decision-GfpXAsk_.d.ts → decision-Bkh_LigV.d.ts} +1 -1
  19. package/dist/index.d.mts +4 -4
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +28 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +28 -3
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/questionnaire/index.d.mts +3 -3
  26. package/dist/questionnaire/index.d.ts +3 -3
  27. package/dist/questionnaire/index.js.map +1 -1
  28. package/dist/questionnaire/index.mjs.map +1 -1
  29. package/dist/reviews/index.d.mts +5 -5
  30. package/dist/reviews/index.d.ts +5 -5
  31. package/dist/reviews/index.js +4 -2
  32. package/dist/reviews/index.js.map +1 -1
  33. package/dist/reviews/index.mjs +4 -2
  34. package/dist/reviews/index.mjs.map +1 -1
  35. package/dist/showcase/index.d.mts +1 -1
  36. package/dist/showcase/index.d.ts +1 -1
  37. package/dist/showcase/index.js.map +1 -1
  38. package/dist/showcase/index.mjs.map +1 -1
  39. package/dist/{transport-DFuPyCoJ.d.ts → transport-B_0SgCBe.d.ts} +1 -1
  40. package/dist/{transport-CefdERPs.d.mts → transport-j5gFfJhK.d.mts} +1 -1
  41. package/dist/{types-CKFhyrMu.d.mts → types-BpwiRpA8.d.mts} +1 -1
  42. package/dist/{types-CKFhyrMu.d.ts → types-BpwiRpA8.d.ts} +1 -1
  43. package/dist/{types-l2tfg23P.d.mts → types-Cju-1_jT.d.mts} +1 -1
  44. package/dist/{types-UVYt9BJe.d.ts → types-h2BZvl1t.d.ts} +1 -1
  45. package/llms.txt +1 -1
  46. package/package.json +3 -1
  47. package/src/OnboardingFlow.tsx +8 -1
  48. package/src/activation/revalidation.ts +9 -1
  49. package/src/analytics/currentSession.ts +10 -0
  50. package/src/analytics/eventQueue.ts +5 -0
  51. package/src/analytics/index.ts +6 -0
  52. package/src/analytics/reportClientEvent.ts +29 -7
  53. package/src/analytics/wireDoctor.ts +330 -0
  54. package/src/coachmarks/runtime.ts +10 -1
  55. package/src/context/deviceId.ts +10 -1
  56. package/src/features/WireFeaturesProvider.tsx +8 -0
  57. package/src/identity/identityRecord.ts +9 -1
  58. package/src/reviews/runtime.ts +11 -1
  59. package/src/theme/ThemeContext.tsx +7 -0
  60. package/src/types.ts +13 -0
  61. package/src/utils/readPlan.ts +74 -0
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import * as wireai_rn from 'wireai-rn';
3
3
  import { Message } from 'wireai-rn';
4
4
  import { O as OnboardingTheme } from './types-BKfpdZzX.js';
5
- import { b as WireOnboardingStorage } from './types-CKFhyrMu.js';
5
+ import { W as WireOnboardingStorage } from './types-BpwiRpA8.js';
6
6
  import { Platform } from 'react-native';
7
7
 
8
8
  /**
@@ -471,6 +471,19 @@ type OnboardingResult = {
471
471
  answers: Record<string, unknown>;
472
472
  /** The raw message thread, for custom downstream parsing. */
473
473
  raw: Message[];
474
+ /**
475
+ * The backend's onboarding plan, when it sent one. Present ONLY on the AI path: a tenant running
476
+ * the static flow, or any run the server finished without a plan, leaves this `undefined` AND
477
+ * leaves the key off the result object entirely — so a host written before plans existed sees
478
+ * byte-identically what it always saw.
479
+ *
480
+ * ⚠️ The kit does NOT interpret this and does NOT validate it. It checks one structural fact (a
481
+ * plan is an object) and hands the payload straight through, unread, unlogged, and never attached
482
+ * to an analytics event. THE HOST MUST VALIDATE IT before applying it: the fields are
483
+ * backend-authored, they may gain new ones without a kit release, and what any of them mean is
484
+ * the host's decision, not the kit's.
485
+ */
486
+ plan?: unknown;
474
487
  };
475
488
  /**
476
489
  * Lifecycle events emitted as the flow runs, for host-side analytics. The kit owns
@@ -1385,4 +1398,4 @@ declare const resetCurrentSessionId: () => void;
1385
1398
  */
1386
1399
  declare const ensureCurrentSessionId: () => string;
1387
1400
 
1388
- export { type IdentifyOnboardingOptions as $, AUTO_DEVICE_ID_PREFIX as A, resetEventQueueKeys as B, type ClearUserContextOptions as C, type DeviceKeyStorage as D, type EventQueueOptions as E, resolveAutoDeviceKey as F, setCurrentSessionId as G, toAnalyticsEvent as H, type WireOnboardingProps as I, type WireOnboardingConfig as J, type WirePermissionStatus as K, type WirePermissionOutcome as L, type OnboardingEvent as M, type OnboardingCopy as N, type OnboardingResult as O, type PermissionStage as P, type DeviceContext as Q, type ResolveAutoDeviceKeyOptions as R, type StepValidator as S, type PermissionScreenConfig as T, type PermissionPlacement as U, DEFAULT_PERMISSION_COPY as V, type WireUserContext as W, type DeviceFormFactor as X, EXTRA_KEY_PREFIX as Y, GENERIC_PERMISSION_COPY as Z, type IdentifyOnboardingBinding as _, type AnalyticsEvent as a, type IdentityRecord as a0, type IdentitySource as a1, type IdentitySpace as a2, NOTIFICATIONS_PERMISSION_COPY as a3, type OnboardingProgress as a4, type PermissionScreenCopy as a5, type ResolveUserContextOptions as a6, type ResolvedUserContext as a7, USER_ID_MAX_LENGTH as a8, WIRE_PERMISSION_EVENTS as a9, type WirePermissionEventName as aa, type WirePermissionKind as ab, activationJoinContext as ac, collectDeviceContext as ad, hashEmailFnv1a as ae, hostIdentity as af, hydrateAutoDeviceKey as ag, hydrateDeviceIdentity as ah, identifyOnboarding as ai, isWireScalar as aj, mintDeviceId as ak, namespaceExtra as al, normalizePermissionStatus as am, permissionEventName as an, permissionEventProps as ao, resetIdentityProvenance as ap, resolveIdentity as aq, resolvePermissionCopy as ar, resolveUserContext as as, sanitizeUserId as at, type ClientEvent as b, type ClientEventTarget as c, type ClientEventType as d, type ContextEnvelope as e, type ContextEnvelopeInput as f, type EnvelopeSource as g, type EventQueue as h, WIRE_ONBOARDING_EVENTS as i, type WireOnboardingEventName as j, analyticsUserIdStorageKey as k, buildContextEnvelope as l, clearPiiFromContext as m, clearUserContext as n, createEventQueue as o, deviceIdStorageKey as p, ensureCurrentSessionId as q, getCurrentSessionId as r, looksLikeEmail as s, makeSessionId as t, reportClientEvent as u, reportClientEventAwait as v, reportClientEvents as w, reportClientEventsAwait as x, resetAutoDeviceKeys as y, resetCurrentSessionId as z };
1401
+ export { type IdentifyOnboardingOptions as $, AUTO_DEVICE_ID_PREFIX as A, resetEventQueueKeys as B, type ClientEventTarget as C, type DeviceKeyStorage as D, type EventQueueOptions as E, resolveAutoDeviceKey as F, setCurrentSessionId as G, toAnalyticsEvent as H, type WireOnboardingProps as I, type WireOnboardingConfig as J, type WirePermissionStatus as K, type WirePermissionOutcome as L, type OnboardingEvent as M, type OnboardingCopy as N, type OnboardingResult as O, type PermissionStage as P, type DeviceContext as Q, type ResolveAutoDeviceKeyOptions as R, type StepValidator as S, type PermissionScreenConfig as T, type PermissionPlacement as U, DEFAULT_PERMISSION_COPY as V, type WireUserContext as W, type DeviceFormFactor as X, EXTRA_KEY_PREFIX as Y, GENERIC_PERMISSION_COPY as Z, type IdentifyOnboardingBinding as _, type AnalyticsEvent as a, type IdentityRecord as a0, type IdentitySource as a1, type IdentitySpace as a2, NOTIFICATIONS_PERMISSION_COPY as a3, type OnboardingProgress as a4, type PermissionScreenCopy as a5, type ResolveUserContextOptions as a6, type ResolvedUserContext as a7, USER_ID_MAX_LENGTH as a8, WIRE_PERMISSION_EVENTS as a9, type WirePermissionEventName as aa, type WirePermissionKind as ab, activationJoinContext as ac, collectDeviceContext as ad, hashEmailFnv1a as ae, hostIdentity as af, hydrateAutoDeviceKey as ag, hydrateDeviceIdentity as ah, identifyOnboarding as ai, isWireScalar as aj, mintDeviceId as ak, namespaceExtra as al, normalizePermissionStatus as am, permissionEventName as an, permissionEventProps as ao, resetIdentityProvenance as ap, resolveIdentity as aq, resolvePermissionCopy as ar, resolveUserContext as as, sanitizeUserId as at, type ClearUserContextOptions as b, type ClientEvent as c, type ClientEventType as d, type ContextEnvelope as e, type ContextEnvelopeInput as f, type EnvelopeSource as g, type EventQueue as h, WIRE_ONBOARDING_EVENTS as i, type WireOnboardingEventName as j, analyticsUserIdStorageKey as k, buildContextEnvelope as l, clearPiiFromContext as m, clearUserContext as n, createEventQueue as o, deviceIdStorageKey as p, ensureCurrentSessionId as q, getCurrentSessionId as r, looksLikeEmail as s, makeSessionId as t, reportClientEvent as u, reportClientEventAwait as v, reportClientEvents as w, reportClientEventsAwait as x, resetAutoDeviceKeys as y, resetCurrentSessionId as z };
@@ -1,4 +1,4 @@
1
- import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-l2tfg23P.mjs';
1
+ import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-Cju-1_jT.mjs';
2
2
 
3
3
  /**
4
4
  * decision.ts — the pure decision logic for the review gate.
@@ -1,4 +1,4 @@
1
- import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-UVYt9BJe.js';
1
+ import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-h2BZvl1t.js';
2
2
 
3
3
  /**
4
4
  * decision.ts — the pure decision logic for the review gate.
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, c as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, b as ClientEvent, g as EnvelopeSource } from './currentSession-BoWtr3Jp.mjs';
4
- export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, C as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-BoWtr3Jp.mjs';
3
+ import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, c as ClientEvent, g as EnvelopeSource } from './currentSession-Cs3lweFZ.mjs';
4
+ export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-Cs3lweFZ.mjs';
5
5
  import { O as OnboardingTheme } from './types-BKfpdZzX.mjs';
6
6
  export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.mjs';
7
7
  export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-C3qQBHsA.mjs';
8
8
  import { WireAIComponent, InjectedProps, Message, WireAIResponse } from 'wireai-rn';
9
- import { a as WireFeaturesConfig, W as WireFeatures, b as WireOnboardingStorage } from './types-CKFhyrMu.mjs';
10
- export { D as DEFAULT_SESSION_TTL_MS, L as LoadedSession, O as OnboardingMode, c as clearPersistedSession, l as loadPersistedSession, p as peekPersistedSession, s as savePersistedSession, d as sessionStorageKey } from './types-CKFhyrMu.mjs';
9
+ import { b as WireFeaturesConfig, a as WireFeatures, W as WireOnboardingStorage } from './types-BpwiRpA8.mjs';
10
+ export { D as DEFAULT_SESSION_TTL_MS, L as LoadedSession, O as OnboardingMode, c as clearPersistedSession, l as loadPersistedSession, p as peekPersistedSession, s as savePersistedSession, d as sessionStorageKey } from './types-BpwiRpA8.mjs';
11
11
  import { z } from 'zod';
12
12
  import 'react-native';
13
13
 
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, c as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, b as ClientEvent, g as EnvelopeSource } from './currentSession-CCOMlaQ2.js';
4
- export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, C as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-CCOMlaQ2.js';
3
+ import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, c as ClientEvent, g as EnvelopeSource } from './currentSession-DD6dKB0i.js';
4
+ export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-DD6dKB0i.js';
5
5
  import { O as OnboardingTheme } from './types-BKfpdZzX.js';
6
6
  export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.js';
7
7
  export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-Cdgns6--.js';
8
8
  import { WireAIComponent, InjectedProps, Message, WireAIResponse } from 'wireai-rn';
9
- import { a as WireFeaturesConfig, W as WireFeatures, b as WireOnboardingStorage } from './types-CKFhyrMu.js';
10
- export { D as DEFAULT_SESSION_TTL_MS, L as LoadedSession, O as OnboardingMode, c as clearPersistedSession, l as loadPersistedSession, p as peekPersistedSession, s as savePersistedSession, d as sessionStorageKey } from './types-CKFhyrMu.js';
9
+ import { b as WireFeaturesConfig, a as WireFeatures, W as WireOnboardingStorage } from './types-BpwiRpA8.js';
10
+ export { D as DEFAULT_SESSION_TTL_MS, L as LoadedSession, O as OnboardingMode, c as clearPersistedSession, l as loadPersistedSession, p as peekPersistedSession, s as savePersistedSession, d as sessionStorageKey } from './types-BpwiRpA8.js';
11
11
  import { z } from 'zod';
12
12
  import 'react-native';
13
13
 
package/dist/index.js CHANGED
@@ -1127,6 +1127,26 @@ var deriveAnswers = (messages) => {
1127
1127
  return out;
1128
1128
  };
1129
1129
 
1130
+ // src/utils/readPlan.ts
1131
+ var PLAN_PART_KIND = "onboarding_plan";
1132
+ var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1133
+ var hasDataParts = (value) => isRecord(value) && Array.isArray(value.dataParts);
1134
+ var planFromPart = (part) => {
1135
+ if (!isRecord(part) || part.kind !== PLAN_PART_KIND) return void 0;
1136
+ return isRecord(part.plan) ? part.plan : void 0;
1137
+ };
1138
+ var readPlan = (messages) => {
1139
+ for (let i = messages.length - 1; i >= 0; i--) {
1140
+ const message = messages[i];
1141
+ if (!hasDataParts(message)) continue;
1142
+ for (const part of message.dataParts) {
1143
+ const plan = planFromPart(part);
1144
+ if (plan !== void 0) return plan;
1145
+ }
1146
+ }
1147
+ return void 0;
1148
+ };
1149
+
1130
1150
  // src/utils/readProgress.ts
1131
1151
  var readProgress = (response) => {
1132
1152
  var _a;
@@ -1157,13 +1177,15 @@ var toWireEvents = (events) => events.map((event) => {
1157
1177
  return rest;
1158
1178
  }
1159
1179
  });
1160
- var buildEventsRequest = (target, events) => {
1180
+ var buildEventsRequest = (target, events, options) => {
1161
1181
  if (!(target == null ? void 0 : target.serverUrl) || events.length === 0) return null;
1162
1182
  try {
1163
1183
  const url = `${target.serverUrl.replace(/\/$/, "")}/v1/events`;
1164
1184
  const headers = { "Content-Type": "application/json" };
1165
1185
  if (target.apiKey) headers.Authorization = `Bearer ${target.apiKey}`;
1166
- const body = JSON.stringify({ events: toWireEvents(events) });
1186
+ const envelope = { events: toWireEvents(events) };
1187
+ if ((options == null ? void 0 : options.dryRun) === true) ;
1188
+ const body = JSON.stringify(envelope);
1167
1189
  return { url, init: { method: "POST", headers, body } };
1168
1190
  } catch {
1169
1191
  return null;
@@ -1795,7 +1817,10 @@ var OnboardingFlow = ({
1795
1817
  const handleFinish = React19.useCallback(() => {
1796
1818
  if (finished.current) return;
1797
1819
  finished.current = true;
1798
- onCompleteRef.current({ answers: deriveAnswers(messages), raw: messages });
1820
+ const result = { answers: deriveAnswers(messages), raw: messages };
1821
+ const plan = readPlan(messages);
1822
+ if (plan !== void 0) result.plan = plan;
1823
+ onCompleteRef.current(result);
1799
1824
  }, [messages]);
1800
1825
  const handleRetry = React19.useCallback(() => {
1801
1826
  attempts.current = 0;