@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-alpha.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.
Files changed (378) hide show
  1. package/.claude-flow/data/pending-insights.jsonl +43 -0
  2. package/.claude-flow/sessions/session-1794323376548.json +14 -0
  3. package/CHANGELOG.md +41 -0
  4. package/jest.config.cjs +22 -0
  5. package/lib/assets/home/loop-day.jpg +0 -0
  6. package/lib/assets/home/loop-day.mp4 +0 -0
  7. package/lib/assets/home/loop-time-back.jpg +0 -0
  8. package/lib/assets/home/loop-time-back.mp4 +0 -0
  9. package/lib/assets/home/loop-where.jpg +0 -0
  10. package/lib/assets/home/loop-where.mp4 +0 -0
  11. package/lib/assets/home/reel-gym.jpg +0 -0
  12. package/lib/assets/home/reel-gym.mp4 +0 -0
  13. package/lib/assets/home/reel-internet.jpg +0 -0
  14. package/lib/assets/home/reel-internet.mp4 +0 -0
  15. package/lib/assets/icon.png +0 -0
  16. package/lib/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  17. package/lib/assets/lottie/lucy-mark-calendar.json +1827 -0
  18. package/lib/assets/lottie/lucy-mark-call.json +1470 -0
  19. package/lib/assets/lottie/lucy-mark-connect.json +2552 -0
  20. package/lib/assets/lottie/lucy-mark-details.json +1735 -0
  21. package/lib/assets/lottie/lucy-mark-email.json +1363 -0
  22. package/lib/assets/lottie/lucy-mark-message.json +1154 -0
  23. package/lib/assets/lottie/lucy-mark-search.json +1067 -0
  24. package/lib/assets/lottie/lucy-mark-think.json +1253 -0
  25. package/lib/assets/lottie/lucy-mark-write.json +1532 -0
  26. package/lib/assets/lottie/time-back.json +16458 -0
  27. package/lib/assets/lottie/where-lucy-works-chat.json +6170 -0
  28. package/lib/assets/lottie/where-lucy-works-cloud.json +10066 -0
  29. package/lib/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  30. package/lib/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  31. package/lib/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  32. package/lib/assets/sounds/hours-back.m4a +0 -0
  33. package/lib/assets/sounds/meet-lucy.m4a +0 -0
  34. package/lib/assets/sounds/power-on.m4a +0 -0
  35. package/lib/assets/sounds/wind-back.m4a +0 -0
  36. package/lib/assets/sounds/youre-in.m4a +0 -0
  37. package/lib/chat/agent.js +358 -0
  38. package/lib/chat/agent.js.map +1 -0
  39. package/lib/chat/appFront.js +32 -0
  40. package/lib/chat/appFront.js.map +1 -0
  41. package/lib/chat/auth.js +370 -0
  42. package/lib/chat/auth.js.map +1 -0
  43. package/lib/chat/chores.js +360 -0
  44. package/lib/chat/chores.js.map +1 -0
  45. package/lib/chat/connectors.js +45 -0
  46. package/lib/chat/connectors.js.map +1 -0
  47. package/lib/chat/jobs.js +223 -0
  48. package/lib/chat/jobs.js.map +1 -0
  49. package/lib/chat/lucyMotion.js +6 -0
  50. package/lib/chat/lucyMotion.js.map +1 -0
  51. package/lib/chat/protocol.js +111 -0
  52. package/lib/chat/protocol.js.map +1 -0
  53. package/lib/chat/results.js +133 -0
  54. package/lib/chat/results.js.map +1 -0
  55. package/lib/chat/store.js +81 -0
  56. package/lib/chat/store.js.map +1 -0
  57. package/lib/chat/useDictation.js +168 -0
  58. package/lib/chat/useDictation.js.map +1 -0
  59. package/lib/chat/useLucyChat.js +451 -0
  60. package/lib/chat/useLucyChat.js.map +1 -0
  61. package/lib/chat/useMyComputer.js +32 -0
  62. package/lib/chat/useMyComputer.js.map +1 -0
  63. package/lib/chat/whereLucyWorks.js +52 -0
  64. package/lib/chat/whereLucyWorks.js.map +1 -0
  65. package/lib/chat/workspace.js +124 -0
  66. package/lib/chat/workspace.js.map +1 -0
  67. package/lib/components/AreaShot.js +289 -0
  68. package/lib/components/AreaShot.js.map +1 -0
  69. package/lib/components/Backdrops.js +262 -0
  70. package/lib/components/Backdrops.js.map +1 -0
  71. package/lib/components/BottomSheet.js +61 -0
  72. package/lib/components/BottomSheet.js.map +1 -0
  73. package/lib/components/ChatSheets.js +429 -0
  74. package/lib/components/ChatSheets.js.map +1 -0
  75. package/lib/components/ConnectorLogo.js +91 -0
  76. package/lib/components/ConnectorLogo.js.map +1 -0
  77. package/lib/components/CustomDrawer.js +534 -0
  78. package/lib/components/CustomDrawer.js.map +1 -0
  79. package/lib/components/IdeasPane.js +394 -0
  80. package/lib/components/IdeasPane.js.map +1 -0
  81. package/lib/components/ImessageSheet.js +261 -0
  82. package/lib/components/ImessageSheet.js.map +1 -0
  83. package/lib/components/KeyboardAvoider.js +29 -0
  84. package/lib/components/KeyboardAvoider.js.map +1 -0
  85. package/lib/components/Logo.js +81 -0
  86. package/lib/components/Logo.js.map +1 -0
  87. package/lib/components/LucyWorking.js +67 -0
  88. package/lib/components/LucyWorking.js.map +1 -0
  89. package/lib/components/Markdown.js +260 -0
  90. package/lib/components/Markdown.js.map +1 -0
  91. package/lib/components/Media.js +93 -0
  92. package/lib/components/Media.js.map +1 -0
  93. package/lib/components/MessagesAppIcon.js +23 -0
  94. package/lib/components/MessagesAppIcon.js.map +1 -0
  95. package/lib/components/MicButton.js +71 -0
  96. package/lib/components/MicButton.js.map +1 -0
  97. package/lib/components/ResultCards.js +974 -0
  98. package/lib/components/ResultCards.js.map +1 -0
  99. package/lib/components/SignInPrompt.js +148 -0
  100. package/lib/components/SignInPrompt.js.map +1 -0
  101. package/lib/components/SignedOut.js +38 -0
  102. package/lib/components/SignedOut.js.map +1 -0
  103. package/lib/components/TalkToLucyHero.js +487 -0
  104. package/lib/components/TalkToLucyHero.js.map +1 -0
  105. package/lib/components/TalkToLucySheet.js +182 -0
  106. package/lib/components/TalkToLucySheet.js.map +1 -0
  107. package/lib/components/WhereLucyWorks.js +277 -0
  108. package/lib/components/WhereLucyWorks.js.map +1 -0
  109. package/lib/components/WorkspaceSection.js +271 -0
  110. package/lib/components/WorkspaceSection.js.map +1 -0
  111. package/lib/components/YantraMark.js +13 -0
  112. package/lib/components/YantraMark.js.map +1 -0
  113. package/lib/components/drawerHeader.js +38 -0
  114. package/lib/components/drawerHeader.js.map +1 -0
  115. package/lib/components/lottieInstalled.js +6 -0
  116. package/lib/components/lottieInstalled.js.map +1 -0
  117. package/lib/components/ui.js +550 -0
  118. package/lib/components/ui.js.map +1 -0
  119. package/lib/components/useSignOut.js +7 -0
  120. package/lib/components/useSignOut.js.map +1 -0
  121. package/lib/components/viewport.js +121 -0
  122. package/lib/components/viewport.js.map +1 -0
  123. package/lib/components/voiceDial.js +10 -0
  124. package/lib/components/voiceDial.js.map +1 -0
  125. package/lib/compute.js +157 -0
  126. package/lib/compute.js.map +1 -0
  127. package/lib/config/env-config.js +27 -0
  128. package/lib/config/env-config.js.map +1 -0
  129. package/lib/config/routes.js +15 -0
  130. package/lib/config/routes.js.map +1 -0
  131. package/lib/content.js +25 -0
  132. package/lib/content.js.map +1 -0
  133. package/lib/hooks/keyboardCover.js +39 -0
  134. package/lib/hooks/keyboardCover.js.map +1 -0
  135. package/lib/hooks/useKeyboard.js +121 -0
  136. package/lib/hooks/useKeyboard.js.map +1 -0
  137. package/lib/hooks/useReducedMotion.js +13 -0
  138. package/lib/hooks/useReducedMotion.js.map +1 -0
  139. package/lib/imessage/openMessages.js +25 -0
  140. package/lib/imessage/openMessages.js.map +1 -0
  141. package/lib/imessage/platform.js +12 -0
  142. package/lib/imessage/platform.js.map +1 -0
  143. package/lib/imessage/textLink.js +262 -0
  144. package/lib/imessage/textLink.js.map +1 -0
  145. package/lib/index.js +1 -0
  146. package/lib/index.js.map +1 -0
  147. package/lib/live/card.js +28 -0
  148. package/lib/live/card.js.map +1 -0
  149. package/lib/live/liveActivity.js +144 -0
  150. package/lib/live/liveActivity.js.map +1 -0
  151. package/lib/module.js +3 -0
  152. package/lib/module.js.map +1 -0
  153. package/lib/offer/BlackFridayOffer.js +378 -0
  154. package/lib/offer/BlackFridayOffer.js.map +1 -0
  155. package/lib/offer/blackFriday.js +78 -0
  156. package/lib/offer/blackFriday.js.map +1 -0
  157. package/lib/offer/parts.js +624 -0
  158. package/lib/offer/parts.js.map +1 -0
  159. package/lib/offer/state.js +63 -0
  160. package/lib/offer/state.js.map +1 -0
  161. package/lib/push/push.js +142 -0
  162. package/lib/push/push.js.map +1 -0
  163. package/lib/push/usePushNotifications.js +39 -0
  164. package/lib/push/usePushNotifications.js.map +1 -0
  165. package/lib/routes.json +175 -0
  166. package/lib/screens/Account/index.js +209 -0
  167. package/lib/screens/Account/index.js.map +1 -0
  168. package/lib/screens/Chat/index.js +710 -0
  169. package/lib/screens/Chat/index.js.map +1 -0
  170. package/lib/screens/Chores/index.js +18 -0
  171. package/lib/screens/Chores/index.js.map +1 -0
  172. package/lib/screens/Connectors/index.js +17 -0
  173. package/lib/screens/Connectors/index.js.map +1 -0
  174. package/lib/screens/History/index.js +380 -0
  175. package/lib/screens/History/index.js.map +1 -0
  176. package/lib/screens/Home/index.js +2715 -0
  177. package/lib/screens/Home/index.js.map +1 -0
  178. package/lib/screens/Home/media.js +25 -0
  179. package/lib/screens/Home/media.js.map +1 -0
  180. package/lib/screens/Welcome/index.js +1066 -0
  181. package/lib/screens/Welcome/index.js.map +1 -0
  182. package/lib/talk/talkToLucy.js +139 -0
  183. package/lib/talk/talkToLucy.js.map +1 -0
  184. package/lib/theme/colors.js +29 -0
  185. package/lib/theme/colors.js.map +1 -0
  186. package/lib/theme/fonts.js +17 -0
  187. package/lib/theme/fonts.js.map +1 -0
  188. package/lib/theme/muse.js +134 -0
  189. package/lib/theme/muse.js.map +1 -0
  190. package/lib/utils/links.js +54 -0
  191. package/lib/utils/links.js.map +1 -0
  192. package/lib/utils/yantraLinks.js +68 -0
  193. package/lib/utils/yantraLinks.js.map +1 -0
  194. package/lib/welcome/flow.js +375 -0
  195. package/lib/welcome/flow.js.map +1 -0
  196. package/lib/welcome/haptics.js +125 -0
  197. package/lib/welcome/haptics.js.map +1 -0
  198. package/lib/welcome/parts.js +1996 -0
  199. package/lib/welcome/parts.js.map +1 -0
  200. package/lib/welcome/powerOn.js +29 -0
  201. package/lib/welcome/powerOn.js.map +1 -0
  202. package/lib/welcome/seen.js +41 -0
  203. package/lib/welcome/seen.js.map +1 -0
  204. package/lib/welcome/sound.js +110 -0
  205. package/lib/welcome/sound.js.map +1 -0
  206. package/package.json +66 -5
  207. package/rollup.config.mjs +42 -0
  208. package/src/.claude-flow/data/pending-insights.jsonl +19 -0
  209. package/src/.claude-flow/sessions/session-1795013028422.json +14 -0
  210. package/src/__tests__/auth.test.ts +94 -0
  211. package/src/__tests__/blackFriday.test.ts +75 -0
  212. package/src/__tests__/cardTokens.test.ts +77 -0
  213. package/src/__tests__/chores.test.ts +188 -0
  214. package/src/__tests__/choresList.test.ts +100 -0
  215. package/src/__tests__/connectLink.test.ts +21 -0
  216. package/src/__tests__/content.test.ts +54 -0
  217. package/src/__tests__/dictation.test.ts +186 -0
  218. package/src/__tests__/envConfig.test.ts +14 -0
  219. package/src/__tests__/haptics.test.ts +202 -0
  220. package/src/__tests__/jobs.test.ts +130 -0
  221. package/src/__tests__/keyboardCover.test.ts +84 -0
  222. package/src/__tests__/liveCard.test.ts +39 -0
  223. package/src/__tests__/lockedPhone.test.ts +355 -0
  224. package/src/__tests__/lucyMotion.test.ts +34 -0
  225. package/src/__tests__/platform.test.ts +32 -0
  226. package/src/__tests__/powerOn.test.ts +62 -0
  227. package/src/__tests__/protocol.test.ts +125 -0
  228. package/src/__tests__/push.test.ts +111 -0
  229. package/src/__tests__/results.test.ts +256 -0
  230. package/src/__tests__/sound.test.ts +248 -0
  231. package/src/__tests__/talkToLucy.test.ts +205 -0
  232. package/src/__tests__/textLink.test.ts +91 -0
  233. package/src/__tests__/voiceDial.test.ts +53 -0
  234. package/src/__tests__/welcomeFlow.test.ts +157 -0
  235. package/src/__tests__/whereLucyWorks.test.ts +81 -0
  236. package/src/__tests__/yantraLinks.test.ts +96 -0
  237. package/src/assets/home/loop-day.jpg +0 -0
  238. package/src/assets/home/loop-day.mp4 +0 -0
  239. package/src/assets/home/loop-time-back.jpg +0 -0
  240. package/src/assets/home/loop-time-back.mp4 +0 -0
  241. package/src/assets/home/loop-where.jpg +0 -0
  242. package/src/assets/home/loop-where.mp4 +0 -0
  243. package/src/assets/home/reel-gym.jpg +0 -0
  244. package/src/assets/home/reel-gym.mp4 +0 -0
  245. package/src/assets/home/reel-internet.jpg +0 -0
  246. package/src/assets/home/reel-internet.mp4 +0 -0
  247. package/src/assets/icon.png +0 -0
  248. package/src/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  249. package/src/assets/lottie/lucy-mark-calendar.json +1827 -0
  250. package/src/assets/lottie/lucy-mark-call.json +1470 -0
  251. package/src/assets/lottie/lucy-mark-connect.json +2552 -0
  252. package/src/assets/lottie/lucy-mark-details.json +1735 -0
  253. package/src/assets/lottie/lucy-mark-email.json +1363 -0
  254. package/src/assets/lottie/lucy-mark-message.json +1154 -0
  255. package/src/assets/lottie/lucy-mark-search.json +1067 -0
  256. package/src/assets/lottie/lucy-mark-think.json +1253 -0
  257. package/src/assets/lottie/lucy-mark-write.json +1532 -0
  258. package/src/assets/lottie/time-back.json +16458 -0
  259. package/src/assets/lottie/where-lucy-works-chat.json +6170 -0
  260. package/src/assets/lottie/where-lucy-works-cloud.json +10066 -0
  261. package/src/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  262. package/src/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  263. package/src/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  264. package/src/assets/sounds/hours-back.m4a +0 -0
  265. package/src/assets/sounds/meet-lucy.m4a +0 -0
  266. package/src/assets/sounds/power-on.m4a +0 -0
  267. package/src/assets/sounds/wind-back.m4a +0 -0
  268. package/src/assets/sounds/youre-in.m4a +0 -0
  269. package/src/chat/.claude-flow/data/pending-insights.jsonl +1 -0
  270. package/src/chat/agent.ts +376 -0
  271. package/src/chat/appFront.ts +39 -0
  272. package/src/chat/auth.ts +433 -0
  273. package/src/chat/chores.ts +394 -0
  274. package/src/chat/connectors.ts +75 -0
  275. package/src/chat/jobs.ts +228 -0
  276. package/src/chat/lucyMotion.ts +33 -0
  277. package/src/chat/protocol.ts +192 -0
  278. package/src/chat/results.ts +224 -0
  279. package/src/chat/store.ts +87 -0
  280. package/src/chat/useDictation.ts +201 -0
  281. package/src/chat/useLucyChat.ts +458 -0
  282. package/src/chat/useMyComputer.ts +41 -0
  283. package/src/chat/whereLucyWorks.ts +97 -0
  284. package/src/chat/workspace.ts +127 -0
  285. package/src/components/.claude-flow/data/pending-insights.jsonl +3 -0
  286. package/src/components/AreaShot.tsx +239 -0
  287. package/src/components/Backdrops.tsx +323 -0
  288. package/src/components/BottomSheet.tsx +96 -0
  289. package/src/components/ChatSheets.tsx +565 -0
  290. package/src/components/ConnectorLogo.tsx +116 -0
  291. package/src/components/CustomDrawer.tsx +526 -0
  292. package/src/components/IdeasPane.tsx +318 -0
  293. package/src/components/ImessageSheet.tsx +280 -0
  294. package/src/components/KeyboardAvoider.tsx +45 -0
  295. package/src/components/Logo.tsx +97 -0
  296. package/src/components/LucyWorking.tsx +122 -0
  297. package/src/components/Markdown.tsx +219 -0
  298. package/src/components/Media.tsx +173 -0
  299. package/src/components/MessagesAppIcon.tsx +51 -0
  300. package/src/components/MicButton.tsx +92 -0
  301. package/src/components/ResultCards.tsx +1067 -0
  302. package/src/components/SignInPrompt.tsx +182 -0
  303. package/src/components/SignedOut.tsx +47 -0
  304. package/src/components/TalkToLucyHero.tsx +540 -0
  305. package/src/components/TalkToLucySheet.tsx +208 -0
  306. package/src/components/VoiceOrb.tsx +364 -0
  307. package/src/components/WhereLucyWorks.tsx +261 -0
  308. package/src/components/WorkspaceSection.tsx +307 -0
  309. package/src/components/YantraMark.tsx +30 -0
  310. package/src/components/drawerHeader.tsx +46 -0
  311. package/src/components/kit.tsx +309 -0
  312. package/src/components/lottieInstalled.ts +7 -0
  313. package/src/components/ui.tsx +700 -0
  314. package/src/components/useSignOut.ts +21 -0
  315. package/src/components/viewport.tsx +166 -0
  316. package/src/components/voiceDial.ts +45 -0
  317. package/src/compute.ts +168 -0
  318. package/src/config/env-config.ts +50 -0
  319. package/src/config/routes.ts +28 -0
  320. package/src/content.ts +217 -0
  321. package/src/hooks/keyboardCover.ts +70 -0
  322. package/src/hooks/useKeyboard.ts +135 -0
  323. package/src/hooks/useReducedMotion.ts +19 -0
  324. package/src/imessage/openMessages.ts +53 -0
  325. package/src/imessage/platform.ts +32 -0
  326. package/src/imessage/textLink.ts +307 -0
  327. package/src/index.ts +24 -0
  328. package/src/live/card.ts +62 -0
  329. package/src/live/liveActivity.ts +192 -0
  330. package/src/module.ts +8 -0
  331. package/src/offer/BlackFridayOffer.tsx +394 -0
  332. package/src/offer/blackFriday.ts +109 -0
  333. package/src/offer/parts.tsx +650 -0
  334. package/src/offer/state.ts +78 -0
  335. package/src/push/push.ts +171 -0
  336. package/src/push/usePushNotifications.ts +47 -0
  337. package/src/screens/Account/index.tsx +310 -0
  338. package/src/screens/Chat/.claude-flow/data/pending-insights.jsonl +4 -0
  339. package/src/screens/Chat/index.tsx +891 -0
  340. package/src/screens/Chores/index.tsx +35 -0
  341. package/src/screens/Connectors/index.tsx +35 -0
  342. package/src/screens/History/index.tsx +346 -0
  343. package/src/screens/Home/index.tsx +2776 -0
  344. package/src/screens/Home/media.ts +31 -0
  345. package/src/screens/Welcome/index.tsx +1182 -0
  346. package/src/talk/talkToLucy.ts +187 -0
  347. package/src/theme/colors.ts +38 -0
  348. package/src/theme/fonts.ts +30 -0
  349. package/src/theme/muse.ts +86 -0
  350. package/src/utils/links.ts +84 -0
  351. package/src/utils/yantraLinks.ts +94 -0
  352. package/src/welcome/flow.ts +418 -0
  353. package/src/welcome/haptics.ts +179 -0
  354. package/src/welcome/parts.tsx +2160 -0
  355. package/src/welcome/powerOn.ts +84 -0
  356. package/src/welcome/seen.ts +68 -0
  357. package/src/welcome/sound.ts +173 -0
  358. package/tools/lottie/chat.motion +0 -0
  359. package/tools/lottie/cloud.motion +0 -0
  360. package/tools/lottie/generate.mjs +1209 -0
  361. package/tools/lottie/inter-glyphs.json +4416 -0
  362. package/tools/lottie/lucy-mark-calendar.motion +0 -0
  363. package/tools/lottie/lucy-mark-call.motion +0 -0
  364. package/tools/lottie/lucy-mark-connect.motion +0 -0
  365. package/tools/lottie/lucy-mark-details.motion +0 -0
  366. package/tools/lottie/lucy-mark-email.motion +0 -0
  367. package/tools/lottie/lucy-mark-message.motion +0 -0
  368. package/tools/lottie/lucy-mark-search.motion +0 -0
  369. package/tools/lottie/lucy-mark-think.motion +0 -0
  370. package/tools/lottie/lucy-mark-write.motion +0 -0
  371. package/tools/lottie/mark.json +1 -0
  372. package/tools/lottie/mine-none.motion +0 -0
  373. package/tools/lottie/mine-offline.motion +0 -0
  374. package/tools/lottie/mine-online.motion +0 -0
  375. package/tools/lottie/time-back.mjs +604 -0
  376. package/tools/sounds/render.mjs +730 -0
  377. package/tsconfig.json +17 -0
  378. package/README.md +0 -3
@@ -0,0 +1,187 @@
1
+ /**
2
+ * Talk to Lucy: Clockbook's own control (iOS 18) for the Action Button, Control Center and the Lock Screen
3
+ * (portable-devices/mobile/targets/lucy-live/TalkToLucyControl.swift). Pressing it opens Clockbook with Home's big mic
4
+ * already listening. Its intent runs inside the app and leaves the press there; modules/lucy-live-activity hands the
5
+ * press to this file (`takeTalkRequest`, `onTalkRequest`).
6
+ *
7
+ * Account's "Lucy on your Action Button" sheet (components/TalkToLucySheet.tsx) says where to find the control. The row
8
+ * shows only where the control exists: an iPhone on iOS 18 or later, in a build that has it. Without the module
9
+ * (Android, Expo Go, a build from before it) nothing here does anything.
10
+ */
11
+ import { AppState, Platform } from 'react-native';
12
+ import { requireOptionalNativeModule } from 'expo-modules-core';
13
+
14
+ interface TalkModule {
15
+ hasTalkToLucy?: () => boolean;
16
+ /** When Talk to Lucy last opened the app (Unix seconds), or 0. Reading it clears it. */
17
+ takeTalkRequest?: () => number;
18
+ addListener?: (event: 'onTalkRequest', listener: () => void) => { remove(): void };
19
+ }
20
+
21
+ const native = Platform.OS === 'ios' ? requireOptionalNativeModule<TalkModule>('LucyLiveActivity') : null;
22
+
23
+ /** The control's name, as the Action Button's and Control Center's pickers show it. */
24
+ export const TALK_TO_LUCY = 'Talk to Lucy';
25
+
26
+ /** Where this iPhone puts Talk to Lucy: the Action Button, or Control Center on an iPhone without one. */
27
+ export type TalkPlace = 'action-button' | 'control-center';
28
+
29
+ export interface TalkStep {
30
+ title: string;
31
+ body?: string;
32
+ /** A way through Settings, drawn as chips. */
33
+ path?: string[];
34
+ }
35
+
36
+ export interface TalkCopy {
37
+ /** Account's row. */
38
+ row: string;
39
+ rowDetail: string;
40
+ /** What the sheet's picture says to do, beside the phone. */
41
+ cue: string;
42
+ title: string;
43
+ lede: string;
44
+ steps: TalkStep[];
45
+ foot: string;
46
+ }
47
+
48
+ /** The sheet's words, as designed on the canvas (VoiceShortcut.dc.html). */
49
+ export const TALK_COPY: Record<TalkPlace, TalkCopy> = {
50
+ 'action-button': {
51
+ row: 'Lucy on your Action Button',
52
+ rowDetail: 'Hold it and Clockbook opens listening',
53
+ cue: 'Hold',
54
+ title: 'Put Lucy on your Action Button',
55
+ lede: 'Hold it from any app and Clockbook opens, already listening. Say what you need and Lucy takes it from there.',
56
+ steps: [
57
+ { title: 'Open Action Button settings', path: ['Settings', 'Action Button'] },
58
+ {
59
+ title: `Choose ${TALK_TO_LUCY}`,
60
+ body: 'Swipe to Controls, tap Choose a Control, then search for “Lucy”.',
61
+ },
62
+ {
63
+ title: 'Hold it and talk',
64
+ body: 'Clockbook opens listening. Send it, and Lucy’s chore shows in the Dynamic Island while you carry on.',
65
+ },
66
+ ],
67
+ foot: `${TALK_TO_LUCY} can go in Control Center and on your Lock Screen too.`,
68
+ },
69
+ 'control-center': {
70
+ row: 'Lucy in Control Center',
71
+ rowDetail: 'One tap and Clockbook opens listening',
72
+ cue: 'Tap',
73
+ title: 'Put Lucy in Control Center',
74
+ lede: 'One tap from any app and Clockbook opens, already listening. Say what you need and Lucy takes it from there.',
75
+ steps: [
76
+ { title: 'Open Control Center', body: 'Swipe down from the top-right corner of the screen.' },
77
+ { title: `Add ${TALK_TO_LUCY}`, body: 'Tap +, then Add a Control, and search for “Lucy”.' },
78
+ {
79
+ title: 'Tap it and talk',
80
+ body: 'Clockbook opens listening. Send it, and Lucy keeps going while you carry on.',
81
+ },
82
+ ],
83
+ foot: `You can put ${TALK_TO_LUCY} on your Lock Screen too, in place of the flashlight or camera.`,
84
+ },
85
+ };
86
+
87
+ const IPHONE = /^iPhone(\d+),\d+$/;
88
+
89
+ /** iPhones on iOS 18 with a Home button: the SE (2nd and 3rd generation), where Control Center is a swipe up. */
90
+ const HOME_BUTTON_IPHONES = new Set(['iPhone12,8', 'iPhone14,6']);
91
+
92
+ /**
93
+ * iPhones with an Action Button: the 15 Pro and 15 Pro Max (iPhone16,1 and iPhone16,2) and every iPhone after them,
94
+ * the 16e included. The 15 and 15 Plus are iPhone15,4 and iPhone15,5.
95
+ */
96
+ export function hasActionButton(modelId: string | null | undefined): boolean {
97
+ const m = IPHONE.exec(String(modelId ?? '').trim());
98
+ return Boolean(m && Number(m[1]) >= 16);
99
+ }
100
+
101
+ /** The Action Button when the iPhone has one, Control Center when it hasn't; a model it can't read gets the Action Button. */
102
+ export function talkPlace(modelId: string | null | undefined): TalkPlace {
103
+ const known = IPHONE.test(String(modelId ?? '').trim());
104
+ return known && !hasActionButton(modelId) ? 'control-center' : 'action-button';
105
+ }
106
+
107
+ /** The sheet's words for this iPhone: on an SE, Control Center is a swipe up from the bottom. */
108
+ export function talkCopy(place: TalkPlace, modelId?: string | null): TalkCopy {
109
+ const copy = TALK_COPY[place];
110
+ if (place !== 'control-center' || !HOME_BUTTON_IPHONES.has(String(modelId ?? '').trim())) return copy;
111
+ return {
112
+ ...copy,
113
+ steps: copy.steps.map((step, i) =>
114
+ i === 0 ? { ...step, body: 'Swipe up from the bottom edge of the screen.' } : step,
115
+ ),
116
+ };
117
+ }
118
+
119
+ /** This phone's model, "iPhone16,1", from expo-device; null when the build hasn't the module. */
120
+ export function phoneModel(): string | null {
121
+ try {
122
+ // Read when asked, as push/push.ts does: a build without expo-device's native module throws on import.
123
+ // eslint-disable-next-line global-require, @typescript-eslint/no-require-imports
124
+ return (require('expo-device') as { modelId?: string | null }).modelId ?? null;
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+
130
+ /** Whether Account shows Talk to Lucy: an iPhone, not an iPad, on iOS 18 or later, in a build that has the control. */
131
+ export function talkToLucyAvailable(): boolean {
132
+ if (Platform.OS !== 'ios' || (Platform as { isPad?: boolean }).isPad) return false;
133
+ try {
134
+ return Boolean(native?.hasTalkToLucy?.());
135
+ } catch {
136
+ return false;
137
+ }
138
+ }
139
+
140
+ /**
141
+ * How long a press still counts: long enough for a cold start (or the first-launch welcome) to load, short enough that a
142
+ * later launch never starts listening out of nowhere.
143
+ */
144
+ export const TALK_REQUEST_TTL_MS = 60_000;
145
+
146
+ /** Whether a press at `atMs` still counts at `now`, with a little slack for a clock that moved back. */
147
+ export function freshTalkRequest(atMs: number, now: number = Date.now(), ttl: number = TALK_REQUEST_TTL_MS): boolean {
148
+ if (!Number.isFinite(atMs) || atMs <= 0) return false;
149
+ const age = now - atMs;
150
+ return age >= -5_000 && age <= ttl;
151
+ }
152
+
153
+ /** True once for each press of Talk to Lucy that still counts: taking it clears it. */
154
+ export function takeTalkRequest(now: number = Date.now()): boolean {
155
+ let seconds = 0;
156
+ try {
157
+ seconds = Number(native?.takeTalkRequest?.() ?? 0);
158
+ } catch {
159
+ seconds = 0;
160
+ }
161
+ return freshTalkRequest(seconds * 1000, now);
162
+ }
163
+
164
+ /**
165
+ * Calls `onTalk` once for each press of Talk to Lucy: a press waiting from a cold start, one made while the app was
166
+ * away, and one while it is open. Returns the unsubscribe.
167
+ */
168
+ export function watchTalkRequests(onTalk: () => void): () => void {
169
+ if (!native?.takeTalkRequest) return () => undefined;
170
+ const check = () => {
171
+ if (takeTalkRequest()) onTalk();
172
+ };
173
+ check();
174
+ const app = AppState.addEventListener('change', (state) => {
175
+ if (state === 'active') check();
176
+ });
177
+ const press = native.addListener?.('onTalkRequest', check);
178
+ return () => {
179
+ app.remove();
180
+ press?.remove();
181
+ };
182
+ }
183
+
184
+ /** Home's params that bring it to the top with the big mic listening (screens/Home `listen`). */
185
+ export function listeningHome(now: number = Date.now()): { at: number; listen: number } {
186
+ return { at: now, listen: now };
187
+ }
@@ -0,0 +1,38 @@
1
+ import { Platform } from 'react-native';
2
+
3
+ /** The web home's palette (the web Clockbook home's --cbh-* tokens). */
4
+ export const colors = {
5
+ orange: '#FF5A00',
6
+ orangeText: '#B84100',
7
+ orangeSoft: '#FFE9DB',
8
+ ink: '#1C1A18',
9
+ ink2: '#4A4540',
10
+ muted: '#6F675F',
11
+ bg: '#FFF8F2',
12
+ soft: '#FFF1E6',
13
+ card: '#FFFFFF',
14
+ line: '#F1E4D8',
15
+ statValue: '#FFB58A',
16
+ statLabel: '#D9CFC6',
17
+ track: 'rgba(90,45,10,0.06)',
18
+ media: '#E9E2DA',
19
+ } as const;
20
+
21
+ /** --cbh-shadow, as a native shadow. */
22
+ /**
23
+ * --cbh-shadow, as a native shadow. iOS draws it soft and tinted; Android only has elevation, which at 4 reads as a
24
+ * heavy grey slab, so there it is a low elevation tinted warm.
25
+ */
26
+ export const cardShadow = (
27
+ Platform.OS === 'android'
28
+ ? { elevation: 2, shadowColor: '#7A4A20' }
29
+ : { shadowColor: '#5A2D0A', shadowOpacity: 0.16, shadowRadius: 24, shadowOffset: { width: 0, height: 14 } }
30
+ ) as {
31
+ shadowColor: string;
32
+ shadowOpacity?: number;
33
+ shadowRadius?: number;
34
+ shadowOffset?: { width: number; height: number };
35
+ elevation?: number;
36
+ };
37
+
38
+ export const RADIUS = 22;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The web home's type (clock-tik-browser pages/Home/homeStyles.tsx): Instrument Serif for display headings, its italic
3
+ * for the orange emphasis, and Geist for everything else. Bundled through @expo-google-fonts, so loading is local.
4
+ */
5
+ import { useFonts } from 'expo-font';
6
+ import { Geist_400Regular, Geist_500Medium, Geist_600SemiBold, Geist_700Bold } from '@expo-google-fonts/geist';
7
+ import { InstrumentSerif_400Regular, InstrumentSerif_400Regular_Italic } from '@expo-google-fonts/instrument-serif';
8
+
9
+ export const fonts = {
10
+ serif: 'InstrumentSerif_400Regular',
11
+ serifItalic: 'InstrumentSerif_400Regular_Italic',
12
+ sans: 'Geist_400Regular',
13
+ sansMedium: 'Geist_500Medium',
14
+ sansSemi: 'Geist_600SemiBold',
15
+ sansBold: 'Geist_700Bold',
16
+ } as const;
17
+
18
+ /** True once the fonts can be used; a font named before then falls back to the system font with a warning. */
19
+ export function useClockbookFonts(): boolean {
20
+ const [loaded, error] = useFonts({
21
+ InstrumentSerif_400Regular,
22
+ InstrumentSerif_400Regular_Italic,
23
+ Geist_400Regular,
24
+ Geist_500Medium,
25
+ Geist_600SemiBold,
26
+ Geist_700Bold,
27
+ });
28
+ // A font that fails to load should not keep the screen blank: render with the system fonts instead.
29
+ return loaded || Boolean(error);
30
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The app's look, after Meta's Muse (calm, system type, plain lists, a floating composer) in the web Clockbook home's
3
+ * warm colours: Clockbook orange is the one accent, Lucy's clock is the avatar. Every screen reads its colours, type
4
+ * and elevation from here, so the screens stay one family.
5
+ */
6
+ import { Platform, type TextStyle, type ViewStyle } from 'react-native';
7
+
8
+ /**
9
+ * Colours are clockbook.com's (clock-tik-browser pages/Home/homeStyles.tsx, its --cbh-* tokens): a warm cream page,
10
+ * white cards, warm-tinted inks and lines, Clockbook orange as the one accent. Layers in between are the web's warm
11
+ * brown laid over the cream.
12
+ */
13
+ export const ui = {
14
+ /** The page: --cbh-bg, a warm cream. */
15
+ bg: '#FFFAF5',
16
+ /** The shaded sections' band (--cbh-soft; the web runs it down to #fff7f1). */
17
+ soft: '#FFF3EA',
18
+ /** Raised things on the page: groups, cards, the composer, the tab bar, floating buttons (--cbh-card). */
19
+ surface: '#FFFFFF',
20
+ /** A second warm layer (search fields, pressed rows, secondary buttons, segmented controls): 6% brown on cream. */
21
+ fill: '#F5EEE7',
22
+ /** Lucy's bubbles: a touch deeper than fill so they read on the cream page. */
23
+ bubbleLucy: '#F3EAE1',
24
+ /** Your bubbles: --cbh-orange-soft. */
25
+ bubbleYou: '#FFE9DC',
26
+
27
+ ink: '#1A1714',
28
+ ink2: '#45403A',
29
+ muted: '#6F675F',
30
+ faint: '#9A9088',
31
+ hairline: 'rgba(26,23,20,0.08)',
32
+
33
+ accent: '#FF5A00',
34
+ accentPressed: '#E04F00',
35
+ accentText: '#B84100',
36
+ accentSoft: '#FFE9DC',
37
+ ok: '#1F8A5B',
38
+ okSoft: '#E2F3E9',
39
+ danger: '#B4381A',
40
+ dangerSoft: '#FBE6E0',
41
+ } as const;
42
+
43
+ /**
44
+ * The system font throughout (SF Pro on iOS, Roboto on Android), compact as Muse's: semibold titles rather than heavy
45
+ * bold, 15.5pt body, smaller grey secondary text.
46
+ */
47
+ export const type = {
48
+ largeTitle: { fontSize: 26, lineHeight: 32, fontWeight: '600', letterSpacing: -0.5, color: ui.ink },
49
+ title: { fontSize: 21, lineHeight: 27, fontWeight: '600', letterSpacing: -0.3, color: ui.ink },
50
+ headline: { fontSize: 15.5, lineHeight: 21, fontWeight: '600', letterSpacing: -0.1, color: ui.ink },
51
+ body: { fontSize: 15.5, lineHeight: 21, fontWeight: '400', color: ui.ink },
52
+ callout: { fontSize: 14.5, lineHeight: 20, fontWeight: '400', color: ui.ink2 },
53
+ subhead: { fontSize: 13.5, lineHeight: 19, fontWeight: '400', color: ui.muted },
54
+ footnote: { fontSize: 12.5, lineHeight: 17, fontWeight: '400', color: ui.muted },
55
+ caption: { fontSize: 11.5, lineHeight: 15, fontWeight: '500', color: ui.muted },
56
+ groupLabel: { fontSize: 13, lineHeight: 18, fontWeight: '500', color: ui.muted },
57
+ } satisfies Record<string, TextStyle>;
58
+
59
+ export const radius = { bubble: 20, card: 18, group: 16, button: 14, pill: 999 } as const;
60
+
61
+ /** A floating thing's shadow: soft on iOS; on Android a low elevation, warm-tinted (high elevation reads as a grey slab). */
62
+ export const float: ViewStyle = Platform.select<ViewStyle>({
63
+ ios: { shadowColor: '#2B1A0C', shadowOpacity: 0.08, shadowRadius: 14, shadowOffset: { width: 0, height: 4 } },
64
+ default: { elevation: 3, shadowColor: '#7A4A20' },
65
+ });
66
+
67
+ /** A card in the thread or on the page: barely lifted. */
68
+ export const lift: ViewStyle = Platform.select<ViewStyle>({
69
+ ios: { shadowColor: '#2B1A0C', shadowOpacity: 0.05, shadowRadius: 10, shadowOffset: { width: 0, height: 2 } },
70
+ default: { elevation: 1, shadowColor: '#7A4A20' },
71
+ });
72
+
73
+ export const PAD = 16;
74
+
75
+ /**
76
+ * A text field the same on both platforms: Android's EditText adds its own side padding and font padding, which
77
+ * pushed the typed text off the placeholder and the ghost text. Multiline fields start at the top on both.
78
+ */
79
+ export const field: TextStyle = Platform.select<TextStyle>({
80
+ android: { paddingHorizontal: 0, includeFontPadding: false, textAlignVertical: 'top' },
81
+ default: {},
82
+ });
83
+ export const fieldLine: TextStyle = Platform.select<TextStyle>({
84
+ android: { paddingHorizontal: 0, includeFontPadding: false, textAlignVertical: 'center' },
85
+ default: {},
86
+ });
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Links from the home into the Clockbook app (the same links as the web Clockbook home).
3
+ * A chore opens the app's new-chat page with the chore pre-typed (`/new?q=`); the person reviews it
4
+ * and presses send - nothing is sent from here.
5
+ */
6
+ import * as WebBrowser from 'expo-web-browser';
7
+ import { Linking } from 'react-native';
8
+ import { config } from '../config/env-config';
9
+
10
+ /** The app's own cap for a pre-typed prompt; longer text is cut, never sent. */
11
+ export const PROMPT_MAX = 500;
12
+ const PRODUCTION_APP = 'https://app-v10.clockbook.com';
13
+
14
+ export function appBase(): string {
15
+ return String(config.APP_URL || PRODUCTION_APP).replace(/\/+$/, '');
16
+ }
17
+
18
+ /** The app's new-chat page with `prompt` pre-typed; an empty prompt opens it blank. */
19
+ export function chatLink(prompt: string, base: string = appBase()): string {
20
+ const url = new URL('/new', base);
21
+ const q = prompt.trim().slice(0, PROMPT_MAX).trim();
22
+ if (q) url.searchParams.set('q', q);
23
+ return url.toString();
24
+ }
25
+
26
+ /** Clockbook for business. Empty when none is configured: the home then shows no business links. */
27
+ export function businessBase(): string {
28
+ return String(config.BUSINESS_URL || '')
29
+ .trim()
30
+ .replace(/\/+$/, '');
31
+ }
32
+
33
+ /** A page of the business site: `businessLink('/pricing')`. Empty when no site is configured. */
34
+ export function businessLink(path = '', base: string = businessBase()): string {
35
+ if (!base) return '';
36
+ const clean = path.trim();
37
+ if (!clean) return base;
38
+ return `${base}${clean.startsWith('/') ? '' : '/'}${clean}`;
39
+ }
40
+
41
+ /** The Yantra app Clockbook runs on: the web home's "For business" link. */
42
+ export function yantraAppUrl(): string {
43
+ return String(config.YANTRA_APP_URL || 'https://yantra.app').replace(/\/+$/, '');
44
+ }
45
+
46
+ /**
47
+ * "Text Lucy on iMessage": the Yantra app's texting onboarding, which links the phone and opens Messages with
48
+ * "Hi Lucy" ready (the web home's fallback, clock-tik-browser pages/Home/platform.ts appTextingLink).
49
+ */
50
+ export function appTextingLink(): string {
51
+ return new URL('/onboarding', yantraAppUrl()).toString();
52
+ }
53
+
54
+ /** Opens a page in the in-app browser sheet, falling back to the system browser. */
55
+ export async function openUrl(url: string): Promise<void> {
56
+ if (!url) return;
57
+ try {
58
+ await WebBrowser.openBrowserAsync(url);
59
+ } catch {
60
+ await Linking.openURL(url).catch(() => undefined);
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Opens a page over the app as a sheet (an iOS page sheet with Done; a custom tab on Android), for a page the person
66
+ * comes back from, such as a result card's Travel or Shopping. Falls back to the system browser.
67
+ */
68
+ export async function openInSheet(url: string): Promise<void> {
69
+ if (!url) return;
70
+ try {
71
+ await WebBrowser.openBrowserAsync(url, {
72
+ presentationStyle: WebBrowser.WebBrowserPresentationStyle.PAGE_SHEET,
73
+ dismissButtonStyle: 'done',
74
+ controlsColor: '#B84100',
75
+ });
76
+ } catch {
77
+ await Linking.openURL(url).catch(() => undefined);
78
+ }
79
+ }
80
+
81
+ /** Hands a chore to Lucy: the app's chat with it pre-typed. */
82
+ export function openChore(prompt: string): Promise<void> {
83
+ return openUrl(chatLink(prompt));
84
+ }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Yantra's pages, opened signed in.
3
+ *
4
+ * Clockbook signs in with the person's Yantra account, but the browser sheet keeps its own cookies: a
5
+ * Yantra page opened there (Connect Google Calendar, the Connectors page) asked them to sign in again
6
+ * with the account they had just used here. Yantra hands the sign-in over instead: asked with the
7
+ * person's Auth0 ID token (POST <app>/resources/app-sign-in/start), it answers a one-time link (good for
8
+ * a minute) that signs the sheet in and goes on to the page. Without one (signed out here, offline, a
9
+ * Yantra that does not have it yet) the page opens as before.
10
+ *
11
+ * The ID token only ever goes to a Yantra app this build knows: the configured one, the one Lucy's agent
12
+ * names, and production's and staging's. A link to anywhere else (one in Lucy's reply, say) opens as is.
13
+ */
14
+ import { agentAppUrl, auth0Token, KNOWN_YANTRA_APPS } from '../chat/auth';
15
+ import { openInSheet, openUrl, yantraAppUrl } from './links';
16
+
17
+ export const APP_SIGN_IN_START_PATH = '/resources/app-sign-in/start';
18
+ /** The sign-in link should come back at once; past this the page opens without it. */
19
+ const START_TIMEOUT_MS = 5000;
20
+
21
+ export interface SignInDeps {
22
+ token: () => Promise<string>;
23
+ agentApp: () => Promise<string>;
24
+ fetch: typeof fetch;
25
+ }
26
+
27
+ const defaultDeps: SignInDeps = { token: auth0Token, agentApp: agentAppUrl, fetch: (...a) => fetch(...a) };
28
+
29
+ function originOf(url: string): string {
30
+ try {
31
+ return new URL(url).origin;
32
+ } catch {
33
+ return '';
34
+ }
35
+ }
36
+
37
+ /** The Yantra apps the ID token may go to. */
38
+ export async function yantraOrigins(agentApp: SignInDeps['agentApp'] = agentAppUrl): Promise<Set<string>> {
39
+ const named = await agentApp().catch(() => '');
40
+ return new Set([yantraAppUrl(), named, ...KNOWN_YANTRA_APPS].map(originOf).filter(Boolean));
41
+ }
42
+
43
+ /**
44
+ * `url` as a link that opens it signed in to the person's Yantra account, when it is a page of a Yantra
45
+ * app and Yantra gives one; else `url` itself.
46
+ */
47
+ export async function signedInYantraLink(url: string, deps: SignInDeps = defaultDeps): Promise<string> {
48
+ let target: URL;
49
+ try {
50
+ target = new URL(url);
51
+ } catch {
52
+ return url;
53
+ }
54
+ if (target.protocol !== 'https:' || !(await yantraOrigins(deps.agentApp)).has(target.origin)) return url;
55
+
56
+ let token: string;
57
+ try {
58
+ token = await deps.token();
59
+ } catch {
60
+ return url; // signed out here: Yantra's own sign-in, as before
61
+ }
62
+
63
+ const controller = new AbortController();
64
+ const timer = setTimeout(() => controller.abort(), START_TIMEOUT_MS);
65
+ try {
66
+ const res = await deps.fetch(`${target.origin}${APP_SIGN_IN_START_PATH}`, {
67
+ method: 'POST',
68
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
69
+ body: JSON.stringify({ returnTo: `${target.pathname}${target.search}${target.hash}` }),
70
+ signal: controller.signal,
71
+ });
72
+ if (!res.ok) return url;
73
+ const body = (await res.json().catch(() => null)) as { url?: unknown } | null;
74
+ const link = typeof body?.url === 'string' ? body.url : '';
75
+ // Only ever a page of the same Yantra.
76
+ return link && originOf(link) === target.origin ? link : url;
77
+ } catch {
78
+ return url;
79
+ } finally {
80
+ clearTimeout(timer);
81
+ }
82
+ }
83
+
84
+ /** Opens a page in the in-app browser sheet, signed in when it is a Yantra page (see signedInYantraLink). */
85
+ export async function openYantraUrl(url: string): Promise<void> {
86
+ if (!url) return;
87
+ return openUrl(await signedInYantraLink(url));
88
+ }
89
+
90
+ /** openInSheet, signed in when it is a Yantra page. */
91
+ export async function openYantraInSheet(url: string): Promise<void> {
92
+ if (!url) return;
93
+ return openInSheet(await signedInYantraLink(url));
94
+ }