@wireai/activation 0.7.0 → 0.9.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 (94) hide show
  1. package/AGENTS.md +29 -5
  2. package/CHANGELOG.md +198 -6
  3. package/README.md +105 -10
  4. package/dist/analytics/index.d.mts +12 -8
  5. package/dist/analytics/index.d.ts +12 -8
  6. package/dist/analytics/index.js +525 -55
  7. package/dist/analytics/index.js.map +1 -1
  8. package/dist/analytics/index.mjs +525 -55
  9. package/dist/analytics/index.mjs.map +1 -1
  10. package/dist/coachmarks/index.d.mts +2 -2
  11. package/dist/coachmarks/index.d.ts +2 -2
  12. package/dist/coachmarks/index.js.map +1 -1
  13. package/dist/coachmarks/index.mjs.map +1 -1
  14. package/dist/{currentSession-CxnP7gAa.d.ts → currentSession-61dcm3V-.d.ts} +19 -3
  15. package/dist/{currentSession-BJBB7i4-.d.mts → currentSession-Bs2JfTJ8.d.mts} +19 -3
  16. package/dist/{decision-BzbiKwk3.d.mts → decision-Bl_M2y3r.d.mts} +1 -1
  17. package/dist/{decision-plDEOCkt.d.ts → decision-Cau5KmP6.d.ts} +1 -1
  18. package/dist/index.d.mts +620 -13
  19. package/dist/index.d.ts +620 -13
  20. package/dist/index.js +1194 -369
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +1015 -201
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/questionnaire/index.d.mts +69 -23
  25. package/dist/questionnaire/index.d.ts +69 -23
  26. package/dist/questionnaire/index.js +643 -172
  27. package/dist/questionnaire/index.js.map +1 -1
  28. package/dist/questionnaire/index.mjs +608 -137
  29. package/dist/questionnaire/index.mjs.map +1 -1
  30. package/dist/reviews/index.d.mts +24 -12
  31. package/dist/reviews/index.d.ts +24 -12
  32. package/dist/reviews/index.js +507 -173
  33. package/dist/reviews/index.js.map +1 -1
  34. package/dist/reviews/index.mjs +462 -129
  35. package/dist/reviews/index.mjs.map +1 -1
  36. package/dist/showcase/index.d.mts +2 -2
  37. package/dist/showcase/index.d.ts +2 -2
  38. package/dist/showcase/index.js.map +1 -1
  39. package/dist/showcase/index.mjs.map +1 -1
  40. package/dist/transport-DzU-TqZz.d.ts +86 -0
  41. package/dist/transport-f5VVB5hH.d.mts +86 -0
  42. package/dist/{types-GL_hQ0TN.d.mts → types-BcmagF6K.d.mts} +1 -1
  43. package/dist/{types-GL_hQ0TN.d.ts → types-BcmagF6K.d.ts} +1 -1
  44. package/dist/{types-BhpXJGlg.d.ts → types-Buj9Lw9t.d.ts} +15 -3
  45. package/dist/{types-CMuOexw0.d.mts → types-CKFhyrMu.d.mts} +1 -1
  46. package/dist/{types-CMuOexw0.d.ts → types-CKFhyrMu.d.ts} +1 -1
  47. package/dist/{types-A6pTxIZV.d.mts → types-CNUqMK0D.d.mts} +15 -3
  48. package/metro/index.d.ts +18 -1
  49. package/metro/index.js +80 -0
  50. package/package.json +9 -1
  51. package/src/WireOnboarding.tsx +4 -0
  52. package/src/analytics/analyticsFacade.ts +55 -10
  53. package/src/analytics/currentSession.ts +1 -1
  54. package/src/cards/CardGridSelectCard.tsx +253 -0
  55. package/src/cards/ChipSelectCard.tsx +1 -1
  56. package/src/cards/SelectionCard.tsx +15 -19
  57. package/src/cards/index.ts +13 -1
  58. package/src/cards/optionSchema.ts +65 -0
  59. package/src/coachmarks/types.ts +1 -1
  60. package/src/components/CardHandoff.tsx +39 -7
  61. package/src/components/DoneCheck.tsx +94 -0
  62. package/src/components/ModalPaneHost.tsx +141 -0
  63. package/src/components/StepDots.tsx +112 -0
  64. package/src/context/deviceId.ts +43 -0
  65. package/src/device/appVersion.ts +29 -8
  66. package/src/device/deviceContext.ts +14 -1
  67. package/src/device/deviceModel.ts +106 -0
  68. package/src/features/cache.ts +1 -1
  69. package/src/haptics/expo-haptics.d.ts +31 -0
  70. package/src/haptics/haptics.ts +58 -0
  71. package/src/icons/IconRegistry.tsx +53 -0
  72. package/src/icons/WireIcon.tsx +85 -0
  73. package/src/icons/expoIcons.ts +165 -0
  74. package/src/icons/index.ts +18 -0
  75. package/src/icons/vocabulary.ts +154 -0
  76. package/src/index.ts +22 -0
  77. package/src/questionnaire/QuestionnaireGate.tsx +315 -164
  78. package/src/questionnaire/decision.ts +4 -2
  79. package/src/questionnaire/index.ts +3 -2
  80. package/src/questionnaire/steps.ts +261 -0
  81. package/src/questionnaire/types.ts +33 -12
  82. package/src/reviews/ReviewGate.tsx +250 -152
  83. package/src/reviews/index.ts +7 -3
  84. package/src/reviews/transport.ts +77 -3
  85. package/src/reviews/types.ts +13 -0
  86. package/src/session/persistedSession.ts +1 -1
  87. package/src/session-analytics/lifecycle.ts +1 -1
  88. package/src/session-analytics/useSessionStart.ts +2 -2
  89. package/src/showcase/FeatureShowcase.tsx +1 -1
  90. package/src/showcase/showcaseColors.ts +1 -1
  91. package/src/theme/mergeThemeOver.ts +27 -0
  92. package/src/types.ts +8 -0
  93. package/dist/transport-BeO_Brcu.d.mts +0 -40
  94. package/dist/transport-DLpd1v5_.d.ts +0 -40
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The icon module — a named semantic vocabulary the AI emits, resolved to real glyphs through
3
+ * an OPTIONAL peer, with a host override registry in front and a no-op behind. See
4
+ * `vocabulary.ts` for the contract and `expoIcons.ts` for why the optional peer honors the
5
+ * kit's no-forced-native-dependency policy rather than breaking it.
6
+ */
7
+ export { WireIcon } from "./WireIcon";
8
+ export type { WireIconProps } from "./WireIcon";
9
+ export { IconRegistryProvider, useHostIcon } from "./IconRegistry";
10
+ export type { WireIconRegistry, IconRegistryProviderProps } from "./IconRegistry";
11
+ export {
12
+ WIRE_ICON_GLYPHS,
13
+ WIRE_ICON_NAMES,
14
+ lookupIconGlyph,
15
+ } from "./vocabulary";
16
+ export type { WireIconName, WireIconFamily, WireIconGlyph } from "./vocabulary";
17
+ export { resolveIconFamily, resetIconModuleCache } from "./expoIcons";
18
+ export type { OptionalRequire, IconComponent } from "./expoIcons";
@@ -0,0 +1,154 @@
1
+ /**
2
+ * The Wire icon VOCABULARY — the stable, semantic contract between the AI and the kit.
3
+ *
4
+ * The model emits a plain semantic string (`"instagram"`, `"friend"`, `"wedding"`), never a
5
+ * raw icon-library glyph name. That indirection is the whole point:
6
+ *
7
+ * • The model is never coupled to a library version. `@expo/vector-icons` renaming a glyph,
8
+ * or a host swapping the library out for brand SVGs, changes THIS map — not the prompt,
9
+ * not the server, and not a single stored answer.
10
+ * • A host can override any name with its own artwork (see `IconRegistry`), so brand icons
11
+ * need no kit change.
12
+ * • An unknown name degrades to no icon (see `WireIcon`), which is why the vocabulary can
13
+ * grow without a coordinated kit+server release.
14
+ *
15
+ * `WIRE_ICON_NAMES` is exported so the server/AI side can be taught the list verbatim — paste
16
+ * it into the prompt as the allowed `icon` values. Keep names SEMANTIC (what the option means)
17
+ * rather than visual (what the glyph looks like): the model reasons about meaning.
18
+ *
19
+ * Every glyph below was verified to exist in the `@expo/vector-icons` 15.0.3 glyphmaps that
20
+ * both live host apps already ship. MaterialCommunityIcons is the default family (the broadest
21
+ * single set); Ionicons covers the few brand logos MCI lacks (TikTok, Discord).
22
+ */
23
+
24
+ /** The icon families this kit resolves out of `@expo/vector-icons`. Both are root exports. */
25
+ export type WireIconFamily = "MaterialCommunityIcons" | "Ionicons";
26
+
27
+ /** One vocabulary entry: the concrete glyph a semantic name resolves to. */
28
+ export interface WireIconGlyph {
29
+ family: WireIconFamily;
30
+ /** The library's own glyph name — an INTERNAL detail. The AI never sees or emits this. */
31
+ name: string;
32
+ }
33
+
34
+ /**
35
+ * The semantic name → concrete glyph map. Grouped by the onboarding questions these actually
36
+ * serve: acquisition channels ("where did you hear about us"), intent/occasion ("what brings
37
+ * you here"), and a general-purpose set for everything else.
38
+ */
39
+ export const WIRE_ICON_GLYPHS = {
40
+ // ── Acquisition channels ("where did you hear about us?") ──────────────────
41
+ instagram: { family: "MaterialCommunityIcons", name: "instagram" },
42
+ tiktok: { family: "Ionicons", name: "logo-tiktok" },
43
+ youtube: { family: "MaterialCommunityIcons", name: "youtube" },
44
+ facebook: { family: "MaterialCommunityIcons", name: "facebook" },
45
+ twitter: { family: "MaterialCommunityIcons", name: "twitter" },
46
+ reddit: { family: "MaterialCommunityIcons", name: "reddit" },
47
+ linkedin: { family: "MaterialCommunityIcons", name: "linkedin" },
48
+ discord: { family: "Ionicons", name: "logo-discord" },
49
+ whatsapp: { family: "MaterialCommunityIcons", name: "whatsapp" },
50
+ twitch: { family: "MaterialCommunityIcons", name: "twitch" },
51
+ snapchat: { family: "MaterialCommunityIcons", name: "snapchat" },
52
+ pinterest: { family: "MaterialCommunityIcons", name: "pinterest" },
53
+ google: { family: "MaterialCommunityIcons", name: "google" },
54
+ search: { family: "MaterialCommunityIcons", name: "magnify" },
55
+ friend: { family: "MaterialCommunityIcons", name: "account-heart" },
56
+ podcast: { family: "MaterialCommunityIcons", name: "podcast" },
57
+ blog: { family: "MaterialCommunityIcons", name: "post" },
58
+ newsletter: { family: "MaterialCommunityIcons", name: "email-outline" },
59
+ news: { family: "MaterialCommunityIcons", name: "newspaper" },
60
+ "app-store": { family: "MaterialCommunityIcons", name: "apple" },
61
+ ad: { family: "MaterialCommunityIcons", name: "bullhorn" },
62
+
63
+ // ── Intent / occasion ("what brings you here?") ────────────────────────────
64
+ wedding: { family: "MaterialCommunityIcons", name: "ring" },
65
+ birthday: { family: "MaterialCommunityIcons", name: "cake-variant" },
66
+ baby: { family: "MaterialCommunityIcons", name: "baby-carriage" },
67
+ travel: { family: "MaterialCommunityIcons", name: "airplane" },
68
+ work: { family: "MaterialCommunityIcons", name: "briefcase" },
69
+ celebration: { family: "MaterialCommunityIcons", name: "party-popper" },
70
+ store: { family: "MaterialCommunityIcons", name: "storefront" },
71
+ school: { family: "MaterialCommunityIcons", name: "school" },
72
+ team: { family: "MaterialCommunityIcons", name: "account-multiple" },
73
+ growth: { family: "MaterialCommunityIcons", name: "trending-up" },
74
+
75
+ // ── General purpose ────────────────────────────────────────────────────────
76
+ sparkle: { family: "MaterialCommunityIcons", name: "star-four-points" },
77
+ heart: { family: "MaterialCommunityIcons", name: "heart" },
78
+ star: { family: "MaterialCommunityIcons", name: "star" },
79
+ fire: { family: "MaterialCommunityIcons", name: "fire" },
80
+ target: { family: "MaterialCommunityIcons", name: "target" },
81
+ trophy: { family: "MaterialCommunityIcons", name: "trophy" },
82
+ rocket: { family: "MaterialCommunityIcons", name: "rocket-launch" },
83
+ clock: { family: "MaterialCommunityIcons", name: "clock-outline" },
84
+ calendar: { family: "MaterialCommunityIcons", name: "calendar-star" },
85
+ camera: { family: "MaterialCommunityIcons", name: "camera" },
86
+ image: { family: "MaterialCommunityIcons", name: "image" },
87
+ video: { family: "MaterialCommunityIcons", name: "video" },
88
+ mic: { family: "MaterialCommunityIcons", name: "microphone" },
89
+ music: { family: "MaterialCommunityIcons", name: "music" },
90
+ book: { family: "MaterialCommunityIcons", name: "book-open-variant" },
91
+ food: { family: "MaterialCommunityIcons", name: "silverware-fork-knife" },
92
+ coffee: { family: "MaterialCommunityIcons", name: "coffee" },
93
+ fitness: { family: "MaterialCommunityIcons", name: "dumbbell" },
94
+ health: { family: "MaterialCommunityIcons", name: "heart-pulse" },
95
+ meditation: { family: "MaterialCommunityIcons", name: "meditation" },
96
+ sleep: { family: "MaterialCommunityIcons", name: "sleep" },
97
+ brain: { family: "MaterialCommunityIcons", name: "brain" },
98
+ idea: { family: "MaterialCommunityIcons", name: "lightbulb-on" },
99
+ money: { family: "MaterialCommunityIcons", name: "cash" },
100
+ shopping: { family: "MaterialCommunityIcons", name: "cart" },
101
+ gift: { family: "MaterialCommunityIcons", name: "gift" },
102
+ home: { family: "MaterialCommunityIcons", name: "home" },
103
+ car: { family: "MaterialCommunityIcons", name: "car" },
104
+ pet: { family: "MaterialCommunityIcons", name: "paw" },
105
+ plant: { family: "MaterialCommunityIcons", name: "sprout" },
106
+ sun: { family: "MaterialCommunityIcons", name: "white-balance-sunny" },
107
+ moon: { family: "MaterialCommunityIcons", name: "weather-night" },
108
+ globe: { family: "MaterialCommunityIcons", name: "earth" },
109
+ "map-pin": { family: "MaterialCommunityIcons", name: "map-marker" },
110
+ compass: { family: "MaterialCommunityIcons", name: "compass" },
111
+ flag: { family: "MaterialCommunityIcons", name: "flag" },
112
+ bookmark: { family: "MaterialCommunityIcons", name: "bookmark" },
113
+ bell: { family: "MaterialCommunityIcons", name: "bell" },
114
+ mail: { family: "MaterialCommunityIcons", name: "email" },
115
+ phone: { family: "MaterialCommunityIcons", name: "phone" },
116
+ chat: { family: "MaterialCommunityIcons", name: "chat" },
117
+ user: { family: "MaterialCommunityIcons", name: "account" },
118
+ users: { family: "MaterialCommunityIcons", name: "account-group" },
119
+ settings: { family: "MaterialCommunityIcons", name: "cog" },
120
+ tools: { family: "MaterialCommunityIcons", name: "tools" },
121
+ puzzle: { family: "MaterialCommunityIcons", name: "puzzle" },
122
+ chart: { family: "MaterialCommunityIcons", name: "chart-line" },
123
+ shield: { family: "MaterialCommunityIcons", name: "shield-check" },
124
+ lock: { family: "MaterialCommunityIcons", name: "lock" },
125
+ cloud: { family: "MaterialCommunityIcons", name: "cloud" },
126
+ pencil: { family: "MaterialCommunityIcons", name: "pencil" },
127
+ check: { family: "MaterialCommunityIcons", name: "check-circle" },
128
+ plus: { family: "MaterialCommunityIcons", name: "plus-circle" },
129
+ question: { family: "MaterialCommunityIcons", name: "help-circle" },
130
+ other: { family: "MaterialCommunityIcons", name: "dots-horizontal-circle" },
131
+ } as const satisfies Record<string, WireIconGlyph>;
132
+
133
+ /** A name in the vocabulary. The card schemas accept any string and degrade — see `WireIcon`. */
134
+ export type WireIconName = keyof typeof WIRE_ICON_GLYPHS;
135
+
136
+ /**
137
+ * Every semantic name, as a plain array — the list to paste into the server/AI prompt as the
138
+ * allowed `icon` values. Sorted for a stable, diffable prompt.
139
+ */
140
+ export const WIRE_ICON_NAMES: readonly string[] = Object.keys(WIRE_ICON_GLYPHS).sort();
141
+
142
+ /**
143
+ * Look up a semantic name. Returns undefined for anything outside the vocabulary.
144
+ *
145
+ * The OWN-property check is load-bearing, not defensive noise: the name comes from an LLM, and
146
+ * a plain object lookup answers `"toString"` / `"constructor"` / `"valueOf"` with an inherited
147
+ * `Object.prototype` member. That would hand back a function where a `{family, name}` is
148
+ * expected — a non-glyph masquerading as one. Caught by the vocabulary canary.
149
+ */
150
+ export const lookupIconGlyph = (name: string | undefined): WireIconGlyph | undefined => {
151
+ if (!name) return undefined;
152
+ if (!Object.prototype.hasOwnProperty.call(WIRE_ICON_GLYPHS, name)) return undefined;
153
+ return (WIRE_ICON_GLYPHS as Record<string, WireIconGlyph>)[name];
154
+ };
package/src/index.ts CHANGED
@@ -52,11 +52,31 @@ export {
52
52
  ChipSelectCard,
53
53
  TextInputCard,
54
54
  SelectionCard,
55
+ CardGridSelectCard,
55
56
  StatusCard,
56
57
  NumberStepperCard,
57
58
  InterstitialCard,
58
59
  onboardingComponents,
59
60
  } from "./cards";
61
+ export type { CardOption } from "./cards";
62
+
63
+ // ─── Icons (semantic vocabulary → optional @expo/vector-icons → nothing) ──────
64
+ // WIRE_ICON_NAMES is the list to paste into the server/AI prompt as the allowed `icon` values.
65
+ export {
66
+ WireIcon,
67
+ IconRegistryProvider,
68
+ useHostIcon,
69
+ WIRE_ICON_GLYPHS,
70
+ WIRE_ICON_NAMES,
71
+ lookupIconGlyph,
72
+ } from "./icons";
73
+ export type {
74
+ WireIconProps,
75
+ WireIconRegistry,
76
+ WireIconName,
77
+ WireIconFamily,
78
+ WireIconGlyph,
79
+ } from "./icons";
60
80
 
61
81
  // ─── Flow internals (advanced) ────────────────────────────────────────────────
62
82
  export { OnboardingFlow } from "./OnboardingFlow";
@@ -118,6 +138,7 @@ export type { OnboardingAttribution } from "./attribution/attribution";
118
138
  export { collectDeviceContext } from "./device/deviceContext";
119
139
  export type { DeviceContext, DeviceFormFactor } from "./device/deviceContext";
120
140
  export { detectAppVersion } from "./device/appVersion";
141
+ export { detectNativeModel } from "./device/deviceModel";
121
142
 
122
143
  // ─── User identity (opaque pseudonymous id; late binding, dependency-free) ────
123
144
  export { identifyOnboarding, sanitizeUserId, USER_ID_MAX_LENGTH } from "./identity/userIdentity";
@@ -137,6 +158,7 @@ export type {
137
158
  ResolvedUserContext,
138
159
  ResolveUserContextOptions,
139
160
  } from "./context/userContext";
161
+ export { mintDeviceId, deviceIdStorageKey, AUTO_DEVICE_ID_PREFIX } from "./context/deviceId";
140
162
 
141
163
  // ─── Current per-open session registry (identify/app-events reuse the live session) ───
142
164
  export {