thursday-agent 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +6 -0
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +13 -13
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +12 -12
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  20. package/.next/server/app/api/artifact/route.js +1 -1
  21. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/notes/route/app-paths-manifest.json +3 -0
  23. package/.next/server/app/api/bot/notes/route/build-manifest.json +12 -0
  24. package/.next/server/app/api/bot/notes/route/server-reference-manifest.json +4 -0
  25. package/.next/server/app/api/bot/notes/route.js +14 -0
  26. package/.next/server/app/api/bot/notes/route.js.map +5 -0
  27. package/.next/server/app/api/bot/notes/route.js.nft.json +1 -0
  28. package/.next/server/app/api/bot/notes/route_client-reference-manifest.js +3 -0
  29. package/.next/server/app/api/bot/route.js +4 -4
  30. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  31. package/.next/server/app/api/bot/task/[id]/route.js +6 -6
  32. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/bot/task/route.js +6 -6
  34. package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
  35. package/.next/server/app/api/config/route.js +3 -3
  36. package/.next/server/app/api/config/route.js.nft.json +1 -1
  37. package/.next/server/app/api/events/route.js +1 -1
  38. package/.next/server/app/api/events/route.js.nft.json +1 -1
  39. package/.next/server/app/api/file/[...path]/route.js +1 -1
  40. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  41. package/.next/server/app/api/llm-model/catalog/route.js +6 -6
  42. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  43. package/.next/server/app/api/llm-model/route.js +3 -3
  44. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  45. package/.next/server/app/api/mcp/[name]/route.js +3 -3
  46. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/mcp/oauth/callback/route.js +5 -5
  48. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  49. package/.next/server/app/api/mcp/route.js +3 -3
  50. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  51. package/.next/server/app/api/mcp/tools/route.js +3 -3
  52. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  53. package/.next/server/app/api/memory/route.js +7 -7
  54. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  55. package/.next/server/app/api/memory/tidy/route.js +10 -11
  56. package/.next/server/app/api/memory/tidy/route.js.nft.json +1 -1
  57. package/.next/server/app/api/skills/[source]/[name]/route.js +1 -1
  58. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  59. package/.next/server/app/api/skills/route.js +1 -1
  60. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  61. package/.next/server/app/api/thursday/call/route.js +8 -8
  62. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  63. package/.next/server/app/api/thursday/skills/route.js +8 -8
  64. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  65. package/.next/server/app/api/thursday/tool-call/route.js +11 -12
  66. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  67. package/.next/server/app/api/workspace/route.js +1 -1
  68. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  69. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  70. package/.next/server/app/artifact/[...path]/page.js +3 -3
  71. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  72. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  74. package/.next/server/app/page/server-reference-manifest.json +63 -41
  75. package/.next/server/app/page.js +7 -7
  76. package/.next/server/app/page.js.nft.json +1 -1
  77. package/.next/server/app/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app-paths-manifest.json +1 -0
  79. package/.next/server/chunks/0d-b_next_dist_server_app-render_after-task-async-storage_external_0-exn7p.js +3 -0
  80. package/.next/server/chunks/{[root-of-the-server]__0t_dqaj._.js → [root-of-the-server]__0-npkh_._.js} +1 -1
  81. package/.next/server/chunks/[root-of-the-server]__005var5._.js +3 -0
  82. package/.next/server/chunks/[root-of-the-server]__019dx9f._.js +2 -2
  83. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +3 -0
  84. package/.next/server/chunks/{[root-of-the-server]__1mzp_el._.js → [root-of-the-server]__04_8spk._.js} +2 -2
  85. package/.next/server/chunks/[root-of-the-server]__06t77t4._.js +1 -1
  86. package/.next/server/chunks/[root-of-the-server]__0bed6hu._.js +4 -4
  87. package/.next/server/chunks/[root-of-the-server]__0cro2dz._.js +5 -0
  88. package/.next/server/chunks/[root-of-the-server]__0emr6go._.js +3 -0
  89. package/.next/server/chunks/[root-of-the-server]__0le4d-p._.js +1 -1
  90. package/.next/server/chunks/[root-of-the-server]__0m8ywyo._.js +5 -5
  91. package/.next/server/chunks/{[root-of-the-server]__113fqg5._.js → [root-of-the-server]__0p32jfz._.js} +3 -3
  92. package/.next/server/chunks/[root-of-the-server]__0phdgco._.js +4 -4
  93. package/.next/server/chunks/[root-of-the-server]__0wvgrsl._.js +1 -1
  94. package/.next/server/chunks/[root-of-the-server]__11j52t0._.js +5 -0
  95. package/.next/server/chunks/{[root-of-the-server]__0j_n5l3._.js → [root-of-the-server]__1692zrv._.js} +2 -2
  96. package/.next/server/chunks/[root-of-the-server]__16thabu._.js +1 -1
  97. package/.next/server/chunks/[root-of-the-server]__173nhwf._.js +3 -3
  98. package/.next/server/chunks/[root-of-the-server]__1bn73ih._.js +10 -0
  99. package/.next/server/chunks/[root-of-the-server]__1bqhuh9._.js +4 -4
  100. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +10 -0
  101. package/.next/server/chunks/[root-of-the-server]__1cqizfq._.js +1 -1
  102. package/.next/server/chunks/{[root-of-the-server]__1u_qvc7._.js → [root-of-the-server]__1fboj2j._.js} +2 -2
  103. package/.next/server/chunks/{[root-of-the-server]__1dow0bz._.js → [root-of-the-server]__1oli73c._.js} +2 -2
  104. package/.next/server/chunks/[root-of-the-server]__1txedx6._.js +4 -4
  105. package/.next/server/chunks/[root-of-the-server]__1untqv8._.js +5 -0
  106. package/.next/server/chunks/_0-73of8._.js +55 -0
  107. package/.next/server/chunks/{_2050gwn._.js → _00_584r._.js} +66 -28
  108. package/.next/server/chunks/{_0y8is-s._.js → _03a0897._.js} +1 -1
  109. package/.next/server/chunks/_05h2cii._.js +1 -1
  110. package/.next/server/chunks/_06mxlgn._.js +1 -1
  111. package/.next/server/chunks/_0a351g7._.js +1 -1
  112. package/.next/server/chunks/{_0hin38_._.js → _0khihjk._.js} +5 -5
  113. package/.next/server/chunks/_0kjjmag._.js +1 -1
  114. package/.next/server/chunks/{_1t8fv7b._.js → _0n74zsf._.js} +5 -5
  115. package/.next/server/chunks/_0nn99o2._.js +3 -0
  116. package/.next/server/chunks/_0pppbb5._.js +10 -6
  117. package/.next/server/chunks/{_1icgbi8._.js → _0rnf-6n._.js} +5 -5
  118. package/.next/server/chunks/_0u10wmw._.js +55 -0
  119. package/.next/server/chunks/{_0kl37zl._.js → _0vnutv9._.js} +1 -1
  120. package/.next/server/chunks/_0wp4le3._.js +1 -1
  121. package/.next/server/chunks/_0y5fg-x._.js +1 -1
  122. package/.next/server/chunks/_106co2o._.js +3 -0
  123. package/.next/server/chunks/_12bbv5i._.js +10 -6
  124. package/.next/server/chunks/_15hq89o._.js +1 -1
  125. package/.next/server/chunks/_15q1pig._.js +1 -1
  126. package/.next/server/chunks/_18-1wcc._.js +55 -0
  127. package/.next/server/chunks/_19wg5yn._.js +138 -0
  128. package/.next/server/chunks/_1_5mnq4._.js +18 -0
  129. package/.next/server/chunks/_1bt95p9._.js +55 -0
  130. package/.next/server/chunks/_1cbk7ms._.js +9 -9
  131. package/.next/server/chunks/_1drgfx4._.js +18 -0
  132. package/.next/server/chunks/_1drv2et._.js +10 -6
  133. package/.next/server/chunks/{_10qam6o._.js → _1e48czp._.js} +5 -5
  134. package/.next/server/chunks/{_1skgy7b._.js → _1kg70wc._.js} +5 -5
  135. package/.next/server/chunks/_1php4eq._.js +1 -1
  136. package/.next/server/chunks/_1rysr-r._.js +10 -0
  137. package/.next/server/chunks/_1u3rwbr._.js +3 -0
  138. package/.next/server/chunks/_1x7p319._.js +1 -1
  139. package/.next/server/chunks/_1yuv4vp._.js +1 -1
  140. package/.next/server/chunks/_next-internal_server_app_api_bot_notes_route_actions_0qcsyu7.js +3 -0
  141. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  142. package/.next/server/chunks/features_bot_task_query_ts_11xuzl3._.js +1 -1
  143. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0228f43._.js → node_modules_consola_dist_chunks_prompt_mjs_02s3hjt._.js} +1 -1
  144. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0ir-vo2._.js → node_modules_consola_dist_chunks_prompt_mjs_06067w6._.js} +1 -1
  145. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0otw8ef._.js → node_modules_consola_dist_chunks_prompt_mjs_096ais_._.js} +1 -1
  146. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0tf290y._.js → node_modules_consola_dist_chunks_prompt_mjs_0a1rd09._.js} +1 -1
  147. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0gzvgfv._.js +3 -0
  148. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0j61-ma._.js +3 -0
  149. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0tvkfgh._.js +3 -0
  150. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_11zjo-1._.js +3 -0
  151. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1pycqsq._.js +3 -0
  152. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1tpvamf._.js +3 -0
  153. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1y9-wcr._.js +3 -0
  154. package/.next/server/chunks/ssr/[externals]__0dizgek._.js +3 -0
  155. package/.next/server/chunks/ssr/[root-of-the-server]__0f6s48x._.js +1 -1
  156. package/.next/server/chunks/ssr/[root-of-the-server]__0m1b5ky._.js +3 -0
  157. package/.next/server/chunks/ssr/{[root-of-the-server]__0dfwvr4._.js → [root-of-the-server]__0un-erv._.js} +2 -2
  158. package/.next/server/chunks/ssr/[root-of-the-server]__1-mnhyd._.js +5 -3
  159. package/.next/server/chunks/ssr/[root-of-the-server]__1bww500._.js +3 -0
  160. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  161. package/.next/server/chunks/ssr/[root-of-the-server]__1qfqvmg._.js +3 -0
  162. package/.next/server/chunks/ssr/[root-of-the-server]__1vcdast._.js +3 -0
  163. package/.next/server/chunks/ssr/[root-of-the-server]__1xwnu-h._.js +3 -0
  164. package/.next/server/chunks/ssr/_03webdr._.js +3 -0
  165. package/.next/server/chunks/ssr/{_0gd4vaa._.js → _040sk32._.js} +71 -29
  166. package/.next/server/chunks/ssr/_077-g6s._.js +1 -1
  167. package/.next/server/chunks/ssr/{_1r2_qk-._.js → _09ja_w1._.js} +2 -2
  168. package/.next/server/chunks/ssr/{_1dnxp2k._.js → _0f_b_9s._.js} +2 -2
  169. package/.next/server/chunks/ssr/_0h7zdni._.js +1 -1
  170. package/.next/server/chunks/ssr/_0lu1n_x._.js +3 -0
  171. package/.next/server/chunks/ssr/_0sf1isi._.js +1 -1
  172. package/.next/server/chunks/ssr/_0su6_08._.js +3 -0
  173. package/.next/server/chunks/ssr/_0w5bgak._.js +3 -0
  174. package/.next/server/chunks/ssr/{_1hkvsg0._.js → _0x_nu5e._.js} +2 -2
  175. package/.next/server/chunks/ssr/_1-teee5._.js +3 -3
  176. package/.next/server/chunks/ssr/_13punpm._.js +1 -1
  177. package/.next/server/chunks/ssr/{_0ay6b01._.js → _1ciyoo3._.js} +2 -2
  178. package/.next/server/chunks/ssr/_1e-dgz0._.js +1 -1
  179. package/.next/server/chunks/ssr/_1fq7zgb._.js +1 -1
  180. package/.next/server/chunks/ssr/{_0cvjbuz._.js → _1g6l4uj._.js} +2 -2
  181. package/.next/server/chunks/ssr/{_1b3yex3._.js → _1lip4th._.js} +2 -2
  182. package/.next/server/chunks/ssr/_1m3bsfr._.js +3 -0
  183. package/.next/server/chunks/ssr/_1mznrxk._.js +1 -1
  184. package/.next/server/chunks/ssr/_1ruzehw._.js +3 -0
  185. package/.next/server/chunks/ssr/_1vyd1ji._.js +3 -0
  186. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +2 -2
  187. package/.next/server/chunks/ssr/features_config_components_14jqgy4._.js +1 -1
  188. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  189. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  190. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  191. package/.next/server/chunks/ssr/lib_realtime_12wg_dd._.js +27 -0
  192. package/.next/server/chunks/ssr/lib_realtime_15h_v1v._.js +27 -0
  193. package/.next/server/chunks/ssr/{node_modules_0i37h34._.js → node_modules_004qlr4._.js} +1 -1
  194. package/.next/server/chunks/ssr/{node_modules_0nh2m35._.js → node_modules_01qnv-a._.js} +1 -1
  195. package/.next/server/chunks/ssr/{node_modules_1kj6swe._.js → node_modules_04n7mjs._.js} +1 -1
  196. package/.next/server/chunks/ssr/{node_modules_0eqdzva._.js → node_modules_08d8bke._.js} +1 -1
  197. package/.next/server/chunks/ssr/{node_modules_0nq_p-o._.js → node_modules_09xhur7._.js} +1 -1
  198. package/.next/server/chunks/ssr/{node_modules_1854ebs._.js → node_modules_0_n241r._.js} +1 -1
  199. package/.next/server/chunks/ssr/{node_modules_00riwzq._.js → node_modules_0iz1rzd._.js} +1 -1
  200. package/.next/server/chunks/ssr/{node_modules_1wsx1pg._.js → node_modules_0kl7-tn._.js} +1 -1
  201. package/.next/server/chunks/ssr/{node_modules_17ls31t._.js → node_modules_0kxz4gt._.js} +1 -1
  202. package/.next/server/chunks/ssr/{node_modules_1fsvm8f._.js → node_modules_0lrjk5t._.js} +1 -1
  203. package/.next/server/chunks/ssr/{node_modules_1euv75v._.js → node_modules_0m93zeg._.js} +1 -1
  204. package/.next/server/chunks/ssr/{node_modules_1_w_b81._.js → node_modules_0n1kj4p._.js} +1 -1
  205. package/.next/server/chunks/ssr/{node_modules_1bjm3ch._.js → node_modules_0ndvxub._.js} +1 -1
  206. package/.next/server/chunks/ssr/{node_modules_03f-6up._.js → node_modules_13r44jq._.js} +1 -1
  207. package/.next/server/chunks/ssr/{node_modules_07_oxjr._.js → node_modules_17lrt3y._.js} +1 -1
  208. package/.next/server/chunks/ssr/{node_modules_1yxkq1s._.js → node_modules_18_dk7_._.js} +1 -1
  209. package/.next/server/chunks/ssr/{node_modules_012m-mo._.js → node_modules_19dp7ko._.js} +1 -1
  210. package/.next/server/chunks/ssr/{node_modules_0egn4iq._.js → node_modules_1dwguw_._.js} +1 -1
  211. package/.next/server/chunks/ssr/{node_modules_1y1m-q4._.js → node_modules_1hd-5tv._.js} +1 -1
  212. package/.next/server/chunks/ssr/{node_modules_0xe_k12._.js → node_modules_1hn8z1f._.js} +1 -1
  213. package/.next/server/chunks/ssr/{node_modules_0sbobpz._.js → node_modules_1n5ygqe._.js} +1 -1
  214. package/.next/server/chunks/ssr/{node_modules_14uxpfb._.js → node_modules_1q0p85z._.js} +1 -1
  215. package/.next/server/chunks/ssr/{node_modules_01jj5oy._.js → node_modules_1toafc-._.js} +1 -1
  216. package/.next/server/chunks/ssr/{node_modules_0ewynyi._.js → node_modules_1xyd7ov._.js} +1 -1
  217. package/.next/server/chunks/ssr/{node_modules_17c71fz._.js → node_modules_1zu988w._.js} +1 -1
  218. package/.next/server/chunks/ssr/{node_modules_1mnmhse._.js → node_modules_20yebtj._.js} +1 -1
  219. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1f5re6n._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0m9a4y0._.js} +1 -1
  220. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_216aa7f._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_13w_wy9._.js} +1 -1
  221. package/.next/server/chunks/ssr/node_modules_consola_dist_chunks_prompt_mjs_05cwqv2._.js +47 -0
  222. package/.next/server/middleware-build-manifest.js +3 -3
  223. package/.next/server/pages/404.html +1 -1
  224. package/.next/server/pages/500.html +1 -1
  225. package/.next/server/server-reference-manifest.js +1 -1
  226. package/.next/server/server-reference-manifest.json +64 -42
  227. package/.next/static/chunks/05b6nx_o3_f_n.js +1 -0
  228. package/.next/static/chunks/{1rja48de93vvx.js → 07kl352c-lvcz.js} +1 -1
  229. package/.next/static/chunks/0dmns-gi0raa4.js +1 -0
  230. package/.next/static/chunks/0oc4_xoia77dg.css +1 -0
  231. package/.next/static/chunks/0pheo8m3a-rzi.js +1 -0
  232. package/.next/static/chunks/{3yan6-5cvpk2o.js → 18vhba44l1fc9.js} +1 -1
  233. package/.next/static/chunks/19i8h2t-5evjx.js +1 -0
  234. package/.next/static/chunks/{0h7pjyewk7ky-.js → 1c5fcj473025q.js} +1 -1
  235. package/.next/static/chunks/1pi_hbmjw-f-z.js +1 -0
  236. package/.next/static/chunks/{0tydnn2kybibk.js → 1twt6k09vg4np.js} +1 -1
  237. package/.next/static/chunks/{2kl3n2d-4-7i5.js → 28gotuisldmom.js} +1 -1
  238. package/.next/static/chunks/{34eu8t79ko6lm.js → 2998p0y7k1c8z.js} +1 -1
  239. package/.next/static/chunks/2l233xfycjpd8.js +1 -0
  240. package/.next/static/chunks/2p5n7pa3c40t-.js +2 -0
  241. package/.next/static/chunks/2ru1q132af7h7.js +1 -0
  242. package/.next/static/chunks/{2ka9uwo_evj7a.js → 2t8wqycwg3y04.js} +2 -2
  243. package/.next/static/chunks/32z_ypgtchw48.js +1 -0
  244. package/.next/static/chunks/{261871a8ot1pi.js → 33pyjb3xd1iez.js} +1 -1
  245. package/.next/static/chunks/3786h5vayt80-.js +28 -0
  246. package/.next/static/chunks/3_h9txt3tq8t8.js +28 -0
  247. package/.next/static/chunks/{2qci2z603es_m.js → 3ard_noqapnw1.js} +1 -1
  248. package/.next/static/chunks/{0yn2yol46cj77.js → 3omud5xunrk1f.js} +1 -1
  249. package/.next/static/chunks/42dnrkbph9e-1.js +1 -0
  250. package/README.md +24 -1
  251. package/app/api/events/app-event.client.ts +24 -0
  252. package/app/api/events/app-event.server.ts +45 -0
  253. package/app/api/events/app-event.ts +44 -0
  254. package/app/api/llm-model/catalog/route.ts +12 -0
  255. package/app/api/llm-model/route.ts +21 -0
  256. package/app/api/query-key.ts +144 -0
  257. package/app/api/thursday/tool-call/route.ts +67 -0
  258. package/bin/thursday.mjs +50 -2
  259. package/components/ui/button-group.tsx +45 -0
  260. package/components/ui/custom-icon.tsx +259 -0
  261. package/components/ui/dropdown-menu.tsx +271 -0
  262. package/components/ui/folded-text.tsx +68 -0
  263. package/components/ui/input-group.tsx +157 -0
  264. package/components/ui/json-view.tsx +240 -0
  265. package/components/ui/shiny-text.tsx +141 -0
  266. package/components/ui/text-type.tsx +213 -0
  267. package/components/ui/theme-sync.tsx +9 -0
  268. package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260909060813_optimal_sabretooth}/migration.sql +7 -0
  269. package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260909060813_optimal_sabretooth}/snapshot.json +54 -1
  270. package/database/migrations/20260909063821_bitter_tenebrous/migration.sql +1 -0
  271. package/database/migrations/20260909063821_bitter_tenebrous/snapshot.json +1285 -0
  272. package/docs/how-it-works.md +59 -0
  273. package/docs/images/keeps-going.png +0 -0
  274. package/docs/images/task-thread.png +0 -0
  275. package/docs/images/two-minds.png +0 -0
  276. package/features/ai/load-tools.ts +55 -5
  277. package/features/ai/prompts/bot.prompt.ts +121 -26
  278. package/features/ai/prompts/memory-tidy.prompt.ts +7 -1
  279. package/features/ai/prompts/prompt-helper.ts +31 -5
  280. package/features/ai/prompts/thursday.prompt.ts +2 -0
  281. package/features/ai/tools/bot.tool.ts +37 -18
  282. package/features/ai/tools/mcp.tool.ts +5 -5
  283. package/features/ai/tools/memory.tool.ts +17 -10
  284. package/features/ai/tools/studio.tool.ts +5 -5
  285. package/features/ai/tools/tool-name.ts +2 -0
  286. package/features/ai/tools/workspace.tool.ts +33 -5
  287. package/features/bot/bot.action.ts +31 -4
  288. package/features/bot/bot.notes.ts +120 -0
  289. package/features/bot/bot.query.ts +56 -1
  290. package/features/bot/bot.run.ts +43 -3
  291. package/features/bot/bot.runner.ts +94 -20
  292. package/features/bot/bot.schema.ts +17 -0
  293. package/features/bot/components/bot-room.tsx +405 -306
  294. package/features/bot/components/bot-setting.tsx +123 -20
  295. package/features/bot/task.query.ts +18 -5
  296. package/features/memory/components/memory-setting.tsx +11 -2
  297. package/features/memory/memory.query.ts +9 -2
  298. package/features/memory/memory.schema.ts +30 -0
  299. package/features/skills/components/skills-setting.tsx +9 -1
  300. package/features/workspace/workspace.ts +136 -3
  301. package/hooks/use-draft.ts +37 -0
  302. package/hooks/use-hotkey.ts +105 -0
  303. package/hooks/use-object-state.ts +51 -0
  304. package/hooks/use-on-visible.ts +72 -0
  305. package/hooks/use-theme.ts +106 -0
  306. package/hooks/use-wake-word.ts +262 -0
  307. package/lib/realtime/realtime.driver.ts +34 -1
  308. package/lib/realtime/realtime.protocol.ts +6 -0
  309. package/lib/sandbox.ts +9 -1
  310. package/lib/tokens.ts +19 -0
  311. package/package.json +1 -1
  312. package/.next/server/chunks/[root-of-the-server]__02kt8yn._.js +0 -10
  313. package/.next/server/chunks/[root-of-the-server]__0h59di-._.js +0 -5
  314. package/.next/server/chunks/[root-of-the-server]__0qjqtwo._.js +0 -5
  315. package/.next/server/chunks/[root-of-the-server]__0yk6s3w._.js +0 -5
  316. package/.next/server/chunks/[root-of-the-server]__0z3gelv._.js +0 -3
  317. package/.next/server/chunks/[root-of-the-server]__11w_7_3._.js +0 -3
  318. package/.next/server/chunks/[root-of-the-server]__1_0q_9w._.js +0 -3
  319. package/.next/server/chunks/[root-of-the-server]__1gmn1cs._.js +0 -10
  320. package/.next/server/chunks/_0fzqt2y._.js +0 -100
  321. package/.next/server/chunks/_0jgm3b8._.js +0 -55
  322. package/.next/server/chunks/_0ks6_sg._.js +0 -55
  323. package/.next/server/chunks/_0tzfesa._.js +0 -3
  324. package/.next/server/chunks/_0zmestz._.js +0 -55
  325. package/.next/server/chunks/_12nr4xc._.js +0 -3
  326. package/.next/server/chunks/_1hzrsvg._.js +0 -55
  327. package/.next/server/chunks/_1uj4_io._.js +0 -10
  328. package/.next/server/chunks/_1yldgo4._.js +0 -55
  329. package/.next/server/chunks/features_0scmr4i._.js +0 -3
  330. package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +0 -3
  331. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0ykklj0._.js +0 -3
  332. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1ryg3wh._.js +0 -3
  333. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1vwbnq_._.js +0 -3
  334. package/.next/server/chunks/ssr/[root-of-the-server]__0b-0i32._.js +0 -3
  335. package/.next/server/chunks/ssr/[root-of-the-server]__1e-f3gy._.js +0 -3
  336. package/.next/server/chunks/ssr/[root-of-the-server]__1minz8_._.js +0 -3
  337. package/.next/server/chunks/ssr/[root-of-the-server]__1ncajna._.js +0 -3
  338. package/.next/server/chunks/ssr/_124q1la._.js +0 -3
  339. package/.next/server/chunks/ssr/_19eoufz._.js +0 -3
  340. package/.next/server/chunks/ssr/_1aca4j8._.js +0 -3
  341. package/.next/server/chunks/ssr/_1cb_5sv._.js +0 -3
  342. package/.next/server/chunks/ssr/_1m5popy._.js +0 -3
  343. package/.next/server/chunks/ssr/lib_realtime_0aetuyp._.js +0 -24
  344. package/.next/server/chunks/ssr/lib_realtime_18k_aj-._.js +0 -24
  345. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_errors_05xv7vp.js +0 -3
  346. package/.next/static/chunks/0_6qjj4f3t3j-.js +0 -1
  347. package/.next/static/chunks/0g2n0xskvyk04.js +0 -2
  348. package/.next/static/chunks/14s7e14xltx47.js +0 -1
  349. package/.next/static/chunks/1lpdcqos7mkek.js +0 -1
  350. package/.next/static/chunks/1u5d-pvhwir9g.js +0 -1
  351. package/.next/static/chunks/2cgzsjzheo2m2.js +0 -1
  352. package/.next/static/chunks/2cwjgkt_hoyhj.js +0 -22
  353. package/.next/static/chunks/2rbf1fpd8n80-.js +0 -22
  354. package/.next/static/chunks/2ukj8k69y89um.js +0 -1
  355. package/.next/static/chunks/2v_vqhmdl8de_.js +0 -1
  356. package/.next/static/chunks/35uo6rtl_otbd.js +0 -1
  357. package/.next/static/chunks/388-t2v72jh39.css +0 -1
  358. package/.next/static/chunks/3w7-y53xzl2ir.js +0 -1
  359. /package/.next/static/{G-9_HnysmzY_Bx9GpDYAO → YR4NWcDDuzwLbTTU7U7Vr}/_buildManifest.js +0 -0
  360. /package/.next/static/{G-9_HnysmzY_Bx9GpDYAO → YR4NWcDDuzwLbTTU7U7Vr}/_clientMiddlewareManifest.js +0 -0
  361. /package/.next/static/{G-9_HnysmzY_Bx9GpDYAO → YR4NWcDDuzwLbTTU7U7Vr}/_ssgManifest.js +0 -0
@@ -0,0 +1,157 @@
1
+ "use client";
2
+
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+ import * as React from "react";
5
+ import { Button } from "@/components/ui/button";
6
+ import { Input } from "@/components/ui/input";
7
+ import { Textarea } from "@/components/ui/textarea";
8
+ import { cn } from "@/lib/utils";
9
+
10
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
11
+ return (
12
+ <div
13
+ data-slot="input-group"
14
+ role="group"
15
+ className={cn(
16
+ "group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
17
+ className,
18
+ )}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ const inputGroupAddonVariants = cva(
25
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
26
+ {
27
+ variants: {
28
+ align: {
29
+ "inline-start":
30
+ "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
31
+ "inline-end":
32
+ "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
33
+ "block-start":
34
+ "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
35
+ "block-end":
36
+ "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
37
+ },
38
+ },
39
+ defaultVariants: {
40
+ align: "inline-start",
41
+ },
42
+ },
43
+ );
44
+
45
+ function InputGroupAddon({
46
+ className,
47
+ align = "inline-start",
48
+ ...props
49
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
50
+ return (
51
+ <div
52
+ role="group"
53
+ data-slot="input-group-addon"
54
+ data-align={align}
55
+ className={cn(inputGroupAddonVariants({ align }), className)}
56
+ onClick={(e) => {
57
+ if ((e.target as HTMLElement).closest("button")) {
58
+ return;
59
+ }
60
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
61
+ }}
62
+ {...props}
63
+ />
64
+ );
65
+ }
66
+
67
+ const inputGroupButtonVariants = cva(
68
+ "flex items-center gap-2 text-sm shadow-none",
69
+ {
70
+ variants: {
71
+ size: {
72
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
73
+ sm: "",
74
+ "icon-xs":
75
+ "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
76
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
77
+ },
78
+ },
79
+ defaultVariants: {
80
+ size: "xs",
81
+ },
82
+ },
83
+ );
84
+
85
+ function InputGroupButton({
86
+ className,
87
+ type = "button",
88
+ variant = "ghost",
89
+ size = "xs",
90
+ ...props
91
+ }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> &
92
+ VariantProps<typeof inputGroupButtonVariants> & {
93
+ type?: "button" | "submit" | "reset";
94
+ }) {
95
+ return (
96
+ <Button
97
+ type={type}
98
+ data-size={size}
99
+ variant={variant}
100
+ className={cn(inputGroupButtonVariants({ size }), className)}
101
+ {...props}
102
+ />
103
+ );
104
+ }
105
+
106
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
107
+ return (
108
+ <span
109
+ className={cn(
110
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
111
+ className,
112
+ )}
113
+ {...props}
114
+ />
115
+ );
116
+ }
117
+
118
+ function InputGroupInput({
119
+ className,
120
+ ...props
121
+ }: React.ComponentProps<"input">) {
122
+ return (
123
+ <Input
124
+ data-slot="input-group-control"
125
+ className={cn(
126
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
127
+ className,
128
+ )}
129
+ {...props}
130
+ />
131
+ );
132
+ }
133
+
134
+ function InputGroupTextarea({
135
+ className,
136
+ ...props
137
+ }: React.ComponentProps<"textarea">) {
138
+ return (
139
+ <Textarea
140
+ data-slot="input-group-control"
141
+ className={cn(
142
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
143
+ className,
144
+ )}
145
+ {...props}
146
+ />
147
+ );
148
+ }
149
+
150
+ export {
151
+ InputGroup,
152
+ InputGroupAddon,
153
+ InputGroupButton,
154
+ InputGroupInput,
155
+ InputGroupText,
156
+ InputGroupTextarea,
157
+ };
@@ -0,0 +1,240 @@
1
+ "use client";
2
+
3
+ import { memo, useMemo, useState } from "react";
4
+ import { cn } from "@/lib/utils";
5
+
6
+ export type JsonValue =
7
+ | string
8
+ | number
9
+ | boolean
10
+ | null
11
+ | undefined
12
+ | JsonValue[]
13
+ | { [key: string]: JsonValue };
14
+
15
+ export type JsonViewProps = {
16
+ data: unknown;
17
+ name?: string;
18
+ initialExpandDepth?: number;
19
+ };
20
+
21
+ function tryParseJson(str: string): { success: boolean; data: JsonValue } {
22
+ const trimmed = str.trim();
23
+ if (
24
+ !(trimmed.startsWith("{") && trimmed.endsWith("}")) &&
25
+ !(trimmed.startsWith("[") && trimmed.endsWith("]"))
26
+ ) {
27
+ return { success: false, data: str };
28
+ }
29
+ try {
30
+ return { success: true, data: JSON.parse(str) };
31
+ } catch {
32
+ return { success: false, data: str };
33
+ }
34
+ }
35
+
36
+ const JsonView = memo(
37
+ ({ data, name, initialExpandDepth = 2 }: JsonViewProps) => {
38
+ // Parse a JSON string once, not on every render.
39
+ const normalizedData = useMemo(
40
+ () => (typeof data === "string" ? tryParseJson(data).data : data),
41
+ [data],
42
+ );
43
+
44
+ return (
45
+ <div className=" text-sm transition-all duration-300">
46
+ <JsonNode
47
+ data={normalizedData as JsonValue}
48
+ name={name}
49
+ depth={0}
50
+ initialExpandDepth={initialExpandDepth}
51
+ />
52
+ </div>
53
+ );
54
+ },
55
+ );
56
+
57
+ JsonView.displayName = "JsonView";
58
+
59
+ interface JsonNodeProps {
60
+ data: JsonValue;
61
+ name?: string;
62
+ depth: number;
63
+ initialExpandDepth: number;
64
+ }
65
+
66
+ const JsonNode = memo(
67
+ ({ data, name, depth = 0, initialExpandDepth }: JsonNodeProps) => {
68
+ const getDataType = (value: JsonValue): string => {
69
+ if (value === undefined) return "undefined";
70
+ if (Array.isArray(value)) return "array";
71
+ if (value === null) return "null";
72
+ return typeof value;
73
+ };
74
+
75
+ const dataType = getDataType(data);
76
+ const [isExpanded, setIsExpanded] = useState(
77
+ dataType === "string" ? false : depth < initialExpandDepth,
78
+ );
79
+
80
+ const typeStyleMap: Record<string, string> = {
81
+ number: "text-blue-500",
82
+ boolean: "text-amber-500",
83
+ null: "text-purple-500",
84
+ undefined: "text-gray-500",
85
+ string: "text-foreground break-all whitespace-pre-wrap",
86
+ default: "text-muted-foreground",
87
+ };
88
+
89
+ const renderCollapsible = (isArray: boolean) => {
90
+ const items = isArray
91
+ ? (data as JsonValue[])
92
+ : Object.entries(data as Record<string, JsonValue>);
93
+ const itemCount = items.length;
94
+ const isEmpty = itemCount === 0;
95
+
96
+ const symbolMap = {
97
+ open: isArray ? "[" : "{",
98
+ close: isArray ? "]" : "}",
99
+ collapsed: isArray ? "[ ... ]" : "{ ... }",
100
+ empty: isArray ? "[]" : "{}",
101
+ };
102
+
103
+ if (isEmpty) {
104
+ return (
105
+ <div className="flex items-center">
106
+ {name && (
107
+ <span className="mr-1 text-muted-foreground">{name}:</span>
108
+ )}
109
+ <span className="text-muted-foreground">{symbolMap.empty}</span>
110
+ </div>
111
+ );
112
+ }
113
+
114
+ return (
115
+ <div className="flex flex-col">
116
+ <div
117
+ className="flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30"
118
+ onClick={() => setIsExpanded(!isExpanded)}
119
+ >
120
+ {name && (
121
+ <span className="mr-1 text-muted-foreground hover:text-foreground">
122
+ {name}:
123
+ </span>
124
+ )}
125
+ {isExpanded ? (
126
+ <span className="text-muted-foreground group-hover:text-foreground">
127
+ {symbolMap.open}
128
+ </span>
129
+ ) : (
130
+ <>
131
+ <span className="text-muted-foreground group-hover:text-foreground">
132
+ {symbolMap.collapsed}
133
+ </span>
134
+ <span className="ml-1 text-muted-foreground group-hover:text-foreground">
135
+ {itemCount} {itemCount === 1 ? "item" : "items"}
136
+ </span>
137
+ </>
138
+ )}
139
+ </div>
140
+ {isExpanded && (
141
+ <>
142
+ <div className="pl-2 ml-4 border-l border-border">
143
+ {isArray
144
+ ? (items as JsonValue[]).map((item, index) => (
145
+ <div key={index} className="my-1">
146
+ <JsonNode
147
+ data={item}
148
+ name={`${index}`}
149
+ depth={depth + 1}
150
+ initialExpandDepth={initialExpandDepth}
151
+ />
152
+ </div>
153
+ ))
154
+ : (items as [string, JsonValue][]).map(([key, value]) => (
155
+ <div key={key} className="my-1">
156
+ <JsonNode
157
+ data={value}
158
+ name={key}
159
+ depth={depth + 1}
160
+ initialExpandDepth={initialExpandDepth}
161
+ />
162
+ </div>
163
+ ))}
164
+ </div>
165
+ <div className="text-muted-foreground">{symbolMap.close}</div>
166
+ </>
167
+ )}
168
+ </div>
169
+ );
170
+ };
171
+
172
+ const renderString = (value: string) => {
173
+ const maxLength = 100;
174
+ const isTooLong = value.length > maxLength;
175
+
176
+ if (!isTooLong) {
177
+ return (
178
+ <div className="flex mr-1 rounded hover:bg-input/30">
179
+ {name && (
180
+ <span className="mr-1 text-muted-foreground">{name}:</span>
181
+ )}
182
+ <pre className={typeStyleMap.string}>&quot;{value}&quot;</pre>
183
+ </div>
184
+ );
185
+ }
186
+
187
+ return (
188
+ <div className="flex mr-1 rounded group hover:bg-input/30">
189
+ {name && (
190
+ <span className="mr-1 text-muted-foreground hover:text-foreground">
191
+ {name}:
192
+ </span>
193
+ )}
194
+ <pre
195
+ className={cn(
196
+ typeStyleMap.string,
197
+ "cursor-pointer group-hover:text-foreground",
198
+ )}
199
+ onClick={() => setIsExpanded(!isExpanded)}
200
+ title={isExpanded ? "Click to collapse" : "Click to expand"}
201
+ >
202
+ {isExpanded ? `"${value}"` : `"${value.slice(0, maxLength)}..."`}
203
+ </pre>
204
+ </div>
205
+ );
206
+ };
207
+
208
+ switch (dataType) {
209
+ case "object":
210
+ case "array":
211
+ return renderCollapsible(dataType === "array");
212
+ case "string":
213
+ return renderString(data as string);
214
+ case "undefined":
215
+ return (
216
+ <div className="flex items-center mr-1 rounded hover:bg-input/30">
217
+ {name && (
218
+ <span className="mr-1 text-muted-foreground">{name}:</span>
219
+ )}
220
+ <span className={typeStyleMap.undefined}>undefined</span>
221
+ </div>
222
+ );
223
+ default:
224
+ return (
225
+ <div className="flex items-center mr-1 rounded hover:bg-input/30">
226
+ {name && (
227
+ <span className="mr-1 text-muted-foreground">{name}:</span>
228
+ )}
229
+ <span className={typeStyleMap[dataType] || typeStyleMap.default}>
230
+ {data === null ? "null" : String(data)}
231
+ </span>
232
+ </div>
233
+ );
234
+ }
235
+ },
236
+ );
237
+
238
+ JsonNode.displayName = "JsonNode";
239
+
240
+ export default JsonView;
@@ -0,0 +1,141 @@
1
+ import {
2
+ motion,
3
+ useAnimationFrame,
4
+ useMotionValue,
5
+ useTransform,
6
+ } from "motion/react";
7
+ import React, { useCallback, useEffect, useRef, useState } from "react";
8
+
9
+ interface ShinyTextProps {
10
+ text: string;
11
+ disabled?: boolean;
12
+ speed?: number;
13
+ className?: string;
14
+ color?: string;
15
+ shineColor?: string;
16
+ spread?: number;
17
+ yoyo?: boolean;
18
+ pauseOnHover?: boolean;
19
+ direction?: "left" | "right";
20
+ delay?: number;
21
+ }
22
+
23
+ const ShinyText: React.FC<ShinyTextProps> = ({
24
+ text,
25
+ disabled = false,
26
+ speed = 2,
27
+ className = "",
28
+ color = "#b5b5b5",
29
+ shineColor = "#ffffff",
30
+ spread = 120,
31
+ yoyo = false,
32
+ pauseOnHover = false,
33
+ direction = "left",
34
+ delay = 0,
35
+ }) => {
36
+ const [isPaused, setIsPaused] = useState(false);
37
+ const progress = useMotionValue(0);
38
+ const elapsedRef = useRef(0);
39
+ const lastTimeRef = useRef<number | null>(null);
40
+ const directionRef = useRef(direction === "left" ? 1 : -1);
41
+
42
+ const animationDuration = speed * 1000;
43
+ const delayDuration = delay * 1000;
44
+
45
+ useAnimationFrame((time) => {
46
+ if (disabled || isPaused) {
47
+ lastTimeRef.current = null;
48
+ return;
49
+ }
50
+
51
+ if (lastTimeRef.current === null) {
52
+ lastTimeRef.current = time;
53
+ return;
54
+ }
55
+
56
+ const deltaTime = time - lastTimeRef.current;
57
+ lastTimeRef.current = time;
58
+
59
+ elapsedRef.current += deltaTime;
60
+
61
+ // Animation goes from 0 to 100
62
+ if (yoyo) {
63
+ const cycleDuration = animationDuration + delayDuration;
64
+ const fullCycle = cycleDuration * 2;
65
+ const cycleTime = elapsedRef.current % fullCycle;
66
+
67
+ if (cycleTime < animationDuration) {
68
+ // Forward animation: 0 -> 100
69
+ const p = (cycleTime / animationDuration) * 100;
70
+ progress.set(directionRef.current === 1 ? p : 100 - p);
71
+ } else if (cycleTime < cycleDuration) {
72
+ // Delay at end
73
+ progress.set(directionRef.current === 1 ? 100 : 0);
74
+ } else if (cycleTime < cycleDuration + animationDuration) {
75
+ // Reverse animation: 100 -> 0
76
+ const reverseTime = cycleTime - cycleDuration;
77
+ const p = 100 - (reverseTime / animationDuration) * 100;
78
+ progress.set(directionRef.current === 1 ? p : 100 - p);
79
+ } else {
80
+ // Delay at start
81
+ progress.set(directionRef.current === 1 ? 0 : 100);
82
+ }
83
+ } else {
84
+ const cycleDuration = animationDuration + delayDuration;
85
+ const cycleTime = elapsedRef.current % cycleDuration;
86
+
87
+ if (cycleTime < animationDuration) {
88
+ // Animation phase: 0 -> 100
89
+ const p = (cycleTime / animationDuration) * 100;
90
+ progress.set(directionRef.current === 1 ? p : 100 - p);
91
+ } else {
92
+ // Delay phase - hold at end (shine off-screen)
93
+ progress.set(directionRef.current === 1 ? 100 : 0);
94
+ }
95
+ }
96
+ });
97
+
98
+ useEffect(() => {
99
+ directionRef.current = direction === "left" ? 1 : -1;
100
+ elapsedRef.current = 0;
101
+ progress.set(0);
102
+ // eslint-disable-next-line react-hooks/exhaustive-deps
103
+ }, [direction]);
104
+
105
+ // Transform: p=0 -> 150% (shine off right), p=100 -> -50% (shine off left)
106
+ const backgroundPosition = useTransform(
107
+ progress,
108
+ (p) => `${150 - p * 2}% center`,
109
+ );
110
+
111
+ const handleMouseEnter = useCallback(() => {
112
+ if (pauseOnHover) setIsPaused(true);
113
+ }, [pauseOnHover]);
114
+
115
+ const handleMouseLeave = useCallback(() => {
116
+ if (pauseOnHover) setIsPaused(false);
117
+ }, [pauseOnHover]);
118
+
119
+ const gradientStyle: React.CSSProperties = {
120
+ backgroundImage: `linear-gradient(${spread}deg, ${color} 0%, ${color} 35%, ${shineColor} 50%, ${color} 65%, ${color} 100%)`,
121
+ backgroundSize: "200% auto",
122
+ WebkitBackgroundClip: "text",
123
+ backgroundClip: "text",
124
+ WebkitTextFillColor: "transparent",
125
+ };
126
+
127
+ return (
128
+ // inline-block beats a caller's `block`, so it also carries the max: without
129
+ // one it grows to its text and spills past the parent instead of truncating.
130
+ <motion.span
131
+ className={`inline-block max-w-full ${className}`}
132
+ style={{ ...gradientStyle, backgroundPosition }}
133
+ onMouseEnter={handleMouseEnter}
134
+ onMouseLeave={handleMouseLeave}
135
+ >
136
+ {text}
137
+ </motion.span>
138
+ );
139
+ };
140
+
141
+ export default ShinyText;