@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 @@
1
+ {"version":3,"file":"sound.js","sources":["../../src/welcome/sound.ts"],"sourcesContent":["/**\n * The welcome's sound, the haptics' twin (haptics.ts): five tones, each on one of the picture's big moments, rendered\n * to its clock by tools/sounds/render.mjs so they land with what you see and feel.\n *\n * - `powerOn`: the first moment (powerOn.ts): the ring's ticks, the click, Lucy's thoom and her heartbeat.\n * - `windBack`: the intro's third beat, the ring lighting backwards (\"Now, wind them back.\").\n * - `meetLucy`: its last, Lucy arriving.\n * - `hoursBack`: the good news, as the hours handed back lock into place.\n * - `youreIn`: you're in.\n *\n * They behave as a phone's own interface sounds do. They play on the ambient channel, so the ring/silent switch mutes\n * them and someone's music or podcast plays on underneath (on Android it dips for a moment rather than stopping).\n * They follow the haptics: where Reduce Motion stills a moment and its haptic, it stills its sound too.\n *\n * expo-audio is loaded only when this binary has its native module (as haptics.ts does with expo-haptics), so a build\n * from before it stays silent instead of failing.\n */\nimport { Platform } from 'react-native';\nimport { requireOptionalNativeModule } from 'expo-modules-core';\n\ntype ExpoAudio = typeof import('expo-audio');\ntype Player = ReturnType<ExpoAudio['createAudioPlayer']>;\n\n/* eslint-disable global-require, @typescript-eslint/no-require-imports */\nconst FILES = {\n powerOn: require('../assets/sounds/power-on.m4a') as number,\n windBack: require('../assets/sounds/wind-back.m4a') as number,\n meetLucy: require('../assets/sounds/meet-lucy.m4a') as number,\n hoursBack: require('../assets/sounds/hours-back.m4a') as number,\n youreIn: require('../assets/sounds/youre-in.m4a') as number,\n};\n/* eslint-enable global-require, @typescript-eslint/no-require-imports */\n\nexport type Cue = keyof typeof FILES;\nexport const CUES = Object.keys(FILES) as Cue[];\n\n/**\n * The beats the files were rendered to: POWER_ON and the ring's last tick in powerOn.ts, and the intro's wind-back\n * (flow.ts, WIND_BACK). Move those and re-render the sounds; the test holds these equal to them.\n */\nexport const RENDERED_FOR = {\n powerOn: { ring: 870, click: 900, ignite: 1000, beats: [1250, 1450], sink: 1640, done: 2300 },\n windBack: { count: 14, every: 75, start: 60, lit: 1100 },\n} as const;\n\n/** Cues that are a timeline under a moving picture: started late, they join where the picture is. */\nconst TIMELINE: ReadonlySet<Cue> = new Set<Cue>(['powerOn', 'windBack']);\n/** Late by more than this, a timeline cue skips ahead to keep up. */\nexport const JOIN_AFTER_MS = 40;\n/** How long a cue waits for its file to load before it gives up. */\nexport const LOAD_MS = 1000;\n/** A stopped cue fades out over this long, so a skip doesn't click. */\nexport const FADE_MS = 60;\n\nconst quiet = () => undefined;\nconst wait = (ms: number) => new Promise<void>((done) => setTimeout(done, ms));\n\nlet loaded: ExpoAudio | null | undefined;\nfunction audio(): ExpoAudio | null {\n if (loaded !== undefined) return loaded;\n try {\n loaded = requireOptionalNativeModule('ExpoAudio')\n ? // eslint-disable-next-line global-require, @typescript-eslint/no-require-imports\n (require('expo-audio') as ExpoAudio)\n : null;\n } catch {\n loaded = null;\n }\n return loaded;\n}\n\n/**\n * The ambient channel. On iOS, not playing in silent mode and mixing with others is AVAudioSession's `.ambient`. On\n * Android it is a transient focus request others may duck under. Each platform gets only its own keys: expo-audio 0.4\n * (SDK 53) rejects 'mixWithOthers' on Android, and from SDK 54 an `interruptionMode` there overrides the Android one.\n */\nexport function ambientMode() {\n return Platform.OS === 'ios'\n ? {\n playsInSilentMode: false,\n interruptionMode: 'mixWithOthers' as const,\n allowsRecording: false,\n shouldPlayInBackground: false,\n }\n : { interruptionModeAndroid: 'duckOthers' as const, shouldPlayInBackground: false };\n}\n\nconst players = new Map<Cue, Player>();\n/** Each play of a cue, counted, so a fade from an earlier one never touches a newer one. */\nconst takes = new Map<Cue, number>();\n\nfunction player(a: ExpoAudio, cue: Cue): Player | null {\n const had = players.get(cue);\n if (had) return had;\n try {\n const made = a.createAudioPlayer(FILES[cue]);\n players.set(cue, made);\n return made;\n } catch {\n return null;\n }\n}\n\n/** Loads the welcome's sounds ahead of their moments, so each starts the moment it's asked to. */\nexport function prepare(): void {\n const a = audio();\n if (!a) return;\n CUES.forEach((cue) => player(a, cue));\n // The ambient channel set and woken now, so the first cue doesn't wait on the phone's audio waking up.\n a.setAudioModeAsync(ambientMode())\n .then(() => a.setIsAudioActiveAsync(true))\n .catch(quiet);\n}\n\n/** Lets them all go, as the welcome closes. */\nexport function release(): void {\n players.forEach((p) => {\n try {\n p.remove();\n } catch {\n /* already gone */\n }\n });\n players.clear();\n}\n\n/**\n * Plays `cue` from its start, or for a timeline from wherever the picture has got to; returns what stops it. The\n * ambient channel is set again first, every time: expo-video sets the playback one whenever its players change (a reel\n * watched on Home), and that one ignores the silent switch. If it can't be set, the cue stays quiet.\n */\nexport function play(cue: Cue): () => void {\n const a = audio();\n const p = a && player(a, cue);\n if (!a || !p) return quiet;\n const take = (takes.get(cue) ?? 0) + 1;\n takes.set(cue, take);\n const current = () => takes.get(cue) === take && players.get(cue) === p;\n const asked = Date.now();\n let stopped = false;\n\n (async () => {\n await a.setAudioModeAsync(ambientMode());\n while (!p.isLoaded && Date.now() - asked < LOAD_MS && !stopped) await wait(20);\n if (stopped || !current() || !p.isLoaded) return;\n const late = Date.now() - asked;\n const from = TIMELINE.has(cue) && late > JOIN_AFTER_MS ? late / 1000 : 0;\n if (from > 0 || p.currentTime > 0) await p.seekTo(from);\n if (stopped || !current()) return;\n p.volume = 1;\n p.play();\n })().catch(quiet);\n\n return () => {\n if (stopped) return;\n stopped = true;\n const steps = [0.6, 0.3, 0.1, 0];\n steps.forEach((v, i) =>\n setTimeout(\n () => {\n if (!current()) return;\n try {\n if (v > 0) p.volume = v;\n else p.pause();\n } catch {\n /* let go meanwhile */\n }\n },\n ((i + 1) * FADE_MS) / steps.length,\n ),\n );\n };\n}\n"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
- "name": "@adminide-stack/clock-tik-mobile",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@adminide-stack/clock-tik-mobile",
3
+ "version": "12.0.37-alpha.1",
4
+ "description": "Clockbook mobile screens: the native Clockbook home and the app drawer",
5
+ "license": "ISC",
6
+ "author": "CDMBase LLC",
7
+ "type": "module",
8
+ "main": "lib/index.js",
9
+ "module": "lib/index.js",
10
+ "typings": "lib/index.d.ts",
11
+ "scripts": {
12
+ "build": "yarn build:clean && yarn build:lib",
13
+ "build:clean": "rimraf lib",
14
+ "build:lib": "rollup -c rollup.config.mjs",
15
+ "build:lib:watch": "yarn build:lib -- --watch",
16
+ "jest": "./node_modules/.bin/jest",
17
+ "prepublish": "yarn build",
18
+ "test": "jest",
19
+ "test:debug": "npm test -- --runInBand",
20
+ "test:watch": "npm test -- --watch",
21
+ "watch": "yarn build:lib:watch",
22
+ "watch-ts": "tsc --watch"
23
+ },
24
+ "devDependencies": {
25
+ "@jest/globals": "^29.7.0",
26
+ "common": "12.0.37-alpha.1"
27
+ },
28
+ "peerDependencies": {
29
+ "@admin-layout/gluestack-ui-mobile": "*",
30
+ "@adminide-stack/clock-tik-browser": "12.0.37-alpha.0",
31
+ "@adminide-stack/user-auth0-client": "*",
32
+ "@common-stack/client-react": "*",
33
+ "@common-stack/core": "*",
34
+ "@expo-google-fonts/geist": "*",
35
+ "@expo-google-fonts/instrument-serif": "*",
36
+ "@expo/vector-icons": "*",
37
+ "@react-native-async-storage/async-storage": "*",
38
+ "@react-navigation/drawer": "*",
39
+ "@react-navigation/elements": "*",
40
+ "@react-navigation/native": "*",
41
+ "envalid": "*",
42
+ "expo": "*",
43
+ "expo-audio": "*",
44
+ "expo-constants": "*",
45
+ "expo-device": "*",
46
+ "expo-font": "*",
47
+ "expo-haptics": "*",
48
+ "expo-modules-core": "*",
49
+ "expo-notifications": "*",
50
+ "expo-secure-store": "*",
51
+ "expo-sms": "*",
52
+ "expo-video": "*",
53
+ "expo-web-browser": "*",
54
+ "lottie-react-native": "*",
55
+ "react": "*",
56
+ "react-native": "*",
57
+ "react-native-safe-area-context": "*",
58
+ "react-native-svg": "*"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "typescript": {
64
+ "definition": "lib/index.d.ts"
65
+ },
66
+ "gitHead": "6b3fee56ac69b0fcc67b3300e06466dec76d6abb"
67
+ }
@@ -0,0 +1,42 @@
1
+ import { copy } from '@web/rollup-plugin-copy';
2
+ import { createRollupConfig } from '../../../rollup.config.base.mjs';
3
+
4
+ // Define any additional plugins specific to this bundle
5
+ const additionalPlugins = [
6
+ copy({
7
+ patterns: ['**/assets/**/*'],
8
+ rootDir: './src',
9
+ }),
10
+ ];
11
+
12
+ // Use the createRollupConfig function to merge the base and specific configurations
13
+ export default (commandLineArgs) => {
14
+ const isWatchMode = commandLineArgs.watch;
15
+ return [
16
+ createRollupConfig(
17
+ {
18
+ input: ['src/index.ts'],
19
+ output: [
20
+ {
21
+ dir: 'lib',
22
+ format: 'es',
23
+ name: 'ClockTikMobile',
24
+ compact: true,
25
+ exports: 'named',
26
+ sourcemap: true,
27
+ preserveModules: true,
28
+ chunkFileNames: '[name]-[hash].[format].js',
29
+ globals: { react: 'React' },
30
+ },
31
+ ],
32
+ plugins: [...additionalPlugins],
33
+ cache: true,
34
+ },
35
+ {
36
+ isWatchMode,
37
+ generateRoutesJSON: true,
38
+ useEsbuild: true,
39
+ },
40
+ ),
41
+ ];
42
+ };
@@ -0,0 +1,19 @@
1
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/ImessageSheet.tsx","success":true,"timestamp":1794311714463,"sessionId":null}
2
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/__tests__/textLink.test.ts","success":true,"timestamp":1794311870479,"sessionId":null}
3
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/AreaShot.tsx","success":true,"timestamp":1794313634482,"sessionId":null}
4
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/YantraMark.tsx","success":true,"timestamp":1794313635425,"sessionId":null}
5
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/imessage/platform.ts","success":true,"timestamp":1794317007225,"sessionId":null}
6
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/MessagesAppIcon.tsx","success":true,"timestamp":1794317008092,"sessionId":null}
7
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/__tests__/platform.test.ts","success":true,"timestamp":1794317085621,"sessionId":null}
8
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/viewport.tsx","success":true,"timestamp":1794317916725,"sessionId":null}
9
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/theme/muse.ts","success":true,"timestamp":1794486790415,"sessionId":null}
10
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/BottomSheet.tsx","success":true,"timestamp":1794489747730,"sessionId":null}
11
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/BottomSheet.tsx","success":true,"timestamp":1794489765296,"sessionId":null}
12
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/WorkspaceSection.tsx","success":true,"timestamp":1794504658670,"sessionId":null}
13
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/drawerHeader.tsx","success":true,"timestamp":1795006066972,"sessionId":null}
14
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/screens/History/index.tsx","success":true,"timestamp":1795007302744,"sessionId":null}
15
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/IdeasPane.tsx","success":true,"timestamp":1795007776782,"sessionId":null}
16
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/chat/jobs.ts","success":true,"timestamp":1795008290423,"sessionId":null}
17
+ {"type":"edit","file":"/private/tmp/claude-501/-Applications-MAMP-htdocs-cdmbase-projects-cdmbase-github-clockbook-feature-mobile-app-clock-tik/237672ea-9e9e-481b-8709-462f17680cab/scratchpad/drawer_body.txt","success":true,"timestamp":1795021002997,"sessionId":null}
18
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/screens/Connectors/index.tsx","success":true,"timestamp":1795023091358,"sessionId":null}
19
+ {"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/MicButton.tsx","success":true,"timestamp":1795089773424,"sessionId":null}
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "session-1795013028422",
3
+ "startedAt": "2026-11-18T14:43:48.422Z",
4
+ "cwd": "/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src",
5
+ "context": {},
6
+ "metrics": {
7
+ "edits": 4,
8
+ "commands": 0,
9
+ "tasks": 0,
10
+ "errors": 0
11
+ },
12
+ "endedAt": "2026-11-18T19:08:49.613Z",
13
+ "duration": 15901197
14
+ }
@@ -0,0 +1,94 @@
1
+ // auth.ts reads the stored Auth0 session through native modules: stub them for node.
2
+ jest.mock(
3
+ 'expo-secure-store',
4
+ () => ({ getItemAsync: jest.fn(), setItemAsync: jest.fn(), deleteItemAsync: jest.fn() }),
5
+ {
6
+ virtual: true,
7
+ },
8
+ );
9
+ jest.mock('@react-native-async-storage/async-storage', () => ({ getItem: jest.fn() }), { virtual: true });
10
+ jest.mock('react-native', () => ({ Platform: { OS: 'ios' } }), { virtual: true });
11
+
12
+ // eslint-disable-next-line import/first
13
+ import { unwrapToken } from '../chat/auth';
14
+
15
+ describe('unwrapToken', () => {
16
+ const jwt = 'eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhdXRoMHwxIn0.sig';
17
+
18
+ it('returns a bare token as it is', () => {
19
+ expect(unwrapToken(jwt)).toBe(jwt);
20
+ });
21
+
22
+ it('drops the quotes of a JSON-encoded token', () => {
23
+ expect(unwrapToken(JSON.stringify(jwt))).toBe(jwt);
24
+ });
25
+
26
+ it('trims, and gives nothing for an empty value', () => {
27
+ expect(unwrapToken(` ${jwt}\n`)).toBe(jwt);
28
+ expect(unwrapToken('""')).toBeNull();
29
+ expect(unwrapToken(' ')).toBeNull();
30
+ });
31
+ });
32
+
33
+ describe('readWorkspaceDefaults', () => {
34
+ // eslint-disable-next-line global-require, @typescript-eslint/no-require-imports
35
+ const { readWorkspaceDefaults, accountSettingsUri } = require('../chat/auth');
36
+ const answer = (data: unknown) => Promise.resolve({ ok: true, status: 200, json: () => Promise.resolve({ data }) });
37
+ let bodies: { query: string; variables?: { resourceUri?: unknown } }[];
38
+
39
+ const stub = (settings: unknown, userId: string | null = 'u1') => {
40
+ bodies = [];
41
+ (globalThis as { fetch: unknown }).fetch = jest.fn((_url: string, init: { body: string }) => {
42
+ const body = JSON.parse(init.body);
43
+ bodies.push(body);
44
+ if (body.query.includes('currentUser')) return answer({ currentUser: userId ? { id: userId } : null });
45
+ return answer({ pageSettings: { settings } });
46
+ });
47
+ };
48
+
49
+ it('reads the account.default subtree the server returns for the config key', async () => {
50
+ stub({ organization: 'acme', project: 'p-uuid', environment: 'env1' });
51
+ await expect(readWorkspaceDefaults('https://x/graphql', 't')).resolves.toEqual({
52
+ organization: 'acme',
53
+ project: 'p-uuid',
54
+ environment: 'env1',
55
+ });
56
+ expect(bodies[1].variables?.resourceUri).toEqual(accountSettingsUri('u1'));
57
+ });
58
+
59
+ it('takes fully keyed and JSON-encoded settings too', async () => {
60
+ stub(JSON.stringify({ 'account.default.organization': 'acme' }));
61
+ await expect(readWorkspaceDefaults('https://x/graphql', 't')).resolves.toEqual({
62
+ organization: 'acme',
63
+ project: undefined,
64
+ environment: undefined,
65
+ });
66
+ });
67
+
68
+ it('gives nothing when there is no saved default', async () => {
69
+ stub(null, null);
70
+ await expect(readWorkspaceDefaults('https://x/graphql', 't')).resolves.toEqual({
71
+ organization: undefined,
72
+ project: undefined,
73
+ environment: undefined,
74
+ });
75
+ });
76
+ });
77
+
78
+ describe('appUrlForBackend', () => {
79
+ // eslint-disable-next-line global-require, @typescript-eslint/no-require-imports
80
+ const { appUrlForBackend } = require('../chat/auth');
81
+
82
+ it('gives the front end that goes with the agent’s backend', () => {
83
+ expect(appUrlForBackend('https://ideback.yantra-app-v1.cdebase.dev/graphql')).toBe(
84
+ 'https://idefront.yantra-app-v1.cdebase.dev',
85
+ );
86
+ expect(appUrlForBackend('https://ideback.yantra.app/graphql')).toBe('https://yantra.app');
87
+ expect(appUrlForBackend('http://ideback.localhost:8080/graphql')).toBe('http://idefront.localhost:8080');
88
+ });
89
+
90
+ it('gives nothing for a backend not named that way', () => {
91
+ expect(appUrlForBackend('https://api.example.com/graphql')).toBe('');
92
+ expect(appUrlForBackend('not a url')).toBe('');
93
+ });
94
+ });
@@ -0,0 +1,75 @@
1
+ import { describe, expect, it } from '@jest/globals';
2
+ import {
3
+ BLACK_FRIDAY,
4
+ countdownTiles,
5
+ endsAt,
6
+ leftSentence,
7
+ leftShort,
8
+ offerShows,
9
+ offerWords,
10
+ timeLeft,
11
+ } from '../offer/blackFriday';
12
+
13
+ /** A moment in November 2026, in the phone's own time zone. */
14
+ const nov = (day: number, h = 0, m = 0, s = 0) => new Date(2026, 10, day, h, m, s);
15
+ const RELEASE = { on: true, early: false };
16
+
17
+ describe('the Black Friday offer', () => {
18
+ it('runs from Black Friday through the last second of Cyber Monday', () => {
19
+ expect(offerShows(nov(26, 23, 59, 59), BLACK_FRIDAY, RELEASE)).toBe(false);
20
+ expect(offerShows(nov(27), BLACK_FRIDAY, RELEASE)).toBe(true);
21
+ expect(offerShows(nov(30, 23, 59, 59), BLACK_FRIDAY, RELEASE)).toBe(true);
22
+ expect(offerShows(new Date(2026, 11, 1), BLACK_FRIDAY, RELEASE)).toBe(false);
23
+ });
24
+
25
+ it('shows early only when asked to, never after it ends, and never in a build without offers', () => {
26
+ expect(offerShows(nov(19, 10), BLACK_FRIDAY, { on: true, early: true })).toBe(true);
27
+ expect(offerShows(new Date(2026, 11, 1), BLACK_FRIDAY, { on: true, early: true })).toBe(false);
28
+ expect(offerShows(nov(28), BLACK_FRIDAY, { on: false, early: true })).toBe(false);
29
+ });
30
+
31
+ it('counts down to its last second, and never below nothing', () => {
32
+ const left = timeLeft(nov(19, 10), BLACK_FRIDAY.ends);
33
+
34
+ expect(left).toMatchObject({ days: 11, hours: 13, minutes: 59, seconds: 59 });
35
+ expect(countdownTiles(left)).toEqual([
36
+ { value: '11', unit: 'Days' },
37
+ { value: '13', unit: 'Hrs' },
38
+ { value: '59', unit: 'Min' },
39
+ { value: '59', unit: 'Sec' },
40
+ ]);
41
+ expect(timeLeft(new Date(2026, 11, 2), BLACK_FRIDAY.ends)).toEqual({
42
+ ms: 0,
43
+ days: 0,
44
+ hours: 0,
45
+ minutes: 0,
46
+ seconds: 0,
47
+ });
48
+ });
49
+
50
+ it('says what is left briefly for the chip, and fully for a screen reader', () => {
51
+ expect(leftShort(timeLeft(nov(19, 10), BLACK_FRIDAY.ends))).toBe('11d 13h left');
52
+ expect(leftShort(timeLeft(nov(30, 20, 39), BLACK_FRIDAY.ends))).toBe('3h 20m left');
53
+ expect(leftShort(timeLeft(nov(30, 23, 39), BLACK_FRIDAY.ends))).toBe('20m left');
54
+ expect(leftSentence(timeLeft(nov(19, 10), BLACK_FRIDAY.ends))).toBe(
55
+ 'Ends in 11 days, 13 hours and 59 minutes.',
56
+ );
57
+ expect(leftSentence(timeLeft(nov(29, 22, 58), BLACK_FRIDAY.ends))).toBe('Ends in 1 day, 1 hour and 1 minute.');
58
+ expect(leftSentence(timeLeft(nov(30, 23, 54), BLACK_FRIDAY.ends))).toBe('Ends in 5 minutes.');
59
+ });
60
+
61
+ it('names when it ends, for the small print', () => {
62
+ expect(endsAt(BLACK_FRIDAY.ends)).toBe('Monday, November 30 at 11:59 PM');
63
+ expect(endsAt(nov(27, 0, 5))).toBe('Friday, November 27 at 12:05 AM');
64
+ });
65
+
66
+ it('calls fifty percent half off, and any other discount by its number', () => {
67
+ expect(offerWords(50)).toMatchObject({
68
+ off: '50% off',
69
+ title: ['Half off', 'a year of Lucy.'],
70
+ claim: 'Claim 50% off',
71
+ claimed: 'Half price, locked in.',
72
+ });
73
+ expect(offerWords(30)).toMatchObject({ title: ['30% off', 'a year of Lucy.'], claimed: '30% off, locked in.' });
74
+ });
75
+ });
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Each Lock Screen card's push token, as iOS reports it (once, a moment after the card goes up): kept by chore, on the
3
+ * phone, so a later turn of the chore (an answer to Lucy's question, after the app restarted) still names its card.
4
+ */
5
+ import { beforeEach, describe, expect, it, jest } from '@jest/globals';
6
+
7
+ const disk = new Map<string, string>();
8
+ const native = { listeners: new Map<string, (e: { choreId: string; token: string }) => void>() };
9
+ jest.mock(
10
+ '@react-native-async-storage/async-storage',
11
+ () => ({
12
+ getItem: jest.fn(async (k: string) => disk.get(k) ?? null),
13
+ setItem: jest.fn(async (k: string, v: string) => {
14
+ disk.set(k, v);
15
+ }),
16
+ }),
17
+ { virtual: true },
18
+ );
19
+ jest.mock('react-native', () => ({ Platform: { OS: 'ios' } }), { virtual: true });
20
+ jest.mock(
21
+ 'expo-modules-core',
22
+ () => ({
23
+ requireOptionalNativeModule: () => ({
24
+ addListener: (event: string, l: (e: { choreId: string; token: string }) => void) => {
25
+ native.listeners.set(event, l);
26
+ return { remove: () => undefined };
27
+ },
28
+ }),
29
+ }),
30
+ { virtual: true },
31
+ );
32
+
33
+ describe('card tokens', () => {
34
+ beforeEach(() => {
35
+ jest.resetModules();
36
+ native.listeners.clear();
37
+ });
38
+
39
+ // eslint-disable-next-line global-require, @typescript-eslint/no-require-imports
40
+ const load = () => require('../live/liveActivity') as typeof import('../live/liveActivity');
41
+ const report = (choreId: string, token: string) => native.listeners.get('onPushToken')?.({ choreId, token });
42
+
43
+ it('keeps the token a card reports, by chore, and tells who listens', async () => {
44
+ disk.clear();
45
+ const live = load();
46
+ const heard: [string, string][] = [];
47
+ live.onCardToken((c, t) => heard.push([c, t]));
48
+ report('board-1', 'aa11');
49
+
50
+ await expect(live.cardTokenFor('board-1')).resolves.toBe('aa11');
51
+ await expect(live.cardTokenFor('board-2')).resolves.toBeUndefined();
52
+ expect(heard).toEqual([['board-1', 'aa11']]);
53
+ });
54
+
55
+ it('still knows it after the app restarts, and a new token replaces the old', async () => {
56
+ disk.clear();
57
+ load();
58
+ report('board-1', 'aa11');
59
+ const restarted = load();
60
+
61
+ await expect(restarted.cardTokenFor('board-1')).resolves.toBe('aa11');
62
+
63
+ report('board-1', 'bb22');
64
+
65
+ await expect(restarted.cardTokenFor('board-1')).resolves.toBe('bb22');
66
+ });
67
+
68
+ it('keeps the latest 30 chores', async () => {
69
+ disk.clear();
70
+ const live = load();
71
+ for (let i = 0; i < 35; i += 1) report(`board-${i}`, `t${i}`);
72
+
73
+ await expect(live.cardTokenFor('board-0')).resolves.toBeUndefined();
74
+ await expect(live.cardTokenFor('board-34')).resolves.toBe('t34');
75
+ expect(JSON.parse(disk.get('clockbook.lucy.cardTokens') ?? '[]')).toHaveLength(30);
76
+ });
77
+ });
@@ -0,0 +1,188 @@
1
+ // chores.ts reads through chat/auth.ts (native storage): the record parsing and grouping are what is tested here.
2
+ jest.mock('../chat/auth', () => ({ agentBackendUrl: jest.fn(), getChatToken: jest.fn() }));
3
+
4
+ // eslint-disable-next-line import/first
5
+ import { choreFromRow, groupChores, setAskingChore, setChoreProgress, type Chore } from '../chat/chores';
6
+ // eslint-disable-next-line import/first
7
+ import { allConnectorsLink, connectLink, connectVerb, LUCY_CONNECTORS } from '../chat/connectors';
8
+
9
+ const NOW = Date.UTC(2026, 10, 10, 18, 0);
10
+ const MIN = 60_000;
11
+
12
+ const row = (details: Record<string, unknown>, status = 'IN_PROGRESS') => ({
13
+ id: 'srv-1',
14
+ title: 'Row title',
15
+ status,
16
+ createdAt: new Date(NOW - 10 * MIN).toISOString(),
17
+ source: {
18
+ details: {
19
+ kind: 'surface-job',
20
+ surface: 'clockbook',
21
+ id: 'job-1',
22
+ title: 'Cancel my gym',
23
+ createdAt: NOW - 10 * MIN,
24
+ ...details,
25
+ },
26
+ },
27
+ });
28
+
29
+ describe('choreFromRow', () => {
30
+ it('reads a running chore with its progress line', () => {
31
+ const c = choreFromRow(row({ deadlineAt: NOW + MIN, stage: { label: 'On hold with the gym' } }), NOW);
32
+ expect(c).toMatchObject({
33
+ id: 'job-1',
34
+ title: 'Cancel my gym',
35
+ status: 'working',
36
+ line: 'On hold with the gym',
37
+ });
38
+ });
39
+
40
+ it('reads a finished chore with what came back', () => {
41
+ const c = choreFromRow(row({ endedAt: NOW - MIN, result: { text: 'Cancelled, no fee.' } }, 'COMPLETED'), NOW);
42
+ expect(c).toMatchObject({ status: 'done', line: 'Cancelled, no fee.', endedAt: NOW - MIN });
43
+ });
44
+
45
+ it('calls a running chore past its deadline stopped', () => {
46
+ const c = choreFromRow(row({ deadlineAt: NOW - MIN }), NOW);
47
+ expect(c).toMatchObject({ status: 'failed', line: 'Stopped responding' });
48
+ });
49
+
50
+ it('reads anything not running or completed as failed', () => {
51
+ expect(choreFromRow(row({ error: 'Line busy' }, 'BLOCKED'), NOW)).toMatchObject({
52
+ status: 'failed',
53
+ line: 'Line busy',
54
+ });
55
+ });
56
+
57
+ it('skips records that are not Clockbook surface jobs', () => {
58
+ expect(choreFromRow(row({ surface: 'travel' }), NOW)).toBeNull();
59
+ expect(choreFromRow(row({ kind: 'todo' }), NOW)).toBeNull();
60
+ expect(choreFromRow({ id: 'x', source: null }, NOW)).toBeNull();
61
+ });
62
+ });
63
+
64
+ describe('groupChores', () => {
65
+ const chore = (id: string, status: Chore['status'], startedAgoMin: number, endedAgoMin?: number): Chore => ({
66
+ id,
67
+ title: id,
68
+ status,
69
+ startedAt: NOW - startedAgoMin * MIN,
70
+ ...(endedAgoMin !== undefined ? { endedAt: NOW - endedAgoMin * MIN } : {}),
71
+ });
72
+
73
+ it('lists what runs, what did not finish and what was done', () => {
74
+ const list = groupChores(
75
+ [
76
+ chore('a', 'working', 3),
77
+ chore('b', 'done', 60, 30),
78
+ chore('c', 'failed', 20, 10),
79
+ chore('d', 'working', 1),
80
+ ],
81
+ NOW,
82
+ );
83
+ expect(list.working.map((c) => c.id)).toEqual(['d', 'a']);
84
+ expect(list.done.map((c) => c.id)).toEqual(['b']);
85
+ expect(list.failed.map((c) => c.id)).toEqual(['c']);
86
+ });
87
+
88
+ it('leaves out quick answers and chores finished over a week ago', () => {
89
+ const quick: Chore = { id: 'q', title: 'q', status: 'done', startedAt: NOW - MIN, endedAt: NOW - MIN + 5_000 };
90
+ const old = chore('o', 'done', 8 * 24 * 60 + 5, 8 * 24 * 60);
91
+ expect(groupChores([quick, old], NOW).done).toEqual([]);
92
+ });
93
+ });
94
+
95
+ describe('connectors', () => {
96
+ it('opens an app’s connect form directly, and a vault entry’s connect page', () => {
97
+ expect(connectLink('https://yantra.app/', 'google-gmail')).toBe(
98
+ 'https://yantra.app/account/connectors?credentialChain=google-gmail&autoStart=true',
99
+ );
100
+ expect(connectLink('https://yantra.app', 'google-calendar')).toBe(
101
+ 'https://yantra.app/account/connectors?credentialChain=google-calendar&autoStart=true',
102
+ );
103
+ expect(connectLink('https://yantra.app', 'site-login')).toBe(
104
+ 'https://yantra.app/connect/site-login?via=surface',
105
+ );
106
+ expect(connectLink('https://yantra.app', 'something-new')).toBe(
107
+ 'https://yantra.app/connect/something-new?via=surface',
108
+ );
109
+ expect(allConnectorsLink('https://yantra.app')).toBe('https://yantra.app/account/connectors');
110
+ expect(connectLink('', 'google-gmail')).toBe('');
111
+ });
112
+
113
+ it('connects apps and adds the rest', () => {
114
+ expect(LUCY_CONNECTORS.map(connectVerb)).toEqual(['Connect', 'Connect', 'Add', 'Add', 'Add']);
115
+ });
116
+ });
117
+
118
+ describe('what the chat knows live', () => {
119
+ const working: Chore = { id: 'w', title: 'Trips to Manali', status: 'working', startedAt: NOW - MIN };
120
+ const quick: Chore = {
121
+ id: 'q',
122
+ title: 'Plan a trip',
123
+ status: 'done',
124
+ startedAt: NOW - MIN,
125
+ endedAt: NOW - MIN + 5_000,
126
+ };
127
+ afterEach(() => {
128
+ setAskingChore(null);
129
+ setChoreProgress('w', null);
130
+ });
131
+
132
+ it('shows what Lucy is doing on a working chore', () => {
133
+ setChoreProgress('w', 'Searching…');
134
+ expect(groupChores([working], NOW).working[0].line).toBe('Searching…');
135
+ });
136
+
137
+ it('puts the chore whose question waits first, even a quick answer', () => {
138
+ setAskingChore('q');
139
+ const list = groupChores([working, quick], NOW);
140
+ expect(list.asking.map((c) => [c.id, c.status])).toEqual([['q', 'asking']]);
141
+ expect(list.done).toEqual([]);
142
+ expect(list.working.map((c) => c.id)).toEqual(['w']);
143
+ });
144
+ });
145
+
146
+ describe('a chore and its answers', () => {
147
+ it('reads a turn filed under another chore as part of it', () => {
148
+ const turn = choreFromRow(row({ id: 'job-2', handle: { kind: 'session', boardId: 'job-1' } }), NOW);
149
+ expect(turn?.id).toBe('job-1');
150
+ });
151
+
152
+ it('keeps a chore one row: named by its first turn, ended as its last', () => {
153
+ const first: Chore = {
154
+ id: 'c',
155
+ title: 'Find me a cheaper flight',
156
+ status: 'done',
157
+ startedAt: NOW - 40 * MIN,
158
+ endedAt: NOW - 38 * MIN,
159
+ };
160
+ const answer: Chore = {
161
+ id: 'c',
162
+ title: 'Route: Mumbai to Delhi',
163
+ status: 'done',
164
+ startedAt: NOW - 30 * MIN,
165
+ endedAt: NOW - 29 * MIN,
166
+ line: 'Found three',
167
+ };
168
+ const list = groupChores([answer, first], NOW);
169
+ expect(list.done).toHaveLength(1);
170
+ expect(list.done[0]).toMatchObject({
171
+ title: 'Find me a cheaper flight',
172
+ endedAt: NOW - 29 * MIN,
173
+ line: 'Found three',
174
+ });
175
+ });
176
+
177
+ it('is under way while an answer is being worked on', () => {
178
+ const first: Chore = {
179
+ id: 'c',
180
+ title: 'Trip',
181
+ status: 'done',
182
+ startedAt: NOW - 10 * MIN,
183
+ endedAt: NOW - 9 * MIN,
184
+ };
185
+ const answer: Chore = { id: 'c', title: 'x', status: 'working', startedAt: NOW - MIN };
186
+ expect(groupChores([first, answer], NOW).working.map((c) => c.title)).toEqual(['Trip']);
187
+ });
188
+ });