thursday-agent 0.21.0 → 0.22.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 (397) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +12 -12
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +11 -11
  16. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  17. package/.next/server/app/api/artifact/route.js +9 -8
  18. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/memory/route.js +9 -8
  21. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/route.js +9 -8
  23. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  24. package/.next/server/app/api/bot/thread/[id]/route.js +7 -6
  25. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  26. package/.next/server/app/api/bot/thread/file/route.js +17 -16
  27. package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
  28. package/.next/server/app/api/bot/thread/route.js +8 -7
  29. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  30. package/.next/server/app/api/config/route.js +5 -4
  31. package/.next/server/app/api/config/route.js.nft.json +1 -1
  32. package/.next/server/app/api/events/route.js.nft.json +1 -1
  33. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  34. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/llm-model/automatic/route.js +8 -7
  36. package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
  37. package/.next/server/app/api/llm-model/catalog/[provider]/route.js +8 -7
  38. package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -1
  39. package/.next/server/app/api/llm-model/credits/[provider]/route.js +8 -7
  40. package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -1
  41. package/.next/server/app/api/llm-model/route.js +9 -8
  42. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  43. package/.next/server/app/api/llm-model/subscription/route.js +9 -8
  44. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  45. package/.next/server/app/api/mcp/[name]/route.js +6 -5
  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 +6 -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 +6 -5
  50. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  51. package/.next/server/app/api/mcp/tools/route.js +6 -5
  52. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  53. package/.next/server/app/api/memory/edit/route.js +13 -12
  54. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  55. package/.next/server/app/api/memory/route.js +6 -5
  56. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  57. package/.next/server/app/api/reach/route.js +19 -18
  58. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  59. package/.next/server/app/api/routine/route.js +9 -8
  60. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  61. package/.next/server/app/api/running/route.js.nft.json +1 -1
  62. package/.next/server/app/api/signins/route.js +5 -4
  63. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  64. package/.next/server/app/api/skills/[source]/[name]/route.js +9 -8
  65. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  66. package/.next/server/app/api/skills/route.js +9 -8
  67. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  68. package/.next/server/app/api/thursday/call/end/route.js +6 -5
  69. package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
  70. package/.next/server/app/api/thursday/call/plan/route.js +15 -14
  71. package/.next/server/app/api/thursday/call/plan/route.js.nft.json +1 -1
  72. package/.next/server/app/api/thursday/call/route.js +7 -6
  73. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  74. package/.next/server/app/api/thursday/settings/route.js +6 -5
  75. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  76. package/.next/server/app/api/thursday/text/route.js +17 -16
  77. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  78. package/.next/server/app/api/thursday/tool-call/route.js +15 -14
  79. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  80. package/.next/server/app/api/workspace/files/route.js +8 -7
  81. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  82. package/.next/server/app/api/workspace/route.js +9 -8
  83. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  84. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
  85. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  86. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  88. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  89. package/.next/server/app/page/react-loadable-manifest.json +15 -1
  90. package/.next/server/app/page/server-reference-manifest.json +63 -63
  91. package/.next/server/app/page.js.nft.json +1 -1
  92. package/.next/server/app/page_client-reference-manifest.js +1 -1
  93. package/.next/server/chunks/[root-of-the-server]__0-5d50l._.js +3 -0
  94. package/.next/server/chunks/[root-of-the-server]__005onk_._.js +3 -0
  95. package/.next/server/chunks/[root-of-the-server]__00dtf7h._.js +3 -0
  96. package/.next/server/chunks/[root-of-the-server]__00f051a._.js +7 -0
  97. package/.next/server/chunks/[root-of-the-server]__019e1fy._.js +2 -2
  98. package/.next/server/chunks/[root-of-the-server]__01jpmcj._.js +1 -1
  99. package/.next/server/chunks/[root-of-the-server]__0340k46._.js +7 -0
  100. package/.next/server/chunks/[root-of-the-server]__03bjojd._.js +1 -1
  101. package/.next/server/chunks/[root-of-the-server]__03vunn6._.js +1 -1
  102. package/.next/server/chunks/[root-of-the-server]__05fq824._.js +3 -0
  103. package/.next/server/chunks/[root-of-the-server]__06kxzw-._.js +1 -1
  104. package/.next/server/chunks/[root-of-the-server]__08922kg._.js +3 -0
  105. package/.next/server/chunks/[root-of-the-server]__0atwstu._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__0btxiu1._.js +3 -0
  107. package/.next/server/chunks/[root-of-the-server]__0d-dfqm._.js +1 -1
  108. package/.next/server/chunks/[root-of-the-server]__0gmxpev._.js +3 -0
  109. package/.next/server/chunks/[root-of-the-server]__0itmdqy._.js +3 -0
  110. package/.next/server/chunks/[root-of-the-server]__0m0qglo._.js +5 -0
  111. package/.next/server/chunks/[root-of-the-server]__0mh1tgg._.js +1 -1
  112. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
  113. package/.next/server/chunks/[root-of-the-server]__0ndw2yj._.js +1 -1
  114. package/.next/server/chunks/[root-of-the-server]__0sfx6id._.js +3 -0
  115. package/.next/server/chunks/[root-of-the-server]__0xn7a8p._.js +3 -0
  116. package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
  117. package/.next/server/chunks/[root-of-the-server]__1478lu3._.js +1 -1
  118. package/.next/server/chunks/[root-of-the-server]__16y0k92._.js +3 -0
  119. package/.next/server/chunks/[root-of-the-server]__17kdjf6._.js +1 -1
  120. package/.next/server/chunks/[root-of-the-server]__17m7ag9._.js +1 -1
  121. package/.next/server/chunks/[root-of-the-server]__19aqyg-._.js +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +1 -1
  123. package/.next/server/chunks/[root-of-the-server]__1a0xgyh._.js +1 -1
  124. package/.next/server/chunks/[root-of-the-server]__1ceammd._.js +1 -1
  125. package/.next/server/chunks/{[root-of-the-server]__01y-8gg._.js → [root-of-the-server]__1clkgmj._.js} +3 -3
  126. package/.next/server/chunks/[root-of-the-server]__1dth047._.js +1 -1
  127. package/.next/server/chunks/[root-of-the-server]__1g08s7l._.js +5 -0
  128. package/.next/server/chunks/[root-of-the-server]__1huywqp._.js +1 -1
  129. package/.next/server/chunks/[root-of-the-server]__1ij4h2a._.js +3 -0
  130. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  131. package/.next/server/chunks/[root-of-the-server]__1o7z93z._.js +1 -1
  132. package/.next/server/chunks/[root-of-the-server]__1onvx8x._.js +1 -1
  133. package/.next/server/chunks/[root-of-the-server]__1q1s4ls._.js +3 -0
  134. package/.next/server/chunks/[root-of-the-server]__1qa67zs._.js +3 -0
  135. package/.next/server/chunks/[root-of-the-server]__1t-mfa4._.js +5 -0
  136. package/.next/server/chunks/[root-of-the-server]__20ofm9t._.js +3 -0
  137. package/.next/server/chunks/_0-qt5if._.js +1 -1
  138. package/.next/server/chunks/_02mn8d7._.js +1 -1
  139. package/.next/server/chunks/_03p6r2-._.js +1 -1
  140. package/.next/server/chunks/_0483t_f._.js +1 -1
  141. package/.next/server/chunks/_06b5b4-._.js +1 -1
  142. package/.next/server/chunks/_06u9yo-._.js +1 -1
  143. package/.next/server/chunks/_07pkeds._.js +1 -1
  144. package/.next/server/chunks/_08354bn._.js +21 -19
  145. package/.next/server/chunks/_09rtyfn._.js +93 -91
  146. package/.next/server/chunks/_0cq69mm._.js +1 -1
  147. package/.next/server/chunks/_0fau3ya._.js +1 -1
  148. package/.next/server/chunks/_0ggqpiz._.js +1 -1
  149. package/.next/server/chunks/_0gxz_1b._.js +1 -1
  150. package/.next/server/chunks/_0lcthk8._.js +1 -1
  151. package/.next/server/chunks/_0p27in2._.js +1 -1
  152. package/.next/server/chunks/_0ue8nq-._.js +1 -1
  153. package/.next/server/chunks/_0uv1gs1._.js +1 -1
  154. package/.next/server/chunks/_0wyh244._.js +21 -19
  155. package/.next/server/chunks/_0zwjr-g._.js +1 -1
  156. package/.next/server/chunks/_1-wp0r0._.js +1 -1
  157. package/.next/server/chunks/_11y8h29._.js +1 -1
  158. package/.next/server/chunks/_14xuq46._.js +93 -91
  159. package/.next/server/chunks/_17fjc-7._.js +5 -0
  160. package/.next/server/chunks/_1823_7a._.js +4 -4
  161. package/.next/server/chunks/_18z965x._.js +1 -1
  162. package/.next/server/chunks/_1ac33qw._.js +1 -1
  163. package/.next/server/chunks/_1cw6-rv._.js +3 -0
  164. package/.next/server/chunks/_1dcbwn-._.js +1 -1
  165. package/.next/server/chunks/_1evvnbp._.js +18 -0
  166. package/.next/server/chunks/_1gn2r2q._.js +15 -15
  167. package/.next/server/chunks/{_00lwnht._.js → _1hw1ujv._.js} +2 -2
  168. package/.next/server/chunks/_1icgbi8._.js +18 -0
  169. package/.next/server/chunks/{_0txk_9z._.js → _1jtvbp9._.js} +2 -2
  170. package/.next/server/chunks/_1ko5shz._.js +1 -1
  171. package/.next/server/chunks/_1ksyu6r._.js +1 -1
  172. package/.next/server/chunks/{_1ntwp1s._.js → _1mgzs18._.js} +1 -1
  173. package/.next/server/chunks/_1q42187._.js +4 -4
  174. package/.next/server/chunks/_1q6e56i._.js +15 -15
  175. package/.next/server/chunks/_1t43w6q._.js +1 -1
  176. package/.next/server/chunks/_1t8fv7b._.js +18 -0
  177. package/.next/server/chunks/_1tjwvoz._.js +1 -1
  178. package/.next/server/chunks/_1ufbxe1._.js +1 -1
  179. package/.next/server/chunks/_1uu4wjr._.js +1 -1
  180. package/.next/server/chunks/{_0q6gng9._.js → _1v4id5q._.js} +2 -2
  181. package/.next/server/chunks/{_07vwkt7._.js → _1v5qol2._.js} +2 -2
  182. package/.next/server/chunks/_1wg0cqo._.js +1 -1
  183. package/.next/server/chunks/_1wgae1c._.js +3 -0
  184. package/.next/server/chunks/_1x2xiyw._.js +1 -1
  185. package/.next/server/chunks/_1xps4ob._.js +3 -0
  186. package/.next/server/chunks/_201k0ah._.js +1 -1
  187. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  188. package/.next/server/chunks/features_bot_08z387_._.js +4 -4
  189. package/.next/server/chunks/node_modules_zod_v4_01bha1c._.js +60 -0
  190. package/.next/server/chunks/node_modules_zod_v4_0b99z6a._.js +60 -0
  191. package/.next/server/chunks/node_modules_zod_v4_0r3ybe4._.js +60 -0
  192. package/.next/server/chunks/node_modules_zod_v4_1t1yj1u._.js +60 -0
  193. package/.next/server/chunks/node_modules_zod_v4_1zz6lo1._.js +60 -0
  194. package/.next/server/chunks/ssr/[root-of-the-server]__0eloa6y._.js +5 -5
  195. package/.next/server/chunks/ssr/[root-of-the-server]__0jjj49d._.js +3 -0
  196. package/.next/server/chunks/ssr/[root-of-the-server]__0yyxgt2._.js +3 -0
  197. package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
  198. package/.next/server/chunks/ssr/[root-of-the-server]__203utm3._.js +3 -0
  199. package/.next/server/chunks/ssr/[root-of-the-server]__20t_4l2._.js +1 -1
  200. package/.next/server/chunks/ssr/_0-y08rv._.js +3 -0
  201. package/.next/server/chunks/ssr/_00buy3i._.js +162 -0
  202. package/.next/server/chunks/ssr/_014_wjp._.js +3 -0
  203. package/.next/server/chunks/ssr/_07m4ii5._.js +3 -0
  204. package/.next/server/chunks/ssr/_09a6bpd._.js +1 -1
  205. package/.next/server/chunks/ssr/{_1569s5b._.js → _0gn_i4s._.js} +2 -2
  206. package/.next/server/chunks/ssr/_0iuvjnw._.js +3 -0
  207. package/.next/server/chunks/ssr/_0j6rtjm._.js +6 -0
  208. package/.next/server/chunks/ssr/{_19u7y57._.js → _0ntol64._.js} +2 -2
  209. package/.next/server/chunks/ssr/_0ogkeu-._.js +3 -0
  210. package/.next/server/chunks/ssr/{_1h0hk_h._.js → _0t_e9rd._.js} +2 -2
  211. package/.next/server/chunks/ssr/{_1-zhg63._.js → _0u43zjx._.js} +2 -2
  212. package/.next/server/chunks/ssr/_0ux4i2m._.js +1 -1
  213. package/.next/server/chunks/ssr/{_1iix_k_._.js → _0xurp8n._.js} +2 -2
  214. package/.next/server/chunks/ssr/_10sc7ab._.js +3 -0
  215. package/.next/server/chunks/ssr/_12hdw8x._.js +22 -20
  216. package/.next/server/chunks/ssr/{_02ybodf._.js → _14nwim3._.js} +2 -2
  217. package/.next/server/chunks/ssr/{_2024r5e._.js → _16o81mn._.js} +2 -2
  218. package/.next/server/chunks/ssr/_1bfrntd._.js +2 -2
  219. package/.next/server/chunks/ssr/_1crszf7._.js +1 -1
  220. package/.next/server/chunks/ssr/_1e01b-_._.js +3 -0
  221. package/.next/server/chunks/ssr/{_0y0qnim._.js → _1gz4ov7._.js} +3 -3
  222. package/.next/server/chunks/ssr/_1neoj22._.js +2 -1
  223. package/.next/server/chunks/ssr/{_04ik9s8._.js → _1nfv27b._.js} +2 -2
  224. package/.next/server/chunks/ssr/_1nwey7a._.js +3 -0
  225. package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
  226. package/.next/server/chunks/ssr/features_ai_components_model-picker_tsx_0ucb1y9._.js +1 -1
  227. package/.next/server/chunks/ssr/features_bot_06n7hmd._.js +3 -0
  228. package/.next/server/chunks/ssr/features_bot_0tb4ui-._.js +1 -1
  229. package/.next/server/chunks/ssr/{_07nmtxo._.js → features_bot_1knyan7._.js} +2 -2
  230. package/.next/server/chunks/ssr/{features_config_1l7bn84._.js → features_config_09wq1s9._.js} +3 -3
  231. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  232. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  233. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  234. package/.next/server/chunks/ssr/features_thursday_0cf9y0b._.js +3 -0
  235. package/.next/server/chunks/ssr/features_thursday_components_ascii-orb_tsx_1yug8cw._.js +3 -0
  236. package/.next/server/chunks/ssr/features_thursday_components_here-globe_tsx_055duhw._.js +3 -0
  237. package/.next/server/chunks/ssr/{node_modules_1bj1zfp._.js → node_modules_01fukqn._.js} +1 -1
  238. package/.next/server/chunks/ssr/{node_modules_1r-1n7c._.js → node_modules_01v7ybp._.js} +1 -1
  239. package/.next/server/chunks/ssr/{node_modules_0f0lohc._.js → node_modules_0536cp2._.js} +1 -1
  240. package/.next/server/chunks/ssr/{node_modules_13iz-t6._.js → node_modules_056xgci._.js} +1 -1
  241. package/.next/server/chunks/ssr/{node_modules_1rnfv0r._.js → node_modules_06n6ruk._.js} +1 -1
  242. package/.next/server/chunks/ssr/{node_modules_1d5j3h5._.js → node_modules_08m1gvh._.js} +1 -1
  243. package/.next/server/chunks/ssr/{node_modules_1_j-et6._.js → node_modules_0_zk6yd._.js} +1 -1
  244. package/.next/server/chunks/ssr/{node_modules_0c1grmu._.js → node_modules_0cpegwf._.js} +1 -1
  245. package/.next/server/chunks/ssr/{node_modules_107249-._.js → node_modules_0e398ts._.js} +1 -1
  246. package/.next/server/chunks/ssr/{node_modules_0ja2eo8._.js → node_modules_0ie8g6a._.js} +2 -2
  247. package/.next/server/chunks/ssr/{node_modules_074pspl._.js → node_modules_0ksqeyy._.js} +1 -1
  248. package/.next/server/chunks/ssr/{node_modules_0ydatn4._.js → node_modules_0m-dnm-._.js} +1 -1
  249. package/.next/server/chunks/ssr/{node_modules_0eoqrzb._.js → node_modules_0m2oth3._.js} +1 -1
  250. package/.next/server/chunks/ssr/{node_modules_1b6sm1g._.js → node_modules_0yn2z6s._.js} +1 -1
  251. package/.next/server/chunks/ssr/{node_modules_0uuobx8._.js → node_modules_12hh0bx._.js} +1 -1
  252. package/.next/server/chunks/ssr/{node_modules_0q-53p6._.js → node_modules_13dwal5._.js} +1 -1
  253. package/.next/server/chunks/ssr/{node_modules_0efmaot._.js → node_modules_16tn8xu._.js} +1 -1
  254. package/.next/server/chunks/ssr/{node_modules_0x4geuk._.js → node_modules_19r9vjv._.js} +1 -1
  255. package/.next/server/chunks/ssr/{node_modules_0k9lm-f._.js → node_modules_1bvw77g._.js} +1 -1
  256. package/.next/server/chunks/ssr/{node_modules_1dgdpcc._.js → node_modules_1ctm_ju._.js} +1 -1
  257. package/.next/server/chunks/ssr/{node_modules_1oo6jfv._.js → node_modules_1dlue-g._.js} +1 -1
  258. package/.next/server/chunks/ssr/{node_modules_1sbozb5._.js → node_modules_1fqgrh0._.js} +1 -1
  259. package/.next/server/chunks/ssr/{node_modules_17eaxbw._.js → node_modules_1i-g3bz._.js} +1 -1
  260. package/.next/server/chunks/ssr/{node_modules_1b_78mo._.js → node_modules_1jf8aik._.js} +1 -1
  261. package/.next/server/chunks/ssr/{node_modules_0vva828._.js → node_modules_1kfbdfo._.js} +1 -1
  262. package/.next/server/chunks/ssr/{node_modules_0lu90ps._.js → node_modules_1zalmtr._.js} +1 -1
  263. package/.next/server/chunks/ssr/{node_modules_1qgte25._.js → node_modules_1zdz2zf._.js} +1 -1
  264. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0obor-y._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0nj1l8f._.js} +1 -1
  265. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0oip1-o._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_17ok98u._.js} +1 -1
  266. package/.next/server/middleware-build-manifest.js +3 -3
  267. package/.next/server/pages/404.html +1 -1
  268. package/.next/server/pages/500.html +1 -1
  269. package/.next/server/server-reference-manifest.js +1 -1
  270. package/.next/server/server-reference-manifest.json +64 -64
  271. package/.next/static/chunks/01r1uco3ikisc.js +2 -0
  272. package/.next/static/chunks/{33s9l7hkzyylm.js → 052u13mcoxt87.js} +1 -1
  273. package/.next/static/chunks/{023rfhzsxzhh1.js → 05blzta_1i7c2.js} +1 -1
  274. package/.next/static/chunks/09kwsjbmr_z1w.js +1 -0
  275. package/.next/static/chunks/0go5_9zqag7l0.js +1 -0
  276. package/.next/static/chunks/0hpx0--bh7vld.js +1 -0
  277. package/.next/static/chunks/0o0vshni5ny91.js +1 -0
  278. package/.next/static/chunks/0ynv7zu_bguve.js +1 -0
  279. package/.next/static/chunks/0zi59tghmg1lu.js +18 -0
  280. package/.next/static/chunks/1_ftsgxa-sia_.js +1 -0
  281. package/.next/static/chunks/1cg3torc90q5t.js +1 -0
  282. package/.next/static/chunks/{3zhqveam0_kub.js → 1dy5xaxjdsy11.js} +1 -1
  283. package/.next/static/chunks/1qnx1h5c8f93b.js +1 -0
  284. package/.next/static/chunks/1rwn3d9ji5w35.js +1 -0
  285. package/.next/static/chunks/{1tyxz6thgf2w6.js → 1so3f5fi7e5g9.js} +1 -1
  286. package/.next/static/chunks/1ya41wxfmp4s8.js +1 -0
  287. package/.next/static/chunks/27rwkfu7_xvs1.js +4 -0
  288. package/.next/static/chunks/2hueh8masqd91.js +15 -0
  289. package/.next/static/chunks/2jrt_752fqz2f.js +1 -0
  290. package/.next/static/chunks/{3fcnfq383hu-y.js → 2nbj2t9yp8ke9.js} +1 -1
  291. package/.next/static/chunks/2ogme4qydxnaq.js +3 -0
  292. package/.next/static/chunks/2r2tocw2rpvm2.js +1 -0
  293. package/.next/static/chunks/2t4kimg1lt-p7.js +2 -0
  294. package/.next/static/chunks/2w6y71o27my_z.js +1 -0
  295. package/.next/static/chunks/{2-2ts24vi9ete.js → 3146sccz1j76i.js} +1 -1
  296. package/.next/static/chunks/31_am8rtmk_tv.css +1 -0
  297. package/.next/static/chunks/{41iv7b8_3z92h.js → 35ehi-okrfot5.js} +1 -1
  298. package/.next/static/chunks/3866u-edsoyj3.js +1 -0
  299. package/.next/static/chunks/3drvp6w6dqzqg.js +1 -0
  300. package/.next/static/chunks/3qfhjwd9yuijo.js +1 -0
  301. package/.next/static/chunks/{3axovmkkuh1us.js → 3tyacy8fh5_18.js} +2 -2
  302. package/.next/static/chunks/3zv4wiqjl5kex.js +1 -0
  303. package/guide/bots.md +25 -5
  304. package/guide/calls.md +18 -9
  305. package/guide/setup.md +15 -4
  306. package/guide/trouble.md +2 -3
  307. package/package.json +1 -1
  308. package/public/here/NOTICE +43 -0
  309. package/public/here/world.json +1 -0
  310. package/skills/README.md +4 -0
  311. package/skills/artifact/SKILL.md +7 -6
  312. package/skills/artifact/references/motion.md +150 -0
  313. package/skills/artifact/runtime/motion/film.js +866 -0
  314. package/skills/artifact/runtime/motion/fonts/Gaegu-Bold.woff2 +0 -0
  315. package/skills/artifact/runtime/motion/fonts/OFL.txt +92 -0
  316. package/skills/artifact/runtime/motion/kit-core.js +699 -0
  317. package/skills/artifact/runtime/motion/kit-people.js +1305 -0
  318. package/skills/artifact/runtime/motion/kit-places.js +854 -0
  319. package/skills/artifact/runtime/motion/kit-things.js +903 -0
  320. package/skills/artifact/runtime/motion/motion.html +108 -0
  321. package/skills/artifact/runtime/motion/page.mjs +54 -0
  322. package/skills/artifact/runtime/motion/score.js +625 -0
  323. package/skills/artifact/scripts/book-video.mjs +1 -46
  324. package/skills/artifact/scripts/media.mjs +74 -0
  325. package/skills/artifact/scripts/motion.mjs +605 -0
  326. package/skills/artifact/templates/motion/birthday.js +182 -0
  327. package/skills/browser/SKILL.md +4 -1
  328. package/skills/browser/scripts/serve.mjs +26 -3
  329. package/skills/browser/scripts/session.mjs +12 -3
  330. package/.next/server/chunks/[root-of-the-server]__0-fn06g._.js +0 -3
  331. package/.next/server/chunks/[root-of-the-server]__03lc17t._.js +0 -3
  332. package/.next/server/chunks/[root-of-the-server]__06nspyt._.js +0 -3
  333. package/.next/server/chunks/[root-of-the-server]__09c88lb._.js +0 -3
  334. package/.next/server/chunks/[root-of-the-server]__09dxfp5._.js +0 -3
  335. package/.next/server/chunks/[root-of-the-server]__0_0w3ug._.js +0 -3
  336. package/.next/server/chunks/[root-of-the-server]__0ap1nbu._.js +0 -5
  337. package/.next/server/chunks/[root-of-the-server]__0bmtib_._.js +0 -7
  338. package/.next/server/chunks/[root-of-the-server]__0im1m7z._.js +0 -3
  339. package/.next/server/chunks/[root-of-the-server]__0mt72qk._.js +0 -7
  340. package/.next/server/chunks/[root-of-the-server]__0uj9rm-._.js +0 -3
  341. package/.next/server/chunks/[root-of-the-server]__0z5n9xz._.js +0 -5
  342. package/.next/server/chunks/[root-of-the-server]__16e_e0e._.js +0 -5
  343. package/.next/server/chunks/[root-of-the-server]__16gn7zn._.js +0 -3
  344. package/.next/server/chunks/[root-of-the-server]__18k8s-z._.js +0 -3
  345. package/.next/server/chunks/[root-of-the-server]__1aw-1kd._.js +0 -3
  346. package/.next/server/chunks/[root-of-the-server]__1kmnkbk._.js +0 -3
  347. package/.next/server/chunks/[root-of-the-server]__1op8qe5._.js +0 -3
  348. package/.next/server/chunks/[root-of-the-server]__1pkq_1z._.js +0 -3
  349. package/.next/server/chunks/[root-of-the-server]__20w_g71._.js +0 -3
  350. package/.next/server/chunks/_01c32w9._.js +0 -75
  351. package/.next/server/chunks/_02bov6_._.js +0 -75
  352. package/.next/server/chunks/_053bi70._.js +0 -60
  353. package/.next/server/chunks/_08s4vft._.js +0 -75
  354. package/.next/server/chunks/_0fb6dvr._.js +0 -75
  355. package/.next/server/chunks/_0iw19ig._.js +0 -75
  356. package/.next/server/chunks/_0mo_6or._.js +0 -5
  357. package/.next/server/chunks/_0poi1t2._.js +0 -75
  358. package/.next/server/chunks/_1d7og_q._.js +0 -75
  359. package/.next/server/chunks/_1o3fc2d._.js +0 -60
  360. package/.next/server/chunks/_20zp65o._.js +0 -60
  361. package/.next/server/chunks/ssr/[root-of-the-server]__03e9zqg._.js +0 -3
  362. package/.next/server/chunks/ssr/[root-of-the-server]__1hbvuqr._.js +0 -3
  363. package/.next/server/chunks/ssr/[root-of-the-server]__1y8_-v1._.js +0 -3
  364. package/.next/server/chunks/ssr/_00_9573._.js +0 -3
  365. package/.next/server/chunks/ssr/_03vw3u5._.js +0 -3
  366. package/.next/server/chunks/ssr/_0iwsdp7._.js +0 -3
  367. package/.next/server/chunks/ssr/_0llhg-6._.js +0 -3
  368. package/.next/server/chunks/ssr/_0o__2ss._.js +0 -3
  369. package/.next/server/chunks/ssr/_0pbav_w._.js +0 -3
  370. package/.next/server/chunks/ssr/_0yjn4jm._.js +0 -162
  371. package/.next/server/chunks/ssr/_186ifln._.js +0 -3
  372. package/.next/server/chunks/ssr/_1x4lhpf._.js +0 -3
  373. package/.next/server/chunks/ssr/_1xfiate._.js +0 -5
  374. package/.next/server/chunks/ssr/features_bot_1dvvmo3._.js +0 -3
  375. package/.next/server/chunks/ssr/features_thursday_0gbh5j_._.js +0 -3
  376. package/.next/static/chunks/06k2o5zxc3xhv.js +0 -1
  377. package/.next/static/chunks/0_s4z70lx1tgs.js +0 -1
  378. package/.next/static/chunks/0cbitatnyjhz7.js +0 -1
  379. package/.next/static/chunks/0m5-0kx85axzv.js +0 -18
  380. package/.next/static/chunks/0non225e2mzp-.js +0 -1
  381. package/.next/static/chunks/0q9b2n6l4flqb.js +0 -1
  382. package/.next/static/chunks/0uhddock-ik4v.js +0 -1
  383. package/.next/static/chunks/14y1gqfplan8a.js +0 -1
  384. package/.next/static/chunks/1pidafhkyxhqw.js +0 -1
  385. package/.next/static/chunks/1sy7zm5dplzym.css +0 -1
  386. package/.next/static/chunks/1t7u4xfljptkv.js +0 -1
  387. package/.next/static/chunks/2nf3mskfp9cyc.js +0 -15
  388. package/.next/static/chunks/2uraofiaoy32s.js +0 -1
  389. package/.next/static/chunks/2vw9_trh_ntv6.js +0 -2
  390. package/.next/static/chunks/2x6-fpctvucte.js +0 -1
  391. package/.next/static/chunks/33lm6ytc816te.js +0 -1
  392. package/.next/static/chunks/3p5q6rj40jmcy.js +0 -1
  393. package/.next/static/chunks/3p80hsvcabgw_.js +0 -3
  394. package/.next/static/chunks/3qez_j23ikyar.js +0 -1
  395. /package/.next/static/{gx61wKkj9_eBGMdyfbBlr → 8exfHAtcoebYtxjUC4ugl}/_buildManifest.js +0 -0
  396. /package/.next/static/{gx61wKkj9_eBGMdyfbBlr → 8exfHAtcoebYtxjUC4ugl}/_clientMiddlewareManifest.js +0 -0
  397. /package/.next/static/{gx61wKkj9_eBGMdyfbBlr → 8exfHAtcoebYtxjUC4ugl}/_ssgManifest.js +0 -0
@@ -0,0 +1,1305 @@
1
+ // Who is in a film: people cut out of paper (any skin, hair, clothes and age, in a pose and
2
+ // with a face), Thursday herself (a little blue sun made of letters), her bots, a dog, a cat.
3
+ // All stand on (x, y): x their middle, y where their feet touch the ground.
4
+
5
+ const SKINS = {
6
+ light: "#f3cfae",
7
+ fair: "#ecb793",
8
+ tan: "#d69a6c",
9
+ brown: "#a86b43",
10
+ deep: "#6e4429",
11
+ };
12
+ const HAIRS = {
13
+ black: "#2b2226",
14
+ brown: "#6b4430",
15
+ blond: "#e8bf62",
16
+ red: "#b84a2a",
17
+ grey: "#c7c3be",
18
+ white: "#eeeae4",
19
+ };
20
+ const INK = "#221f3f";
21
+
22
+ /** Body measures for an age, in units of a grown-up 1000 tall. */
23
+ const BODY = {
24
+ adult: { R: 150, neck: -590, hip: -300, sw: 120, leg: 64 },
25
+ elder: { R: 150, neck: -575, hip: -300, sw: 122, leg: 64 },
26
+ child: { R: 168, neck: -455, hip: -225, sw: 100, leg: 58 },
27
+ };
28
+
29
+ /**
30
+ * Where the hands go in a pose, from each shoulder, in arm lengths (A) and head radii (R):
31
+ * [left hand, right hand], each [x, y], and the feet. `t` moves the poses that move.
32
+ */
33
+ function poseHands(pose, B, t, facing) {
34
+ const A = (B.hip - B.neck) * 1.02;
35
+ const f = facing;
36
+ const headY = B.neck - B.R * 0.9;
37
+ const sway = Math.sin(t * 7);
38
+ const down = [
39
+ [-0.16 * A, 0.94 * A],
40
+ [0.16 * A, 0.94 * A],
41
+ ];
42
+ switch (pose) {
43
+ case "wave":
44
+ return [down[0], [0.5 * A + sway * 0.14 * A, -0.9 * A]];
45
+ case "cheer":
46
+ return [
47
+ [-0.55 * A, -0.9 * A + sway * 0.05 * A],
48
+ [0.55 * A, -0.9 * A - sway * 0.05 * A],
49
+ ];
50
+ case "hold":
51
+ return [
52
+ [0.45 * A, 0.62 * A],
53
+ [-0.45 * A, 0.62 * A],
54
+ ];
55
+ case "give":
56
+ return [
57
+ [0.55 * A + f * 0.35 * A, 0.45 * A],
58
+ [-0.55 * A + f * 0.35 * A, 0.45 * A],
59
+ ];
60
+ case "hug":
61
+ return f > 0
62
+ ? [
63
+ [0.95 * A, 0.4 * A],
64
+ [0.75 * A, 0.3 * A],
65
+ ]
66
+ : [
67
+ [-0.75 * A, 0.3 * A],
68
+ [-0.95 * A, 0.4 * A],
69
+ ];
70
+ case "point":
71
+ return f > 0
72
+ ? [down[0], [1.0 * A, -0.12 * A]]
73
+ : [[-1.0 * A, -0.12 * A], down[1]];
74
+ case "clap": {
75
+ const o = 0.12 * A + 0.1 * A * Math.abs(Math.sin(t * 9));
76
+ return [
77
+ [0.72 * A - o, 0.5 * A],
78
+ [-0.72 * A + o, 0.5 * A],
79
+ ];
80
+ }
81
+ case "heart": {
82
+ // Arms up over the head, hands meeting on top: a heart made of arms
83
+ const top = headY - B.R * 1.05 - (B.neck + 40);
84
+ return [
85
+ [B.sw - 30, top],
86
+ [-B.sw + 30, top],
87
+ ];
88
+ }
89
+ case "cheeks":
90
+ return [
91
+ [B.sw - 15 - B.R * 0.72, headY + B.R * 0.35 - (B.neck + 40)],
92
+ [-B.sw + 15 + B.R * 0.72, headY + B.R * 0.35 - (B.neck + 40)],
93
+ ];
94
+ case "think":
95
+ return [
96
+ [0.55 * A, 0.62 * A],
97
+ [-B.sw + 15 + B.R * 0.35, headY + B.R * 0.85 - (B.neck + 40)],
98
+ ];
99
+ case "shrug":
100
+ return [
101
+ [-0.75 * A, 0.3 * A],
102
+ [0.75 * A, 0.3 * A],
103
+ ];
104
+ case "walk": {
105
+ const s = Math.sin(t * 6.5);
106
+ return [
107
+ [-0.16 * A + s * 0.28 * A, 0.9 * A],
108
+ [0.16 * A + s * 0.28 * A, 0.9 * A],
109
+ ];
110
+ }
111
+ case "sit":
112
+ return [
113
+ [0.3 * A, 0.95 * A + 90],
114
+ [-0.3 * A, 0.95 * A + 90],
115
+ ];
116
+ default:
117
+ return down;
118
+ }
119
+ }
120
+ /** An elbow between a shoulder and a hand, bent away from the body. */
121
+ function elbowOf(S, H, A, side) {
122
+ const dx = H[0] - S[0];
123
+ const dy = H[1] - S[1];
124
+ const d = Math.hypot(dx, dy) || 1;
125
+ const half = Math.min(d / 2, A / 2);
126
+ const h = Math.sqrt(Math.max(0, (A / 2) ** 2 - half ** 2));
127
+ const mx = S[0] + dx / 2;
128
+ const my = S[1] + dy / 2;
129
+ const px = -dy / d;
130
+ const py = dx / d;
131
+ const a = [mx + px * h, my + py * h];
132
+ const b = [mx - px * h, my - py * h];
133
+ return a[0] * side > b[0] * side ? a : b;
134
+ }
135
+
136
+ const FACES = {
137
+ smile: ["open", "smile"],
138
+ happy: ["happy", "grin"],
139
+ laugh: ["happy", "laugh"],
140
+ surprised: ["wide", "o"],
141
+ sad: ["sad", "frown"],
142
+ cry: ["shut", "wobble", "tears"],
143
+ teary: ["happy", "smile", "tears"],
144
+ sleepy: ["shut", "flat"],
145
+ calm: ["shut", "smile"],
146
+ wink: ["wink", "grin"],
147
+ love: ["hearts", "grin"],
148
+ talk: ["open", "talk"],
149
+ worried: ["worried", "wobble"],
150
+ proud: ["shut", "grin"],
151
+ };
152
+
153
+ /** The face on a head `R` across, its middle at (0, 0). */
154
+ function faceOf(R, o, t, age) {
155
+ const k = R / 100;
156
+ const [eyes, mouth, extra] = FACES[o.face ?? "smile"] ?? FACES.smile;
157
+ const look = o.look ?? [0, 0];
158
+ // Everyone blinks now and then, each on their own time
159
+ const every = 3.1 + hash(o.seed ?? 1, 30) * 1.6;
160
+ const u = (t + hash(o.seed ?? 1, 31) * every) % every;
161
+ const blink = eyes === "open" && u < 0.14 ? Math.sin((u / 0.14) * PI) : 0;
162
+ for (const side of [-1, 1]) {
163
+ blob(
164
+ ellipse(side * 60 * k, 34 * k, 17 * k, 12 * k, 16),
165
+ `rgba(242,120,130,${o.blush ?? 0.5})`,
166
+ );
167
+ const ex = side * 36 * k + look[0] * 6 * k;
168
+ const ey = 6 * k + look[1] * 5 * k;
169
+ const e =
170
+ eyes === "wink" && side === 1 ? "happy" : eyes === "wink" ? "open" : eyes;
171
+ if (e === "open" || e === "wide" || e === "worried") {
172
+ const s = e === "wide" ? 1.25 : 1;
173
+ const h = 13 * s * (1 - 0.85 * blink);
174
+ blob(ellipse(ex, ey, 10 * s * k, h * k, 16), INK);
175
+ if (blink < 0.5)
176
+ blob(
177
+ ellipse(ex + 3.5 * k, ey - 4.5 * k, 3.6 * k, 3.8 * k, 8),
178
+ "#ffffff",
179
+ { jitter: 0.4 },
180
+ );
181
+ if (e === "wide")
182
+ crayon(
183
+ arc(side * 36 * k, -22 * k, 14 * k, 7 * k, PI * 1.15, PI * 1.85),
184
+ 4.5 * k,
185
+ INK,
186
+ { shine: false },
187
+ );
188
+ if (e === "worried")
189
+ crayon(
190
+ [
191
+ [side * 22 * k, -20 * k],
192
+ [side * 50 * k, -12 * k],
193
+ ],
194
+ 4.5 * k,
195
+ INK,
196
+ { shine: false },
197
+ );
198
+ } else if (e === "happy") {
199
+ crayon(
200
+ arc(ex, ey + 6 * k, 11 * k, 10 * k, PI * 1.1, PI * 1.9),
201
+ 5 * k,
202
+ INK,
203
+ { shine: false },
204
+ );
205
+ } else if (e === "sad") {
206
+ blob(ellipse(ex, ey + 3 * k, 8 * k, 10 * k, 14), INK);
207
+ crayon(
208
+ [
209
+ [side * 22 * k, -16 * k],
210
+ [side * 50 * k, -24 * k],
211
+ ],
212
+ 4.5 * k,
213
+ INK,
214
+ { shine: false },
215
+ );
216
+ } else if (e === "hearts") {
217
+ blob(heart(ex, ey - 2 * k, 15 * k), "#e0463f");
218
+ } else {
219
+ crayon(
220
+ arc(ex, ey - 2 * k, 11 * k, 8 * k, PI * 0.1, PI * 0.9),
221
+ 5 * k,
222
+ INK,
223
+ { shine: false },
224
+ );
225
+ }
226
+ if (age === "elder" && e !== "wide") {
227
+ crayon(
228
+ [
229
+ [side * 56 * k, 0],
230
+ [side * 66 * k, -5 * k],
231
+ ],
232
+ 2.6 * k,
233
+ "rgba(120,70,60,0.55)",
234
+ { shine: false },
235
+ );
236
+ crayon(
237
+ [
238
+ [side * 56 * k, 8 * k],
239
+ [side * 66 * k, 12 * k],
240
+ ],
241
+ 2.6 * k,
242
+ "rgba(120,70,60,0.55)",
243
+ { shine: false },
244
+ );
245
+ }
246
+ }
247
+ if (extra === "tears") {
248
+ // Tears run down both cheeks, one after another
249
+ for (const side of [-1, 1])
250
+ for (let i = 0; i < 2; i++) {
251
+ const q = (t * 0.9 + i * 0.5 + (side > 0 ? 0.25 : 0)) % 1;
252
+ const tx = side * 48 * k;
253
+ const ty = 18 * k + q * 42 * k;
254
+ blob(
255
+ [...arc(tx, ty, 6 * k, 7 * k, 0, PI, 8), [tx, ty - 13 * k]],
256
+ `rgba(120,190,245,${Math.sin(q * PI) * 0.95})`,
257
+ );
258
+ }
259
+ }
260
+ const my = 44 * k;
261
+ if (mouth === "smile")
262
+ crayon(
263
+ arc(0, my - 8 * k, 13 * k, 9 * k, PI * 0.15, PI * 0.85),
264
+ 4.5 * k,
265
+ INK,
266
+ { shine: false },
267
+ );
268
+ else if (mouth === "grin") {
269
+ blob(arc(0, my - 6 * k, 17 * k, 16 * k, 0, PI, 14), "#8d2a35");
270
+ blob(arc(0, my + 5 * k, 8 * k, 4 * k, 0, TAU, 10), "#f07c8a", {
271
+ jitter: 0.5,
272
+ });
273
+ } else if (mouth === "laugh") {
274
+ const open = 0.8 + 0.2 * Math.abs(Math.sin(t * 12));
275
+ blob(arc(0, my - 8 * k, 22 * k, 24 * k * open, 0, PI, 16), "#8d2a35");
276
+ blob(arc(0, my + 8 * k, 10 * k, 5 * k, 0, TAU, 10), "#f07c8a", {
277
+ jitter: 0.5,
278
+ });
279
+ } else if (mouth === "flat")
280
+ crayon(
281
+ [
282
+ [-9 * k, my],
283
+ [9 * k, my + k],
284
+ ],
285
+ 4.5 * k,
286
+ INK,
287
+ { shine: false },
288
+ );
289
+ else if (mouth === "o") blob(ellipse(0, my, 7 * k, 9 * k, 12), "#8d2a35");
290
+ else if (mouth === "frown")
291
+ crayon(
292
+ arc(0, my + 6 * k, 12 * k, 8 * k, PI * 1.15, PI * 1.85),
293
+ 4.5 * k,
294
+ INK,
295
+ { shine: false },
296
+ );
297
+ else if (mouth === "wobble")
298
+ crayon(
299
+ Array.from({ length: 7 }, (_, i) => [
300
+ (-15 + i * 5) * k,
301
+ my + (i % 2 ? -2 : 2) * k,
302
+ ]),
303
+ 4 * k,
304
+ INK,
305
+ { shine: false },
306
+ );
307
+ else if (mouth === "talk") {
308
+ const v = 0.5 + 0.5 * Math.sin(t * 19) * Math.sin(t * 7.3);
309
+ blob(ellipse(0, my, 10 * k, (3 + v * 9) * k, 14), "#8d2a35");
310
+ }
311
+ }
312
+
313
+ /** Hair behind the head (and for long hair, behind the shoulders). */
314
+ function hairBack(style, R, color, seed) {
315
+ const o = { seed: seed + 1, rim: 3 };
316
+ if (style === "bald" || style === "none") return;
317
+ if (style === "long")
318
+ paper(rect(-1.22 * R, -1.28 * R, 2.44 * R, 3.25 * R, R), color, o);
319
+ else if (style === "bob")
320
+ paper(rect(-1.24 * R, -1.28 * R, 2.48 * R, 2.12 * R, R), color, o);
321
+ else if (style === "curly")
322
+ paper(cloud(0, -0.12 * R, 1.3 * R, 11, 0.3), color, o);
323
+ else if (style === "spiky")
324
+ paper(star(0, -0.25 * R, 1.3 * R, 9, 0.8, -PI / 2), color, o);
325
+ else paper(ellipse(0, -0.14 * R, 1.1 * R, 1.06 * R, 40), color, o);
326
+ if (style === "bun")
327
+ paper(ellipse(0, -1.2 * R, 0.46 * R, 0.4 * R, 26), color, {
328
+ seed: seed + 2,
329
+ rim: 2.4,
330
+ });
331
+ if (style === "ponytail")
332
+ paper(
333
+ tube(
334
+ curve([0.7 * R, -0.9 * R], [1.35 * R, -0.3 * R], [1.3 * R, 0.7 * R]),
335
+ 0.42 * R,
336
+ ),
337
+ color,
338
+ { seed: seed + 3, rim: 2.4 },
339
+ );
340
+ if (style === "pigtails")
341
+ for (const side of [-1, 1])
342
+ paper(ellipse(side * 1.22 * R, 0.25 * R, 0.34 * R, 0.5 * R, 24), color, {
343
+ seed: seed + 4 + side,
344
+ rim: 2.4,
345
+ });
346
+ }
347
+ /** Hair over the forehead. */
348
+ function hairFront(style, R, color, seed, age) {
349
+ const o = { seed: seed + 9, rim: 1.6, shadow: 5 };
350
+ if (style === "bald" || style === "none") {
351
+ if (age === "elder")
352
+ for (const side of [-1, 1])
353
+ paper(
354
+ ellipse(side * 0.98 * R, -0.12 * R, 0.2 * R, 0.34 * R, 18),
355
+ color,
356
+ { seed: seed + 10 + side, rim: 1.2 },
357
+ );
358
+ return;
359
+ }
360
+ const cap = arc(0, 0.02 * R, 1.07 * R, 1.07 * R, PI * 1.03, PI * 1.97, 30);
361
+ let edge;
362
+ if (style === "curly") {
363
+ edge = [];
364
+ for (let i = 0; i <= 8; i++) {
365
+ const x = R * (1.02 - (2.04 * i) / 8);
366
+ edge.push([x, -0.42 * R + (i % 2 ? -0.14 * R : 0)]);
367
+ }
368
+ } else if (style === "spiky")
369
+ edge = [
370
+ [1.02 * R, -0.3 * R],
371
+ [0.6 * R, -0.5 * R],
372
+ [0.45 * R, -0.28 * R],
373
+ [0.1 * R, -0.55 * R],
374
+ [-0.15 * R, -0.3 * R],
375
+ [-0.5 * R, -0.52 * R],
376
+ [-0.7 * R, -0.3 * R],
377
+ [-1.02 * R, -0.28 * R],
378
+ ];
379
+ else if (style === "short")
380
+ edge = [
381
+ [1.02 * R, -0.28 * R],
382
+ [0.62 * R, -0.52 * R],
383
+ [0.1 * R, -0.62 * R],
384
+ [-0.46 * R, -0.5 * R],
385
+ [-0.8 * R, -0.3 * R],
386
+ [-1.03 * R, -0.18 * R],
387
+ ];
388
+ else
389
+ edge = curve(
390
+ [1.02 * R, -0.18 * R],
391
+ [0.78 * R, -0.36 * R],
392
+ [0.5 * R, -0.34 * R],
393
+ [0.2 * R, -0.46 * R],
394
+ [-0.12 * R, -0.4 * R],
395
+ [-0.42 * R, -0.48 * R],
396
+ [-0.72 * R, -0.38 * R],
397
+ [-1.04 * R, -0.16 * R],
398
+ );
399
+ paper([...cap, ...edge], color, o);
400
+ }
401
+ function hatOf(hat, R, color, seed) {
402
+ if (!hat) return;
403
+ const c =
404
+ color ??
405
+ {
406
+ party: "#f27caa",
407
+ cap: "#3a80ef",
408
+ beanie: "#e05a4c",
409
+ crown: "#f8d65c",
410
+ grad: "#2b2d42",
411
+ }[hat];
412
+ if (hat === "party") {
413
+ const top = [0.15 * R, -2.05 * R];
414
+ paper([[-0.42 * R, -0.95 * R], top, [0.62 * R, -0.9 * R]], c, {
415
+ seed,
416
+ rim: 2.4,
417
+ });
418
+ for (let i = 0; i < 3; i++)
419
+ blob(
420
+ ellipse(
421
+ lerp(-0.25 * R, 0.4 * R, i / 2) + 0.05 * R,
422
+ lerp(-1.1 * R, -1.6 * R, (i % 2) * 0.6 + i * 0.2),
423
+ 0.08 * R,
424
+ ),
425
+ "#fff6c8",
426
+ );
427
+ paper(ellipse(top[0], top[1], 0.14 * R), "#f8d65c", {
428
+ seed: seed + 1,
429
+ rim: 1.4,
430
+ });
431
+ } else if (hat === "cap") {
432
+ paper(arc(0, -0.45 * R, 1.08 * R, 0.8 * R, PI, TAU, 20), c, {
433
+ seed,
434
+ rim: 2.4,
435
+ });
436
+ paper(
437
+ rect(-0.2 * R, -0.62 * R, 1.55 * R, 0.24 * R, 0.12 * R),
438
+ shade(c, -0.2),
439
+ { seed: seed + 1, rim: 2 },
440
+ );
441
+ } else if (hat === "beanie") {
442
+ paper(arc(0, -0.5 * R, 1.08 * R, 0.85 * R, PI, TAU, 20), c, {
443
+ seed,
444
+ rim: 2.4,
445
+ });
446
+ paper(
447
+ rect(-1.12 * R, -0.66 * R, 2.24 * R, 0.3 * R, 0.1 * R),
448
+ shade(c, -0.15),
449
+ { seed: seed + 1, rim: 2 },
450
+ );
451
+ paper(ellipse(0, -1.38 * R, 0.2 * R), "#fbf6ea", {
452
+ seed: seed + 2,
453
+ rim: 1.6,
454
+ });
455
+ } else if (hat === "crown") {
456
+ paper(
457
+ [
458
+ [-0.7 * R, -0.75 * R],
459
+ [-0.75 * R, -1.45 * R],
460
+ [-0.38 * R, -1.1 * R],
461
+ [0, -1.55 * R],
462
+ [0.38 * R, -1.1 * R],
463
+ [0.75 * R, -1.45 * R],
464
+ [0.7 * R, -0.75 * R],
465
+ ],
466
+ c,
467
+ { seed, rim: 2.4 },
468
+ );
469
+ blob(ellipse(0, -1.0 * R, 0.1 * R), "#e0463f");
470
+ } else if (hat === "grad") {
471
+ paper(rect(-0.62 * R, -1.05 * R, 1.24 * R, 0.36 * R, 0.08 * R), c, {
472
+ seed,
473
+ rim: 2,
474
+ });
475
+ paper(
476
+ [
477
+ [-1.25 * R, -1.1 * R],
478
+ [0, -1.45 * R],
479
+ [1.25 * R, -1.1 * R],
480
+ [0, -0.82 * R],
481
+ ],
482
+ c,
483
+ { seed: seed + 1, rim: 2.4 },
484
+ );
485
+ crayon(
486
+ curve([0.1 * R, -1.12 * R], [0.8 * R, -1.02 * R], [0.95 * R, -0.62 * R]),
487
+ 0.05 * R,
488
+ "#f8d65c",
489
+ { shine: false },
490
+ );
491
+ blob(ellipse(0.95 * R, -0.55 * R, 0.07 * R, 0.12 * R), "#f8d65c");
492
+ }
493
+ }
494
+
495
+ /**
496
+ * A person standing with their feet at (x, y), `size` tall if grown up (a child is shorter,
497
+ * the same size given). `who`: { skin, hair, hairStyle, top, bottom, skirt, shoes, age,
498
+ * glasses, beard, hat }. o: pose, face, look, blush, walk (true: legs and arms swing), flip,
499
+ * facing (1 right, -1 left), holding(x, y), hat. Returns where their head, mouth and hands
500
+ * are, in the same coordinates as x and y.
501
+ */
502
+ function person(who, x, y, size, o = {}) {
503
+ const seed = nextSeed(o);
504
+ return personAt(who, x, y, size, o, seed);
505
+ }
506
+ function personAt(who, x, y, size, o, seed) {
507
+ const age = BODY[who.age] ? who.age : "adult";
508
+ const B = BODY[age];
509
+ const R = B.R;
510
+ const s = size / 1000;
511
+ const skin = SKINS[who.skin] ?? who.skin ?? SKINS.fair;
512
+ const hair =
513
+ HAIRS[who.hair] ?? who.hair ?? (age === "elder" ? HAIRS.grey : HAIRS.black);
514
+ const style = who.hairStyle ?? (age === "elder" ? "short" : "short");
515
+ const top = who.top ?? "#e05a4c";
516
+ const bottom = who.bottom ?? "#3b4a7a";
517
+ const shoes = who.shoes ?? "#4a3a3a";
518
+ const pose = o.pose ?? "stand";
519
+ const t = X.T + hash(seed, 3) * 10;
520
+ const facing = o.facing ?? 1;
521
+ const walking = pose === "walk" || o.walk;
522
+ const step = walking ? Math.sin(t * 6.5) : 0;
523
+ // A walk bobs; standing still, they breathe
524
+ const bob = walking
525
+ ? -Math.abs(Math.cos(t * 6.5)) * 14
526
+ : Math.sin(t * 2.1) * 5;
527
+ const sitting = pose === "sit";
528
+ const hipY = sitting ? B.hip + 130 : B.hip;
529
+ const neckY = (sitting ? B.neck + 130 : B.neck) + bob;
530
+ const headY = neckY - R * 0.9;
531
+ const g = X.g;
532
+ const out = {};
533
+ const toWorld = (px, py) => [x + px * s * (o.flip ? -1 : 1), y + py * s];
534
+ out.head = toWorld(0, headY);
535
+ out.top = toWorld(0, headY - R * 1.15);
536
+ out.mouth = toWorld(0, headY + R * 0.44);
537
+ g.save();
538
+ g.translate(x, y);
539
+ g.scale(s * (o.flip ? -1 : 1), s);
540
+ // Hair that falls behind the shoulders goes first
541
+ if (style === "long") {
542
+ g.save();
543
+ g.translate(0, headY);
544
+ hairBack(style, R, hair, seed);
545
+ g.restore();
546
+ }
547
+ // Legs, or a skirt with legs under it
548
+ const feet = sitting
549
+ ? [
550
+ [-70, hipY + 30, -95, hipY - 10],
551
+ [70, hipY + 30, 95, hipY - 10],
552
+ ]
553
+ : [
554
+ [-50 + step * 10, -30 - Math.max(0, step) * 40],
555
+ [50 - step * 10, -30 - Math.max(0, -step) * 40],
556
+ ];
557
+ const legColor = who.skirt ? skin : bottom;
558
+ for (const [i, side] of [-1, 1].entries()) {
559
+ const f = feet[i];
560
+ const hip = [side * 45, hipY - 20];
561
+ const P = sitting ? [hip, [f[2], f[3]], [f[0], -30]] : [hip, [f[0], f[1]]];
562
+ paper(tube(P, B.leg), legColor, {
563
+ seed: seed + 20 + i,
564
+ rim: 2.2,
565
+ shadow: 4,
566
+ });
567
+ const fx = sitting ? f[0] : f[0];
568
+ const fy = sitting ? -30 : f[1];
569
+ paper(ellipse(fx + side * 10, fy + 12, 50, 26, 20), shoes, {
570
+ seed: seed + 22 + i,
571
+ rim: 2,
572
+ shadow: 4,
573
+ });
574
+ }
575
+ // The body
576
+ paper(
577
+ rect(-B.sw + 5, hipY - 60, 2 * B.sw - 10, 70, 24),
578
+ who.skirt ? top : bottom,
579
+ { seed: seed + 30, rim: 2.4 },
580
+ );
581
+ paper(rect(-B.sw, neckY + 12, 2 * B.sw, hipY - neckY - 30, 58), top, {
582
+ seed: seed + 31,
583
+ rim: 3,
584
+ });
585
+ if (who.skirt) {
586
+ const sk = typeof who.skirt === "string" ? who.skirt : bottom;
587
+ paper(
588
+ [
589
+ [-B.sw + 8, hipY - 60],
590
+ [B.sw - 8, hipY - 60],
591
+ [B.sw + 50, hipY + 110],
592
+ [-B.sw - 50, hipY + 110],
593
+ ],
594
+ sk,
595
+ { seed: seed + 32, rim: 2.6 },
596
+ );
597
+ }
598
+ crayon(
599
+ arc(0, neckY + 18, 34, 26, PI * 0.15, PI * 0.85, 10),
600
+ 5,
601
+ shade(top, -0.3),
602
+ { shine: false },
603
+ );
604
+ paper(rect(-26, neckY - 20, 52, 50, 12), skin, {
605
+ seed: seed + 33,
606
+ rim: 0,
607
+ shadow: 0,
608
+ });
609
+ // Arms and hands, then what they hold in front of them; arms that reach over the head go
610
+ // behind it, bent out around it
611
+ const shoulders = [
612
+ [-B.sw + 18, neckY + 50],
613
+ [B.sw - 18, neckY + 50],
614
+ ];
615
+ const A = (B.hip - B.neck) * 1.02;
616
+ const hands = poseHands(pose, B, t, facing * (o.flip ? -1 : 1)).map(
617
+ (h, i) => [shoulders[i][0] + h[0], shoulders[i][1] + h[1]],
618
+ );
619
+ const overHead = pose === "heart";
620
+ const arms = () =>
621
+ hands.forEach((h, i) => {
622
+ const side = i ? 1 : -1;
623
+ const el = overHead
624
+ ? [side * R * 1.6, headY - R * 0.35]
625
+ : elbowOf(shoulders[i], h, A, side);
626
+ paper(tube([shoulders[i], el, h], R * 0.36), top, {
627
+ seed: seed + 50 + i,
628
+ rim: 2.4,
629
+ shadow: 5,
630
+ });
631
+ });
632
+ if (overHead) arms();
633
+ // The head
634
+ {
635
+ g.save();
636
+ g.translate(0, headY);
637
+ const tilt =
638
+ (o.tilt ?? 0) +
639
+ (FACES[o.face]?.[1] === "laugh" ? Math.sin(t * 14) * 0.03 : 0);
640
+ g.rotate(tilt);
641
+ if (style !== "long") hairBack(style, R, hair, seed);
642
+ for (const side of [-1, 1])
643
+ paper(ellipse(side * R * 0.98, R * 0.1, R * 0.17, R * 0.23, 16), skin, {
644
+ seed: seed + 40 + side,
645
+ rim: 1.4,
646
+ shadow: 3,
647
+ });
648
+ paper(ellipse(0, 0, R, R * 0.97, 56), skin, { seed: seed + 42, rim: 2.6 });
649
+ if (who.beard) {
650
+ const bc = typeof who.beard === "string" ? who.beard : hair;
651
+ paper(
652
+ [
653
+ ...arc(0, 0.05 * R, 0.95 * R, 0.95 * R, PI * 0.02, PI * 0.98, 20),
654
+ [-0.5 * R, 0.35 * R],
655
+ [0, 0.3 * R],
656
+ [0.5 * R, 0.35 * R],
657
+ ],
658
+ bc,
659
+ { seed: seed + 43, rim: 1.2, shadow: 2 },
660
+ );
661
+ }
662
+ quiet(() => faceOf(R, { ...o, seed }, t, age));
663
+ hairFront(style, R, hair, seed, age);
664
+ if (who.glasses) {
665
+ const gc = typeof who.glasses === "string" ? who.glasses : INK;
666
+ for (const side of [-1, 1])
667
+ crayon(
668
+ arc(side * 0.36 * R, 0.07 * R, 0.21 * R, 0.19 * R, 0, TAU, 24),
669
+ 0.035 * R,
670
+ gc,
671
+ { shine: false },
672
+ );
673
+ crayon(
674
+ [
675
+ [-0.15 * R, 0.04 * R],
676
+ [0.15 * R, 0.04 * R],
677
+ ],
678
+ 0.035 * R,
679
+ gc,
680
+ { shine: false },
681
+ );
682
+ }
683
+ hatOf(o.hat ?? who.hat, R, o.hatColor ?? who.hatColor, seed + 60);
684
+ g.restore();
685
+ }
686
+ if (!overHead) arms();
687
+ out.hands = hands.map(([hx, hy]) => toWorld(hx, hy));
688
+ hands.forEach(([hx, hy], i) =>
689
+ paper(ellipse(hx, hy, R * 0.2, R * 0.18, 20), skin, {
690
+ seed: seed + 55 + i,
691
+ rim: 2,
692
+ shadow: 4,
693
+ }),
694
+ );
695
+ g.restore();
696
+ if (o.holding) {
697
+ const [a, b] = out.hands;
698
+ o.holding((a[0] + b[0]) / 2, (a[1] + b[1]) / 2);
699
+ }
700
+ faced(
701
+ "person",
702
+ out.head[0],
703
+ out.head[1],
704
+ R * s * 1.1,
705
+ (R * 1.15 - headY) * s,
706
+ );
707
+ return out;
708
+ }
709
+
710
+ // ---------------------------------------------------------------- Thursday
711
+ // Her face and her rays are made of letters: a small stroke font for the few she is made of.
712
+ const GLY = {};
713
+ (() => {
714
+ const d = (x, y) => [
715
+ [x, y - 0.035],
716
+ [x + 0.012, y + 0.035],
717
+ ];
718
+ const L = (...p) => p;
719
+ const bowl = () => arc(0.42, -0.5, 0.42, 0.5, -0.12 * PI, -1.9 * PI);
720
+ const def = {
721
+ a: [0.84, [bowl(), L([0.84, -1], [0.84, 0])]],
722
+ c: [0.8, [arc(0.42, -0.5, 0.42, 0.5, -0.22 * PI, -1.78 * PI)]],
723
+ e: [
724
+ 0.86,
725
+ [
726
+ [
727
+ [0.04, -0.52],
728
+ [0.86, -0.52],
729
+ ...arc(0.43, -0.5, 0.43, 0.5, 0, -1.74 * PI),
730
+ ],
731
+ ],
732
+ ],
733
+ h: [
734
+ 0.78,
735
+ [
736
+ L([0, -1.75], [0, 0]),
737
+ curve(
738
+ [0, -0.6],
739
+ [0.2, -0.94],
740
+ [0.45, -1],
741
+ [0.72, -0.85],
742
+ [0.78, -0.5],
743
+ [0.78, 0],
744
+ ),
745
+ ],
746
+ ],
747
+ k: [
748
+ 0.78,
749
+ [
750
+ L([0, -1.75], [0, 0]),
751
+ L([0.72, -1], [0.04, -0.42]),
752
+ L([0.28, -0.62], [0.78, 0]),
753
+ ],
754
+ ],
755
+ m: [
756
+ 1.1,
757
+ [
758
+ L([0, -1], [0, 0]),
759
+ curve(
760
+ [0, -0.62],
761
+ [0.15, -0.95],
762
+ [0.32, -1],
763
+ [0.5, -0.85],
764
+ [0.55, -0.55],
765
+ [0.55, 0],
766
+ ),
767
+ curve(
768
+ [0.55, -0.62],
769
+ [0.7, -0.95],
770
+ [0.87, -1],
771
+ [1.05, -0.85],
772
+ [1.1, -0.55],
773
+ [1.1, 0],
774
+ ),
775
+ ],
776
+ ],
777
+ n: [
778
+ 0.78,
779
+ [
780
+ L([0, -1], [0, 0]),
781
+ curve(
782
+ [0, -0.6],
783
+ [0.2, -0.94],
784
+ [0.45, -1],
785
+ [0.72, -0.85],
786
+ [0.78, -0.5],
787
+ [0.78, 0],
788
+ ),
789
+ ],
790
+ ],
791
+ o: [0.9, [arc(0.45, -0.5, 0.45, 0.5, -PI / 2, -PI / 2 - TAU - 0.12)]],
792
+ q: [0.84, [bowl(), L([0.84, -1], [0.84, 0.72])]],
793
+ s: [
794
+ 0.7,
795
+ [
796
+ curve(
797
+ [0.66, -0.88],
798
+ [0.4, -1],
799
+ [0.12, -0.9],
800
+ [0.12, -0.66],
801
+ [0.4, -0.52],
802
+ [0.66, -0.36],
803
+ [0.66, -0.1],
804
+ [0.38, 0],
805
+ [0.04, -0.1],
806
+ ),
807
+ ],
808
+ ],
809
+ u: [
810
+ 0.78,
811
+ [
812
+ curve(
813
+ [0, -1],
814
+ [0, -0.4],
815
+ [0.12, -0.08],
816
+ [0.4, 0],
817
+ [0.66, -0.1],
818
+ [0.78, -0.4],
819
+ ),
820
+ L([0.78, -1], [0.78, 0]),
821
+ ],
822
+ ],
823
+ v: [0.8, [L([0, -1], [0.4, 0], [0.8, -1])]],
824
+ w: [1.1, [L([0, -1], [0.27, 0], [0.55, -0.72], [0.83, 0], [1.1, -1])]],
825
+ x: [0.75, [L([0, -1], [0.75, 0]), L([0.75, -1], [0, 0])]],
826
+ y: [
827
+ 0.85,
828
+ [
829
+ L([0, -1], [0.42, -0.05]),
830
+ curve([0.85, -1], [0.55, -0.1], [0.36, 0.44], [0.2, 0.66], [0, 0.62]),
831
+ ],
832
+ ],
833
+ "?": [
834
+ 0.74,
835
+ [
836
+ curve(
837
+ [0.04, -1.35],
838
+ [0.3, -1.7],
839
+ [0.68, -1.62],
840
+ [0.72, -1.28],
841
+ [0.42, -1],
842
+ [0.38, -0.5],
843
+ ),
844
+ d(0.38, -0.08),
845
+ ],
846
+ ],
847
+ ".": [0.2, [d(0.08, -0.06)]],
848
+ ",": [0.2, [L([0.14, -0.12], [0.02, 0.24])]],
849
+ "-": [0.62, [L([0, -0.5], [0.62, -0.5])]],
850
+ ":": [0.2, [d(0.1, -0.9), d(0.1, -0.08)]],
851
+ ";": [0.2, [d(0.12, -0.9), L([0.14, -0.12], [0.02, 0.24])]],
852
+ "=": [0.7, [L([0, -0.72], [0.7, -0.72]), L([0, -0.32], [0.7, -0.32])]],
853
+ "+": [0.7, [L([0.35, -0.88], [0.35, -0.12]), L([0, -0.5], [0.7, -0.5])]],
854
+ "*": [
855
+ 0.7,
856
+ [
857
+ L([0.35, -0.95], [0.35, -0.15]),
858
+ L([0.02, -0.75], [0.68, -0.35]),
859
+ L([0.02, -0.35], [0.68, -0.75]),
860
+ ],
861
+ ],
862
+ };
863
+ for (const [ch, [w, strokes]] of Object.entries(def))
864
+ GLY[ch] = { w, s: strokes.map((st) => dense(st, 0.07)) };
865
+ })();
866
+ function glyphPath(path, ch, x, y, s, rot = 0) {
867
+ const gl = GLY[ch];
868
+ if (!gl) return;
869
+ const cr = Math.cos(rot);
870
+ const sr = Math.sin(rot);
871
+ for (const st of gl.s)
872
+ st.forEach(([u, v], k) => {
873
+ const px = (u - gl.w / 2) * s;
874
+ const py = (v + 0.5) * s;
875
+ const Xx = x + px * cr - py * sr;
876
+ const Yy = y + px * sr + py * cr;
877
+ k ? path.lineTo(Xx, Yy) : path.moveTo(Xx, Yy);
878
+ });
879
+ }
880
+ const RAMP = [
881
+ [".", ","],
882
+ [",", ":"],
883
+ [";", "-"],
884
+ ["=", "+"],
885
+ ["*", "?"],
886
+ ["c", "v"],
887
+ ["o", "x"],
888
+ ["s", "y"],
889
+ ["e", "a"],
890
+ ["k", "w"],
891
+ ["q", "h"],
892
+ ["n", "m"],
893
+ ];
894
+ const RAYSET = [
895
+ ["o", "x", "s", "a", "e", "w", "m", "n"],
896
+ ["c", "v", "x", "o", "u"],
897
+ ["*", "+", "="],
898
+ [".", ",", ":"],
899
+ ];
900
+ const HER_CELLS = (() => {
901
+ const side = 11;
902
+ const cells = [];
903
+ for (let r = 0; r < side; r++)
904
+ for (let q = 0; q < side; q++) {
905
+ const x = (q + 0.5) / side - 0.5;
906
+ const y = (r + 0.5) / side - 0.5;
907
+ const d = Math.hypot(x, y) * 2;
908
+ const seed = r * 131 + q;
909
+ if (d + (hash(seed, 1) - 0.5) * 0.2 > 0.9) continue;
910
+ cells.push({ x, y, d, seed });
911
+ }
912
+ return cells;
913
+ })();
914
+ /**
915
+ * Thursday, her middle at (x, y), `r` her radius. o: face ('open', 'happy', 'wink',
916
+ * 'closed'), rays (0..1), glow, look, clap (0..1, with hands: true), color.
917
+ */
918
+ function her(x, y, r, o = {}) {
919
+ nextSeed(o);
920
+ faced("her", x, y, r * 1.1, r * 2);
921
+ if (X.dry) return { head: [x, y], top: [x, y - r * 1.3] };
922
+ const g = X.g;
923
+ const t = X.T;
924
+ const R = r;
925
+ const blue = o.color ?? "#3a80ef";
926
+ const rays = o.rays ?? 1;
927
+ const face = o.face ?? "open";
928
+ const look = o.look ?? [0, 0];
929
+ g.save();
930
+ g.translate(x, y);
931
+ g.rotate(o.tilt ?? Math.sin(t * 1.6) * 0.05);
932
+ if ((o.glow ?? 1) > 0) {
933
+ const gr = g.createRadialGradient(0, 0, R * 0.6, 0, 0, R * 2.6);
934
+ gr.addColorStop(0, `rgba(255,236,170,${0.34 * (o.glow ?? 1)})`);
935
+ gr.addColorStop(1, "rgba(255,236,170,0)");
936
+ g.fillStyle = gr;
937
+ g.fillRect(-R * 2.7, -R * 2.7, R * 5.4, R * 5.4);
938
+ }
939
+ if (rays > 0.01) {
940
+ const path = new Path2D();
941
+ for (let k = 0; k < 12; k++) {
942
+ const a = (k / 12) * TAU + t * 0.12;
943
+ for (let m = 0; m < (k % 2 ? 3 : 4); m++) {
944
+ const rad =
945
+ R *
946
+ (1.24 + m * 0.21 + 0.03 * Math.sin(t * 3 + k)) *
947
+ lerp(0.6, 1, rays);
948
+ const turn = Math.floor(t / 0.6 + hash(k * 7 + m, 3) * 3);
949
+ const band = RAYSET[m];
950
+ const ch = band[Math.floor(hash(k * 7 + m, turn) * band.length)];
951
+ glyphPath(
952
+ path,
953
+ ch,
954
+ Math.cos(a) * rad,
955
+ Math.sin(a) * rad,
956
+ R * [0.15, 0.13, 0.11, 0.09][m] * Math.min(rays, 1.15),
957
+ a + PI / 2,
958
+ );
959
+ }
960
+ }
961
+ g.save();
962
+ g.globalAlpha *= clamp(rays * 1.5);
963
+ g.strokeStyle = o.rayColor ?? "#e5762c";
964
+ g.lineWidth = R * 0.035;
965
+ g.lineCap = "round";
966
+ g.lineJoin = "round";
967
+ g.stroke(path);
968
+ g.restore();
969
+ }
970
+ const clap = o.clap ?? 0;
971
+ const drawHands = () => {
972
+ for (const side of [-1, 1]) {
973
+ g.save();
974
+ g.translate(
975
+ side * lerp(R * 1.02, R * 0.16, clap),
976
+ lerp(R * 0.42, R * 0.62, clap),
977
+ );
978
+ g.rotate(side * lerp(0.5, 1.3, clap));
979
+ paper(ellipse(0, 0, R * 0.2, R * 0.15), blue, {
980
+ seed: 70 + side,
981
+ rim: 2,
982
+ shadow: 4,
983
+ });
984
+ g.restore();
985
+ }
986
+ };
987
+ if (o.hands && clap < 0.5) drawHands();
988
+ paper(ellipse(0, 0, R, R, 72), blue, {
989
+ seed: 61,
990
+ rim: 3.4,
991
+ wob: 2.4,
992
+ shadow: 10,
993
+ });
994
+ const path = new Path2D();
995
+ const pitch = ((R * 2) / 11) * 0.95;
996
+ for (const c of HER_CELLS) {
997
+ const turn = Math.floor(t / 0.6 + hash(c.seed, 3) * 4);
998
+ const wave = 0.5 + 0.5 * Math.sin(c.x * 7 + c.y * 5 + turn * 0.9);
999
+ const lv = clamp((1 - c.d ** 1.3) * (0.55 + 0.45 * wave), 0, 0.999);
1000
+ const band = RAMP[1 + (Math.floor(lv * 11) % 11)];
1001
+ glyphPath(
1002
+ path,
1003
+ band[Math.floor(hash(c.seed, turn) * band.length)],
1004
+ c.x * R * 1.9,
1005
+ c.y * R * 1.9 - pitch * 0.2,
1006
+ pitch * 0.46,
1007
+ (hash(c.seed, 5) - 0.5) * 0.3,
1008
+ );
1009
+ }
1010
+ g.save();
1011
+ g.globalAlpha *= 0.5;
1012
+ g.strokeStyle = "#eef5ff";
1013
+ g.lineWidth = R * 0.03;
1014
+ g.lineCap = "round";
1015
+ g.lineJoin = "round";
1016
+ g.stroke(path);
1017
+ g.restore();
1018
+ const every = 2.9;
1019
+ const bu = (t + 1.3) % every;
1020
+ const blink = face === "open" && bu < 0.14 ? Math.sin((bu / 0.14) * PI) : 0;
1021
+ for (const side of [-1, 1]) {
1022
+ g.save();
1023
+ g.translate(
1024
+ side * R * 0.3 + look[0] * R * 0.08,
1025
+ -R * 0.02 + look[1] * R * 0.05,
1026
+ );
1027
+ blob(
1028
+ ellipse(0, R * 0.22, R * 0.11, R * 0.07, 20),
1029
+ "rgba(246,128,150,0.75)",
1030
+ );
1031
+ const f =
1032
+ face === "wink" && side === 1 ? "happy" : face === "wink" ? "open" : face;
1033
+ if (f === "open" && blink < 0.6) {
1034
+ blob(ellipse(0, 0, R * 0.075, R * 0.1 * (1 - blink), 20), INK);
1035
+ blob(ellipse(R * 0.025, -R * 0.035, R * 0.028, R * 0.03, 10), "#ffffff", {
1036
+ jitter: 0.5,
1037
+ });
1038
+ } else if (f === "happy") {
1039
+ crayon(
1040
+ arc(0, R * 0.03, R * 0.075, R * 0.07, PI * 1.05, PI * 1.95),
1041
+ R * 0.04,
1042
+ INK,
1043
+ { shine: false },
1044
+ );
1045
+ } else {
1046
+ crayon(
1047
+ arc(0, -R * 0.03, R * 0.075, R * 0.06, PI * 0.1, PI * 0.9),
1048
+ R * 0.04,
1049
+ INK,
1050
+ { shine: false },
1051
+ );
1052
+ }
1053
+ g.restore();
1054
+ }
1055
+ const mo = o.mouth ?? 0.3;
1056
+ g.save();
1057
+ g.translate(look[0] * R * 0.06, R * 0.2 + look[1] * R * 0.04);
1058
+ g.beginPath();
1059
+ g.moveTo(-R * 0.13, 0);
1060
+ g.quadraticCurveTo(0, R * (0.12 + mo * 0.3), R * 0.13, 0);
1061
+ if (mo > 0.35) {
1062
+ g.closePath();
1063
+ g.fillStyle = INK;
1064
+ g.fill();
1065
+ } else {
1066
+ g.lineWidth = R * 0.04;
1067
+ g.lineCap = "round";
1068
+ g.strokeStyle = INK;
1069
+ g.stroke();
1070
+ }
1071
+ g.restore();
1072
+ if (o.hands && clap >= 0.5) drawHands();
1073
+ g.restore();
1074
+ return { head: [x, y], top: [x, y - R * 1.3] };
1075
+ }
1076
+
1077
+ // ---------------------------------------------------------------- her bots
1078
+ const BOTS = {
1079
+ teal: "#18a896",
1080
+ pink: "#f27caa",
1081
+ purple: "#7a68dd",
1082
+ orange: "#e5762c",
1083
+ yellow: "#f2c14e",
1084
+ blue: "#3a80ef",
1085
+ };
1086
+ const BOT_SHAPES = new Map();
1087
+ /**
1088
+ * A bot, a soft square blob with two tall eyes, standing on (x, y), `size` tall. `color` a
1089
+ * name (teal, pink, purple, orange, yellow, blue) or a colour. o: eyes ('happy'), look,
1090
+ * squash (-1..1), arms ([[x, y], [x, y]] from its middle), glasses.
1091
+ */
1092
+ function bot(color, x, y, size, o = {}) {
1093
+ const seed = nextSeed(o);
1094
+ const col = BOTS[color] ?? color ?? BOTS.teal;
1095
+ const r = size / 2;
1096
+ const key = `${Math.round(hash(rgbOf(col)[0], rgbOf(col)[2]) * 1000)}_${Math.round(r)}`;
1097
+ if (!BOT_SHAPES.has(key)) {
1098
+ const bs = Number(key.split("_")[0]);
1099
+ const hs = [2, 3, 4].map((k) => ({
1100
+ k,
1101
+ a: (hash(bs, k) - 0.5) * (0.2 / k),
1102
+ p: hash(bs, k + 9) * TAU,
1103
+ }));
1104
+ const pts = [];
1105
+ for (let i = 0; i < 80; i++) {
1106
+ const a = (i / 80) * TAU;
1107
+ const c = Math.cos(a);
1108
+ const s = Math.sin(a);
1109
+ const sq = (Math.abs(c) ** 4 + Math.abs(s) ** 4) ** -0.25;
1110
+ const q =
1111
+ (0.92 + 0.12 * (sq - 1)) *
1112
+ (1 + hs.reduce((v, h) => v + h.a * Math.sin(h.k * a + h.p), 0));
1113
+ pts.push([c * q * r, s * q * r * 0.94]);
1114
+ }
1115
+ BOT_SHAPES.set(key, pts);
1116
+ }
1117
+ const out = { head: [x, y - r], top: [x, y - 2 * r] };
1118
+ faced("bot", x, y - r, r, size);
1119
+ if (X.dry) return out;
1120
+ const g = X.g;
1121
+ const t = X.T;
1122
+ g.save();
1123
+ g.translate(x, y - r * 1.05);
1124
+ const sq = o.squash ?? 0;
1125
+ g.translate(0, r * 0.95);
1126
+ g.scale(1 + sq * 0.22, 1 - sq * 0.22);
1127
+ g.translate(0, -r * 0.95);
1128
+ g.rotate(o.tilt ?? 0);
1129
+ for (const side of [-1, 1])
1130
+ paper(ellipse(side * r * 0.38, r * 0.9, r * 0.2, r * 0.13, 18), col, {
1131
+ seed: seed + side,
1132
+ rim: 1.6,
1133
+ shadow: 3,
1134
+ });
1135
+ paper(BOT_SHAPES.get(key), col, { seed, rim: 3, shadow: 8 });
1136
+ const every = 2.3 + hash(seed, 30) * 1.4;
1137
+ const u = (t + hash(seed, 31) * every) % every;
1138
+ const shut =
1139
+ o.eyes === "happy" ? 1 : u < 0.16 ? Math.sin((u / 0.16) * PI) : 0;
1140
+ const look = o.look ?? [0, 0];
1141
+ for (const side of [-1, 1]) {
1142
+ const ex = side * r * 0.3 + look[0] * r * 0.1;
1143
+ const ey = -r * 0.1 + look[1] * r * 0.08;
1144
+ if (o.eyes === "happy")
1145
+ crayon(
1146
+ arc(ex, ey + r * 0.08, r * 0.12, r * 0.12, PI * 1.1, PI * 1.9),
1147
+ r * 0.09,
1148
+ "#ffffff",
1149
+ { shine: false },
1150
+ );
1151
+ else {
1152
+ const ew = r * 0.2;
1153
+ const eh = r * 0.38 * (1 - 0.88 * shut);
1154
+ blob(rect(ex - ew / 2, ey - eh / 2, ew, eh, ew / 2), "#ffffff", {
1155
+ jitter: 0.8,
1156
+ });
1157
+ }
1158
+ if (o.glasses)
1159
+ crayon(arc(ex, ey, r * 0.24, r * 0.24, 0, TAU, 24), r * 0.05, INK, {
1160
+ shine: false,
1161
+ });
1162
+ }
1163
+ if (o.arms)
1164
+ o.arms.forEach((tip, i) => {
1165
+ if (!tip) return;
1166
+ const side = i ? 1 : -1;
1167
+ const sh = [side * r * 0.78, r * 0.2];
1168
+ const mid = [
1169
+ lerp(sh[0], tip[0], 0.5) + side * r * 0.12,
1170
+ lerp(sh[1], tip[1], 0.5) + r * 0.1,
1171
+ ];
1172
+ paper(tube([sh, mid, tip], r * 0.2), col, {
1173
+ seed: seed + 40 + i,
1174
+ rim: 1.8,
1175
+ shadow: 3,
1176
+ });
1177
+ });
1178
+ g.restore();
1179
+ return out;
1180
+ }
1181
+
1182
+ // ---------------------------------------------------------------- animals
1183
+ /** A dog sitting, facing us, its paws at (x, y), `size` tall. o: color, ear, wag, face. */
1184
+ function dog(x, y, size, o = {}) {
1185
+ const seed = nextSeed(o);
1186
+ faced("dog", x, y - size * 0.68, size * 0.3, size);
1187
+ if (X.dry) return { head: [x, y - size * 0.7], top: [x, y - size] };
1188
+ const g = X.g;
1189
+ const t = X.T + hash(seed, 2) * 5;
1190
+ const c = o.color ?? "#d9a066";
1191
+ const ear = o.ear ?? shade(c, -0.35);
1192
+ const s = size / 100;
1193
+ g.save();
1194
+ g.translate(x, y);
1195
+ g.scale(s, s);
1196
+ const wag = Math.sin(t * (o.wag === false ? 0 : 12)) * 0.5;
1197
+ crayon(curve([22, -18], [42, -30 + wag * 8], [50 + wag * 10, -48]), 9, c, {
1198
+ seed: seed + 1,
1199
+ });
1200
+ paper(ellipse(0, -28, 30, 30, 26), c, { seed: seed + 2, rim: 2 });
1201
+ paper(ellipse(0, -8, 24, 10, 16), shade(c, 0.35), {
1202
+ seed: seed + 3,
1203
+ rim: 1.4,
1204
+ shadow: 2,
1205
+ });
1206
+ g.translate(0, -68);
1207
+ for (const side of [-1, 1]) {
1208
+ g.save();
1209
+ g.translate(side * 25, -8);
1210
+ g.rotate(side * (0.25 + Math.sin(t * 3) * 0.05));
1211
+ paper(ellipse(0, 12, 11, 22, 18), ear, { seed: seed + 4 + side, rim: 1.4 });
1212
+ g.restore();
1213
+ }
1214
+ paper(ellipse(0, 0, 28, 25, 30), c, { seed: seed + 6, rim: 2.2 });
1215
+ paper(ellipse(0, 10, 15, 11, 18), shade(c, 0.45), {
1216
+ seed: seed + 7,
1217
+ rim: 0,
1218
+ shadow: 0,
1219
+ });
1220
+ blob(ellipse(0, 5, 5.5, 4.2, 12), INK);
1221
+ const happy = o.face === "happy";
1222
+ for (const side of [-1, 1]) {
1223
+ if (happy)
1224
+ crayon(arc(side * 11, -4, 5, 4, PI * 1.1, PI * 1.9), 2.4, INK, {
1225
+ shine: false,
1226
+ });
1227
+ else blob(ellipse(side * 11, -5, 3.6, 4.4, 10), INK);
1228
+ }
1229
+ if (o.tongue !== false) blob(ellipse(0, 18, 4, 6, 10), "#f07c8a");
1230
+ g.restore();
1231
+ return { head: [x, y - size * 0.68], top: [x, y - size * 0.95] };
1232
+ }
1233
+ /** A cat sitting, facing us, on (x, y), `size` tall. o: color, face. */
1234
+ function cat(x, y, size, o = {}) {
1235
+ const seed = nextSeed(o);
1236
+ faced("cat", x, y - size * 0.62, size * 0.26, size);
1237
+ if (X.dry) return { head: [x, y - size * 0.7], top: [x, y - size] };
1238
+ const g = X.g;
1239
+ const t = X.T + hash(seed, 2) * 5;
1240
+ const c = o.color ?? "#6d6a75";
1241
+ const s = size / 100;
1242
+ g.save();
1243
+ g.translate(x, y);
1244
+ g.scale(s, s);
1245
+ const sw = Math.sin(t * 2.2) * 0.4;
1246
+ crayon(
1247
+ curve(
1248
+ [16, -8],
1249
+ [40, -12 + sw * 10],
1250
+ [48, -36 + sw * 20],
1251
+ [40, -54 + sw * 24],
1252
+ ),
1253
+ 8,
1254
+ c,
1255
+ { seed: seed + 1 },
1256
+ );
1257
+ paper(ellipse(0, -24, 26, 25, 24), c, { seed: seed + 2, rim: 2 });
1258
+ g.translate(0, -62);
1259
+ paper(
1260
+ [
1261
+ [-24, -8],
1262
+ [-20, -34],
1263
+ [-6, -16],
1264
+ ],
1265
+ c,
1266
+ { seed: seed + 3, rim: 1.4 },
1267
+ );
1268
+ paper(
1269
+ [
1270
+ [24, -8],
1271
+ [20, -34],
1272
+ [6, -16],
1273
+ ],
1274
+ c,
1275
+ { seed: seed + 4, rim: 1.4 },
1276
+ );
1277
+ paper(ellipse(0, 0, 24, 21, 26), c, { seed: seed + 5, rim: 2 });
1278
+ const happy = o.face === "happy";
1279
+ for (const side of [-1, 1]) {
1280
+ if (happy)
1281
+ crayon(arc(side * 9, -2, 4.5, 4, PI * 1.1, PI * 1.9), 2.2, INK, {
1282
+ shine: false,
1283
+ });
1284
+ else blob(ellipse(side * 9, -3, 3.5, 4.6, 10), "#f8d65c");
1285
+ crayon(
1286
+ [
1287
+ [side * 12, 7],
1288
+ [side * 30, 4],
1289
+ ],
1290
+ 1.6,
1291
+ "rgba(255,255,255,0.7)",
1292
+ { shine: false },
1293
+ );
1294
+ }
1295
+ blob(
1296
+ [
1297
+ [-3, 4],
1298
+ [3, 4],
1299
+ [0, 8],
1300
+ ],
1301
+ "#f07c8a",
1302
+ );
1303
+ g.restore();
1304
+ return { head: [x, y - size * 0.62], top: [x, y - size * 0.95] };
1305
+ }