thursday-agent 0.28.0 → 0.30.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 (528) 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.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +3 -3
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  19. package/.next/server/app/api/artifact/route.js +13 -14
  20. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/memory/files/route.js +11 -6
  22. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/memory/route.js +11 -11
  24. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bot/route.js +11 -11
  26. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  27. package/.next/server/app/api/bot/thread/file/route.js +19 -19
  28. package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
  29. package/.next/server/app/api/bot/thread/lessons/route/app-paths-manifest.json +3 -0
  30. package/.next/server/app/api/bot/thread/lessons/route/build-manifest.json +12 -0
  31. package/.next/server/app/api/bot/thread/lessons/route/server-reference-manifest.json +4 -0
  32. package/.next/server/app/api/bot/thread/lessons/route.js +18 -0
  33. package/.next/server/app/api/bot/thread/lessons/route.js.map +5 -0
  34. package/.next/server/app/api/bot/thread/lessons/route.js.nft.json +1 -0
  35. package/.next/server/app/api/bot/thread/lessons/route_client-reference-manifest.js +3 -0
  36. package/.next/server/app/api/bot/thread/route.js +8 -9
  37. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  38. package/.next/server/app/api/bot/tool-result/[id]/route.js +10 -11
  39. package/.next/server/app/api/bot/tool-result/[id]/route.js.nft.json +1 -1
  40. package/.next/server/app/api/config/route.js +6 -7
  41. package/.next/server/app/api/config/route.js.nft.json +1 -1
  42. package/.next/server/app/api/events/route.js +4 -4
  43. package/.next/server/app/api/events/route.js.nft.json +1 -1
  44. package/.next/server/app/api/favicon/[host]/route.js +3 -3
  45. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  46. package/.next/server/app/api/file/[...path]/route.js +11 -6
  47. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  48. package/.next/server/app/api/llm-model/automatic/route.js +10 -11
  49. package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
  50. package/.next/server/app/api/llm-model/catalog/[provider]/route.js +10 -11
  51. package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -1
  52. package/.next/server/app/api/llm-model/credits/[provider]/route.js +10 -11
  53. package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -1
  54. package/.next/server/app/api/llm-model/route.js +8 -9
  55. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  56. package/.next/server/app/api/llm-model/subscription/route.js +8 -9
  57. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  58. package/.next/server/app/api/mcp/[name]/route.js +8 -9
  59. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  60. package/.next/server/app/api/mcp/oauth/callback/route.js +10 -11
  61. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  62. package/.next/server/app/api/mcp/route.js +8 -9
  63. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  64. package/.next/server/app/api/mcp/tools/route.js +8 -9
  65. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  66. package/.next/server/app/api/memory/edit/route.js +19 -19
  67. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  68. package/.next/server/app/api/memory/route.js +6 -7
  69. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  70. package/.next/server/app/api/reach/route.js +20 -20
  71. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  72. package/.next/server/app/api/routine/route.js +12 -12
  73. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  74. package/.next/server/app/api/running/route.js +3 -3
  75. package/.next/server/app/api/running/route.js.nft.json +1 -1
  76. package/.next/server/app/api/signins/route.js +11 -7
  77. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  78. package/.next/server/app/api/skills/[source]/[name]/route.js +14 -14
  79. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  80. package/.next/server/app/api/skills/route.js +14 -14
  81. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  82. package/.next/server/app/api/thursday/call/end/route.js +19 -19
  83. package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
  84. package/.next/server/app/api/thursday/call/plan/route.js +19 -19
  85. package/.next/server/app/api/thursday/call/plan/route.js.nft.json +1 -1
  86. package/.next/server/app/api/thursday/call/route.js +11 -12
  87. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  88. package/.next/server/app/api/thursday/settings/route.js +11 -12
  89. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  90. package/.next/server/app/api/thursday/text/route.js +20 -20
  91. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  92. package/.next/server/app/api/thursday/tool-call/route.js +20 -20
  93. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  94. package/.next/server/app/api/update/route.js +10 -11
  95. package/.next/server/app/api/update/route.js.nft.json +1 -1
  96. package/.next/server/app/api/workspace/files/route.js +13 -13
  97. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  98. package/.next/server/app/api/workspace/route.js +13 -13
  99. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  100. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
  101. package/.next/server/app/artifact/[...path]/page.js +11 -11
  102. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  103. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  105. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  106. package/.next/server/app/page/server-reference-manifest.json +101 -68
  107. package/.next/server/app/page.js +10 -10
  108. package/.next/server/app/page.js.nft.json +1 -1
  109. package/.next/server/app/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app-paths-manifest.json +1 -0
  111. package/.next/server/chunks/[root-of-the-server]__0-xeb9k._.js +3 -0
  112. package/.next/server/chunks/{[root-of-the-server]__0qkh140._.js → [root-of-the-server]__01lftiq._.js} +1 -1
  113. package/.next/server/chunks/[root-of-the-server]__022hmm4._.js +1 -1
  114. package/.next/server/chunks/{[root-of-the-server]__1im7w7z._.js → [root-of-the-server]__02td13j._.js} +1 -1
  115. package/.next/server/chunks/[root-of-the-server]__03bjojd._.js +2 -2
  116. package/.next/server/chunks/[root-of-the-server]__03jn6g5._.js +3 -0
  117. package/.next/server/chunks/[root-of-the-server]__05wauq3._.js +12 -0
  118. package/.next/server/chunks/[root-of-the-server]__06eoz24._.js +5 -0
  119. package/.next/server/chunks/{[root-of-the-server]__0sfx6id._.js → [root-of-the-server]__0_jtzqu._.js} +2 -2
  120. package/.next/server/chunks/[root-of-the-server]__0_k10q9._.js +3 -0
  121. package/.next/server/chunks/{[root-of-the-server]__1l4feoc._.js → [root-of-the-server]__0cmzvf7._.js} +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__0cq8fp4._.js +3 -0
  123. package/.next/server/chunks/[root-of-the-server]__0cyki0f._.js +8 -0
  124. package/.next/server/chunks/[root-of-the-server]__0fvz6w5._.js +6 -0
  125. package/.next/server/chunks/[root-of-the-server]__0kj7-jk._.js +3 -0
  126. package/.next/server/chunks/{[root-of-the-server]__1p1ww2o._.js → [root-of-the-server]__0mq_mis._.js} +1 -1
  127. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
  128. package/.next/server/chunks/{[root-of-the-server]__00dtf7h._.js → [root-of-the-server]__0o6p3jk._.js} +2 -2
  129. package/.next/server/chunks/[root-of-the-server]__0opzn4f._.js +3 -0
  130. package/.next/server/chunks/{[root-of-the-server]__0ags3y9._.js → [root-of-the-server]__0puaol7._.js} +2 -2
  131. package/.next/server/chunks/[root-of-the-server]__0qhf60h._.js +1 -1
  132. package/.next/server/chunks/{[root-of-the-server]__0ah_uba._.js → [root-of-the-server]__0s6-921._.js} +1 -1
  133. package/.next/server/chunks/{[root-of-the-server]__0n4xgfd._.js → [root-of-the-server]__0sg3_9d._.js} +2 -2
  134. package/.next/server/chunks/[root-of-the-server]__0t9e405._.js +3 -0
  135. package/.next/server/chunks/{[root-of-the-server]__20zucml._.js → [root-of-the-server]__0ubu0sh._.js} +1 -1
  136. package/.next/server/chunks/[root-of-the-server]__0ucigrb._.js +3 -0
  137. package/.next/server/chunks/{[root-of-the-server]__0_qe8iq._.js → [root-of-the-server]__0wnd1ac._.js} +2 -2
  138. package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +5 -0
  139. package/.next/server/chunks/[root-of-the-server]__10x2qg8._.js +5 -0
  140. package/.next/server/chunks/{[root-of-the-server]__0fo9gc5._.js → [root-of-the-server]__114bnf1._.js} +1 -1
  141. package/.next/server/chunks/[root-of-the-server]__1343ru3._.js +3 -0
  142. package/.next/server/chunks/{[root-of-the-server]__1g6_6it._.js → [root-of-the-server]__16682o8._.js} +1 -1
  143. package/.next/server/chunks/[root-of-the-server]__16bbvlw._.js +7 -0
  144. package/.next/server/chunks/{[root-of-the-server]__1ui547o._.js → [root-of-the-server]__16cwbuc._.js} +1 -1
  145. package/.next/server/chunks/{[root-of-the-server]__05fq824._.js → [root-of-the-server]__17luxss._.js} +2 -2
  146. package/.next/server/chunks/[root-of-the-server]__17ses32._.js +3 -0
  147. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +1 -1
  148. package/.next/server/chunks/{[root-of-the-server]__1m9dh1w._.js → [root-of-the-server]__1ahc9c9._.js} +1 -1
  149. package/.next/server/chunks/[root-of-the-server]__1bewni6._.js +8 -0
  150. package/.next/server/chunks/{[root-of-the-server]__0lg1fok._.js → [root-of-the-server]__1bk734v._.js} +1 -1
  151. package/.next/server/chunks/{[root-of-the-server]__0atf1-_._.js → [root-of-the-server]__1btmuni._.js} +5 -5
  152. package/.next/server/chunks/[root-of-the-server]__1e2aiae._.js +3 -0
  153. package/.next/server/chunks/[root-of-the-server]__1fjmju_._.js +3 -0
  154. package/.next/server/chunks/[root-of-the-server]__1j-6f71._.js +3 -0
  155. package/.next/server/chunks/{[root-of-the-server]__0btxiu1._.js → [root-of-the-server]__1ltmy5k._.js} +2 -2
  156. package/.next/server/chunks/[root-of-the-server]__1mf425m._.js +8 -0
  157. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  158. package/.next/server/chunks/[root-of-the-server]__1o7z93z._.js +1 -1
  159. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +11 -0
  160. package/.next/server/chunks/[root-of-the-server]__1pho9cl._.js +3 -0
  161. package/.next/server/chunks/[root-of-the-server]__1q2jauq._.js +3 -0
  162. package/.next/server/chunks/[root-of-the-server]__1rs2v4h._.js +5 -0
  163. package/.next/server/chunks/{[root-of-the-server]__1ivv7te._.js → [root-of-the-server]__1rso8xj._.js} +2 -2
  164. package/.next/server/chunks/[root-of-the-server]__1xr0wxp._.js +3 -0
  165. package/.next/server/chunks/[root-of-the-server]__1yiazek._.js +3 -0
  166. package/.next/server/chunks/{[root-of-the-server]__0a2v56f._.js → [root-of-the-server]__20_po2e._.js} +2 -2
  167. package/.next/server/chunks/{[root-of-the-server]__0gmxpev._.js → [root-of-the-server]__20v-jxs._.js} +2 -2
  168. package/.next/server/chunks/[root-of-the-server]__212_w8j._.js +5 -0
  169. package/.next/server/chunks/_0-g8m2a._.js +72 -0
  170. package/.next/server/chunks/_0-qt5if._.js +1 -1
  171. package/.next/server/chunks/_00uhvhe._.js +12 -12
  172. package/.next/server/chunks/_02tecta._.js +5 -0
  173. package/.next/server/chunks/_04862qx._.js +3 -0
  174. package/.next/server/chunks/_05p90of._.js +3 -0
  175. package/.next/server/chunks/{_1_30lb4._.js → _06tj0ik._.js} +2 -2
  176. package/.next/server/chunks/_06u9yo-._.js +1 -1
  177. package/.next/server/chunks/_07mczew._.js +1 -1
  178. package/.next/server/chunks/_07pkeds._.js +2 -2
  179. package/.next/server/chunks/_08-mlqd._.js +1 -1
  180. package/.next/server/chunks/_08354bn._.js +12 -12
  181. package/.next/server/chunks/_08bp8w1._.js +3 -0
  182. package/.next/server/chunks/_0adsimt._.js +3 -0
  183. package/.next/server/chunks/_0bcx24d._.js +8 -0
  184. package/.next/server/chunks/{_0e8ks1n._.js → _0chqx-h._.js} +16 -12
  185. package/.next/server/chunks/_0d4f7pc._.js +5 -0
  186. package/.next/server/chunks/_0d9208_._.js +6 -0
  187. package/.next/server/chunks/{_0lip2ae._.js → _0ejet8x._.js} +16 -12
  188. package/.next/server/chunks/_0eowjm_._.js +72 -0
  189. package/.next/server/chunks/_0gxz_1b._.js +1 -1
  190. package/.next/server/chunks/_0iy3dus._.js +1 -1
  191. package/.next/server/chunks/_0jzv71c._.js +5 -0
  192. package/.next/server/chunks/{_0hin38_._.js → _0khihjk._.js} +6 -6
  193. package/.next/server/chunks/_0lrns0i._.js +3 -0
  194. package/.next/server/chunks/_0nbkv9k._.js +7 -0
  195. package/.next/server/chunks/_0p94gu0._.js +57 -0
  196. package/.next/server/chunks/_0pzqm_r._.js +3 -3
  197. package/.next/server/chunks/_0s515yz._.js +57 -0
  198. package/.next/server/chunks/_0supk_r._.js +5 -0
  199. package/.next/server/chunks/_0sxwm3y._.js +3 -0
  200. package/.next/server/chunks/_0tkzlv1._.js +11 -9
  201. package/.next/server/chunks/{_02o3ay7._.js → _0tzxrjg._.js} +2 -2
  202. package/.next/server/chunks/_0u0pa-b._.js +72 -0
  203. package/.next/server/chunks/_0umx0sn._.js +3 -0
  204. package/.next/server/chunks/_0vojr2u._.js +3 -0
  205. package/.next/server/chunks/_0wyh244._.js +12 -12
  206. package/.next/server/chunks/_0xlv72v._.js +57 -0
  207. package/.next/server/chunks/{_0a9x0xp._.js → _0y-5vzm._.js} +2 -2
  208. package/.next/server/chunks/{_0xt812m._.js → _0z06xn0._.js} +16 -12
  209. package/.next/server/chunks/_0zwjr-g._.js +1 -1
  210. package/.next/server/chunks/_1002x_9._.js +72 -0
  211. package/.next/server/chunks/{_0cdeabn._.js → _1299dpz._.js} +2 -2
  212. package/.next/server/chunks/_12htlm_._.js +9 -0
  213. package/.next/server/chunks/_13tat6z._.js +1 -1
  214. package/.next/server/chunks/_143moy6._.js +5 -0
  215. package/.next/server/chunks/_186uku9._.js +1 -1
  216. package/.next/server/chunks/_190pdee._.js +3 -0
  217. package/.next/server/chunks/_1951_6o._.js +3 -0
  218. package/.next/server/chunks/_19h6ag7._.js +3 -0
  219. package/.next/server/chunks/_1_0gehg._.js +11 -9
  220. package/.next/server/chunks/_1be0yao._.js +12 -12
  221. package/.next/server/chunks/_1dtm9bs._.js +1 -1
  222. package/.next/server/chunks/_1e1t6tm._.js +57 -0
  223. package/.next/server/chunks/_1e1yip3._.js +3 -0
  224. package/.next/server/chunks/{_0uet1h6._.js → _1e48czp._.js} +6 -6
  225. package/.next/server/chunks/_1fqa4ax._.js +72 -0
  226. package/.next/server/chunks/_1gb0_wm._.js +3 -0
  227. package/.next/server/chunks/_1i6626u._.js +3 -0
  228. package/.next/server/chunks/_1jca8ws._.js +3 -0
  229. package/.next/server/chunks/_1k6bmez._.js +1 -1
  230. package/.next/server/chunks/{_10qam6o._.js → _1kg70wc._.js} +6 -6
  231. package/.next/server/chunks/_1ko5shz._.js +1 -1
  232. package/.next/server/chunks/{_12a_gfz._.js → _1kqgeww._.js} +16 -12
  233. package/.next/server/chunks/_1kwmzab._.js +1 -1
  234. package/.next/server/chunks/_1l5qbki._.js +6 -0
  235. package/.next/server/chunks/_1mlsbwy._.js +3 -0
  236. package/.next/server/chunks/_1nej_f5._.js +72 -0
  237. package/.next/server/chunks/_1o15f0b._.js +3 -0
  238. package/.next/server/chunks/_1omiszv._.js +57 -0
  239. package/.next/server/chunks/_1otx63k._.js +3 -0
  240. package/.next/server/chunks/_1pwai-w._.js +72 -0
  241. package/.next/server/chunks/_1qdqpgf._.js +3 -0
  242. package/.next/server/chunks/_1qo2kxe._.js +3 -0
  243. package/.next/server/chunks/_1qoa_n_._.js +3 -0
  244. package/.next/server/chunks/_1qwi06-._.js +5 -0
  245. package/.next/server/chunks/_1qxheoa._.js +1 -1
  246. package/.next/server/chunks/{_1skgy7b._.js → _1ry6afh._.js} +6 -6
  247. package/.next/server/chunks/_1u9tb9z._.js +57 -0
  248. package/.next/server/chunks/_1v7z66t._.js +5 -0
  249. package/.next/server/chunks/_1vdlc8g._.js +5 -0
  250. package/.next/server/chunks/_1x2xiyw._.js +1 -1
  251. package/.next/server/chunks/_1y-e2mk._.js +79 -0
  252. package/.next/server/chunks/_1yx285_._.js +1 -1
  253. package/.next/server/chunks/_1za6dtx._.js +72 -0
  254. package/.next/server/chunks/_1zsrejy._.js +3 -0
  255. package/.next/server/chunks/_1zvhk_m._.js +1 -1
  256. package/.next/server/chunks/{_0m3sdq8._.js → _20sfopz._.js} +16 -12
  257. package/.next/server/chunks/_next-internal_server_app_api_bot_thread_lessons_route_actions_0zt-nr6.js +3 -0
  258. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  259. package/.next/server/chunks/features_0-728_-._.js +1 -1
  260. package/.next/server/chunks/features_0uy40ze._.js +1 -1
  261. package/.next/server/chunks/features_0vyrnq0._.js +3 -0
  262. package/.next/server/chunks/features_116bwtn._.js +1 -1
  263. package/.next/server/chunks/features_14kex_m._.js +6 -4
  264. package/.next/server/chunks/features_1cb9luv._.js +1 -1
  265. package/.next/server/chunks/features_1jd2zjm._.js +8 -8
  266. package/.next/server/chunks/features_1xn6un-._.js +6 -4
  267. package/.next/server/chunks/features_bot_1d6ghh5._.js +1 -1
  268. package/.next/server/chunks/features_bot_1dfrdsb._.js +1 -1
  269. package/.next/server/chunks/ssr/{[root-of-the-server]__1j2x83w._.js → [root-of-the-server]__0ama9d0._.js} +2 -2
  270. package/.next/server/chunks/ssr/[root-of-the-server]__0auk-ke._.js +13 -8
  271. package/.next/server/chunks/ssr/{[root-of-the-server]__02-kwsg._.js → [root-of-the-server]__0p0cgo1._.js} +2 -2
  272. package/.next/server/chunks/ssr/{[root-of-the-server]__1ngprpi._.js → [root-of-the-server]__0rpm20m._.js} +2 -2
  273. package/.next/server/chunks/ssr/[root-of-the-server]__0vcuiyu._.js +3 -0
  274. package/.next/server/chunks/ssr/{[root-of-the-server]__13xx3dr._.js → [root-of-the-server]__0x2--_p._.js} +2 -2
  275. package/.next/server/chunks/ssr/{[root-of-the-server]__1qiq402._.js → [root-of-the-server]__145268e._.js} +2 -2
  276. package/.next/server/chunks/ssr/{[root-of-the-server]__11_ws3y._.js → [root-of-the-server]__153-ebp._.js} +2 -2
  277. package/.next/server/chunks/ssr/[root-of-the-server]__16jc196._.js +1 -1
  278. package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
  279. package/.next/server/chunks/ssr/[root-of-the-server]__1hqly37._.js +3 -0
  280. package/.next/server/chunks/ssr/[root-of-the-server]__1j-bkt7._.js +3 -0
  281. package/.next/server/chunks/ssr/[root-of-the-server]__1nb9kc9._.js +3 -0
  282. package/.next/server/chunks/ssr/_0692i-a._.js +1 -1
  283. package/.next/server/chunks/ssr/{_0ldpw1q._.js → _0732nef._.js} +2 -2
  284. package/.next/server/chunks/ssr/_0cu8_pz._.js +3 -0
  285. package/.next/server/chunks/ssr/_0gk_72-._.js +3 -0
  286. package/.next/server/chunks/ssr/_0jvrmoz._.js +9 -0
  287. package/.next/server/chunks/ssr/_0k06tdw._.js +6 -0
  288. package/.next/server/chunks/ssr/{_1tc_gbg._.js → _0l_qakv._.js} +2 -2
  289. package/.next/server/chunks/ssr/_0lqzdd0._.js +3 -0
  290. package/.next/server/chunks/ssr/{_19g10gj._.js → _0p18b0z._.js} +2 -2
  291. package/.next/server/chunks/ssr/{_04f6fil._.js → _0pg2mgq._.js} +3 -3
  292. package/.next/server/chunks/ssr/{_1nnl9sj._.js → _0rm-9aj._.js} +2 -2
  293. package/.next/server/chunks/ssr/_128r03g._.js +13 -11
  294. package/.next/server/chunks/ssr/_17fa2ns._.js +12 -12
  295. package/.next/server/chunks/ssr/_18cjc9o._.js +3 -0
  296. package/.next/server/chunks/ssr/_1_px1o-._.js +1 -1
  297. package/.next/server/chunks/ssr/_1a_w_du._.js +1 -1
  298. package/.next/server/chunks/ssr/_1crszf7._.js +2 -2
  299. package/.next/server/chunks/ssr/_1e_9qjr._.js +1 -1
  300. package/.next/server/chunks/ssr/_1ehd80b._.js +3 -0
  301. package/.next/server/chunks/ssr/{_0a31ywo._.js → _1fua8fv._.js} +2 -2
  302. package/.next/server/chunks/ssr/_1m290ru._.js +3 -0
  303. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  304. package/.next/server/chunks/ssr/{_0nans9v._.js → _1q30h74._.js} +2 -2
  305. package/.next/server/chunks/ssr/_1q9r6u6._.js +1 -1
  306. package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
  307. package/.next/server/chunks/ssr/{_079xt7h._.js → _1v_5j9l._.js} +23 -19
  308. package/.next/server/chunks/ssr/_1x_6jyh._.js +3 -0
  309. package/.next/server/chunks/ssr/{components_ui_markdown-body_tsx_13aa4_2._.js → components_ui_markdown-body_tsx_0ywzjrl._.js} +2 -2
  310. package/.next/server/chunks/ssr/features_0rrgq_t._.js +1 -1
  311. package/.next/server/chunks/ssr/features_ai_components_model-picker_tsx_0ucb1y9._.js +1 -1
  312. package/.next/server/chunks/ssr/features_bot_1stfytf._.js +1 -1
  313. package/.next/server/chunks/ssr/features_bot_components_01ye2wp._.js +1 -1
  314. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +2 -2
  315. package/.next/server/chunks/ssr/features_bot_components_thread-setting_tsx_0yae7zy._.js +1 -1
  316. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  317. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  318. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  319. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  320. package/.next/server/chunks/ssr/features_skills_components_skills-setting_tsx_1wtuuip._.js +1 -1
  321. package/.next/server/chunks/ssr/features_thursday_components_thursday-setting_tsx_1_6ydrc._.js +1 -1
  322. package/.next/server/chunks/ssr/{node_modules_1k0ygyl._.js → node_modules_0-s3xam._.js} +1 -1
  323. package/.next/server/chunks/ssr/{node_modules_0jrjbfv._.js → node_modules_02p2t58._.js} +1 -1
  324. package/.next/server/chunks/ssr/{node_modules_1si826e._.js → node_modules_03gt5eg._.js} +1 -1
  325. package/.next/server/chunks/ssr/{node_modules_0jqaiyb._.js → node_modules_03ytewb._.js} +1 -1
  326. package/.next/server/chunks/ssr/{node_modules_19acw__._.js → node_modules_05yikon._.js} +1 -1
  327. package/.next/server/chunks/ssr/{node_modules_0gb732y._.js → node_modules_060s01j._.js} +2 -2
  328. package/.next/server/chunks/ssr/{node_modules_0wsygp2._.js → node_modules_07k-xj6._.js} +1 -1
  329. package/.next/server/chunks/ssr/{node_modules_1fa_3_c._.js → node_modules_08xo4p2._.js} +2 -2
  330. package/.next/server/chunks/ssr/{node_modules_05fihwh._.js → node_modules_09e0lw8._.js} +1 -1
  331. package/.next/server/chunks/ssr/{node_modules_0kdc_b7._.js → node_modules_0a1kt26._.js} +1 -1
  332. package/.next/server/chunks/ssr/{node_modules_050v667._.js → node_modules_0ahwwc6._.js} +2 -2
  333. package/.next/server/chunks/ssr/{node_modules_0ou72wu._.js → node_modules_0c2vpni._.js} +2 -2
  334. package/.next/server/chunks/ssr/{node_modules_1n5ds4a._.js → node_modules_0e7nwfw._.js} +1 -1
  335. package/.next/server/chunks/ssr/{node_modules_04qcy8e._.js → node_modules_0er1nmg._.js} +2 -2
  336. package/.next/server/chunks/ssr/{node_modules_1misalx._.js → node_modules_0f3769j._.js} +1 -1
  337. package/.next/server/chunks/ssr/{node_modules_0ljjw5o._.js → node_modules_0fi5we8._.js} +1 -1
  338. package/.next/server/chunks/ssr/{node_modules_1-vdt7b._.js → node_modules_0i2j6g6._.js} +1 -1
  339. package/.next/server/chunks/ssr/{node_modules_1861d28._.js → node_modules_0ka66-h._.js} +1 -1
  340. package/.next/server/chunks/ssr/{node_modules_140qn14._.js → node_modules_0keiwh2._.js} +2 -2
  341. package/.next/server/chunks/ssr/{node_modules_06p_ayw._.js → node_modules_0mihldg._.js} +1 -1
  342. package/.next/server/chunks/ssr/{node_modules_107hxun._.js → node_modules_0mujceo._.js} +1 -1
  343. package/.next/server/chunks/ssr/{node_modules_06b7g0r._.js → node_modules_0ntw_qg._.js} +1 -1
  344. package/.next/server/chunks/ssr/{node_modules_0jaxs1q._.js → node_modules_0py4_6y._.js} +1 -1
  345. package/.next/server/chunks/ssr/{node_modules_0y_dhgi._.js → node_modules_0qu8a5o._.js} +1 -1
  346. package/.next/server/chunks/ssr/{node_modules_1vh6nr-._.js → node_modules_0sk7kv9._.js} +1 -1
  347. package/.next/server/chunks/ssr/{node_modules_2045nus._.js → node_modules_0ted14c._.js} +2 -2
  348. package/.next/server/chunks/ssr/{node_modules_0z8o0-n._.js → node_modules_0u78wn3._.js} +1 -1
  349. package/.next/server/chunks/ssr/{node_modules_0skzy7i._.js → node_modules_0umtxxj._.js} +1 -1
  350. package/.next/server/chunks/ssr/{node_modules_1o1ud40._.js → node_modules_0ze7604._.js} +1 -1
  351. package/.next/server/chunks/ssr/{node_modules_152bm83._.js → node_modules_116k0n3._.js} +1 -1
  352. package/.next/server/chunks/ssr/{node_modules_0-zy1_5._.js → node_modules_15_65ve._.js} +1 -1
  353. package/.next/server/chunks/ssr/{node_modules_12409ud._.js → node_modules_16hmz5b._.js} +1 -1
  354. package/.next/server/chunks/ssr/{node_modules_069gsbk._.js → node_modules_16ki2uq._.js} +1 -1
  355. package/.next/server/chunks/ssr/{node_modules_0ia9-w8._.js → node_modules_19xrd6b._.js} +2 -2
  356. package/.next/server/chunks/ssr/{node_modules_1pt7o47._.js → node_modules_1_c3zat._.js} +2 -2
  357. package/.next/server/chunks/ssr/{node_modules_19gok-9._.js → node_modules_1axn4aw._.js} +2 -2
  358. package/.next/server/chunks/ssr/{node_modules_1jrlct1._.js → node_modules_1bjctcm._.js} +1 -1
  359. package/.next/server/chunks/ssr/{node_modules_1jt8w7f._.js → node_modules_1cxx8tm._.js} +1 -1
  360. package/.next/server/chunks/ssr/{node_modules_1v-un0n._.js → node_modules_1d7evv9._.js} +1 -1
  361. package/.next/server/chunks/ssr/{node_modules_13ccsqp._.js → node_modules_1depc7o._.js} +1 -1
  362. package/.next/server/chunks/ssr/{node_modules_1b45v66._.js → node_modules_1dm5c-u._.js} +1 -1
  363. package/.next/server/chunks/ssr/{node_modules_1uyu3cc._.js → node_modules_1fdivhl._.js} +1 -1
  364. package/.next/server/chunks/ssr/{node_modules_0ob-uxg._.js → node_modules_1gxpcyd._.js} +1 -1
  365. package/.next/server/chunks/ssr/{node_modules_0wa05ay._.js → node_modules_1ih7lxu._.js} +2 -2
  366. package/.next/server/chunks/ssr/{node_modules_18uwehg._.js → node_modules_1k-0av-._.js} +1 -1
  367. package/.next/server/chunks/ssr/{node_modules_0zi89fj._.js → node_modules_1kpg87p._.js} +1 -1
  368. package/.next/server/chunks/ssr/{node_modules_0q8xm6u._.js → node_modules_1le-lim._.js} +2 -2
  369. package/.next/server/chunks/ssr/{node_modules_17-v4n4._.js → node_modules_1lnx_h4._.js} +1 -1
  370. package/.next/server/chunks/ssr/{node_modules_0v0l095._.js → node_modules_1mwxdhp._.js} +1 -1
  371. package/.next/server/chunks/ssr/{node_modules_1x7napn._.js → node_modules_1q2a30m._.js} +2 -2
  372. package/.next/server/chunks/ssr/{node_modules_0walxvo._.js → node_modules_1soi3y1._.js} +2 -2
  373. package/.next/server/chunks/ssr/{node_modules_1xtd9ml._.js → node_modules_1sphzx9._.js} +1 -1
  374. package/.next/server/chunks/ssr/{node_modules_150qjpq._.js → node_modules_1tfn213._.js} +2 -2
  375. package/.next/server/chunks/ssr/{node_modules_20llbw8._.js → node_modules_1vmqt-a._.js} +1 -1
  376. package/.next/server/chunks/ssr/{node_modules_0xetrwd._.js → node_modules_1w8ljz0._.js} +2 -2
  377. package/.next/server/chunks/ssr/{node_modules_0_uhcxd._.js → node_modules_208s6_i._.js} +1 -1
  378. package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_1bf0rdx._.js → node_modules_katex_dist_katex_mjs_0jhievg._.js} +1 -1
  379. package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0-moq-r._.js → node_modules_katex_dist_katex_mjs_1zcod1m._.js} +1 -1
  380. package/.next/server/middleware-build-manifest.js +3 -3
  381. package/.next/server/pages/404.html +1 -1
  382. package/.next/server/pages/500.html +1 -1
  383. package/.next/server/server-reference-manifest.js +1 -1
  384. package/.next/server/server-reference-manifest.json +102 -69
  385. package/.next/static/chunks/{0lc_77uhatqgd.js → 078xraafllix3.js} +1 -1
  386. package/.next/static/chunks/{2njcedjozdqm7.js → 0nev6q2iq077s.js} +1 -1
  387. package/.next/static/chunks/{06ymo4xf31ggh.js → 0ocx6nt76fc71.js} +1 -1
  388. package/.next/static/chunks/0oo3vqzbrckzw.js +1 -0
  389. package/.next/static/chunks/{1ki7x6-ehua0u.js → 0piazplcpaho6.js} +1 -1
  390. package/.next/static/chunks/{25tttxgpn-fdl.js → 0totfwrzgu9zy.js} +2 -2
  391. package/.next/static/chunks/{1s5t41jiomssd.css → 0tpwm72wdln0d.css} +1 -1
  392. package/.next/static/chunks/{1o4z63f94c3r-.js → 0u_wx1-lmoae2.js} +1 -1
  393. package/.next/static/chunks/{2tlvu360xbisx.js → 0wwq57j09skhy.js} +1 -1
  394. package/.next/static/chunks/152u4p6c_6spk.js +1 -0
  395. package/.next/static/chunks/{3f4aku2z0zdxp.js → 1fignuuc030t2.js} +1 -1
  396. package/.next/static/chunks/{29fpns41ml485.js → 1n3a07w81jbc-.js} +1 -1
  397. package/.next/static/chunks/2-zfbypxf0agx.js +1 -0
  398. package/.next/static/chunks/{277zw6dp5yzks.js → 21wm184xoke98.js} +9 -9
  399. package/.next/static/chunks/{1vxq-0uxcm5yl.js → 25-zh-0nfxqyg.js} +1 -1
  400. package/.next/static/chunks/{1gca5ia-a-3e2.js → 29p2mdrn-z1oz.js} +1 -1
  401. package/.next/static/chunks/{2jn9y4sol_low.js → 2biit-egkb-xl.js} +2 -2
  402. package/.next/static/chunks/{1zwj72bhapocl.js → 2cciu1ow-svbf.js} +1 -1
  403. package/.next/static/chunks/{0i4df8t5_6a-g.js → 2gl-fo_rmmmq0.js} +1 -1
  404. package/.next/static/chunks/2kt0nc5m372ie.js +4 -0
  405. package/.next/static/chunks/2v486bh_6kl11.js +1 -0
  406. package/.next/static/chunks/33_a4j5altfr5.js +1 -0
  407. package/.next/static/chunks/37pwubc1t0jyy.js +1 -0
  408. package/.next/static/chunks/{0km5rjf8k0gst.js → 38rbtwatw658l.js} +1 -1
  409. package/.next/static/chunks/{233p45nuh4m5b.css → 3d-1vk5hzu5rq.css} +2 -2
  410. package/.next/static/chunks/{3ymtwwxmbactm.js → 3da8rr3q6pt0b.js} +1 -1
  411. package/.next/static/chunks/3i12sqqp1v8a8.js +1 -0
  412. package/.next/static/chunks/{1e3karuzhh7ik.js → 3iwdx3_gikxbg.js} +1 -1
  413. package/.next/static/chunks/{17ow2tmvy65in.js → 3k_xm_e4grb9u.js} +1 -1
  414. package/.next/static/chunks/{0_o7o4-itqsz7.js → 3odtl00mfb4u7.js} +1 -1
  415. package/.next/static/chunks/3wblbyhomh9va.js +1 -0
  416. package/.next/static/chunks/{1vwqvgit8a1vm.js → 3x2goglbfw5t7.js} +1 -1
  417. package/database/migrations/20261006014533_first_mercury/migration.sql +16 -0
  418. package/database/migrations/20261006014533_first_mercury/snapshot.json +2134 -0
  419. package/database/migrations/20261006022849_purple_young_avengers/migration.sql +1 -0
  420. package/database/migrations/20261006022849_purple_young_avengers/snapshot.json +2144 -0
  421. package/database/migrations/20261006040316_lazy_ogun/migration.sql +3 -0
  422. package/database/migrations/20261006040316_lazy_ogun/snapshot.json +2174 -0
  423. package/database/migrations/20261006043313_modern_goliath/migration.sql +1 -0
  424. package/database/migrations/20261006043313_modern_goliath/snapshot.json +2184 -0
  425. package/guide/bots.md +29 -0
  426. package/guide/calls.md +3 -1
  427. package/guide/phone.md +3 -1
  428. package/package.json +1 -1
  429. package/.next/server/chunks/[root-of-the-server]__00qilm2._.js +0 -3
  430. package/.next/server/chunks/[root-of-the-server]__01jpmcj._.js +0 -11
  431. package/.next/server/chunks/[root-of-the-server]__0bzz4u5._.js +0 -8
  432. package/.next/server/chunks/[root-of-the-server]__0d-dfqm._.js +0 -5
  433. package/.next/server/chunks/[root-of-the-server]__0elyqrt._.js +0 -3
  434. package/.next/server/chunks/[root-of-the-server]__0jqidnu._.js +0 -8
  435. package/.next/server/chunks/[root-of-the-server]__0mmynvy._.js +0 -5
  436. package/.next/server/chunks/[root-of-the-server]__0mzzwmt._.js +0 -8
  437. package/.next/server/chunks/[root-of-the-server]__0qo3zap._.js +0 -8
  438. package/.next/server/chunks/[root-of-the-server]__0rqmdxt._.js +0 -6
  439. package/.next/server/chunks/[root-of-the-server]__0sea36s._.js +0 -10
  440. package/.next/server/chunks/[root-of-the-server]__0unmyur._.js +0 -6
  441. package/.next/server/chunks/[root-of-the-server]__0wimh1u._.js +0 -8
  442. package/.next/server/chunks/[root-of-the-server]__0zezbds._.js +0 -5
  443. package/.next/server/chunks/[root-of-the-server]__12hkdpz._.js +0 -8
  444. package/.next/server/chunks/[root-of-the-server]__13dy1f5._.js +0 -5
  445. package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +0 -3
  446. package/.next/server/chunks/[root-of-the-server]__14inehv._.js +0 -3
  447. package/.next/server/chunks/[root-of-the-server]__17kdjf6._.js +0 -5
  448. package/.next/server/chunks/[root-of-the-server]__17yv6lg._.js +0 -5
  449. package/.next/server/chunks/[root-of-the-server]__1ac25yp._.js +0 -12
  450. package/.next/server/chunks/[root-of-the-server]__1hjb8wf._.js +0 -3
  451. package/.next/server/chunks/[root-of-the-server]__1jcu_e9._.js +0 -5
  452. package/.next/server/chunks/[root-of-the-server]__1jmr2ed._.js +0 -8
  453. package/.next/server/chunks/[root-of-the-server]__1onvx8x._.js +0 -5
  454. package/.next/server/chunks/[root-of-the-server]__1r2kimd._.js +0 -3
  455. package/.next/server/chunks/[root-of-the-server]__1rjj4i4._.js +0 -3
  456. package/.next/server/chunks/[root-of-the-server]__1s3umyw._.js +0 -3
  457. package/.next/server/chunks/[root-of-the-server]__212tz6e._.js +0 -8
  458. package/.next/server/chunks/_0-mqt2w._.js +0 -3
  459. package/.next/server/chunks/_0bcg3vg._.js +0 -6
  460. package/.next/server/chunks/_0cm67bo._.js +0 -6
  461. package/.next/server/chunks/_0gifi_2._.js +0 -7
  462. package/.next/server/chunks/_0li046e._.js +0 -3
  463. package/.next/server/chunks/_0mirg2-._.js +0 -3
  464. package/.next/server/chunks/_0oj2slk._.js +0 -5
  465. package/.next/server/chunks/_0oyz9x0._.js +0 -3
  466. package/.next/server/chunks/_0pljp-1._.js +0 -3
  467. package/.next/server/chunks/_0rdxqrk._.js +0 -5
  468. package/.next/server/chunks/_0sxih1y._.js +0 -3
  469. package/.next/server/chunks/_0u-96in._.js +0 -9
  470. package/.next/server/chunks/_0wjia9n._.js +0 -5
  471. package/.next/server/chunks/_0x2mdif._.js +0 -5
  472. package/.next/server/chunks/_0xa89lt._.js +0 -3
  473. package/.next/server/chunks/_0y2a-fg._.js +0 -3
  474. package/.next/server/chunks/_0ynjnhl._.js +0 -5
  475. package/.next/server/chunks/_1-sk_q4._.js +0 -3
  476. package/.next/server/chunks/_1355-km._.js +0 -3
  477. package/.next/server/chunks/_14-kmob._.js +0 -5
  478. package/.next/server/chunks/_1d7gbgb._.js +0 -3
  479. package/.next/server/chunks/_1d_enhu._.js +0 -3
  480. package/.next/server/chunks/_1evvnbp._.js +0 -18
  481. package/.next/server/chunks/_1g10pf5._.js +0 -3
  482. package/.next/server/chunks/_1icgbi8._.js +0 -18
  483. package/.next/server/chunks/_1ihge52._.js +0 -6
  484. package/.next/server/chunks/_1k92b3d._.js +0 -3
  485. package/.next/server/chunks/_1nfr-75._.js +0 -3
  486. package/.next/server/chunks/_1o2r4ja._.js +0 -5
  487. package/.next/server/chunks/_1pv6xbq._.js +0 -5
  488. package/.next/server/chunks/_1qgix-j._.js +0 -3
  489. package/.next/server/chunks/_1sd6nev._.js +0 -3
  490. package/.next/server/chunks/_1t8fv7b._.js +0 -18
  491. package/.next/server/chunks/_1ufbxe1._.js +0 -5
  492. package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +0 -3
  493. package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +0 -8
  494. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0omj5b1._.js +0 -3
  495. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0s2o664._.js +0 -3
  496. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0ufuc3s._.js +0 -3
  497. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1cvpr1j._.js +0 -3
  498. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1y49572._.js +0 -3
  499. package/.next/server/chunks/node_modules_zod_v4_03dw6sa._.js +0 -57
  500. package/.next/server/chunks/node_modules_zod_v4_0h0-drr._.js +0 -57
  501. package/.next/server/chunks/node_modules_zod_v4_0uctlhw._.js +0 -57
  502. package/.next/server/chunks/node_modules_zod_v4_13mu186._.js +0 -57
  503. package/.next/server/chunks/node_modules_zod_v4_17gxt3_._.js +0 -57
  504. package/.next/server/chunks/node_modules_zod_v4_1mygyfn._.js +0 -3
  505. package/.next/server/chunks/node_modules_zod_v4_1u-rl3b._.js +0 -57
  506. package/.next/server/chunks/ssr/[root-of-the-server]__0lv-wr_._.js +0 -3
  507. package/.next/server/chunks/ssr/[root-of-the-server]__0utwbb5._.js +0 -3
  508. package/.next/server/chunks/ssr/[root-of-the-server]__1fvh0zn._.js +0 -3
  509. package/.next/server/chunks/ssr/[root-of-the-server]__1ynag_l._.js +0 -3
  510. package/.next/server/chunks/ssr/_0f3t9pm._.js +0 -9
  511. package/.next/server/chunks/ssr/_131wmbl._.js +0 -6
  512. package/.next/server/chunks/ssr/_15zznka._.js +0 -3
  513. package/.next/server/chunks/ssr/_183f3bo._.js +0 -3
  514. package/.next/server/chunks/ssr/_1e1qe7w._.js +0 -3
  515. package/.next/server/chunks/ssr/_1kj3d2q._.js +0 -3
  516. package/.next/server/chunks/ssr/_1qtcl42._.js +0 -3
  517. package/.next/server/chunks/ssr/lib_utils_ts_0_f1xvm._.js +0 -3
  518. package/.next/static/chunks/051z85h3ofmif.js +0 -1
  519. package/.next/static/chunks/1hwehpk3kk-pc.js +0 -1
  520. package/.next/static/chunks/1pxe_gpjic1_h.js +0 -1
  521. package/.next/static/chunks/2zvo7b47hhxi5.js +0 -1
  522. package/.next/static/chunks/3k7fum0yljmyr.js +0 -1
  523. package/.next/static/chunks/3qhhs3dk6cdbq.js +0 -4
  524. package/.next/static/chunks/3sawwm4vucnzn.js +0 -1
  525. package/.next/static/chunks/3ul6m16ba_i3u.js +0 -1
  526. /package/.next/static/{pekZvsOZ3_8_ohluwgZtY → nXUvWsiGKRvNRk8kqeJ-u}/_buildManifest.js +0 -0
  527. /package/.next/static/{pekZvsOZ3_8_ohluwgZtY → nXUvWsiGKRvNRk8kqeJ-u}/_clientMiddlewareManifest.js +0 -0
  528. /package/.next/static/{pekZvsOZ3_8_ohluwgZtY → nXUvWsiGKRvNRk8kqeJ-u}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports=[364937,(e,o,d)=>{}];
2
+
3
+ //# sourceMappingURL=_next-internal_server_app_api_bot_thread_lessons_route_actions_0zt-nr6.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[333925,e=>{"use strict";let s=process.env.THURSDAY_APP_DIR?.trim()||process.cwd(),t=process.env.THURSDAY_HOME?.trim()||process.cwd(),r=process.env.THURSDAY_URL?.trim()||`http://localhost:${process.env.PORT?.trim()||3e3}`,a=`${t}/local.db`,o=`file:${a}`,i=`${t}/.env`,E=".ai-workspace",M={workspace:E,artifacts:"artifacts",projects:"projects",scratch:"scratch",bots:"bots",output:".output",signIns:".sign-ins",skills:{default:"skills",custom:`${E}/.agents/skills`,own:".agents/skills",runtime:"runtime",seeds:"seed-skills"}},_="artifact";e.s(["APP_DIR",0,s,"APP_NAME",0,"Thursday","APP_URL",0,r,"ARTIFACT_SKILL",0,_,"BOT_MEMORY_LIMITS",0,{files:60,chars:3e3},"BOT_REFLECT",0,{minTools:5,steps:8},"BOT_RUN",0,{steps:100,compactAt:5e5,compactHeadroom:.8,summaryWords:{min:600,max:3e3,perTokens:200},participants:8,concurrent:8,turns:120,queuedMessages:200,silenceMs:3e5,overflowShrink:.6,retryMs:1e4,compactFiles:40},"BOT_WORK",0,{open:5,recent:5,said:80,files:2,reads:2,asked:400,readChars:4e3},"BROWSER_CLI",0,{readMs:15e3,loadMs:3e4},"BROWSER_GONE_MS",0,1e4,"BROWSER_IDLE",0,{closeAfterMs:36e5,checkEveryMs:3e5},"BROWSER_VIEWPORT",0,"700x700","CALL_EXEC_TIMEOUT_MS",0,15e3,"CALL_MEMORY",0,{steps:8,turns:300,stepMs:12e4,catchUpMs:864e5},"CALL_RELAY",0,{quietMs:2e3,perTurn:3,readMs:15e3,chars:600},"CATALOG_MS",0,6e5,"CHATGPT_SIGN_IN",0,{waitMs:6e5,renewBeforeMs:3e5},"COMMON_VALIDATE",0,{name:{max:16},shortDescription:{max:60},description:{max:100},prompt:{max:4e3}},"CONNECTED_TOOL_TIMEOUT_MS",0,6e5,"DATA_DIR",0,t,"DB_FILE_NAME",0,o,"DB_PATH",0,a,"DECK",0,{slides:30,shotsMs:9e4},"ENV_PATH",0,i,"EXEC_KILL_GRACE_MS",0,5e3,"EXEC_TIMEOUT_MS",0,18e4,"FINISHED_NOTICE",0,{rows:5,shown:1,words:240},"FULL_RESULT_LINES",0,400,"GIVEN_FILES",0,{dir:"inbox",maxBytes:0x1900000,perMessage:8},"HISTORY_KEEP",0,{forMs:7776e6,sweepEveryMs:216e5},"INBOX_FINISHED",0,5,"INBOX_UNREAD",0,20,"IS_DEV",0,!1,"JOB_FOLDER_WALK",0,500,"LIVE_CALL",0,{startupMs:3e4,closeMs:15e3,transcriptGapMs:1500,transcriptSaveMs:500,appendMs:15e3,backendOutputTokens:4096,reasoningCheckMs:5e3,keyCheckMs:5e3,openingHoldMs:3e3,instructionsTokens:16384},"LOOK",0,{maxBytes:4194304,perRequest:0xc00000},"MAIL_CHECK",0,{backMs:18e5,waitMs:12e4,waitMaxMs:3e5,chars:6e3},"MARKETING_SKILL",0,"marketing","MAX_PINNED_TOOLS",0,10,"MCP_IDLE_MS",0,18e5,"MEMORY_LIMITS",0,{facts:400,factsPerNote:50,descriptionChars:100},"PATHS",0,M,"PLAN_CALL",0,{delegationBytes:4096,pictureBytes:262144},"PROMPT_BUDGET",0,6e3,"PROMPT_LINE",0,{skill:90,toolArgs:30,jobOutcome:160,botMemory:100,threadStatus:200,routineRequest:300,routineOutcome:200,boardAsk:100},"REACH",0,{pollSeconds:50,retryMs:5e3,idleMs:6e5,messages:40,trimTo:30,oldChars:1e3,files:3,fileBytes:0x2d00000,rateRetries:3,rateWaitMs:3e4,codeDigits:4,held:5,pictures:9,drawMs:6e4,lookMs:2e3,mailFreshMs:1728e5,mailCheckAgainMs:3e4,mailHoldMs:36e5,mailPushAfterMs:1e3,mailIdleMs:24e4,mailDnsMs:5e3,mailIdsKept:200,mailLookMs:3e5},"RECENT_CALL",0,{rows:20,tokens:600},"ROUTINE",0,{tickMs:3e4,max:12,minHours:1,runsShown:5},"SEARCH",0,{sources:3,excerptChars:1200,timeoutMs:3e4},"SEED_KITS_RENAMED",0,{marketer:"writer"},"SIGNAL_PACE_MS",0,150,"SKILLS_FOLDED",0,{design:_,"picture-book":_,"interactive-page":_},"SKILL_FILES_LISTED",0,50,"STUDIO_SERVER",0,"studio","TEXT_CALL",0,{maxSteps:12,model:"text",autoTurns:10,chunkMs:12e4},"THREAD_LABEL_REACH",0,20,"THREAD_STATUS_LIMIT",0,10,"TOOL_OUTPUT",0,{max:8e3,head:5500,tail:1500},"TOOL_SEARCH_SCHEMAS",0,8,"TRAVEL_SKILL",0,"travel","WORKSPACE_KEEP",0,{forMs:2592e5,sweepEveryMs:36e5}])}];
1
+ module.exports=[333925,e=>{"use strict";let s=process.env.THURSDAY_APP_DIR?.trim()||process.cwd(),t=process.env.THURSDAY_HOME?.trim()||process.cwd(),r=process.env.THURSDAY_URL?.trim()||`http://localhost:${process.env.PORT?.trim()||3e3}`,a=`${t}/local.db`,o=`file:${a}`,i=`${t}/.env`,E=".ai-workspace",_={workspace:E,artifacts:"artifacts",projects:"projects",scratch:"scratch",bots:"bots",output:".output",signIns:".sign-ins",skills:{default:"skills",custom:`${E}/.agents/skills`,own:".agents/skills",runtime:"runtime",seeds:"seed-skills"}},M="artifact";e.s(["APP_DIR",0,s,"APP_NAME",0,"Thursday","APP_URL",0,r,"ARTIFACT_SKILL",0,M,"BOT_LESSON",0,{fileChars:64e3,listed:40,shownChars:2e3},"BOT_MEMORY_LIMITS",0,{files:60,chars:3e3},"BOT_REFLECT",0,{minTools:5,steps:8},"BOT_RUN",0,{steps:100,compactAt:5e5,compactHeadroom:.8,summaryWords:{min:600,max:3e3,perTokens:200},participants:8,concurrent:8,turns:120,queuedMessages:200,silenceMs:3e5,overflowShrink:.6,retryMs:1e4,compactFiles:40},"BOT_WORK",0,{open:5,recent:5,said:80,files:2,reads:2,asked:400,readChars:4e3},"BROWSER_CLI",0,{readMs:15e3,loadMs:3e4},"BROWSER_GONE_MS",0,1e4,"BROWSER_IDLE",0,{closeAfterMs:36e5,checkEveryMs:3e5},"BROWSER_VIEWPORT",0,"700x700","CALL_EXEC_TIMEOUT_MS",0,15e3,"CALL_MEMORY",0,{steps:8,turns:300,stepMs:12e4,catchUpMs:864e5},"CALL_RELAY",0,{quietMs:2e3,perTurn:3,readMs:15e3,chars:600},"CATALOG_MS",0,6e5,"CHATGPT_SIGN_IN",0,{waitMs:6e5,renewBeforeMs:3e5},"COMMON_VALIDATE",0,{name:{max:16},shortDescription:{max:60},description:{max:100},prompt:{max:4e3}},"CONNECTED_TOOL_TIMEOUT_MS",0,6e5,"DATA_DIR",0,t,"DB_FILE_NAME",0,o,"DB_PATH",0,a,"DECK",0,{slides:30,shotsMs:9e4},"ENV_PATH",0,i,"EXEC_KILL_GRACE_MS",0,5e3,"EXEC_TIMEOUT_MS",0,18e4,"FINISHED_NOTICE",0,{rows:5,shown:1,words:240},"FULL_RESULT_LINES",0,400,"GIVEN_FILES",0,{dir:"inbox",maxBytes:0x1900000,perMessage:8},"HIDDEN_SECRET_MIN",0,12,"HISTORY_KEEP",0,{forMs:7776e6,sweepEveryMs:216e5},"INBOX_FINISHED",0,5,"INBOX_UNREAD",0,20,"IS_DEV",0,!1,"JOB_FOLDER_WALK",0,500,"LIVE_CALL",0,{startupMs:3e4,closeMs:15e3,transcriptGapMs:1500,transcriptSaveMs:500,appendMs:15e3,backendOutputTokens:4096,reasoningCheckMs:5e3,keyCheckMs:5e3,openingHoldMs:3e3,instructionsTokens:16384},"LOOK",0,{maxBytes:4194304,perRequest:0xc00000},"MAIL_CHECK",0,{backMs:18e5,waitMs:12e4,waitMaxMs:3e5,chars:6e3},"MARKETING_SKILL",0,"marketing","MAX_PINNED_TOOLS",0,10,"MCP_IDLE_MS",0,18e5,"MEMORY_LIMITS",0,{facts:400,factsPerNote:50,descriptionChars:100},"PATHS",0,_,"PLAN_CALL",0,{delegationBytes:4096,pictureBytes:262144},"PROMPT_BUDGET",0,6e3,"PROMPT_LINE",0,{skill:90,toolArgs:30,jobOutcome:160,botMemory:100,threadStatus:200,routineRequest:300,routineOutcome:200,watchOutput:300,boardAsk:100},"REACH",0,{pollSeconds:50,retryMs:5e3,idleMs:6e5,messages:40,trimTo:30,oldChars:1e3,files:3,fileBytes:0x2d00000,rateRetries:3,rateWaitMs:3e4,codeDigits:4,held:5,pictures:9,drawMs:6e4,lookMs:2e3,mailFreshMs:1728e5,mailCheckAgainMs:3e4,mailHoldMs:36e5,mailPushAfterMs:1e3,mailIdleMs:24e4,mailDnsMs:5e3,mailIdsKept:200,mailLookMs:3e5},"RECENT_CALL",0,{rows:20,tokens:600},"ROUTINE",0,{tickMs:3e4,max:12,minHours:1,runsShown:5,watchMs:6e4,watchChars:2e3},"SEARCH",0,{sources:3,excerptChars:1200,timeoutMs:3e4},"SEED_KITS_RENAMED",0,{marketer:"writer"},"SIGNAL_PACE_MS",0,150,"SKILLS_FOLDED",0,{design:M,"picture-book":M,"interactive-page":M},"SKILL_FILES_LISTED",0,50,"STUDIO_SERVER",0,"studio","TEXT_CALL",0,{maxSteps:12,model:"text",autoTurns:10,chunkMs:12e4},"THREAD_LABEL_REACH",0,20,"THREAD_STATUS_LIMIT",0,10,"TOOL_OUTPUT",0,{max:8e3,head:5500,tail:1500},"TOOL_SEARCH_SCHEMAS",0,8,"TRAVEL_SKILL",0,"travel","WORKSPACE_KEEP",0,{forMs:2592e5,sweepEveryMs:36e5}])}];
2
2
 
3
3
  //# sourceMappingURL=config_ts_1g4sz5o._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[353885,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},944971,e=>{"use strict";var t=e.i(907855),r=e.i(334512),r=r,n=e.i(687388),i=e.i(264079),s=e.i(704161),a=e.i(41444),o=e.i(554199),l=e.i(889034);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],944971)},889034,e=>{"use strict";var t=e.i(907855);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
1
+ module.exports=[353885,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",routine_watch:"routine_watch",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},944971,e=>{"use strict";var t=e.i(907855),r=e.i(334512),r=r,n=e.i(687388),i=e.i(264079),s=e.i(704161),a=e.i(41444),o=e.i(554199),l=e.i(889034);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],944971)},889034,e=>{"use strict";var t=e.i(907855);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
2
2
 
3
3
  //# sourceMappingURL=features_0-728_-._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[51083,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},951056,e=>{"use strict";var t=e.i(749906),r=e.i(867849),r=r,n=e.i(333925),i=e.i(864328),s=e.i(900533),a=e.i(64774),o=e.i(746565),l=e.i(600690);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],951056)},600690,e=>{"use strict";var t=e.i(749906);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
1
+ module.exports=[51083,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",routine_watch:"routine_watch",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},951056,e=>{"use strict";var t=e.i(749906),r=e.i(867849),r=r,n=e.i(333925),i=e.i(864328),s=e.i(900533),a=e.i(64774),o=e.i(746565),l=e.i(600690);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],951056)},600690,e=>{"use strict";var t=e.i(749906);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
2
2
 
3
3
  //# sourceMappingURL=features_0uy40ze._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[242563,t=>{"use strict";var e=t.i(554199);let a=2*Math.PI,r=t=>Math.round(100*t)/100;function i(t){let e=t>>>0;return()=>{let t=Math.imul((e=e+0x6d2b79f5>>>0)^e>>>15,1|e);return(((t=t+Math.imul(t^t>>>7,61|t)^t)^t>>>14)>>>0)/0x100000000}}function n(t,e){return[t[0]-e[0],t[1]-e[1]]}function s(t){let e=Math.hypot(t[0],t[1])||1;return[t[0]/e,t[1]/e]}let o={shape:"blob",sides:3,corner:.74,rotation:0,squircle:4.6,wobble:.2,seed:113,autofit:!0,color:"currentColor",fill:!0,strokeWidth:14,eyeLen:51,eyeWidth:38,eyeBend:-1,eyeTaper:.35,eyeTilt:-90,eyeSkew:0,eyeGap:88,eyeY:100,gazeRange:7,follow:!0,ripple:9,pulse:7,punch:.05,bandEase:.019,bobRate:1,stretch:15,idle:!0,liveliness:55,float:7,breathe:3.7,speed:1.7,blink:!0,notify:!1,notifyAngle:41,notifyDist:109,notifyR:25,notifyRing:11};function l(t,e,r=.035){let n=i(12139^e),s=[2,3,5].map(t=>({k:t,a:(2*n()-1)/t,p:n()*a})),o=t.map((t,e)=>{let r=e/128*a,i=0;for(let t of s)i+=t.a*Math.sin(t.k*r+t.p);return i}),c=Math.max(...o.map(Math.abs))||1;return t.map((t,e)=>t*(1+r*o[e]/c))}let c=new Map;t.s(["markStill",0,function(t,u){let{head:h,eyes:f}=function(t,e=o.shape){let u=(t,e)=>(function(t){let e=t.tilt*Math.PI/180,a=Math.cos(e),i=Math.sin(e),n=(e,r)=>[t.cx+e*a-r*i,t.cy+e*i+r*a],s=-t.len/2,o=t.len/2,l=[],c=[];for(let e=0;e<=30;e++){let a=e/30,r=1-a,i=r*r*s+a*a*o,u=-(2*r*a*t.bend),h=-(2*r*s)+2*a*o,f=-(2*r*t.bend)+2*a*t.bend,p=Math.hypot(h,f)||1,w=-f/p,d=h/p,m=t.width/2*Math.sin(Math.PI*a)**t.taper;l.push(n(i+w*m,u+d*m)),c.push(n(i-w*m,u-d*m))}let u=`M${r(l[0][0])} ${r(l[0][1])}`;for(let t=1;t<=30;t++)u+=`L${r(l[t][0])} ${r(l[t][1])}`;for(let t=29;t>=0;t--)u+=`L${r(c[t][0])} ${r(c[t][1])}`;return`${u}Z`})({len:o.eyeLen,width:o.eyeWidth,bend:o.eyeBend,taper:o.eyeTaper,tilt:e,cx:t,cy:o.eyeY});return{head:function(t){let e=t.map((t,e)=>{let r=e/128*a;return[120+Math.cos(r)*t,120+Math.sin(r)*t]}),i=`M${r(e[0][0])} ${r(e[0][1])}`;for(let t=0;t<128;t++){let a=e[(t-1+128)%128],n=e[t],s=e[(t+1)%128],o=e[(t+2)%128],l=n[0]+(s[0]-a[0])/6,c=n[1]+(s[1]-a[1])/6,u=s[0]-(o[0]-n[0])/6,h=s[1]-(o[1]-n[1])/6;i+=`C${r(l)} ${r(c)} ${r(u)} ${r(h)} ${r(s[0])} ${r(s[1])}`}return`${i}Z`}(function(t,e,r){var o,u,h;let f=`${"poly"===e?`poly|${t.sides}|${t.corner}|${t.rotation}|${r}`:"squircle"===e?`squircle|${t.squircle}|${r}`:"heart"===e?`heart|${r}`:`blob|${t.wobble}|${r}`}|${t.autofit}`,p=c.get(f);if(p)return p;let w=function(t){let e=Array(128);for(let r=0;r<128;r++){let i=r/128*a,n=Math.cos(i),s=Math.sin(i),o=0;for(let e=0;e<t.length;e++){let a=t[e],r=t[(e+1)%t.length],i=r[0]-a[0],l=r[1]-a[1],c=n*l-s*i;if(1e-9>Math.abs(c))continue;let u=a[0]-120,h=a[1]-120,f=(u*l-h*i)/c,p=(u*s-h*n)/c;f>o&&p>=-1e-9&&p<=1+1e-9&&(o=f)}e[r]=o||112}return e}((o=t,u=e,h=r,"squircle"===u?function(t){let e=[],r=2/t;for(let t=0;t<360;t++){let i=t/360*a,n=Math.cos(i),s=Math.sin(i);e.push([120+Math.sign(n)*Math.abs(n)**r*112,120+Math.sign(s)*Math.abs(s)**r*112])}return e}(o.squircle):"poly"===u?function(t,e,r){let i=r*Math.PI/180-Math.PI/2,o=[];for(let e=0;e<t;e++){let r=i+e/t*a;o.push([120+112*Math.cos(r),120+112*Math.sin(r)])}let l=(Math.PI-a/t)/2,c=224*Math.sin(Math.PI/t)/2*Math.tan(l)*Math.min(1,Math.max(.001,e)),u=c/Math.tan(l),h=[];for(let e=0;e<t;e++){let r=o[e],i=o[(e-1+t)%t],f=o[(e+1)%t],p=s(n(i,r)),w=s(n(f,r)),d=[r[0]+p[0]*u,r[1]+p[1]*u],m=s([p[0]+w[0],p[1]+w[1]]),y=[r[0]+m[0]*c/Math.sin(l),r[1]+m[1]*c/Math.sin(l)],M=Math.atan2(d[1]-y[1],d[0]-y[0]),S=[r[0]+w[0]*u,r[1]+w[1]*u],T=Math.atan2(S[1]-y[1],S[0]-y[0])-M;for(;T>Math.PI;)T-=a;for(;T<-Math.PI;)T+=a;for(let t=0;t<=20;t++){let e=M+t/20*T;h.push([y[0]+Math.cos(e)*c,y[1]+Math.sin(e)*c])}}return h}(o.sides,o.corner,o.rotation):"heart"===u?function(){let t=[];for(let e=0;e<400;e++){let r=e/400*a,i=16*Math.sin(r)**3,n=13*Math.cos(r)-5*Math.cos(2*r)-2*Math.cos(3*r)-Math.cos(4*r);t.push([120+6.6*i,120-(n+2.2)*7.26])}return t}():function(t,e){let r=i(t),n=[1,2,3,4,5].map(t=>({k:t,a:(2*r()-1)/t,p:r()*a})),s=[],o=0;for(let t=0;t<360;t++){let e=t/360*a,r=0;for(let t of n)r+=t.a*Math.sin(t.k*e+t.p);s.push(r),o=Math.max(o,Math.abs(r))}let l=o>0?e/o:0;return s.map((t,e)=>{let r=e/360*a,i=112*(1+t*l);return[120+Math.cos(r)*i,120+Math.sin(r)*i]})}(h,o.wobble))),d="blob"===e?w:"heart"===e?function(t,e){let a=t;for(let t=0;t<2;t++){let t=a;a=t.map((e,a)=>{let r=0;for(let e=-3;e<=3;e++)r+=t[(a+e+128)%128];return r/7})}let r=a.reduce((t,e)=>t+e,0)/128,n=l(a.map(t=>.95*t+.05*r),e,.05),s=Math.round((2*i(20977^e)()-1)*3);return s?n.map((t,e)=>n[(e-s+256)%128]):n}(w,r):l(w,r),m=t.autofit?function(t){let e=a/128,r=0,i=0;for(let a of t)r+=.5*a*a*e,a>i&&(i=a);if(r<=0)return t;let n=Math.min(Math.sqrt(112*Math.PI*112/r),130/i);return t.map(t=>t*n)}(d):d;return c.size>400&&c.clear(),c.set(f,m),m}(o,e,function(t){if("number"==typeof t)return t;let e=0x811c9dc5;for(let a=0;a<t.length;a++)e=Math.imul(e^t.charCodeAt(a),0x1000193);return(e>>>0)%1e4}(t))),eyes:[u(120-o.eyeGap/2,o.eyeTilt),u(120+o.eyeGap/2,o.eyeTilt+o.eyeSkew)]}}(t,u?.shape??o.shape),p=u?.paint?e.MARK_PAINTS[u.paint]:null;return{head:h,eyes:f,ink:(0,e.markInk)(u?.color??e.MARK_SYSTEM,!1),paint:p?"aurora"===p.look?p.colors.slice(0,2):[...p.colors]:null,outline:u?.outline===!0}}])},786025,t=>t.a(async(e,a)=>{try{let Y;var r=t.i(666680),i=t.i(902157),n=t.i(912714),s=t.i(660526),o=t.i(750227),l=t.i(380690),c=t.i(687388),u=t.i(242563),h=t.i(340698),f=t.i(148831),p=t.i(640911),w=t.i(211644),d=t.i(561298),m=t.i(41444),y=e([h,f]);[h,f]=y.then?(await y)():y;let F=c.APP_DIR,U=(0,o.join)(c.DATA_DIR,c.PATHS.workspace),K=(process.env.THURSDAY_TOOL_PATH?.split(":")??[(0,o.join)(F,"node_modules",".bin")]).filter(Boolean),G=(0,o.join)(U,c.PATHS.artifacts),J=[c.PATHS.artifacts,c.PATHS.projects,c.PATHS.scratch,c.PATHS.bots],q=new Set([...J,".agents"]),V=".playwright-cli",z=(t,e)=>e===t||e.startsWith(t+o.sep),Z=t=>(0,n.realpath)(t).catch(()=>null);async function M(t){let e=await Z(U)??U,a=(0,o.resolve)(U,t);if(!z(U,a))return null;let r=a,i=await Z(r);for(;null===i&&(0,o.dirname)(r)!==r;)r=(0,o.dirname)(r),i=await Z(r);if(null===i)return null;let n=(0,o.relative)(r,a),s=n?(0,o.join)(i,n):i;return z(e,s)?s:null}function S(t,e){return`${c.PATHS.scratch}/${(0,m.slug)(e)||"job"}-${t.slice(0,6)}`}let X=t=>t.replace(/[^\p{L}\p{N}_-]+/gu,"-"),Q=t=>`${c.PATHS.bots}/${X(t)}`,tt=t=>`${c.PATHS.artifacts}/${X(t)}`;async function T(t){let e=Q(t),a=tt(t);return await Promise.all([e,a].map(t=>(0,n.mkdir)((0,o.join)(U,t),{recursive:!0}))),{own:e,artifacts:a}}async function $(t,e){let a=S(t,e);return await (0,n.mkdir)((0,o.join)(U,a),{recursive:!0}),a}let te="thread-",ta=t=>({PLAYWRIGHT_MCP_BROWSER:"chromium",...t?{PLAYWRIGHT_CLI_SESSION:`${te}${t}`,PLAYWRIGHT_MCP_VIEWPORT_SIZE:c.BROWSER_VIEWPORT}:{}}),tr={runtimes:["node","python3","uv","bun","deno"],managers:["pnpm","npm","yarn"]};async function b(t){let e=Object.values(tr).flat(),{stdout:a}=await t.exec(e.map(t=>`command -v ${t} >/dev/null 2>&1 && printf '%s ' ${t}`).join("; "),{timeoutMs:1e4}),r=new Set(a.trim().split(/\s+/).filter(Boolean)),i=t=>({found:t.filter(t=>r.has(t)),missing:t.filter(t=>!r.has(t))});return{runtimes:i(tr.runtimes),managers:i(tr.managers),browser:null}}async function A(){await tn(),await ti()}async function P(t,e){let a=await t.exec("playwright-cli list --json",{env:e,timeoutMs:c.BROWSER_CLI.readMs});if(0!==a.exitCode)throw Error(`playwright-cli list failed (${a.exitCode}): ${a.stderr.trim()}`);let{browsers:r}=JSON.parse(a.stdout||"{}");return r??[]}async function _(t){await g(t,await O(t,!1))}async function g(t,e){if(e)return k(t,e);p.logger.warn(`thread ${t}: its browsers could not be listed, so they and their profiles are left as they are`)}async function E(t){await O(t,!0)}async function I(t,e){await O(t,!1,e)}async function R(t,e){await g(t,await O(t,!0,e))}async function H(){let t=await D();return P(t,ta(null)).catch(()=>null)}async function k(t,e){let a=await v(),r=ta(t).PLAYWRIGHT_CLI_SESSION;for(let t of(await (0,n.readdir)(a).catch(()=>[]))){let i=t.startsWith("ud-")?t.slice(3):t;(i===r||i.startsWith(`${r}-`)||i.startsWith(`${r}.`))&&(e.some(t=>i===t||i.startsWith(`${t}-`)||i.startsWith(`${t}.`))||await (0,n.rm)((0,o.join)(a,t),{recursive:!0,force:!0}).catch(e=>p.logger.warn(`browser data ${t}: ${String(e)}`)))}}async function v(){let t=process.env.XDG_CACHE_HOME||(0,o.join)((0,s.homedir)(),".cache"),e=await (0,n.realpath)(U).catch(()=>U);return(0,o.join)(t,"ms-playwright","daemon",(0,r.createHash)("sha1").update(e).digest("hex").slice(0,16))}async function O(t,e,a){let r=await D(),n=ta(t),s=a??await P(r,n).catch(()=>null);if(!s)return null;let o=s.filter(t=>t.name===n.PLAYWRIGHT_CLI_SESSION||t.name.startsWith(`${n.PLAYWRIGHT_CLI_SESSION}-`)),l=o.length?await v():"";l&&!(0,i.existsSync)(l)&&p.logger.warn(`playwright-cli keeps this workspace's browsers somewhere other than ${l}: removing a thread will leave its browser profiles on disk`);let u=[];for(let t of o){if(t.attached||!e&&!1!==t.headed){u.push(t.name);continue}await r.exec("playwright-cli close",{env:{...n,PLAYWRIGHT_CLI_SESSION:t.name},timeoutMs:c.BROWSER_CLI.readMs}).catch(()=>{})}return a||await A(),u}let ti=()=>j(c.PATHS.output),tn=()=>j(V);async function j(t){let e=(0,o.join)(U,t),a=await (0,n.readdir)(e,{withFileTypes:!0}).catch(()=>[]),r=Date.now()-c.WORKSPACE_KEEP.forMs;for(let t of a){if(!t.isFile())continue;let a=(0,o.join)(e,t.name),i=await (0,n.stat)(a).catch(()=>null);i&&i.mtimeMs<r&&await (0,n.unlink)(a).catch(()=>{})}}async function L(){return(await (0,n.readdir)((0,o.join)(U,c.PATHS.scratch),{withFileTypes:!0}).catch(()=>[])).filter(t=>t.isDirectory()).map(t=>`${c.PATHS.scratch}/${t.name}`)}async function W(t){let e=Date.now()-c.WORKSPACE_KEEP.forMs,a=[];for(let r of t){let t=(0,o.join)(U,r),i=await (0,n.stat)(t).catch(()=>null);i?.isDirectory()&&!(i.mtimeMs>=e)&&(await (0,n.rm)(t,{recursive:!0,force:!0}).catch(()=>{}),a.push(r))}return a}let ts={"pnpm-workspace.yaml":"packages:\n - '**'\n",".npmrc":"recursive-install=false\n"},to=globalThis.__storedSecrets??=(Y={values:null},l.appEvents.subscribe(t=>{("config"===t.type||"mcp"===t.type)&&(Y.values=null)}),Y);async function x(){let t=await (0,n.stat)(c.ENV_PATH).catch(()=>null),e=t?`${t.size}:${t.mtimeMs}`:"",a=globalThis;return a.__keyTexts?.stamp!==e&&(a.__keyTexts={stamp:e,texts:(0,d.encryptionKeyTexts)()}),a.__keyTexts.texts}async function C(){let t=Object.entries(process.env).flatMap(([t,e])=>e?t===d.ENCRYPTION_KEY_NAME?[e.trim().replace(/=+$/,"")]:w.SECRET_NAME.test(t)&&!w.APP_OWN.test(t)?[e]:[]:[]);return[...await x(),...await (to.values??=Promise.all([(0,h.configSecretValues)(),(0,f.connectorSecretValues)()]).then(([t,e])=>[...t,...e],t=>{throw to.values=null,t}),to.values),...t].map(t=>t.trim()).filter(t=>t.length>=c.HIDDEN_SECRET_MIN&&!((0,o.isAbsolute)(t)&&(0,i.existsSync)(t)))}async function D(){for(let t of[...J,".playwright"])await (0,n.mkdir)((0,o.join)(U,t),{recursive:!0});for(let[t,e]of Object.entries(ts))await (0,n.writeFile)((0,o.join)(U,t),e,{flag:"wx"}).catch(()=>{});let t=(0,w.createSandBox)({workingDirectory:U,spill:{dir:c.PATHS.output,...c.TOOL_OUTPUT},toolPath:K,secrets:C}),e=()=>l.appEvents.emit({type:"files"});return{...t,exec:(a,r)=>t.exec(a,r).finally(e),writeFile:(a,r)=>t.writeFile(a,r).finally(e)}}async function B(t,e){let a=t.map(t=>(0,o.resolve)(U,t));if(e){let t=0;for await(let r of(0,w.walkFiles)((0,o.join)(U,e)))if(a.push(r),(t+=1)>=c.JOB_FOLDER_WALK)break}let r=new Map;for(let t of a){let e=await (0,n.stat)(t).catch(()=>null);if(!e?.isFile())continue;let a=(0,o.relative)(U,t);r.set(a&&!a.startsWith("..")?a:t,e.mtimeMs)}return[...r].sort((t,e)=>t[1]-e[1]).map(([t])=>t)}async function N(t,e){let a=S(t,e);await (0,n.rm)((0,o.join)(U,a),{recursive:!0,force:!0}).catch(t=>p.logger.warn(`job folder ${a}: ${String(t)}`))}t.s(["ARTIFACTS",0,G,"DELETED_BOT_MARK",0,".deleted-bot.json","WORKSPACE",0,U,"botArtifacts",0,tt,"botBrowserSession",0,(t,e)=>`${t}-bot-${(0,r.createHash)("sha256").update(e.trim().toLowerCase()).digest("hex").slice(0,20)}`,"botFolder",0,Q,"botFolderName",0,X,"botShellEnv",0,(t,e)=>({THURSDAY_BOT:t,THURSDAY_BOT_MARK:JSON.stringify((0,u.markStill)(t,e)),THURSDAY_ARTIFACTS:(0,o.join)(U,tt(t)),THURSDAY_SKILLS:(0,o.join)(c.APP_DIR,c.PATHS.skills.default),THURSDAY_TOOL_OUTPUT:String(c.TOOL_OUTPUT.max),DISABLE_TELEMETRY:"1"}),"browserStateFile",0,()=>`${V}/state-${crypto.randomUUID()}.json`,"closeHiddenBrowser",0,_,"closeIdleBrowser",0,I,"closeJobShell",0,E,"filesOnDisk",0,B,"insideWorkspace",0,M,"jobScratch",0,S,"jobShellEnv",0,ta,"listBrowsers",0,P,"listJobBrowsers",0,H,"listScratchFolders",0,L,"openBotFolders",0,T,"openJobScratch",0,$,"openWorkspace",0,D,"pruneJobFiles",0,A,"readMachineTools",0,b,"removeJobBrowsers",0,R,"removeJobScratch",0,N,"removeUnchangedFolders",0,W,"saveBrowserState",0,t=>`mkdir -p ${V} && playwright-cli state-save ${t}`,"threadOfBrowser",0,function(t){let e=t.slice(te.length,te.length+36);return t.startsWith(te)&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(e)?e:null},"writeRefusal",0,function(t,e){if(z(U,t)){let a=(0,o.relative)(U,t),[r,n]=a.split(o.sep);return r&&q.has(r)?e&&r===c.PATHS.artifacts&&n&&n.toLowerCase()!==X(e).toLowerCase()&&!(0,i.existsSync)((0,o.join)(G,n))?`Not written: ${a} would sit loose at the top of ${c.PATHS.artifacts}/. Your finished work goes in ${tt(e)}/.`:null:`Not written: ${a||"the workspace root"} is outside the workspace's folders. Finished work goes under ${e?tt(e):c.PATHS.artifacts}/, code under ${c.PATHS.projects}/, your own kit under ${c.PATHS.bots}/, and this job's working material under ${c.PATHS.scratch}/.`}return z(F,t)?`Not written: ${t} is inside the app that is running you, not the user's files. Work in ${U}; outside it, write only where the user pointed you.`:null}]),a()}catch(t){a(t)}},!1)];
2
+
3
+ //# sourceMappingURL=features_0vyrnq0._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[353885,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},944971,e=>{"use strict";var t=e.i(907855),r=e.i(334512),r=r,n=e.i(687388),i=e.i(264079),s=e.i(704161),a=e.i(41444),o=e.i(554199),l=e.i(889034);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],944971)},889034,e=>{"use strict";var t=e.i(907855);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
1
+ module.exports=[353885,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",routine_watch:"routine_watch",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},944971,e=>{"use strict";var t=e.i(907855),r=e.i(334512),r=r,n=e.i(687388),i=e.i(264079),s=e.i(704161),a=e.i(41444),o=e.i(554199),l=e.i(889034);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],944971)},889034,e=>{"use strict";var t=e.i(907855);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
2
2
 
3
3
  //# sourceMappingURL=features_116bwtn._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[56802,e=>e.a(async(t,a)=>{try{e.i(687388);var o=e.i(378884);e.i(704161),e.i(41444);var n=t([o]);[o]=n.then?(await n)():n,e.s([]),a()}catch(e){a(e)}},!1),962072,e=>e.a(async(t,a)=>{try{var o=e.i(687388),n=e.i(186304),r=e.i(353885),s=e.i(265143),i=e.i(944971),l=e.i(378884),h=e.i(619898),d=e.i(453569),u=e.i(636882),c=e.i(22676),w=e.i(786025),y=e.i(660948),p=e.i(899352),m=e.i(54282),f=t([s,l,h,u,c,y]);async function g(e){var t,a,f,g,k,v,$,E;let O,{backendPrompt:_,written:L=!1,phone:S=!1,readSkills:A}=e,M=await (0,w.openWorkspace)(),[x,I,C,N,R,q,P]=await Promise.all([(0,u.loadSkills)(M),(0,h.listNoteIndex)(),(0,h.readNotes)(d.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,y.listConnectedToolNames)(),(0,s.listJobBots)(),(0,c.listRecentTurns)(o.RECENT_CALL.rows,e.callId),(0,s.readBotMemoryOn)()]),W=await (0,l.listCallJobs)(q.map(e=>e.callId)),U=[(0,m.thursdayIdentity)(new Date,e.where),L?(0,p.personaLines)(e.persona):"",L?(0,m.styleLines)(e.stylePrompt):"",b(I,C.notes),(t=R,a=(0,m.reachNames)(A?[]:x,N),f=P,g=S,0===t.length?"":`## Background work
1
+ module.exports=[56802,e=>e.a(async(t,a)=>{try{e.i(687388);var o=e.i(378884);e.i(704161),e.i(41444);var n=t([o]);[o]=n.then?(await n)():n,e.s([]),a()}catch(e){a(e)}},!1),962072,e=>e.a(async(t,a)=>{try{var o=e.i(687388),n=e.i(186304),r=e.i(353885),s=e.i(265143),i=e.i(944971),l=e.i(378884),h=e.i(619898),d=e.i(453569),u=e.i(636882),c=e.i(22676),w=e.i(786025),y=e.i(660948),p=e.i(899352),m=e.i(54282),f=t([s,l,h,u,c,w,y]);async function g(e){var t,a,f,g,k,v,$,E;let O,{backendPrompt:_,written:L=!1,phone:S=!1,readSkills:A}=e,M=await (0,w.openWorkspace)(),[x,I,C,N,R,q,P]=await Promise.all([(0,u.loadSkills)(M),(0,h.listNoteIndex)(),(0,h.readNotes)(d.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,y.listConnectedToolNames)(),(0,s.listJobBots)(),(0,c.listRecentTurns)(o.RECENT_CALL.rows,e.callId),(0,s.readBotMemoryOn)()]),W=await (0,l.listCallJobs)(q.map(e=>e.callId)),U=[(0,m.thursdayIdentity)(new Date,e.where),L?(0,p.personaLines)(e.persona):"",L?(0,m.styleLines)(e.stylePrompt):"",b(I,C.notes),(t=R,a=(0,m.reachNames)(A?[]:x,N),f=P,g=S,0===t.length?"":`## Background work
2
2
 
3
3
  Who you hand work to — the names \`${r.TOOL_NAMES.thread_start}\` takes.
4
4
 
@@ -8,7 +8,9 @@ What bots can reach for: ${a}.`:""}
8
8
 
9
9
  **A bot can take on almost anything, and anything that takes more than a few seconds is a bot's**; a note, a look at a file or one command is yours. A bot has this computer, a real browser, the web, a shell to build what is missing and far more time than a call; it signs in where it has to and carries work to the end, so something you do not know how to do is work for a bot, not a no. Bots bring each other in, so work that spans several things is still one thread.${f?" Each bot keeps its own memory from thread to thread: when the user says how a bot should work from now on, pass it to that bot to remember.":""}
10
10
 
11
- **Work lives in threads.** A thread's bot remembers that thread and nothing else, so the same bot started on a new one begins from nothing. More about work already handed over — a correction, the next step once it finished, going on after it stopped — is said to that thread (\`${r.TOOL_NAMES.thread_tell}\`); only a request that stands on its own starts a new one (\`${r.TOOL_NAMES.thread_start}\`). The threads open as this call started come into the conversation at the start, and they move while you talk: \`${r.TOOL_NAMES.thread_status}\` reads them as they are now, before you answer about one or hand anything over. Ask the user which it is only when the request could be either. Write the request in the user's own words, with what it stands on — including how they told you they want work done — and nothing they did not say. When something the work needs is still missing, either ask the user yourself before handing it over or let the bot ask them — never both.
11
+ **Work lives in threads.** A thread's bot remembers that thread and nothing else, so the same bot started on a new one begins from nothing. More about work already handed over — a correction, the next step once it finished, going on after it stopped — is said to that thread (\`${r.TOOL_NAMES.thread_tell}\`); only a request that stands on its own starts a new one (\`${r.TOOL_NAMES.thread_start}\`). The threads open as this call started come into the conversation at the start, and they move while you talk: \`${r.TOOL_NAMES.thread_status}\` reads them as they are now, before you answer about one or hand anything over. Ask the user which it is only when the request could be either. Write the request in the user's own words, with what it stands on — including how they told you they want work done — and nothing they did not say.
12
+
13
+ **Ask before you start a thread.** Propose it first, even when they named the bot — which bot, and the request in a sentence — with what it needs from them that they have not said, and start it only on their yes to that proposal: a reply that goes on talking about the work is not a yes. Their answers go in the request, so the bot does not ask them again.
12
14
 
13
15
  **Work that should start by itself — every morning, every few hours — is a routine.** \`${r.TOOL_NAMES.routine}\` makes one from a bot, the work in the user's own words, and when; from then on it starts a thread for it each time without being asked, and the result reaches the user like any thread's. Ask once for whichever of those they left out, and read the ones that exist before making, changing or deleting one.
14
16
 
@@ -33,7 +35,7 @@ What was said on the last calls, verbatim, newest last. It is the past: pick it
33
35
 
34
36
  A \`${r.TOOL_NAMES.thread_start}\` line carries the thread's handle and how it ended; the handle is for the thread tools, never said aloud. What they ask for now is often one of these carried further.
35
37
 
36
- ${(0,m.recentCallLines)($.map(e=>({...e,jobs:E.filter(t=>t.callId===e.callId)})),o.RECENT_CALL.tokens)}`:""),T(_)].filter(Boolean).join("\n\n");return(0,m.logPromptSize)("thursday",U),U}[s,l,h,u,c,y]=f.then?(await f)():f;let T=e=>e?.trim()?`## Additional instructions
38
+ ${(0,m.recentCallLines)($.map(e=>({...e,jobs:E.filter(t=>t.callId===e.callId)})),o.RECENT_CALL.tokens)}`:""),T(_)].filter(Boolean).join("\n\n");return(0,m.logPromptSize)("thursday",U),U}[s,l,h,u,c,w,y]=f.then?(await f)():f;let T=e=>e?.trim()?`## Additional instructions
37
39
 
38
40
  Written by the user. Follow them together with everything above.
39
41
 
@@ -54,6 +56,6 @@ ${c}What tells you most about them comes first: what they loved or could not sta
54
56
  **Keep memory clean as you write.** A fact that repeats, narrows or changes one already in the note replaces it, merged into one line, rather than sitting beside it. A later call finds a note only by its path and its line: give something new its own path below, and when a line no longer says what its note is about, \`${r.TOOL_NAMES.memory_describe}\` puts it right.
55
57
 
56
58
  ${d.MEMORY_PATHS.map(e=>`- ${e.path} — ${e.of}`).join("\n")}`;return[h,u,w].join("\n\n")}function k(e){let t=e.facts.map(e=>`- ${e.text} #${e.id}`);return`${e.path} — ${e.description}
57
- ${t.length?t.join("\n"):"- (nothing yet)"}`}e.s(["loadThursdayPrompt",0,g,"memoryChapter",0,b]),a()}catch(e){a(e)}},!1),97334,e=>e.a(async(t,a)=>{try{var o=e.i(912714),n=e.i(68356),r=e.i(907855),s=e.i(175936),i=e.i(687388),l=e.i(911757),h=e.i(159479),d=e.i(386075),u=e.i(264079),c=e.i(56802),w=e.i(962072),y=e.i(170801),p=e.i(353885),m=e.i(279041),f=e.i(340698),g=e.i(629668),b=e.i(878498),k=e.i(640911),T=e.i(120219),v=e.i(53748),$=e.i(41444),E=e.i(22676),O=e.i(134344),_=t([h,d,c,w,f,E]);async function L(){let e=await Promise.all(O.TEXT_CALL_PROVIDERS.map(async e=>await (0,f.readConfig)(e.apiKeyName)?e.apiKeyName:null));return(0,O.textCallRunsOn)(t=>e.includes(t))}async function S(e,t){if(t)return t;let a=await L();return a||(0,v.publicError)(X),{provider:a,model:e.backendModel}}async function A(e,t){if("chatgpt"!==e.provider||!(0,d.isPlanSpent)(t)||!await (0,f.readConfig)(l.LIVE_PROVIDER.apiKeyName))return null;let a=(await (0,E.readLiveSettings)()).backendModel,o=u.TEXT_MODEL_PROVIDERS.openai.suggestModels.find(e=>e.id===a)?.label??a,n=t instanceof Error?t.message:String(t);return{ref:{provider:"openai",model:a},why:n,line:`${n} Answering on your OpenAI key (${o}) until it resets.`}}[h,d,c,w,f,E]=_.then?(await _)():_;let R=r.object({callId:r.string().min(1),standing:r.string().nullish(),runsOn:u.textModelRefSchema.nullish(),turn:r.string().min(1),messages:r.array(r.unknown()).min(1),where:r.unknown().optional()}),q=globalThis.__textCallTurns??=new Map;async function M(e,t){var a;let o,r,s,l=null,h=[],u=()=>{l&&q.delete(l)};try{let a=R.parse(e);l=a.turn,q.set(l,{callId:a.callId,notes:h}),t.addEventListener("abort",u,{once:!0}),t.aborted&&u(),s=await N(a)}catch(a){u();let{status:e,message:t}=(0,T.startError)(a,"Could not reach her");return new Response(t,{status:e})}let c=(a=s.callId,o=s.seq,{step:async e=>{for(let t of e.content)if("tool-call"===t.type){let n=e.content.find(e=>"tool-result"===e.type&&e.toolCallId===t.toolCallId);await (0,E.saveTurns)(a,[{id:t.toolCallId,role:"tool",tool:t.toolName,text:t.toolName===p.TOOL_NAMES.web_search?function(e,t){let a=t??{},o=[(e??{}).query,a.action?.query].find(e=>"string"==typeof e&&!!e.trim()),n=Array.isArray(a.sources)?a.sources.flatMap(e=>e&&"object"==typeof e&&"url"in e&&"string"==typeof e.url?[{url:e.url,..."title"in e&&"string"==typeof e.title?{title:e.title}:{}}]:[]):[];return JSON.stringify({query:o??null,sources:n})}(t.input,n?.type==="tool-result"?n.output:null):JSON.stringify(t.input??{}),seq:o++}])}else"text"===t.type&&t.text.trim()?await (0,E.saveTurns)(a,[{id:crypto.randomUUID(),role:"assistant",text:t.text.trim(),seq:o++}]):"reasoning"===t.type&&t.text.trim()&&await (0,E.saveThought)(a,{id:crypto.randomUUID(),text:t.text.trim(),seq:o})},said:(e,t=crypto.randomUUID())=>(0,E.saveTurns)(a,[{id:t,role:"user",text:e,seq:o++}])}),w=new Map,y=async e=>(0,n.streamText)({model:e.model,instructions:e.system,messages:await I(s.messages,e.ref),allowSystemInMessages:!0,tools:e.tools,providerOptions:e.providerOptions,stopWhen:(0,n.stepCountIs)(i.TEXT_CALL.maxSteps),abortSignal:t,timeout:{chunkMs:i.TEXT_CALL.chunkMs},prepareStep:async({stepNumber:t,messages:a})=>{let o=h.splice(0);if(o.length){for(let e of o)e.said&&await c.said(e.text,e.id);return w.set(t,o),{messages:await I([...a,...o.map(e=>({role:"user",content:j(e.text,e.pictures)}))],e.ref)}}},onStepEnd:c.step}),m=null,f=s.ref.provider,g=null,b=e=>"abort"!==e.type||t.aborted?e:{type:"error",error:Error(`No answer came for ${Math.round(i.TEXT_CALL.chunkMs/1e3)} seconds, so this one was stopped.`)},v=(r=async function*(){let e=[],t=!1,a=null;for await(let o of(await y(s)).stream){let n=b(o);if(!t&&"error"===n.type&&(a=await A(s.ref,n.error)))break;if(!t&&("start"===n.type||"start-step"===n.type)){e.push(n);continue}t=!0,yield*e.splice(0),yield n}if(!a)return yield*e;k.logger.info(`text call ${s.callId}: ${a.line}`),m={why:a.why,line:a.line},f=a.ref.provider,h.unshift(...w.get(0)??[]),w.delete(0);try{for await(let e of(await y(await C(s.callId,a.ref))).stream)yield b(e)}catch(e){yield{type:"error",error:e}}}(),new ReadableStream({async pull(e){let t=await r.next();t.done?e.close():e.enqueue(t.value)},async cancel(){await r.return(void 0)}})),$=-1,_=new TransformStream({transform(e,t){if("start-step"===e.type)for(let e of($+=1,w.get($)??[]))t.enqueue({type:`data-${O.TEXT_CALL_NOTE}`,id:e.id,data:e});"error"===e.type&&g&&t.enqueue({type:`data-${O.TEXT_CALL_REFUSED}`,data:g,transient:!0}),t.enqueue(e),"start"===e.type&&m&&t.enqueue({type:`data-${O.TEXT_CALL_MOVED}`,data:m,transient:!0})},flush:u});return(0,n.createUIMessageStreamResponse)({stream:(0,n.toUIMessageStream)({stream:v,tools:s.tools,onError:e=>((0,d.isKeyRefused)(e)&&(g={provider:f}),(0,d.modelErrorToString)(e))}).pipeThrough(_)})}let P="workspace:",W=e=>({type:"file",mediaType:(0,g.mimeOf)(e),filename:e,data:{type:"url",url:new URL(`${P}${encodeURIComponent(e)}`)}}),U=e=>{let t=e.data,a=t instanceof URL?t:t?.type==="url"?t.url:null;return a instanceof URL&&a.protocol===P?decodeURIComponent(a.pathname):null},j=(e,t)=>t?.length?[{type:"text",text:e},...t.map(W)]:e,K=s.queryKey.file(""),D=new WeakMap;async function x(e,t,a){if(t)return{missed:`${e} is a picture, and ${t} cannot see pictures, so it was not sent to you.`};let n=await (0,y.checkPicture)(e);if("missing"in n)return{missed:`There is no file at ${e} in the workspace, so no picture was sent to you.`};if("notPicture"in n)return{missed:`${e} is not a png, jpg, webp or gif, so it was not sent to you as a picture.`};if("tooBig"in n)return{missed:`${(0,y.tooBigToSee)(e,n.tooBig)} It was not sent to you.`};if(n.bytes>a)return{missed:`${e} is a picture not sent with this message: the pictures after it fill the ${(0,$.formatBytes)(i.LOOK.perRequest)} one message to you carries. Look at it with look_at to see it.`};let r=await (0,o.readFile)(n.full).catch(()=>null);return r?{data:r.toString("base64"),mediaType:n.mediaType,bytes:r.length}:{missed:`${e} could not be read, so no picture was sent to you.`}}async function I(e,t){let a=(0,d.seesToolImages)(t)?null:t.model,o=i.LOOK.perRequest-e.reduce((e,t)=>e+function(e){if("user"!==e.role||"string"==typeof e.content)return 0;let t=0;for(let a of e.content){if("file"!==a.type)continue;let e=a.data,o=e?.type==="data"?e.data:e;"string"==typeof o?t+=Math.floor(3*o.length/4):(o instanceof Uint8Array||o instanceof ArrayBuffer)&&(t+=o.byteLength)}return t}(t),0),n=[...e];for(let e=n.length-1;e>=0;e-=1){let t=n[e];if("user"!==t.role||"string"==typeof t.content||!t.content.some(e=>"file"===e.type&&null!==U(e)))continue;let r=[];for(let e of[...t.content].reverse()){let t="file"===e.type?U(e):null;if(!t){r.unshift(e);continue}let n=await x(t,a,o);if("missed"in n){r.unshift({type:"text",text:n.missed});continue}o-=n.bytes,r.unshift({type:"text",text:`${t}, as an image:`},{type:"file",mediaType:n.mediaType,data:{type:"data",data:n.data}})}let s={role:"user",content:r};D.set(s,t),n[e]=s}return n}async function C(e,t,a=!1,o){let n=await (0,E.readLiveSettings)(),r=await S(n,t),s="openai"===r.provider||"chatgpt"===r.provider,[i,u,c,y,g]=await Promise.all([(0,d.getTextModel)(r),(0,w.loadThursdayPrompt)({backendPrompt:n.backendPrompt,written:!0,callId:e,phone:a,persona:n.persona,stylePrompt:n.stylePrompt,readSkills:n.readSkills,where:o}),(0,h.loadTools)({target:"thursday",callId:e,webSearch:n.webSearch,readSkills:n.readSkills,written:!0,model:r,phone:a}),(0,f.readConfig)(m.EXA_API_KEY),(0,f.readConfig)(l.LIVE_PROVIDER.apiKeyName)]),k=i.searchTools&&Object.values(i.searchTools)[0],T={...c,...n.webSearch&&!y&&k?{[p.TOOL_NAMES.web_search]:k}:{}},v=s?g?await (0,b.acceptedReasoning)({apiKey:g,model:r.model,effort:n.reasoningEffort}):(0,b.wantedReasoning)(n.reasoningEffort):null;return{ref:r,model:i.model,system:u,tools:T,providerOptions:{openai:{...v?.effort?{reasoningEffort:v.effort}:{},...v&&"summary"in v&&v.summary?{reasoningSummary:v.summary}:{}}}}}async function N({callId:e,standing:t,runsOn:a,messages:o,where:r}){let[s,i,l]=await Promise.all([C(e,a,!1,function(e){if(null==e)return null;let t=O.WhereSchema.safeParse(e);return t.success?t.data:(k.logger.warn(`The call goes on without where the user is: ${t.error.issues[0]?.message}`),null)}(r)),(0,n.validateUIMessages)({messages:o,dataSchemas:{[O.TEXT_CALL_NOTE]:O.TextCallNoteSchema}}),(0,E.nextTurnSeq)(e)]),h=i.at(-1)?.role;"user"!==h&&"assistant"!==h&&(0,v.publicError)("The conversation must end with your words or hers.");let d=l,u=i.findLastIndex(e=>"assistant"===e.role);for(let t of i.slice(u+1)){for(let a of(0,O.notesIn)([t]))a.said&&await (0,E.saveTurns)(e,[{id:a.id,role:"user",text:a.text,seq:d++}]);let a=B(t);a&&await (0,E.saveTurns)(e,[{id:t.id,role:"user",text:a,seq:d++}])}return{...s,callId:e,seq:d,messages:[...t?[{role:"system",content:t}]:[],...await (0,n.convertToModelMessages)(i.flatMap(e=>{let t=[],a=[],o=()=>{a.length&&t.push({...e,id:`${e.id}:${t.length}`,parts:a}),a=[]};for(let n of e.parts){let e=(0,O.noteOf)(n);if(!e){a.push(n);continue}o(),t.push({id:e.id,role:"user",parts:[{type:"text",text:e.text},...(e.pictures??[]).map(O.picturePart)]})}return o(),t}).map(e=>e.parts.some(e=>"file"===e.type)?{...e,parts:e.parts.map(e=>{if("file"!==e.type)return e;let t=e.url.startsWith(K)?(0,g.workspaceRelative)(e.url):null;return t?{...e,url:`${P}${encodeURIComponent(t)}`}:{type:"text",text:`${e.filename??"A file"} is not in the workspace, so nothing of it was sent to you.`}})}:e),{ignoreIncompleteToolCalls:!0})]}}let X="Writing to Thursday needs a GPT subscription sign-in or an OpenAI key — Settings › API keys.",B=e=>e.parts.flatMap(e=>"text"===e.type?e.text:[]).join("\n").trim();e.s(["readTextCallProvider",0,L,"streamTextCall",0,M]),a()}catch(e){a(e)}},!1)];
59
+ ${t.length?t.join("\n"):"- (nothing yet)"}`}e.s(["loadThursdayPrompt",0,g,"memoryChapter",0,b]),a()}catch(e){a(e)}},!1),97334,e=>e.a(async(t,a)=>{try{var o=e.i(912714),n=e.i(68356),r=e.i(907855),s=e.i(175936),i=e.i(687388),l=e.i(911757),h=e.i(159479),d=e.i(386075),u=e.i(264079),c=e.i(56802),w=e.i(962072),y=e.i(170801),p=e.i(353885),m=e.i(279041),f=e.i(340698),g=e.i(629668),b=e.i(878498),k=e.i(640911),T=e.i(120219),v=e.i(53748),$=e.i(41444),E=e.i(22676),O=e.i(134344),_=t([h,d,c,w,y,f,E]);async function L(){let e=await Promise.all(O.TEXT_CALL_PROVIDERS.map(async e=>await (0,f.readConfig)(e.apiKeyName)?e.apiKeyName:null));return(0,O.textCallRunsOn)(t=>e.includes(t))}async function S(e,t){if(t)return t;let a=await L();return a||(0,v.publicError)(X),{provider:a,model:e.backendModel}}async function A(e,t){if("chatgpt"!==e.provider||!(0,d.isPlanSpent)(t)||!await (0,f.readConfig)(l.LIVE_PROVIDER.apiKeyName))return null;let a=(await (0,E.readLiveSettings)()).backendModel,o=u.TEXT_MODEL_PROVIDERS.openai.suggestModels.find(e=>e.id===a)?.label??a,n=t instanceof Error?t.message:String(t);return{ref:{provider:"openai",model:a},why:n,line:`${n} Answering on your OpenAI key (${o}) until it resets.`}}[h,d,c,w,y,f,E]=_.then?(await _)():_;let R=r.object({callId:r.string().min(1),standing:r.string().nullish(),runsOn:u.textModelRefSchema.nullish(),turn:r.string().min(1),messages:r.array(r.unknown()).min(1),where:r.unknown().optional()}),q=globalThis.__textCallTurns??=new Map;async function M(e,t){var a;let o,r,s,l=null,h=[],u=()=>{l&&q.delete(l)};try{let a=R.parse(e);l=a.turn,q.set(l,{callId:a.callId,notes:h}),t.addEventListener("abort",u,{once:!0}),t.aborted&&u(),s=await N(a)}catch(a){u();let{status:e,message:t}=(0,T.startError)(a,"Could not reach her");return new Response(t,{status:e})}let c=(a=s.callId,o=s.seq,{step:async e=>{for(let t of e.content)if("tool-call"===t.type){let n=e.content.find(e=>"tool-result"===e.type&&e.toolCallId===t.toolCallId);await (0,E.saveTurns)(a,[{id:t.toolCallId,role:"tool",tool:t.toolName,text:t.toolName===p.TOOL_NAMES.web_search?function(e,t){let a=t??{},o=[(e??{}).query,a.action?.query].find(e=>"string"==typeof e&&!!e.trim()),n=Array.isArray(a.sources)?a.sources.flatMap(e=>e&&"object"==typeof e&&"url"in e&&"string"==typeof e.url?[{url:e.url,..."title"in e&&"string"==typeof e.title?{title:e.title}:{}}]:[]):[];return JSON.stringify({query:o??null,sources:n})}(t.input,n?.type==="tool-result"?n.output:null):JSON.stringify(t.input??{}),seq:o++}])}else"text"===t.type&&t.text.trim()?await (0,E.saveTurns)(a,[{id:crypto.randomUUID(),role:"assistant",text:t.text.trim(),seq:o++}]):"reasoning"===t.type&&t.text.trim()&&await (0,E.saveThought)(a,{id:crypto.randomUUID(),text:t.text.trim(),seq:o})},said:(e,t=crypto.randomUUID())=>(0,E.saveTurns)(a,[{id:t,role:"user",text:e,seq:o++}])}),w=new Map,y=async e=>(0,n.streamText)({model:e.model,instructions:e.system,messages:await I(s.messages,e.ref),allowSystemInMessages:!0,tools:e.tools,providerOptions:e.providerOptions,stopWhen:(0,n.stepCountIs)(i.TEXT_CALL.maxSteps),abortSignal:t,timeout:{chunkMs:i.TEXT_CALL.chunkMs},prepareStep:async({stepNumber:t,messages:a})=>{let o=h.splice(0);if(o.length){for(let e of o)e.said&&await c.said(e.text,e.id);return w.set(t,o),{messages:await I([...a,...o.map(e=>({role:"user",content:j(e.text,e.pictures)}))],e.ref)}}},onStepEnd:c.step}),m=null,f=s.ref.provider,g=null,b=e=>"abort"!==e.type||t.aborted?e:{type:"error",error:Error(`No answer came for ${Math.round(i.TEXT_CALL.chunkMs/1e3)} seconds, so this one was stopped.`)},v=(r=async function*(){let e=[],t=!1,a=null;for await(let o of(await y(s)).stream){let n=b(o);if(!t&&"error"===n.type&&(a=await A(s.ref,n.error)))break;if(!t&&("start"===n.type||"start-step"===n.type)){e.push(n);continue}t=!0,yield*e.splice(0),yield n}if(!a)return yield*e;k.logger.info(`text call ${s.callId}: ${a.line}`),m={why:a.why,line:a.line},f=a.ref.provider,h.unshift(...w.get(0)??[]),w.delete(0);try{for await(let e of(await y(await C(s.callId,a.ref))).stream)yield b(e)}catch(e){yield{type:"error",error:e}}}(),new ReadableStream({async pull(e){let t=await r.next();t.done?e.close():e.enqueue(t.value)},async cancel(){await r.return(void 0)}})),$=-1,_=new TransformStream({transform(e,t){if("start-step"===e.type)for(let e of($+=1,w.get($)??[]))t.enqueue({type:`data-${O.TEXT_CALL_NOTE}`,id:e.id,data:e});"error"===e.type&&g&&t.enqueue({type:`data-${O.TEXT_CALL_REFUSED}`,data:g,transient:!0}),t.enqueue(e),"start"===e.type&&m&&t.enqueue({type:`data-${O.TEXT_CALL_MOVED}`,data:m,transient:!0})},flush:u});return(0,n.createUIMessageStreamResponse)({stream:(0,n.toUIMessageStream)({stream:v,tools:s.tools,onError:e=>((0,d.isKeyRefused)(e)&&(g={provider:f}),(0,d.modelErrorToString)(e))}).pipeThrough(_)})}let P="workspace:",W=e=>({type:"file",mediaType:(0,g.mimeOf)(e),filename:e,data:{type:"url",url:new URL(`${P}${encodeURIComponent(e)}`)}}),U=e=>{let t=e.data,a=t instanceof URL?t:t?.type==="url"?t.url:null;return a instanceof URL&&a.protocol===P?decodeURIComponent(a.pathname):null},j=(e,t)=>t?.length?[{type:"text",text:e},...t.map(W)]:e,K=s.queryKey.file(""),D=new WeakMap;async function x(e,t,a){if(t)return{missed:`${e} is a picture, and ${t} cannot see pictures, so it was not sent to you.`};let n=await (0,y.checkPicture)(e);if("missing"in n)return{missed:`There is no file at ${e} in the workspace, so no picture was sent to you.`};if("notPicture"in n)return{missed:`${e} is not a png, jpg, webp or gif, so it was not sent to you as a picture.`};if("tooBig"in n)return{missed:`${(0,y.tooBigToSee)(e,n.tooBig)} It was not sent to you.`};if(n.bytes>a)return{missed:`${e} is a picture not sent with this message: the pictures after it fill the ${(0,$.formatBytes)(i.LOOK.perRequest)} one message to you carries. Look at it with look_at to see it.`};let r=await (0,o.readFile)(n.full).catch(()=>null);return r?{data:r.toString("base64"),mediaType:n.mediaType,bytes:r.length}:{missed:`${e} could not be read, so no picture was sent to you.`}}async function I(e,t){let a=(0,d.seesToolImages)(t)?null:t.model,o=i.LOOK.perRequest-e.reduce((e,t)=>e+function(e){if("user"!==e.role||"string"==typeof e.content)return 0;let t=0;for(let a of e.content){if("file"!==a.type)continue;let e=a.data,o=e?.type==="data"?e.data:e;"string"==typeof o?t+=Math.floor(3*o.length/4):(o instanceof Uint8Array||o instanceof ArrayBuffer)&&(t+=o.byteLength)}return t}(t),0),n=[...e];for(let e=n.length-1;e>=0;e-=1){let t=n[e];if("user"!==t.role||"string"==typeof t.content||!t.content.some(e=>"file"===e.type&&null!==U(e)))continue;let r=[];for(let e of[...t.content].reverse()){let t="file"===e.type?U(e):null;if(!t){r.unshift(e);continue}let n=await x(t,a,o);if("missed"in n){r.unshift({type:"text",text:n.missed});continue}o-=n.bytes,r.unshift({type:"text",text:`${t}, as an image:`},{type:"file",mediaType:n.mediaType,data:{type:"data",data:n.data}})}let s={role:"user",content:r};D.set(s,t),n[e]=s}return n}async function C(e,t,a=!1,o){let n=await (0,E.readLiveSettings)(),r=await S(n,t),s="openai"===r.provider||"chatgpt"===r.provider,[i,u,c,y,g]=await Promise.all([(0,d.getTextModel)(r),(0,w.loadThursdayPrompt)({backendPrompt:n.backendPrompt,written:!0,callId:e,phone:a,persona:n.persona,stylePrompt:n.stylePrompt,readSkills:n.readSkills,where:o}),(0,h.loadTools)({target:"thursday",callId:e,webSearch:n.webSearch,readSkills:n.readSkills,written:!0,model:r,phone:a}),(0,f.readConfig)(m.EXA_API_KEY),(0,f.readConfig)(l.LIVE_PROVIDER.apiKeyName)]),k=i.searchTools&&Object.values(i.searchTools)[0],T={...c,...n.webSearch&&!y&&k?{[p.TOOL_NAMES.web_search]:k}:{}},v=s?g?await (0,b.acceptedReasoning)({apiKey:g,model:r.model,effort:n.reasoningEffort}):(0,b.wantedReasoning)(n.reasoningEffort):null;return{ref:r,model:i.model,system:u,tools:T,providerOptions:{openai:{...v?.effort?{reasoningEffort:v.effort}:{},...v&&"summary"in v&&v.summary?{reasoningSummary:v.summary}:{}}}}}async function N({callId:e,standing:t,runsOn:a,messages:o,where:r}){let[s,i,l]=await Promise.all([C(e,a,!1,function(e){if(null==e)return null;let t=O.WhereSchema.safeParse(e);return t.success?t.data:(k.logger.warn(`The call goes on without where the user is: ${t.error.issues[0]?.message}`),null)}(r)),(0,n.validateUIMessages)({messages:o,dataSchemas:{[O.TEXT_CALL_NOTE]:O.TextCallNoteSchema}}),(0,E.nextTurnSeq)(e)]),h=i.at(-1)?.role;"user"!==h&&"assistant"!==h&&(0,v.publicError)("The conversation must end with your words or hers.");let d=l,u=i.findLastIndex(e=>"assistant"===e.role);for(let t of i.slice(u+1)){for(let a of(0,O.notesIn)([t]))a.said&&await (0,E.saveTurns)(e,[{id:a.id,role:"user",text:a.text,seq:d++}]);let a=B(t);a&&await (0,E.saveTurns)(e,[{id:t.id,role:"user",text:a,seq:d++}])}return{...s,callId:e,seq:d,messages:[...t?[{role:"system",content:t}]:[],...await (0,n.convertToModelMessages)(i.flatMap(e=>{let t=[],a=[],o=()=>{a.length&&t.push({...e,id:`${e.id}:${t.length}`,parts:a}),a=[]};for(let n of e.parts){let e=(0,O.noteOf)(n);if(!e){a.push(n);continue}o(),t.push({id:e.id,role:"user",parts:[{type:"text",text:e.text},...(e.pictures??[]).map(O.picturePart)]})}return o(),t}).map(e=>e.parts.some(e=>"file"===e.type)?{...e,parts:e.parts.map(e=>{if("file"!==e.type)return e;let t=e.url.startsWith(K)?(0,g.workspaceRelative)(e.url):null;return t?{...e,url:`${P}${encodeURIComponent(t)}`}:{type:"text",text:`${e.filename??"A file"} is not in the workspace, so nothing of it was sent to you.`}})}:e),{ignoreIncompleteToolCalls:!0})]}}let X="Writing to Thursday needs a GPT subscription sign-in or an OpenAI key — Settings › API keys.",B=e=>e.parts.flatMap(e=>"text"===e.type?e.text:[]).join("\n").trim();e.s(["readTextCallProvider",0,L,"streamTextCall",0,M]),a()}catch(e){a(e)}},!1)];
58
60
 
59
61
  //# sourceMappingURL=features_14kex_m._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[51083,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},951056,e=>{"use strict";var t=e.i(749906),r=e.i(867849),r=r,n=e.i(333925),i=e.i(864328),s=e.i(900533),a=e.i(64774),o=e.i(746565),l=e.i(600690);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],951056)},600690,e=>{"use strict";var t=e.i(749906);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
1
+ module.exports=[51083,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",routine_watch:"routine_watch",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},951056,e=>{"use strict";var t=e.i(749906),r=e.i(867849),r=r,n=e.i(333925),i=e.i(864328),s=e.i(900533),a=e.i(64774),o=e.i(746565),l=e.i(600690);let m=t.object({color:t.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:t.enum(o.MARK_SHAPES).optional(),outline:t.boolean().optional(),paint:t.enum(o.MARK_PAINT_IDS).optional()}),d=t.string().max(n.COMMON_VALIDATE.prompt.max),c=t.object({line:t.string(),reason:t.string(),at:t.number()}),u=t.object({id:t.number(),name:t.string(),serverName:t.string()}),g=t.string().trim().transform(e=>e.replace(/\s+/g," ")).refine(e=>e.toLowerCase()!==l.ROOM_THURSDAY.toLowerCase(),"Thursday is reserved for the voice assistant.").pipe(t.string().min(1,"A name is required").max(n.COMMON_VALIDATE.name.max)),h=t.object({input:t.number(),output:t.number()});t.object({name:t.string(),description:t.string(),descriptionLocked:t.boolean(),ownLine:c.nullish(),systemPrompt:t.string().nullish(),icon:m.nullish(),provider:i.textModelProviderSchema.nullish(),model:t.string().nullish(),compactAt:t.number().nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean(),createdAt:s.DateLikeSchema,tools:u.array().default([]),tokens:h,lastJobAt:s.DateLikeSchema.nullish()}),t.object({name:g,description:t.string().trim().min(1,"Say what this bot is for").max(n.COMMON_VALIDATE.description.max),systemPrompt:d.optional(),icon:m.optional(),provider:i.textModelProviderSchema.nullish(),model:t.string().trim().max(80).nullish(),compactAt:r.number().int().min(8e3,"At least 8k").nullish(),effort:i.effortSchema.nullish(),disabled:t.boolean().optional(),descriptionLocked:t.boolean().optional(),toolIds:t.number().int().array().max(n.MAX_PINNED_TOOLS).optional()});let _={color:o.MARK_SYSTEM,shape:"blob"};t.object({file:t.string(),path:t.string(),line:t.string(),at:s.DateLikeSchema,bytes:t.number()});let b="Continue",p={thursday:"Thursday, on the call:",user:"The user, on screen:"},k=e=>Object.keys(p).find(t=>e.startsWith(`${p[t]} `))??null,y=t.discriminatedUnion("type",[t.object({type:t.literal("text"),text:t.string()}),t.object({type:t.literal("image"),src:t.string()})]),x=t.object({id:t.string(),seq:t.number(),bot:t.string().nullable(),parent:t.string().nullable(),to:t.string().nullish(),at:s.DateLikeSchema}),f=t.discriminatedUnion("kind",[x.extend({kind:t.literal("user"),text:t.string(),by:t.enum(["thursday","user"]).nullable()}),x.extend({kind:t.literal("text"),text:t.string()}),x.extend({kind:t.literal("note"),text:t.string()}),x.extend({kind:t.literal("stop"),text:t.string()}),x.extend({kind:t.literal("tool"),callId:t.string(),name:t.string(),input:t.string(),note:t.string().nullish(),path:t.string().nullish()}),x.extend({kind:t.literal("tool-result"),callId:t.string(),name:t.string(),results:y.array(),more:t.boolean()}),x.extend({kind:t.literal("ask"),callId:t.string(),to:t.string(),text:t.string(),question:t.boolean().optional(),questionId:t.string().optional(),exchange:t.string().optional(),after:t.array(t.string()).optional()})]),A=t.object({question:t.string(),messageId:t.string().optional(),bot:t.string().optional(),options:t.string().array(),refused:i.textModelProviderSchema.optional()});t.object({id:t.string(),bot:t.string(),label:t.string(),request:t.string(),status:t.enum(["running","waiting","done","cancelled"]),outcome:t.string().nullable(),ask:A.nullable(),seen:t.boolean(),routineId:t.string().nullable(),startedBy:t.enum(["thursday","user"]).nullable(),tokens:h,contextTokens:t.number(),contextBudget:t.number(),createdAt:s.DateLikeSchema,updatedAt:s.DateLikeSchema,lines:f.array(),room:l.RoomViewSchema}),e.s(["BOT_MEMORY_KEY",0,"BOT_MEMORY","COMPACT_AT_MIN",0,8e3,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",ownLine:null,systemPrompt:null,icon:_,provider:null,model:null,disabled:!1,compactAt:null,effort:null},"DEFAULT_BOT_ICON",0,_,"THREAD_CONTINUE",0,b,"isAppStop",0,e=>{let t=e?.options??[];return!e?.messageId&&1===t.length&&t[0]===b},"isBotMemoryOn",0,e=>e?.trim()!=="off","rosterLine",0,function(e){let t=e.description.trim();return e.ownLine?`${t}${/[.!?。…]$/.test(t)?"":"."} ${e.ownLine}`:t},"speakerOf",0,k,"tagSpeaker",0,(e,t)=>`${p[e]} ${t}`,"threadActivity",0,function(e,t=120){let r=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if("tool"===i.kind)r??=`${i.name} ${i.note??i.input}`;else if("text"===i.kind)return(0,a.clip)(r?`${i.text} → ${r}`:i.text,t);else if("ask"===i.kind)return(0,a.clip)(`asked ${i.to}: ${i.text}`,t);else if("user"===i.kind)break}return r?(0,a.clip)(r,t):null},"untagSpeaker",0,e=>{let t=k(e);return t?e.slice(p[t].length+1):e},"workHandle",0,e=>e.slice(0,6)],951056)},600690,e=>{"use strict";var t=e.i(749906);let r=t.object({to:t.string().trim().min(1),text:t.string().trim().min(1),why:t.string().trim().min(1),kind:t.enum(["message","question"]).default("message"),options:t.array(t.string().trim().min(1)).nullish(),after:t.array(t.string().trim().min(1)).nullish()}),n=t.enum(["queued","running","waiting","external","paused","done","cancelled"]),i=t.object({bot:t.string(),state:n}),s=t.object({id:t.string(),bot:t.string(),caller:t.string(),state:n,waitsFor:t.string().array()}),a=t.object({id:t.string(),bot:t.string(),text:t.string(),options:t.string().array().optional()}),o=t.enum(["message","question","report","interrupted"]),l="Thursday",m=t.object({participants:i.array(),questions:a.array(),deliveries:t.object({id:t.string(),bot:t.string(),text:t.string(),delivered:t.boolean()}).array(),relays:t.object({id:t.number(),bot:t.string(),text:t.string(),kind:o,messageId:t.string().nullable()}).array(),exchanges:s.array()});e.s(["RESUME_CHECK",0,"Resume from the saved state; inspect any tool whose result is missing before repeating it.","ROOM_THURSDAY",0,l,"ROOM_USER",0,"The user","RoomMessageSchema",0,r,"RoomViewSchema",0,m,"isCoordinatorSeat",0,(e,t,r)=>e===t&&r===l])}];
2
2
 
3
3
  //# sourceMappingURL=features_1cb9luv._.js.map
@@ -1,20 +1,20 @@
1
- module.exports=[850668,e=>{"use strict";var t=e.i(912714),a=e.i(660526),n=e.i(750227),i=e.i(333925),s=e.i(375814),l=e.i(871096),r=e.i(938281),o=e.i(64774);let c=(0,n.join)(i.APP_DIR,i.PATHS.skills.default,"artifact","runtime","render.mjs"),d={viewport:{width:412,height:839},deviceScaleFactor:2},h=(0,o.PromiseChain)(),u=e=>["html","htm"].includes((0,s.extensionOf)(e));async function f(e){let a=await (0,t.open)(e);try{let e=Buffer.alloc(4096),{bytesRead:t}=await a.read(e,0,e.length,0),n=/<meta name="print" content="pdf(?: (\d+x\d+))?">/.exec(e.subarray(0,t).toString("utf8"));return n?{size:n[1]??""}:null}finally{await a.close()}}async function p(e,s,{failed:r,take:o}){let h=await (0,t.mkdtemp)((0,n.join)((0,a.tmpdir)(),"thursday-pictures-")),u=(0,n.join)(h,"browser.json");await (0,t.writeFile)(u,JSON.stringify({browser:{contextOptions:d}}));let f={PLAYWRIGHT_CLI_SESSION:"reach-pictures",PLAYWRIGHT_MCP_BROWSER:"chromium",PLAYWRIGHT_MCP_ISOLATED:"true",PLAYWRIGHT_MCP_CONFIG:u,RENDER:c,PAGE:e,OUT:h,NAME:(0,n.basename)(e,(0,n.extname)(e))},m=await (0,l.openWorkspace)();try{let e=await m.exec(`node "$RENDER" "$PAGE" --shot ${s}`,{env:f,timeoutMs:i.REACH.drawMs});if(0!==e.exitCode)throw Error(e.stderr.trim().split("\n").at(-1)||r);return await o(h)}finally{await m.exec("playwright-cli close",{env:f,timeoutMs:15e3}).catch(()=>{}),await (0,t.rm)(h,{recursive:!0,force:!0})}}e.s(["pdfOf",0,function(e){return u(e)?h(async()=>{let a=await f(e);if(!a)return null;let i=a.size?` --size ${a.size}`:"";return p(e,`--pdf "$OUT/$NAME.pdf"${i}`,{failed:"not printed",take:async a=>({bytes:await (0,t.readFile)((0,n.join)(a,`${(0,n.basename)(e,(0,n.extname)(e))}.pdf`)),name:`${(0,n.basename)(e,(0,n.extname)(e))}.pdf`,picture:!1})})}).catch(t=>(r.logger.warn(`reach: no PDF of ${(0,n.basename)(e)}`,t),null)):Promise.resolve(null)},"picturesOf",0,function(e){return u(e)?h(()=>p(e,`--out "$OUT" --name "$NAME" --most ${i.REACH.pictures}`,{failed:"no pictures",take:async e=>Promise.all((await (0,t.readdir)(e)).filter(e=>e.endsWith(".png")).sort().map(async a=>({bytes:await (0,t.readFile)((0,n.join)(e,a)),name:a,picture:!0})))})).catch(t=>(r.logger.warn(`reach: no pictures of ${(0,n.basename)(e)}`,t),[])):Promise.resolve([])}])},480791,e=>{"use strict";var t=e.i(417043),a=e.i(775247),n=e.i(903438);let i="https://slack.com/api",s=new Set(["invalid_auth","not_authed","account_inactive","token_revoked","not_allowed_token_type","missing_scope"]);e.s(["createSlack",0,function(e,l){async function r(a,n,o=l){for(let l=0;;l++){let r=await fetch(`${i}/${a}`,{method:"POST",headers:{authorization:`Bearer ${o}`,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(n)}).catch(e=>{throw Error(`Could not reach ${new URL(i).host}`,{cause:e})}),c=r.headers.get("retry-after");if(429===r.status&&await (0,t.waitOut)(null===c?null:Number(c),l))continue;let d=await r.json().catch(()=>null);if(d?.ok)return d;let h=d?.error??`http_${r.status}`;if(!s.has(h))throw Error(`Slack answered ${h} to ${a}`);let u=o===e,f=d?.needed??"a scope";throw new t.ChannelRefusal("missing_scope"===h?u?`Slack says this app-level token lacks ${f} — generate one with it under Basic Information › App-Level Tokens and paste it here.`:`Slack says the app lacks a permission (${f}) — make it from the manifest in the guide.`:u?`Slack turned the app-level token away (${h}). Generate a new one under Basic Information › App-Level Tokens and paste it here.`:`Slack turned the bot token away (${h}). Copy the Bot User OAuth Token again from Install App and paste it here.`,+!u)}}let o=new Map;async function c(e){let t=o.get(e);if(t)return t;let a=await r("users.info",{user:e}).then(t=>({name:t.user?.real_name||t.user?.name||e,handle:t.user?.name?`@${t.user.name}`:null})).catch(()=>({name:e,handle:null}));return o.set(e,a),a}async function d(e,t){if("events_api"===e){let e=t.event??{},a=!e.subtype||"file_share"===e.subtype;if("message"!==e.type||"im"!==e.channel_type||!a||e.bot_id||!e.user||!e.channel)return null;let n=await c(e.user);return{kind:"message",chat:e.channel,name:n.name,handle:n.handle,words:(e.text??"").trim(),files:(e.files??[]).flatMap(e=>{let t=e.url_private_download;if(!t)return[];let a=e.name??"file";return[{name:a,size:e.size,fetch:async()=>{let n=await fetch(t,{headers:{authorization:`Bearer ${l}`}});if(!n.ok)throw Error(`Slack answered ${n.status} for the file`);return new File([await n.arrayBuffer()],a,{type:e.mimetype??""})}}]}),unreadable:!1}}return"interactive"===e&&"block_actions"===t.type?t.channel?.id?{kind:"press",chat:t.channel.id,data:t.actions?.[0]?.value??"",under:t.message?.ts&&t.message.text?{id:t.message.ts,text:t.message.text}:null}:null:null}return{limits:{take:1/0,file:0x40000000,picture:0x40000000},async listen(t,a){let i=await r("auth.test",{}),{url:s}=await r("apps.connections.open",{},e);t.ready(i.user?`@${i.user}`:"the app",null,i.bot_id??i.user_id??"");let l=await (0,n.runSocket)(s,{message(e,a){let{type:n,envelope_id:i,payload:s}=e;i&&a({envelope_id:i}),n&&s&&d(n,s).then(e=>{e&&t.incoming(e)})}},a);if(!a.aborted)throw Error(`Slack closed the connection (${l.code})`)},async say(e,t,n){let i=(0,a.chatPieces)(t,"slack",2900);for(let[t,a]of i.entries()){let s=n?.length&&t===i.length-1;await r("chat.postMessage",{channel:e,text:a,unfurl_links:!1,unfurl_media:!1,...s?{blocks:[{type:"section",text:{type:"mrkdwn",text:a}},{type:"actions",elements:n.slice(0,25).map((e,t)=>({type:"button",action_id:`choice_${t}`,text:{type:"plain_text",text:e.text.slice(0,75)},value:e.data}))}]}:{}})}},async typing(){},async settle(e,t,n){let i=`
1
+ module.exports=[850668,e=>e.a(async(t,a)=>{try{var n=e.i(912714),i=e.i(660526),s=e.i(750227),l=e.i(333925),r=e.i(375814),o=e.i(871096),c=e.i(938281),d=e.i(64774),h=t([o]);[o]=h.then?(await h)():h;let p=(0,s.join)(l.APP_DIR,l.PATHS.skills.default,"artifact","runtime","render.mjs"),m={viewport:{width:412,height:839},deviceScaleFactor:2},w=(0,d.PromiseChain)(),y=e=>["html","htm"].includes((0,r.extensionOf)(e));async function u(e){let t=await (0,n.open)(e);try{let e=Buffer.alloc(4096),{bytesRead:a}=await t.read(e,0,e.length,0),n=/<meta name="print" content="pdf(?: (\d+x\d+))?">/.exec(e.subarray(0,a).toString("utf8"));return n?{size:n[1]??""}:null}finally{await t.close()}}async function f(e,t,{failed:a,take:r}){let c=await (0,n.mkdtemp)((0,s.join)((0,i.tmpdir)(),"thursday-pictures-")),d=(0,s.join)(c,"browser.json");await (0,n.writeFile)(d,JSON.stringify({browser:{contextOptions:m}}));let h={PLAYWRIGHT_CLI_SESSION:"reach-pictures",PLAYWRIGHT_MCP_BROWSER:"chromium",PLAYWRIGHT_MCP_ISOLATED:"true",PLAYWRIGHT_MCP_CONFIG:d,RENDER:p,PAGE:e,OUT:c,NAME:(0,s.basename)(e,(0,s.extname)(e))},u=await (0,o.openWorkspace)();try{let e=await u.exec(`node "$RENDER" "$PAGE" --shot ${t}`,{env:h,timeoutMs:l.REACH.drawMs});if(0!==e.exitCode)throw Error(e.stderr.trim().split("\n").at(-1)||a);return await r(c)}finally{await u.exec("playwright-cli close",{env:h,timeoutMs:15e3}).catch(()=>{}),await (0,n.rm)(c,{recursive:!0,force:!0})}}e.s(["pdfOf",0,function(e){return y(e)?w(async()=>{let t=await u(e);if(!t)return null;let a=t.size?` --size ${t.size}`:"";return f(e,`--pdf "$OUT/$NAME.pdf"${a}`,{failed:"not printed",take:async t=>({bytes:await (0,n.readFile)((0,s.join)(t,`${(0,s.basename)(e,(0,s.extname)(e))}.pdf`)),name:`${(0,s.basename)(e,(0,s.extname)(e))}.pdf`,picture:!1})})}).catch(t=>(c.logger.warn(`reach: no PDF of ${(0,s.basename)(e)}`,t),null)):Promise.resolve(null)},"picturesOf",0,function(e){return y(e)?w(()=>f(e,`--out "$OUT" --name "$NAME" --most ${l.REACH.pictures}`,{failed:"no pictures",take:async e=>{let t=(await (0,n.readdir)(e)).filter(e=>e.endsWith(".png")).sort();return Promise.all(t.map(async t=>({bytes:await (0,n.readFile)((0,s.join)(e,t)),name:t,picture:!0})))}})).catch(t=>(c.logger.warn(`reach: no pictures of ${(0,s.basename)(e)}`,t),[])):Promise.resolve([])}]),a()}catch(e){a(e)}},!1),480791,e=>{"use strict";var t=e.i(417043),a=e.i(775247),n=e.i(903438);let i="https://slack.com/api",s=new Set(["invalid_auth","not_authed","account_inactive","token_revoked","not_allowed_token_type","missing_scope"]);e.s(["createSlack",0,function(e,l){async function r(a,n,o=l){for(let l=0;;l++){let r=await fetch(`${i}/${a}`,{method:"POST",headers:{authorization:`Bearer ${o}`,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(n)}).catch(e=>{throw Error(`Could not reach ${new URL(i).host}`,{cause:e})}),c=r.headers.get("retry-after");if(429===r.status&&await (0,t.waitOut)(null===c?null:Number(c),l))continue;let d=await r.json().catch(()=>null);if(d?.ok)return d;let h=d?.error??`http_${r.status}`;if(!s.has(h))throw Error(`Slack answered ${h} to ${a}`);let u=o===e,f=d?.needed??"a scope";throw new t.ChannelRefusal("missing_scope"===h?u?`Slack says this app-level token lacks ${f} — generate one with it under Basic Information › App-Level Tokens and paste it here.`:`Slack says the app lacks a permission (${f}) — make it from the manifest in the guide.`:u?`Slack turned the app-level token away (${h}). Generate a new one under Basic Information › App-Level Tokens and paste it here.`:`Slack turned the bot token away (${h}). Copy the Bot User OAuth Token again from Install App and paste it here.`,+!u)}}let o=new Map;async function c(e){let t=o.get(e);if(t)return t;let a=await r("users.info",{user:e}).then(t=>({name:t.user?.real_name||t.user?.name||e,handle:t.user?.name?`@${t.user.name}`:null})).catch(()=>({name:e,handle:null}));return o.set(e,a),a}async function d(e,t){if("events_api"===e){let e=t.event??{},a=!e.subtype||"file_share"===e.subtype;if("message"!==e.type||"im"!==e.channel_type||!a||e.bot_id||!e.user||!e.channel)return null;let n=await c(e.user);return{kind:"message",chat:e.channel,name:n.name,handle:n.handle,words:(e.text??"").trim(),files:(e.files??[]).flatMap(e=>{let t=e.url_private_download;if(!t)return[];let a=e.name??"file";return[{name:a,size:e.size,fetch:async()=>{let n=await fetch(t,{headers:{authorization:`Bearer ${l}`}});if(!n.ok)throw Error(`Slack answered ${n.status} for the file`);return new File([await n.arrayBuffer()],a,{type:e.mimetype??""})}}]}),voice:null,unreadable:!1}}return"interactive"===e&&"block_actions"===t.type?t.channel?.id?{kind:"press",chat:t.channel.id,data:t.actions?.[0]?.value??"",under:t.message?.ts&&t.message.text?{id:t.message.ts,text:t.message.text}:null}:null:null}return{limits:{take:1/0,file:0x40000000,picture:0x40000000},async listen(t,a){let i=await r("auth.test",{}),{url:s}=await r("apps.connections.open",{},e);t.ready(i.user?`@${i.user}`:"the app",null,i.bot_id??i.user_id??"");let l=await (0,n.runSocket)(s,{message(e,a){let{type:n,envelope_id:i,payload:s}=e;i&&a({envelope_id:i}),n&&s&&d(n,s).then(e=>{e&&t.incoming(e)})}},a);if(!a.aborted)throw Error(`Slack closed the connection (${l.code})`)},async say(e,t,n){let i=(0,a.chatPieces)(t,"slack",2900);for(let[t,a]of i.entries()){let s=n?.length&&t===i.length-1;await r("chat.postMessage",{channel:e,text:a,unfurl_links:!1,unfurl_media:!1,...s?{blocks:[{type:"section",text:{type:"mrkdwn",text:a}},{type:"actions",elements:n.slice(0,25).map((e,t)=>({type:"button",action_id:`choice_${t}`,text:{type:"plain_text",text:e.text.slice(0,75)},value:e.data}))}]}:{}})}},async typing(){},async settle(e,t,n){let i=`
2
2
 
3
- → ${(0,a.chatPieces)({plain:n},"slack",2900)[0]}`;await r("chat.update",{channel:e,ts:t.id,text:`${t.text.slice(0,2900-i.length)}${i}`,blocks:[]}).catch(()=>{})},async sendFiles(e,t){let a=[];for(let{bytes:e,name:n}of t){let t=new URLSearchParams({filename:n,length:String(e.byteLength)}),s=await fetch(`${i}/files.getUploadURLExternal`,{method:"POST",headers:{authorization:`Bearer ${l}`},body:t}),r=await s.json();if(!r.ok||!r.upload_url||!r.file_id)throw Error(`Slack answered ${r.error??s.status} to the upload`);let o=await fetch(r.upload_url,{method:"POST",body:new Blob([e])});if(!o.ok)throw Error(`Slack answered ${o.status} to the upload`);a.push({id:r.file_id,title:n})}a.length&&await r("files.completeUploadExternal",{files:a,channel_id:e})}}}])},644301,e=>{"use strict";var t=e.i(333925),a=e.i(417043),n=e.i(775247);let i="https://api.telegram.org",s={take:0x1400000,file:0x3200000,picture:0xa00000};class l extends Error{status;constructor(e,t){super(e),this.status=t}}e.s(["createTelegram",0,function(e){async function r(t,n,s){let r=n instanceof FormData;for(let o=0;;o++){let c=await fetch(`${i}/bot${e}/${t}`,{method:"POST",signal:s,...r?{body:n}:{headers:{"content-type":"application/json"},body:JSON.stringify(n??{})}}).catch(e=>{throw Error(`Could not reach ${new URL(i).host}`,{cause:e})}),d=await c.json().catch(()=>null);if(d?.ok)return d.result;if(429===c.status&&await (0,a.waitOut)(d?.parameters?.retry_after,o))continue;let h=d?.description??`Telegram answered ${c.status}`;if(401===c.status)throw new a.ChannelRefusal(`Telegram said “${h}”: this token was revoked or mistyped. Get it again from @BotFather and paste it here.`);throw new l(h,c.status)}}async function o(t,a,n){let{file_path:s}=await r("getFile",{file_id:t});if(!s)throw Error("Telegram did not say where the file is");let l=await fetch(`${i}/file/bot${e}/${s}`);if(!l.ok)throw Error(`Telegram answered ${l.status} for the file`);let o=s.includes(".")?s.slice(s.lastIndexOf(".")):"";return new File([await l.arrayBuffer()],a.includes(".")?a:`${a}${o}`,n?{type:n}:void 0)}let c=0;async function d(e,t){let a=new FormData;if(a.set("chat_id",e),1===t.length){a.set("photo",new Blob([t[0].bytes]),t[0].name),await r("sendPhoto",a);return}for(let[e,n]of(a.set("media",JSON.stringify(t.map((e,t)=>({type:"photo",media:`attach://p${t}`})))),t.entries()))a.set(`p${e}`,new Blob([n.bytes]),n.name);await r("sendMediaGroup",a)}return{limits:s,async listen(e,a){let n=await r("getMe",void 0,a);for(e.ready(n.username?`@${n.username}`:n.first_name??"the bot",n.username?`https://t.me/${n.username}`:null,String(n.id));!a.aborted;)for(let n of(await r("getUpdates",{offset:c,timeout:t.REACH.pollSeconds,allowed_updates:["message","callback_query"]},AbortSignal.any([a,AbortSignal.timeout((t.REACH.pollSeconds+15)*1e3)])))){c=n.update_id+1;let t=function(e){let t,a=e.callback_query;if(a)return r("answerCallbackQuery",{callback_query_id:a.id}).catch(()=>{}),{kind:"press",chat:String(a.from.id),data:a.data??"",under:a.message?.text?{id:String(a.message.message_id),text:a.message.text,keep:a.message.entities}:null};let n=e.message;if(!n?.from||"private"!==n.chat.type)return null;let i=n.photo?.at(-1),s=n.document?{id:n.document.file_id,name:n.document.file_name??"file",type:n.document.mime_type,size:n.document.file_size}:i?{id:i.file_id,name:`photo-${n.message_id}`,type:"",size:i.file_size}:null;return{kind:"message",chat:String(n.chat.id),name:(t=n.from,[t?.first_name,t?.last_name].filter(Boolean).join(" ")||(t?.username?`@${t.username}`:"Someone")),handle:n.from.username?`@${n.from.username}`:null,words:(n.text??n.caption??"").trim(),files:s?[{name:s.name,size:s.size,fetch:()=>o(s.id,s.name,s.type)}]:[],unreadable:!!(n.voice||n.audio||n.video)}}(n);t&&e.incoming(t)}},async say(e,t,a){let i=(0,n.chatPieces)(t,"telegram",4e3);for(let[t,n]of i.entries())await r("sendMessage",{chat_id:e,text:n,parse_mode:"HTML",link_preview_options:{is_disabled:!0},...a?.length&&t===i.length-1?{reply_markup:{inline_keyboard:a.map(e=>[{text:e.text,callback_data:e.data}])}}:{}})},async typing(e){await r("sendChatAction",{chat_id:e,action:"typing"}).catch(()=>{})},async settle(e,t,a){await r("editMessageText",{chat_id:e,message_id:Number(t.id),text:`${t.text}
3
+ → ${(0,a.chatPieces)({plain:n},"slack",2900)[0]}`;await r("chat.update",{channel:e,ts:t.id,text:`${t.text.slice(0,2900-i.length)}${i}`,blocks:[]}).catch(()=>{})},async sendFiles(e,t){let a=[];for(let{bytes:e,name:n}of t){let t=new URLSearchParams({filename:n,length:String(e.byteLength)}),s=await fetch(`${i}/files.getUploadURLExternal`,{method:"POST",headers:{authorization:`Bearer ${l}`},body:t}),r=await s.json();if(!r.ok||!r.upload_url||!r.file_id)throw Error(`Slack answered ${r.error??s.status} to the upload`);let o=await fetch(r.upload_url,{method:"POST",body:new Blob([e])});if(!o.ok)throw Error(`Slack answered ${o.status} to the upload`);a.push({id:r.file_id,title:n})}a.length&&await r("files.completeUploadExternal",{files:a,channel_id:e})}}}])},644301,e=>{"use strict";var t=e.i(333925),a=e.i(417043),n=e.i(775247);let i="https://api.telegram.org",s={take:0x1400000,file:0x3200000,picture:0xa00000};class l extends Error{status;constructor(e,t){super(e),this.status=t}}e.s(["createTelegram",0,function(e){async function r(t,n,s){let r=n instanceof FormData;for(let o=0;;o++){let c=await fetch(`${i}/bot${e}/${t}`,{method:"POST",signal:s,...r?{body:n}:{headers:{"content-type":"application/json"},body:JSON.stringify(n??{})}}).catch(e=>{throw Error(`Could not reach ${new URL(i).host}`,{cause:e})}),d=await c.json().catch(()=>null);if(d?.ok)return d.result;if(429===c.status&&await (0,a.waitOut)(d?.parameters?.retry_after,o))continue;let h=d?.description??`Telegram answered ${c.status}`;if(401===c.status)throw new a.ChannelRefusal(`Telegram said “${h}”: this token was revoked or mistyped. Get it again from @BotFather and paste it here.`);throw new l(h,c.status)}}async function o(t,a,n){let{file_path:s}=await r("getFile",{file_id:t});if(!s)throw Error("Telegram did not say where the file is");let l=await fetch(`${i}/file/bot${e}/${s}`);if(!l.ok)throw Error(`Telegram answered ${l.status} for the file`);let o=s.includes(".")?s.slice(s.lastIndexOf(".")):"";return new File([await l.arrayBuffer()],a.includes(".")?a:`${a}${o}`,n?{type:n}:void 0)}let c=0;async function d(e,t){let a=new FormData;if(a.set("chat_id",e),1===t.length){a.set("photo",new Blob([t[0].bytes]),t[0].name),await r("sendPhoto",a);return}for(let[e,n]of(a.set("media",JSON.stringify(t.map((e,t)=>({type:"photo",media:`attach://p${t}`})))),t.entries()))a.set(`p${e}`,new Blob([n.bytes]),n.name);await r("sendMediaGroup",a)}return{limits:s,async listen(e,a){let n=await r("getMe",void 0,a);for(e.ready(n.username?`@${n.username}`:n.first_name??"the bot",n.username?`https://t.me/${n.username}`:null,String(n.id));!a.aborted;)for(let n of(await r("getUpdates",{offset:c,timeout:t.REACH.pollSeconds,allowed_updates:["message","callback_query"]},AbortSignal.any([a,AbortSignal.timeout((t.REACH.pollSeconds+15)*1e3)])))){c=n.update_id+1;let t=function(e){let t,a=e.callback_query;if(a)return r("answerCallbackQuery",{callback_query_id:a.id}).catch(()=>{}),{kind:"press",chat:String(a.from.id),data:a.data??"",under:a.message?.text?{id:String(a.message.message_id),text:a.message.text,keep:a.message.entities}:null};let n=e.message;if(!n?.from||"private"!==n.chat.type)return null;let i=n.photo?.at(-1),s=n.voice,l=n.document?{id:n.document.file_id,name:n.document.file_name??"file",type:n.document.mime_type,size:n.document.file_size}:i?{id:i.file_id,name:`photo-${n.message_id}`,type:"",size:i.file_size}:n.audio?{id:n.audio.file_id,name:n.audio.file_name??`audio-${n.message_id}`,type:n.audio.mime_type??"",size:n.audio.file_size}:null;return{kind:"message",chat:String(n.chat.id),name:(t=n.from,[t?.first_name,t?.last_name].filter(Boolean).join(" ")||(t?.username?`@${t.username}`:"Someone")),handle:n.from.username?`@${n.from.username}`:null,words:(n.text??n.caption??"").trim(),files:l?[{name:l.name,size:l.size,fetch:()=>o(l.id,l.name,l.type)}]:[],voice:s?{name:`voice-${n.message_id}.ogg`,size:s.file_size,fetch:()=>o(s.file_id,`voice-${n.message_id}.ogg`,s.mime_type??"audio/ogg")}:null,unreadable:!!n.video}}(n);t&&e.incoming(t)}},async say(e,t,a){let i=(0,n.chatPieces)(t,"telegram",4e3);for(let[t,n]of i.entries())await r("sendMessage",{chat_id:e,text:n,parse_mode:"HTML",link_preview_options:{is_disabled:!0},...a?.length&&t===i.length-1?{reply_markup:{inline_keyboard:a.map(e=>[{text:e.text,callback_data:e.data}])}}:{}})},async typing(e){await r("sendChatAction",{chat_id:e,action:"typing"}).catch(()=>{})},async settle(e,t,a){await r("editMessageText",{chat_id:e,message_id:Number(t.id),text:`${t.text}
4
4
 
5
- → ${a}`,entities:t.keep,link_preview_options:{is_disabled:!0}}).catch(()=>{})},async sendFiles(e,t){let a=t.filter(e=>e.picture),n=t.filter(e=>!e.picture);for(let t=0;t<a.length;t+=10){let i=a.slice(t,t+10);await d(e,i).catch(e=>{if(!(e instanceof l&&400===e.status))throw e;n.unshift(...i)})}for(let t of n){let a=new FormData;a.set("chat_id",e),a.set("document",new Blob([t.bytes]),t.name),await r("sendDocument",a)}}}}])},312485,e=>e.a(async(t,a)=>{try{var n=e.i(666680),i=e.i(912714),s=e.i(232347),l=e.i(333925),r=e.i(986507),o=e.i(636608),c=e.i(450220),d=e.i(49002),h=e.i(811592),u=e.i(5509),f=e.i(724185),p=e.i(822931),m=e.i(520401),w=e.i(181300),y=e.i(293822),g=e.i(375814),$=e.i(871096),k=e.i(317613),b=e.i(900533),_=e.i(938281),v=e.i(212389),E=e.i(417043),S=e.i(775247),x=e.i(854455),A=e.i(719041),C=e.i(850668),I=e.i(735186),R=e.i(480791),T=e.i(644301),P=t([r,d,h,u,f,m,w,k,A]);[r,d,h,u,f,m,w,k,A]=P.then?(await P)():P;let el={telegram:e=>(0,T.createTelegram)(e),discord:e=>(0,x.createDiscord)(e),slack:(e,t)=>(0,R.createSlack)(e,t),email:(e,t,a,n)=>(0,A.createEmail)(e,t,a,n)},er=globalThis,eo=er.__reach??={live:new Map,last:null,told:new Map,choices:new Map,listening:null,gone:null,looking:null,idle:null},ec=()=>s.appEvents.emit({type:"reach"});async function O(e){return await eo.live.get(e)?.settled,L(e)}async function L(e){let t=await (0,f.readConfig)((0,I.reachPersonKey)(e));if(!t)return null;try{let e=JSON.parse(t);return"string"==typeof e.chat&&"string"==typeof e.name?{chat:e.chat,name:e.name,bot:"string"==typeof e.bot?e.bot:null}:null}catch{return null}}let ed=(e,t)=>(0,f.writeConfig)((0,I.reachPersonKey)(e),JSON.stringify(t));async function M(e){for(let t of e?[e]:I.REACH_CHANNELS){let a=eo.live.get(t);if(a?.stop.abort(),eo.live.delete(t),e&&a?.line&&await (0,m.endCall)(a.line.callId).catch(()=>{}),(await Promise.all(I.REACH_KEYS[t].map(f.configState))).includes("unreadable"))continue;let n=await Promise.all(I.REACH_KEYS[t].map(f.readConfig));if(!n.every(e=>!!e)){e&&await (0,f.removeConfig)((0,I.reachPersonKey)(t));continue}let i=e&&a?.id?await L(t):null;i&&null===i.bot&&a?.id&&await ed(t,{...i,bot:a.id});let s={name:t,channel:el[t](...n),stop:new AbortController,bot:null,link:null,problem:null,holding:null,refused:null,id:null,adopt:!e,settled:Promise.resolve(),asking:null,held:[],line:null,calls:new Set,busy:!1,notes:[]};eo.live.set(t,s),H(s)}eo.live.size&&(eo.listening??=s.appEvents.subscribe(e=>{"threads"===e.type&&Z()}),eo.gone??=s.presence.onGone(ea),Z(),eo.idle??=setInterval(()=>{q().catch(e=>_.logger.error("reach: idle lines",e))},l.REACH.idleMs).unref()),ec()}async function H(e){let{signal:t}=e.stop,a=t=>{e.problem!==t&&(e.problem=t,ec())};for(;!t.aborted;){try{await e.channel.listen({ready:(t,a,n)=>{e.bot=t,e.link=a,e.problem=null,e.holding=null,e.id=n,e.settled=N(e,n).catch(t=>_.logger.error(`reach ${e.name}: who is let in`,t)),ec()},incoming:t=>void D(e,t).catch(t=>_.logger.error(`reach ${e.name}: what arrived`,t)),holding:t=>{e.holding!==t&&(e.holding=t,ec())},wanted:async t=>!e.channel.named||(await O(e.name))?.chat===t},t)}catch(i){if(t.aborted)return;let n=i instanceof Error?i.message:String(i);if(i instanceof E.ChannelRefusal){_.logger.warn(`reach ${e.name}: ${n}`);let t=I.REACH_KEYS[e.name];return e.refused=t[i.token]??t[0],e.problem=n,ec()}a(n)}await new Promise(e=>setTimeout(e,l.REACH.retryMs))}}async function N(e,t){let a=await L(e.name);if(a&&a.bot!==t){if(null===a.bot&&e.adopt)return ed(e.name,{...a,bot:t});await (0,f.removeConfig)((0,I.reachPersonKey)(e.name)),ec()}}async function D(e,t){let a=await O(e.name);if("message"===t.kind&&void 0!==t.unproven){a?.chat===t.chat&&await e.channel.say(t.chat,{plain:t.unproven});return}if("press"===t.kind){if(a?.chat!==t.chat)return;return es(e,a,t.data,t.under)}return a?.chat===t.chat?j(e,a,t):e.channel.named?void 0:a?e.channel.say(t.chat,{plain:"This Thursday already answers someone else."}):B(e,t)}async function B(e,t){if(e.asking&&e.asking.chat!==t.chat)return e.channel.say(t.chat,{plain:"Someone else is already waiting to be let in here. If that is not you, press Not them on the computer, then write again."});e.held.length<l.REACH.held&&e.held.push(t),e.asking||(e.asking={chat:t.chat,name:t.name,handle:t.handle,said:t.words,code:(0,n.randomInt)(10**l.REACH.codeDigits).toString().padStart(l.REACH.codeDigits,"0")},ec(),await e.channel.say(t.chat,{plain:`Almost there. Thursday is asking on your computer whether to let you in. Press Allow there only if it shows ${e.asking.code}, and she answers what you wrote.`}))}async function j(e,t,a){var n,i,s;let l=await F(e,a);l&&(n=e,i=t,s=l,n.busy?n.notes.push({text:s.words,said:!0,pictures:s.pictures}):(n.busy=!0,(async()=>{try{for(let e=s;null!==e;){await K(n,i,e);let t=n.notes.filter(e=>e.said);n.notes=n.notes.filter(e=>!e.said),e=t.length?{words:t.map(e=>e.text).join("\n"),pictures:t.flatMap(e=>e.pictures??[])}:null}}finally{n.busy=!1}})()))}async function F(e,t){let{channel:a}=e;eo.last=e.name;let{kept:n,lost:i}=await z(e,t.files);i.length&&await a.say(t.chat,{plain:i.map(({name:e,why:t})=>`${e} did not come through: ${t}.`).join("\n")}).catch(t=>_.logger.warn(`reach ${e.name}: could not say so`,t));let s=[t.words,...n].filter(Boolean).join("\n");return s?(i.length&&e.notes.push({text:`[Sent from their phone with what follows, and lost on the way: ${i.map(({name:e,why:t})=>`${e} (${t})`).join("; ")}. They have been told.]`,said:!1}),{words:s,pictures:n.filter(g.isPicture)}):(t.unreadable&&!i.length&&await a.say(t.chat,{plain:"I can read words, pictures and files here — not voice or video yet. Write it instead."}),null)}async function z(e,t){let a=Math.min(e.channel.limits.take,l.REACH.fileBytes),n=[],i=t.filter(t=>!t.size||t.size<=a||(n.push({name:t.name,why:`it is ${eu(t.size)}, and the most taken from ${I.REACH_LABEL[e.name]} is ${eu(a)}`}),!1)),s=await Promise.allSettled(i.map(e=>e.fetch())),r=[];for(let[e,t]of s.entries())"fulfilled"===t.status?r.push(t.value):n.push({name:i[e].name,why:eh(t.reason)});if(!r.length)return{kept:[],lost:n};try{return{kept:await (0,k.keepGivenFiles)(r),lost:n}}catch(t){let e=eh(t);return{kept:[],lost:[...n,...r.map(t=>({name:t.name,why:e}))]}}}let eh=e=>e instanceof Error?e.message:String(e),eu=e=>`${Math.ceil(e/1048576)} MB`;async function q(){for(let e of eo.live.values())e.line&&!e.busy&&await W(e.line)&&await G(e)}async function W(e){return!(Date.now()-e.lastAt<=l.REACH.idleMs)&&!(await (0,u.listCallJobs)([e.callId])).some(e=>"running"===e.status)}async function G(e){let t=e.line;e.line=null,t&&await (0,m.endCall)(t.callId).catch(()=>{})}async function K(e,t,{words:a,pictures:n}){let{channel:i}=e;i.typing(t.chat).catch(()=>{});let s=setInterval(()=>void i.typing(t.chat).catch(()=>{}),4e3),o=e.notes.filter(e=>!e.said);e.notes=e.notes.filter(e=>e.said);let d=new AbortController;e.turn=d;let h=()=>d.signal.aborted||e.stop.signal.aborted;try{let s=e.line;(!s||!await (0,m.isCallOpen)(s.callId)||await W(s))&&(await G(e),e.line={...await (0,w.openTextCall)(),messages:[],lastAt:0},e.calls.add(e.line.callId));let r=e.line,u=await (0,w.answerInWriting)({callId:r.callId,standing:r.standing,messages:[...r.messages,...o.map(e=>({role:"user",content:e.text})),{role:"user",content:a}],said:a,pictures:n,notes:()=>e.notes.splice(0),signal:AbortSignal.any([d.signal,e.stop.signal])});if(h())return;r.messages=function(e){let t=Math.max(e.findLastIndex(e=>"user"===e.role),0),a=e.findIndex((e,a)=>a<t&&("tool"===e.role||"assistant"===e.role&&"string"!=typeof e.content)),n=a<0?t:a,i=[...e.slice(0,n),...(0,c.asWords)(e.slice(n,t),(e,t)=>(0,y.toolLine)(e,JSON.stringify(t??{}))??e,e=>e.length>l.REACH.oldChars?`${e.slice(0,l.REACH.oldChars)}…`:e),...e.slice(t)];if(i.length<=l.REACH.messages)return i;let s=i.findIndex((e,t)=>t>=i.length-l.REACH.trimTo&&"user"===e.role);return s>0?i.slice(s):i}(u.messages),r.lastAt=Date.now(),u.moved&&!r.moved&&(r.moved=!0,await i.say(t.chat,{plain:u.moved}));let f=[...new Set(u.did)].join(" · "),p={markdown:u.text?.trim()||(f?`— ${(0,S.literal)(f)}`:"…")};i.attaches?await U(e,t,p,u.text):(await i.say(t.chat,p),await J(e,t,u.text))}catch(n){if(h())return;e.notes.unshift(...o),e.line&&!e.line.lastAt&&await G(e);let a=(0,v.isPublicError)(n)?n.message:(0,r.modelErrorToString)(n);_.logger.warn(`reach ${e.name}: ${a}`),await i.say(t.chat,{plain:a}).catch(()=>{})}finally{clearInterval(s),e.turn===d&&(e.turn=null)}}async function J(e,t,a){let{named:n,left:i}=await Y(a);for(let a of n)try{let n=await V(e,a);if(!n)continue;n.files.length&&await e.channel.sendFiles(t.chat,n.files),n.left&&i.push(n.left)}catch(t){_.logger.warn(`reach ${e.name}: could not send ${a}`,t),i.push({name:a,why:eh(t)})}i.length&&(await e.channel.say(t.chat,{plain:ef(i)}).catch(t=>_.logger.warn(`reach ${e.name}: could not say so`,t)),Q(e,i))}async function U(e,t,a,n,i){let{named:s,left:r}=await Y(n),o=Math.min(e.channel.limits.file,l.REACH.fileBytes),c=[],d=[],h=0;for(let t of s)try{let a=await V(e,t);if(!a)continue;let n=a.files.reduce((e,t)=>e+t.bytes.length,0);if(n&&h+n>o){r.push({name:t,why:`with the files before it, it passes the ${eu(o)} one ${I.REACH_LABEL[e.name]} message takes`});continue}n&&d.push(t),c.push(...a.files),h+=n,a.left&&r.push(a.left)}catch(a){_.logger.warn(`reach ${e.name}: could not send ${t}`,a),r.push({name:t,why:eh(a)})}let u=e=>e.length?"plain"in a?{plain:`${a.plain}
5
+ → ${a}`,entities:t.keep,link_preview_options:{is_disabled:!0}}).catch(()=>{})},async sendFiles(e,t){let a=t.filter(e=>e.picture),n=t.filter(e=>!e.picture);for(let t=0;t<a.length;t+=10){let i=a.slice(t,t+10);await d(e,i).catch(e=>{if(!(e instanceof l&&400===e.status))throw e;n.unshift(...i)})}for(let t of n){let a=new FormData;a.set("chat_id",e),a.set("document",new Blob([t.bytes]),t.name),await r("sendDocument",a)}}}}])},312485,e=>e.a(async(t,a)=>{try{var n=e.i(666680),i=e.i(912714),s=e.i(734732),l=e.i(232347),r=e.i(333925),o=e.i(986507),c=e.i(636608),d=e.i(450220),h=e.i(49002),u=e.i(811592),f=e.i(5509),p=e.i(724185),m=e.i(822931),w=e.i(520401),y=e.i(181300),g=e.i(293822),$=e.i(375814),k=e.i(871096),b=e.i(317613),_=e.i(900533),v=e.i(938281),E=e.i(212389),S=e.i(417043),A=e.i(775247),x=e.i(854455),C=e.i(719041),R=e.i(850668),I=e.i(735186),T=e.i(480791),P=e.i(644301),O=t([o,h,u,f,p,w,y,k,b,C,R]);[o,h,u,f,p,w,y,k,b,C,R]=O.then?(await O)():O;let eo={telegram:e=>(0,P.createTelegram)(e),discord:e=>(0,x.createDiscord)(e),slack:(e,t)=>(0,T.createSlack)(e,t),email:(e,t,a,n)=>(0,C.createEmail)(e,t,a,n)},ec=globalThis,ed=ec.__reach??={live:new Map,last:null,told:new Map,choices:new Map,listening:null,gone:null,looking:null,idle:null},eh=()=>l.appEvents.emit({type:"reach"});async function L(e){return await ed.live.get(e)?.settled,M(e)}async function M(e){let t=await (0,p.readConfig)((0,I.reachPersonKey)(e));if(!t)return null;try{let e=JSON.parse(t);return"string"==typeof e.chat&&"string"==typeof e.name?{chat:e.chat,name:e.name,bot:"string"==typeof e.bot?e.bot:null}:null}catch{return null}}let eu=(e,t)=>(0,p.writeConfig)((0,I.reachPersonKey)(e),JSON.stringify(t));async function H(e){for(let t of e?[e]:I.REACH_CHANNELS){let a=ed.live.get(t);if(a?.stop.abort(),ed.live.delete(t),e&&a?.line&&await (0,w.endCall)(a.line.callId).catch(()=>{}),(await Promise.all(I.REACH_KEYS[t].map(p.configState))).includes("unreadable"))continue;let n=await Promise.all(I.REACH_KEYS[t].map(p.readConfig));if(!n.every(e=>!!e)){e&&await (0,p.removeConfig)((0,I.reachPersonKey)(t));continue}let i=e&&a?.id?await M(t):null;i&&null===i.bot&&a?.id&&await eu(t,{...i,bot:a.id});let s={name:t,channel:eo[t](...n),stop:new AbortController,bot:null,link:null,problem:null,holding:null,refused:null,id:null,adopt:!e,settled:Promise.resolve(),asking:null,held:[],line:null,calls:new Set,busy:!1,notes:[]};ed.live.set(t,s),N(s)}ed.live.size&&(ed.listening??=l.appEvents.subscribe(e=>{"threads"===e.type&&et()}),ed.gone??=l.presence.onGone(ei),et(),ed.idle??=setInterval(()=>{G().catch(e=>v.logger.error("reach: idle lines",e))},r.REACH.idleMs).unref()),eh()}async function N(e){let{signal:t}=e.stop,a=t=>{e.problem!==t&&(e.problem=t,eh())};for(;!t.aborted;){try{await e.channel.listen({ready:(t,a,n)=>{e.bot=t,e.link=a,e.problem=null,e.holding=null,e.id=n,e.settled=z(e,n).catch(t=>v.logger.error(`reach ${e.name}: who is let in`,t)),eh()},incoming:t=>void B(e,t).catch(t=>v.logger.error(`reach ${e.name}: what arrived`,t)),holding:t=>{e.holding!==t&&(e.holding=t,eh())},wanted:async t=>!e.channel.named||(await L(e.name))?.chat===t},t)}catch(i){if(t.aborted)return;let n=i instanceof Error?i.message:String(i);if(i instanceof S.ChannelRefusal){v.logger.warn(`reach ${e.name}: ${n}`);let t=I.REACH_KEYS[e.name];return e.refused=t[i.token]??t[0],e.problem=n,eh()}a(n)}await new Promise(e=>setTimeout(e,r.REACH.retryMs))}}async function z(e,t){let a=await M(e.name);if(a&&a.bot!==t){if(null===a.bot&&e.adopt)return eu(e.name,{...a,bot:t});await (0,p.removeConfig)((0,I.reachPersonKey)(e.name)),eh()}}async function B(e,t){let a=await L(e.name);if("message"===t.kind&&void 0!==t.unproven){a?.chat===t.chat&&await e.channel.say(t.chat,{plain:t.unproven});return}if("press"===t.kind){if(a?.chat!==t.chat)return;return er(e,a,t.data,t.under)}return a?.chat===t.chat?j(e,a,t):e.channel.named?void 0:a?e.channel.say(t.chat,{plain:"This Thursday already answers someone else."}):D(e,t)}async function D(e,t){if(e.asking&&e.asking.chat!==t.chat)return e.channel.say(t.chat,{plain:"Someone else is already waiting to be let in here. If that is not you, press Not them on the computer, then write again."});e.held.length<r.REACH.held&&e.held.push(t),e.asking||(e.asking={chat:t.chat,name:t.name,handle:t.handle,said:t.words,code:(0,n.randomInt)(10**r.REACH.codeDigits).toString().padStart(r.REACH.codeDigits,"0")},eh(),await e.channel.say(t.chat,{plain:`Almost there. Thursday is asking on your computer whether to let you in. Press Allow there only if it shows ${e.asking.code}, and she answers what you wrote.`}))}async function j(e,t,a){var n,i,s;let l=await F(e,a);l&&(n=e,i=t,s=l,n.busy?n.notes.push({text:s.words,said:!0,pictures:s.pictures}):(n.busy=!0,(async()=>{try{for(let e=s;null!==e;){await J(n,i,e);let t=n.notes.filter(e=>e.said);n.notes=n.notes.filter(e=>!e.said),e=t.length?{words:t.map(e=>e.text).join("\n"),pictures:t.flatMap(e=>e.pictures??[])}:null}}finally{n.busy=!1}})()))}async function F(e,t){let{channel:a}=e;ed.last=e.name;let{kept:n,lost:i}=await W(e,t.files),s=t.voice?await q(e,t.voice):null;s&&"why"in s&&i.push({name:"Your voice message",why:s.why}),i.length&&await a.say(t.chat,{plain:i.map(({name:e,why:t})=>`${e} did not come through: ${t}.`).join("\n")}).catch(t=>v.logger.warn(`reach ${e.name}: could not say so`,t));let l=s&&"words"in s?`[A voice message, as a transcription model heard it:] ${s.words}`:"",r=[t.words,l,...n].filter(Boolean).join("\n");return r?(i.length&&e.notes.push({text:`[Sent from their phone with what follows, and lost on the way: ${i.map(({name:e,why:t})=>`${e} (${t})`).join("; ")}. They have been told.]`,said:!1}),{words:r,pictures:n.filter($.isPicture)}):(t.unreadable&&!i.length&&await a.say(t.chat,{plain:"I can read words, voice messages, pictures and files here — not video yet. Write it instead."}),null)}async function q(e,t){let a=await (0,o.resolveMediaRef)("transcription");if(!a)return{why:"voice messages are read once a transcription model is picked in Settings › Models"};let n=Math.min(e.channel.limits.take,r.REACH.fileBytes);if(t.size&&t.size>n)return{why:`it is ${ep(t.size)}, and the most taken from ${I.REACH_LABEL[e.name]} is ${ep(n)}`};try{let e=new Uint8Array(await (await t.fetch()).arrayBuffer()),{text:n}=await (0,s.transcribe)({model:(0,o.buildTranscriptionModel)(a.ref,a.apiKey),audio:e});return n.trim()?{words:n.trim()}:{why:"the transcription model heard no words in it"}}catch(e){return{why:(0,o.modelErrorToString)(e)}}}async function W(e,t){let a=Math.min(e.channel.limits.take,r.REACH.fileBytes),n=[],i=t.filter(t=>!t.size||t.size<=a||(n.push({name:t.name,why:`it is ${ep(t.size)}, and the most taken from ${I.REACH_LABEL[e.name]} is ${ep(a)}`}),!1)),s=await Promise.allSettled(i.map(e=>e.fetch())),l=[];for(let[e,t]of s.entries())"fulfilled"===t.status?l.push(t.value):n.push({name:i[e].name,why:ef(t.reason)});if(!l.length)return{kept:[],lost:n};try{return{kept:await (0,b.keepGivenFiles)(l),lost:n}}catch(t){let e=ef(t);return{kept:[],lost:[...n,...l.map(t=>({name:t.name,why:e}))]}}}let ef=e=>e instanceof Error?e.message:String(e),ep=e=>`${Math.ceil(e/1048576)} MB`;async function G(){for(let e of ed.live.values())e.line&&!e.busy&&await K(e.line)&&await U(e)}async function K(e){return!(Date.now()-e.lastAt<=r.REACH.idleMs)&&!(await (0,f.listCallJobs)([e.callId])).some(e=>"running"===e.status)}async function U(e){let t=e.line;e.line=null,t&&await (0,w.endCall)(t.callId).catch(()=>{})}async function J(e,t,{words:a,pictures:n}){let{channel:i}=e;i.typing(t.chat).catch(()=>{});let s=setInterval(()=>void i.typing(t.chat).catch(()=>{}),4e3),l=e.notes.filter(e=>!e.said);e.notes=e.notes.filter(e=>e.said);let c=new AbortController;e.turn=c;let h=()=>c.signal.aborted||e.stop.signal.aborted;try{let s=e.line;(!s||!await (0,w.isCallOpen)(s.callId)||await K(s))&&(await U(e),e.line={...await (0,y.openTextCall)(),messages:[],lastAt:0},e.calls.add(e.line.callId));let o=e.line,u=await (0,y.answerInWriting)({callId:o.callId,standing:o.standing,messages:[...o.messages,...l.map(e=>({role:"user",content:e.text})),{role:"user",content:a}],said:a,pictures:n,notes:()=>e.notes.splice(0),signal:AbortSignal.any([c.signal,e.stop.signal])});if(h())return;o.messages=function(e){let t=Math.max(e.findLastIndex(e=>"user"===e.role),0),a=e.findIndex((e,a)=>a<t&&("tool"===e.role||"assistant"===e.role&&"string"!=typeof e.content)),n=a<0?t:a,i=[...e.slice(0,n),...(0,d.asWords)(e.slice(n,t),(e,t)=>(0,g.toolLine)(e,JSON.stringify(t??{}))??e,e=>e.length>r.REACH.oldChars?`${e.slice(0,r.REACH.oldChars)}…`:e),...e.slice(t)];if(i.length<=r.REACH.messages)return i;let s=i.findIndex((e,t)=>t>=i.length-r.REACH.trimTo&&"user"===e.role);return s>0?i.slice(s):i}(u.messages),o.lastAt=Date.now(),u.moved&&!o.moved&&(o.moved=!0,await i.say(t.chat,{plain:u.moved}));let f=[...new Set(u.did)].join(" · "),p={markdown:u.text?.trim()||(f?`— ${(0,A.literal)(f)}`:"…")};i.attaches?await V(e,t,p,u.text):(await i.say(t.chat,p),await Y(e,t,u.text))}catch(n){if(h())return;e.notes.unshift(...l),e.line&&!e.line.lastAt&&await U(e);let a=(0,E.isPublicError)(n)?n.message:(0,o.modelErrorToString)(n);v.logger.warn(`reach ${e.name}: ${a}`),await i.say(t.chat,{plain:a}).catch(()=>{})}finally{clearInterval(s),e.turn===c&&(e.turn=null)}}async function Y(e,t,a){let{named:n,left:i}=await Q(a);for(let a of n)try{let n=await X(e,a);if(!n)continue;n.files.length&&await e.channel.sendFiles(t.chat,n.files),n.left&&i.push(n.left)}catch(t){v.logger.warn(`reach ${e.name}: could not send ${a}`,t),i.push({name:a,why:ef(t)})}i.length&&(await e.channel.say(t.chat,{plain:em(i)}).catch(t=>v.logger.warn(`reach ${e.name}: could not say so`,t)),Z(e,i))}async function V(e,t,a,n,i){let{named:s,left:l}=await Q(n),o=Math.min(e.channel.limits.file,r.REACH.fileBytes),c=[],d=[],h=0;for(let t of s)try{let a=await X(e,t);if(!a)continue;let n=a.files.reduce((e,t)=>e+t.bytes.length,0);if(n&&h+n>o){l.push({name:t,why:`with the files before it, it passes the ${ep(o)} one ${I.REACH_LABEL[e.name]} message takes`});continue}n&&d.push(t),c.push(...a.files),h+=n,a.left&&l.push(a.left)}catch(a){v.logger.warn(`reach ${e.name}: could not send ${t}`,a),l.push({name:t,why:ef(a)})}let u=e=>e.length?"plain"in a?{plain:`${a.plain}
6
6
 
7
- ${ef(e)}`}:{markdown:`${a.markdown}
7
+ ${em(e)}`}:{markdown:`${a.markdown}
8
8
 
9
- ${(0,S.literal)(ef(e))}`}:a;try{await e.channel.say(t.chat,u(r),i,c)}catch(a){if(!c.length)throw a;_.logger.warn(`reach ${e.name}: could not send with its files`,a),r.push(...d.map(e=>({name:e,why:eh(a)}))),await e.channel.say(t.chat,u(r),i)}r.length&&Q(e,r)}async function Y(e){let t=await (0,$.filesOnDisk)((0,g.pathsIn)(e),null);return{named:t.slice(-l.REACH.files),left:t.slice(0,Math.max(t.length-l.REACH.files,0)).map(e=>({name:e,why:`only ${l.REACH.files} files go with one answer`}))}}async function V(e,t){let a=await (0,$.insideWorkspace)(t),n=a?await (0,i.stat)(a).catch(()=>null):null;if(!a||!n)return null;let{limits:s}=e.channel,r=Math.min(s.file,l.REACH.fileBytes),o=I.REACH_LABEL[e.name],c=await (0,C.picturesOf)(a);if(c.length){let n=await (0,C.pdfOf)(a),i=n&&n.bytes.length<=r,s=e.channel.attaches?"sent as pictures":"sent as pictures above";return{files:i?[...c,n]:c,left:i?null:{name:t,why:n?`${s}; as a PDF it is ${eu(n.bytes.length)}, and the most that goes to ${o} is ${eu(r)}`:`${s}; the page itself opens on the computer`}}}return n.size>r?{files:[],left:{name:t,why:`it is ${eu(n.size)}, and the most that goes to ${o} is ${eu(r)}`}}:{files:[{bytes:await (0,i.readFile)(a),name:t.split("/").pop()??"file",picture:"image"===(0,g.viewKindOf)(t)&&n.size<=s.picture}],left:null}}let ef=e=>["Not sent — still on this computer:",...e.map(({name:e,why:t})=>`• ${e}: ${t}`)].join("\n");function Q(e,t){e.notes.push({text:`[Named in what went to their phone, and not sent: ${t.map(({name:e,why:t})=>`${e} (${t})`).join("; ")}. They have been told.]`,said:!1})}async function X(){for(let e of[...eo.last?[eo.last]:[],...I.REACH_CHANNELS.filter(e=>e!==eo.last)]){let t=eo.live.get(e),a=t?await O(e):null;if(t&&a)return{live:t,person:a}}return null}let ep=Date.now()-1e3*process.uptime();function Z(e=l.REACH.lookMs){eo.looking??=setTimeout(()=>{eo.looking=null,ee().catch(e=>_.logger.error("reach: open work",e))},e)}async function ee(){if(eo.inLook){eo.lookAgain=!0;return}eo.inLook=!0;try{do eo.lookAgain=!1,await et();while(eo.lookAgain)}finally{eo.inLook=!1}}async function et(){let e=ep+l.BROWSER_GONE_MS-Date.now();if(e>0)return Z(e);let t=await X();if(!t)return;let a=await (0,u.listInboxThreads)(),n=(0,p.openWork)(a).filter(e=>"progress"!==e.kind),i=new Set(n.map(e=>e.key));for(let e of eo.told.keys())i.has(e)||eo.told.delete(e);for(let[e,t]of eo.choices)i.has((0,p.questionKey)(t.question))||eo.choices.delete(e);let r=n.filter(e=>!eo.told.has(e.key));if(!r.length)return;let o=await en();for(let e of r){let n=a.find(t=>t.id===e.threadId);if(!n)continue;let i=o.get(e.threadId),l=i?await O(i.name):null,r=i&&l?{live:i,person:l}:!s.presence.watching&&(0,b.toDate)(n.updatedAt).getTime()>=ep?t:null;eo.told.set(e.key,{kind:e.kind,phone:!!r}),r&&await ei(r,e,n)}}function ea(){for(let[e,t]of eo.told)"question"!==t.kind||t.phone||eo.told.delete(e);Z(0)}async function en(){let e=[...eo.live.values()],t=await (0,u.listCallJobs)(e.flatMap(e=>[...e.calls]));return new Map(t.flatMap(t=>{let a=e.find(e=>e.calls.has(t.callId??""));return a?[[t.id,a]]:[]}))}async function ei(e,t,a){let{live:n,person:i}=e,s=a.room.questions.find(e=>(0,p.questionKey)(e.id)===t.key),l=(s?.options??[]).map((e,t)=>{let n=`${s?.id.slice(0,40)}:${t}`;return eo.choices.set(n,{threadId:a.id,bot:s?.bot??"",question:s?.id??"",answer:e}),{text:e,data:n}}),r={markdown:`${(0,S.literal)(`${t.show.line} \xb7 ${t.show.name}`)}
9
+ ${(0,A.literal)(em(e))}`}:a;try{await e.channel.say(t.chat,u(l),i,c)}catch(a){if(!c.length)throw a;v.logger.warn(`reach ${e.name}: could not send with its files`,a),l.push(...d.map(e=>({name:e,why:ef(a)}))),await e.channel.say(t.chat,u(l),i)}l.length&&Z(e,l)}async function Q(e){let t=await (0,k.filesOnDisk)((0,$.pathsIn)(e),null);return{named:t.slice(-r.REACH.files),left:t.slice(0,Math.max(t.length-r.REACH.files,0)).map(e=>({name:e,why:`only ${r.REACH.files} files go with one answer`}))}}async function X(e,t){let a=await (0,k.insideWorkspace)(t),n=a?await (0,i.stat)(a).catch(()=>null):null;if(!a||!n)return null;let{limits:s}=e.channel,l=Math.min(s.file,r.REACH.fileBytes),o=I.REACH_LABEL[e.name],c=await (0,R.picturesOf)(a);if(c.length){let n=await (0,R.pdfOf)(a),i=n&&n.bytes.length<=l,s=e.channel.attaches?"sent as pictures":"sent as pictures above";return{files:i?[...c,n]:c,left:i?null:{name:t,why:n?`${s}; as a PDF it is ${ep(n.bytes.length)}, and the most that goes to ${o} is ${ep(l)}`:`${s}; the page itself opens on the computer`}}}return n.size>l?{files:[],left:{name:t,why:`it is ${ep(n.size)}, and the most that goes to ${o} is ${ep(l)}`}}:{files:[{bytes:await (0,i.readFile)(a),name:t.split("/").pop()??"file",picture:"image"===(0,$.viewKindOf)(t)&&n.size<=s.picture}],left:null}}let em=e=>["Not sent — still on this computer:",...e.map(({name:e,why:t})=>`• ${e}: ${t}`)].join("\n");function Z(e,t){e.notes.push({text:`[Named in what went to their phone, and not sent: ${t.map(({name:e,why:t})=>`${e} (${t})`).join("; ")}. They have been told.]`,said:!1})}async function ee(){for(let e of[...ed.last?[ed.last]:[],...I.REACH_CHANNELS.filter(e=>e!==ed.last)]){let t=ed.live.get(e),a=t?await L(e):null;if(t&&a)return{live:t,person:a}}return null}let ew=Date.now()-1e3*process.uptime();function et(e=r.REACH.lookMs){ed.looking??=setTimeout(()=>{ed.looking=null,ea().catch(e=>v.logger.error("reach: open work",e))},e)}async function ea(){if(ed.inLook){ed.lookAgain=!0;return}ed.inLook=!0;try{do ed.lookAgain=!1,await en();while(ed.lookAgain)}finally{ed.inLook=!1}}async function en(){let e=ew+r.BROWSER_GONE_MS-Date.now();if(e>0)return et(e);let t=await ee();if(!t)return;let a=await (0,f.listInboxThreads)(),n=(0,m.openWork)(a).filter(e=>"progress"!==e.kind),i=new Set(n.map(e=>e.key));for(let e of ed.told.keys())i.has(e)||ed.told.delete(e);for(let[e,t]of ed.choices)i.has((0,m.questionKey)(t.question))||ed.choices.delete(e);let s=n.filter(e=>!ed.told.has(e.key));if(!s.length)return;let o=await es();for(let e of s){let n=a.find(t=>t.id===e.threadId);if(!n)continue;let i=o.get(e.threadId),s=i?await L(i.name):null,r=i&&s?{live:i,person:s}:!l.presence.watching&&(0,_.toDate)(n.updatedAt).getTime()>=ew?t:null;ed.told.set(e.key,{kind:e.kind,phone:!!r}),r&&await el(r,e,n)}}function ei(){for(let[e,t]of ed.told)"question"!==t.kind||t.phone||ed.told.delete(e);et(0)}async function es(){let e=[...ed.live.values()],t=await (0,f.listCallJobs)(e.flatMap(e=>[...e.calls]));return new Map(t.flatMap(t=>{let a=e.find(e=>e.calls.has(t.callId??""));return a?[[t.id,a]]:[]}))}async function el(e,t,a){let{live:n,person:i}=e,s=a.room.questions.find(e=>(0,m.questionKey)(e.id)===t.key),l=(s?.options??[]).map((e,t)=>{let n=`${s?.id.slice(0,40)}:${t}`;return ed.choices.set(n,{threadId:a.id,bot:s?.bot??"",question:s?.id??"",answer:e}),{text:e,data:n}}),r={markdown:`${(0,A.literal)(`${t.show.line} \xb7 ${t.show.name}`)}
10
10
 
11
- ${t.text||"…"}`};try{n.channel.attaches?await U(n,i,r,t.text,l):await n.channel.say(i.chat,r,l)}catch(e){_.logger.warn(`reach ${n.name}: could not tell ${t.key}`,e),eo.told.delete(t.key);return}n.channel.attaches||await J(n,i,t.text),n.notes.push({text:`${t.line}
12
- [The user has had this on their phone, as ${t.show.bot} wrote it, since ${(0,o.clockNow)()}.]`,said:!1}),"ending"===t.kind?await (0,u.markSeen)([t.threadId]):await (0,h.acceptRoomRelays)(t.relayIds)}async function es(e,t,a,n){let i=eo.choices.get(a);if(!i)return void await e.channel.say(t.chat,{plain:"That question is no longer open here. Write your answer instead."});for(let[e,t]of eo.choices)t.question===i.question&&eo.choices.delete(e);try{await (0,d.answerThread)(i.threadId,i.answer,"user",i.bot,i.question||void 0),n&&await e.channel.settle(t.chat,n,i.answer),e.notes.push({text:`[The user answered ${i.bot}'s question from their phone at ${(0,o.clockNow)()}: ${i.answer}. It has reached ${i.bot}.]`,said:!1})}catch(a){await e.channel.say(t.chat,{plain:(0,v.isPublicError)(a)?a.message:"That answer did not get through."})}}e.s(["heldCalls",0,()=>[...eo.live.values()].flatMap(e=>e.line?[e.line.callId]:[]),"startReach",0,M]),a()}catch(e){a(e)}},!1),903438,e=>{"use strict";e.s(["runSocket",0,function(e,t,a){return new Promise((n,i)=>{let s=new WebSocket(e),l=e=>{s.readyState===WebSocket.OPEN&&s.send(JSON.stringify(e))},r=!1,o=e=>{r||(r=!0,a.removeEventListener("abort",d),n(e))},c=(e,t)=>{o({code:e,reason:t}),s.close(e,t)},d=()=>c(1e3,"");a.addEventListener("abort",d,{once:!0}),s.addEventListener("message",e=>{try{t.message(JSON.parse(String(e.data)),l,c)}catch{}}),s.addEventListener("error",()=>{s.readyState===WebSocket.OPEN||r||(r=!0,a.removeEventListener("abort",d),i(Error(`Could not connect to ${new URL(e).host}`)))}),s.addEventListener("close",e=>o({code:e.code,reason:e.reason}))})}])},854455,e=>{"use strict";var t=e.i(417043),a=e.i(775247),n=e.i(903438);let i="https://discord.com/api/v10",s={4004:"Discord did not take the bot token: it was reset or mistyped. Reset it on the application's Bot page and paste the new one here.",4013:"Discord refused the intents this bot asked for.",4014:"Discord refused an intent this bot is not allowed — check the bot's page."};e.s(["createDiscord",0,function(e){async function l(a,n,s){let l=s instanceof FormData;for(let r=0;;r++){let o=await fetch(`${i}${n}`,{method:a,headers:{authorization:`Bot ${e}`,...l||!s?{}:{"content-type":"application/json"}},body:l?s:s?JSON.stringify(s):void 0}).catch(e=>{throw Error(`Could not reach ${new URL(i).host}`,{cause:e})});if(o.ok)return 204===o.status?null:await o.json();let c=await o.json().catch(()=>null);if(429===o.status&&await (0,t.waitOut)(c?.retry_after,r))continue;let d=c?.message??`Discord answered ${o.status}`;throw 401===o.status?new t.ChannelRefusal(d):Error(d)}}let r=e=>{let t=e.length<=5?1:5,a=[];for(let n=0;n<e.length&&a.length<5;n+=t)a.push({type:1,components:e.slice(n,n+t).map(e=>({type:2,style:2,label:e.text.slice(0,80),custom_id:e.data}))});return a};return{limits:{take:1/0,file:0x1400000,picture:0x1400000},async listen(a,i){let r,o=null,c=!0;try{let d=await (0,n.runSocket)("wss://gateway.discord.gg/?v=10&encoding=json",{message(t,n,i){let{op:s,d,s:h,t:u}=t;if(null!==h&&(o=h),10===s){let t=d.heartbeat_interval;r=setInterval(()=>{if(!c)return i(4e3,"Discord stopped answering");c=!1,n({op:1,d:o})},t),n({op:2,d:{token:e,intents:4096,properties:{os:process.platform,browser:"thursday",device:"thursday"}}})}else if(1===s)n({op:1,d:o});else if(11===s)c=!0;else if(7===s||9===s)i(4e3,"Discord asked for a new connection");else if(0===s&&"READY"===u){let e;a.ready(d.user.username,(e=d.application?.id)?`https://discord.com/oauth2/authorize?client_id=${e}&scope=bot&permissions=0`:null,d.user.id)}else if(0===s&&u){var f,p;let e=(f=u,p=d,"MESSAGE_CREATE"===f?p.guild_id||p.author.bot?null:{kind:"message",chat:p.channel_id,name:p.author.global_name||p.author.username,handle:`@${p.author.username}`,words:p.content.trim(),files:(p.attachments??[]).map(e=>({name:e.filename,size:e.size,fetch:async()=>{let t=await fetch(e.url);if(!t.ok)throw Error(`Discord answered ${t.status} for the file`);return new File([await t.arrayBuffer()],e.filename,{type:e.content_type??""})}})),unreadable:!1}:"INTERACTION_CREATE"===f?3!==p.type||p.guild_id?null:(l("POST",`/interactions/${p.id}/${p.token}/callback`,{type:6}).catch(()=>{}),{kind:"press",chat:p.channel_id,data:p.data?.custom_id??"",under:p.message?{id:p.message.id,text:p.message.content}:null}):null);e&&a.incoming(e)}}},i),h=s[d.code];if(h)throw new t.ChannelRefusal(h);if(!i.aborted)throw Error(d.reason||`Discord closed the connection (${d.code})`)}finally{clearInterval(r)}},async say(e,t,n){let i=(0,a.chatPieces)(t,"discord",1900);for(let[t,a]of i.entries())await l("POST",`/channels/${e}/messages`,{content:a,flags:4,allowed_mentions:{parse:[]},...n?.length&&t===i.length-1?{components:r(n)}:{}})},async typing(e){await l("POST",`/channels/${e}/typing`).catch(()=>{})},async settle(e,t,n){let i=`
11
+ ${t.text||"…"}`};try{n.channel.attaches?await V(n,i,r,t.text,l):await n.channel.say(i.chat,r,l)}catch(e){v.logger.warn(`reach ${n.name}: could not tell ${t.key}`,e),ed.told.delete(t.key);return}n.channel.attaches||await Y(n,i,t.text),n.notes.push({text:`${t.line}
12
+ [The user has had this on their phone, as ${t.show.bot} wrote it, since ${(0,c.clockNow)()}.]`,said:!1}),"ending"===t.kind?await (0,f.markSeen)([t.threadId]):await (0,u.acceptRoomRelays)(t.relayIds)}async function er(e,t,a,n){let i=ed.choices.get(a);if(!i)return void await e.channel.say(t.chat,{plain:"That question is no longer open here. Write your answer instead."});for(let[e,t]of ed.choices)t.question===i.question&&ed.choices.delete(e);try{await (0,h.answerThread)(i.threadId,i.answer,"user",i.bot,i.question||void 0),n&&await e.channel.settle(t.chat,n,i.answer),e.notes.push({text:`[The user answered ${i.bot}'s question from their phone at ${(0,c.clockNow)()}: ${i.answer}. It has reached ${i.bot}.]`,said:!1})}catch(a){await e.channel.say(t.chat,{plain:(0,E.isPublicError)(a)?a.message:"That answer did not get through."})}}e.s(["heldCalls",0,()=>[...ed.live.values()].flatMap(e=>e.line?[e.line.callId]:[]),"startReach",0,H]),a()}catch(e){a(e)}},!1),903438,e=>{"use strict";e.s(["runSocket",0,function(e,t,a){return new Promise((n,i)=>{let s=new WebSocket(e),l=e=>{s.readyState===WebSocket.OPEN&&s.send(JSON.stringify(e))},r=!1,o=e=>{r||(r=!0,a.removeEventListener("abort",d),n(e))},c=(e,t)=>{o({code:e,reason:t}),s.close(e,t)},d=()=>c(1e3,"");a.addEventListener("abort",d,{once:!0}),s.addEventListener("message",e=>{try{t.message(JSON.parse(String(e.data)),l,c)}catch{}}),s.addEventListener("error",()=>{s.readyState===WebSocket.OPEN||r||(r=!0,a.removeEventListener("abort",d),i(Error(`Could not connect to ${new URL(e).host}`)))}),s.addEventListener("close",e=>o({code:e.code,reason:e.reason}))})}])},854455,e=>{"use strict";var t=e.i(417043),a=e.i(775247),n=e.i(903438);let i="https://discord.com/api/v10",s={4004:"Discord did not take the bot token: it was reset or mistyped. Reset it on the application's Bot page and paste the new one here.",4013:"Discord refused the intents this bot asked for.",4014:"Discord refused an intent this bot is not allowed — check the bot's page."};e.s(["createDiscord",0,function(e){async function l(a,n,s){let l=s instanceof FormData;for(let r=0;;r++){let o=await fetch(`${i}${n}`,{method:a,headers:{authorization:`Bot ${e}`,...l||!s?{}:{"content-type":"application/json"}},body:l?s:s?JSON.stringify(s):void 0}).catch(e=>{throw Error(`Could not reach ${new URL(i).host}`,{cause:e})});if(o.ok)return 204===o.status?null:await o.json();let c=await o.json().catch(()=>null);if(429===o.status&&await (0,t.waitOut)(c?.retry_after,r))continue;let d=c?.message??`Discord answered ${o.status}`;throw 401===o.status?new t.ChannelRefusal(d):Error(d)}}let r=e=>{let t=e.length<=5?1:5,a=[];for(let n=0;n<e.length&&a.length<5;n+=t)a.push({type:1,components:e.slice(n,n+t).map(e=>({type:2,style:2,label:e.text.slice(0,80),custom_id:e.data}))});return a};return{limits:{take:1/0,file:0x1400000,picture:0x1400000},async listen(a,i){let r,o=null,c=!0;try{let d=await (0,n.runSocket)("wss://gateway.discord.gg/?v=10&encoding=json",{message(t,n,i){let{op:s,d,s:h,t:u}=t;if(null!==h&&(o=h),10===s){let t=d.heartbeat_interval;r=setInterval(()=>{if(!c)return i(4e3,"Discord stopped answering");c=!1,n({op:1,d:o})},t),n({op:2,d:{token:e,intents:4096,properties:{os:process.platform,browser:"thursday",device:"thursday"}}})}else if(1===s)n({op:1,d:o});else if(11===s)c=!0;else if(7===s||9===s)i(4e3,"Discord asked for a new connection");else if(0===s&&"READY"===u){let e;a.ready(d.user.username,(e=d.application?.id)?`https://discord.com/oauth2/authorize?client_id=${e}&scope=bot&permissions=0`:null,d.user.id)}else if(0===s&&u){let e=function(e,t){if("MESSAGE_CREATE"===e){if(t.guild_id||t.author.bot)return null;let e=(t.attachments??[]).map(e=>({name:e.filename,size:e.size,fetch:async()=>{let t=await fetch(e.url);if(!t.ok)throw Error(`Discord answered ${t.status} for the file`);return new File([await t.arrayBuffer()],e.filename,{type:e.content_type??""})}})),a=!!((t.flags??0)&8192);return{kind:"message",chat:t.channel_id,name:t.author.global_name||t.author.username,handle:`@${t.author.username}`,words:t.content.trim(),...a?{files:[],voice:e[0]??null}:{files:e,voice:null},unreadable:!1}}return"INTERACTION_CREATE"===e?3!==t.type||t.guild_id?null:(l("POST",`/interactions/${t.id}/${t.token}/callback`,{type:6}).catch(()=>{}),{kind:"press",chat:t.channel_id,data:t.data?.custom_id??"",under:t.message?{id:t.message.id,text:t.message.content}:null}):null}(u,d);e&&a.incoming(e)}}},i),h=s[d.code];if(h)throw new t.ChannelRefusal(h);if(!i.aborted)throw Error(d.reason||`Discord closed the connection (${d.code})`)}finally{clearInterval(r)}},async say(e,t,n){let i=(0,a.chatPieces)(t,"discord",1900);for(let[t,a]of i.entries())await l("POST",`/channels/${e}/messages`,{content:a,flags:4,allowed_mentions:{parse:[]},...n?.length&&t===i.length-1?{components:r(n)}:{}})},async typing(e){await l("POST",`/channels/${e}/typing`).catch(()=>{})},async settle(e,t,n){let i=`
13
13
 
14
14
  → ${(0,a.chatPieces)({plain:n},"discord",1900)[0]}`;await l("PATCH",`/channels/${e}/messages/${t.id}`,{content:`${t.text.slice(0,1900-i.length)}${i}`,components:[]}).catch(()=>{})},async sendFiles(e,t){for(let a=0;a<t.length;a+=10){let n=t.slice(a,a+10),i=new FormData;for(let[e,t]of(i.set("payload_json",JSON.stringify({attachments:n.map((e,t)=>({id:t,filename:e.name}))})),n.entries()))i.set(`files[${e}]`,new Blob([t.bytes]),t.name);await l("POST",`/channels/${e}/messages`,i)}}}}])},822931,e=>{"use strict";var t=e.i(333925),a=e.i(951056),n=e.i(900533),i=e.i(64774);let s={message:"says",question:"asks",report:"reports",interrupted:"was cut off"},l={question:0,stopped:1,done:2,progress:3};function r(e){let a=(0,i.captionText)(e.replace(/!\[[^\]]*\]\([^)]*\)/g," ")).replace(i.MARKDOWN_LINK,"$1").replace(/^• /gm,"").trim();if(a.length<=t.CALL_RELAY.chars)return a;let n=a.slice(0,t.CALL_RELAY.chars),s=Math.max(n.lastIndexOf("\n\n"),n.lastIndexOf(". "),n.lastIndexOf(".\n"),n.lastIndexOf("。")),l=(s>t.CALL_RELAY.chars/3?n.slice(0,s+1):n).trim();return`${l}
15
15
  [The message goes on; the rest is in its thread on screen.]`}let o=e=>`question:${e}`;e.s(["openWork",0,function(e){let t=[];for(let i of e){let{relays:e,questions:c}=i.room,d=(0,n.toDate)(i.updatedAt).getTime(),h=(e,t)=>`[${e} → Thursday, thread "${i.label}" (${i.id}), ${t}.]`,u=(e,t)=>({kind:"relay",name:i.label,line:t,done:!0,bot:e});for(let a of c){let n=a.options?.length?` Options: ${a.options.join(" / ")}.`:"";t.push({rank:l.question,key:o(a.id),kind:"question",line:`${h(a.bot,"question")}
16
16
  ${r(a.text)}${n}`,relayIds:e.filter(e=>e.messageId===a.id).map(e=>e.id),threadId:i.id,text:a.text,show:u(a.bot,`${a.bot} asks`)})}let f=e.filter(e=>!c.some(t=>t.id===e.messageId)),p="done"===i.status,m="waiting"===i.status&&(0,a.isAppStop)(i.ask);if(p||m){if(i.seen)continue;let e=m?"stopped":"done",a=(m?i.ask?.question:null)??i.outcome??"",n="stopped"===e?`It stopped before finishing. Where it got to: ${r(a)}`:`Done. Its answer: ${r(a)}`;t.push({rank:l[e],key:`${e}:${i.id}@${d}`,kind:"ending",line:`${h(i.bot,e)}
17
17
  ${n}`,relayIds:f.map(e=>e.id),threadId:i.id,text:a,show:u(i.bot,"stopped"===e?`${i.bot} stopped`:`${i.bot} finished`)});continue}for(let e of f)t.push({rank:l.progress,key:`progress:${e.id}`,kind:"progress",line:`${h(e.bot,e.kind)}
18
- ${r(e.text)}`,relayIds:[e.id],threadId:i.id,text:e.text,show:u(e.bot,`${e.bot} ${s[e.kind]}`)})}return t.sort((e,t)=>e.rank-t.rank)},"questionKey",0,o])},317613,e=>e.a(async(t,a)=>{try{var n=e.i(874533);e.i(666680);var i=e.i(912714),s=e.i(750227),l=e.i(812057),r=e.i(333925),o=e.i(5509);e.i(375814);var c=e.i(871096),d=t([o]);async function h(e){let t=await (0,c.openWorkspace)(),a=new Set(await (0,i.readdir)((0,s.join)(c.WORKSPACE,r.GIVEN_FILES.dir)).catch(()=>[])),n=[];for(let i of e){let e=i.name.normalize("NFC").replace(/[^\p{L}\p{N}._-]+/gu,"-").replace(/^[-.]+|-+$/g,"")||"file",s=e.lastIndexOf("."),l=s>0?e.slice(0,s):e,o=s>0?e.slice(s):"",c=e;for(let e=2;a.has(c);e++)c=`${l}-${e}${o}`;a.add(c);let d=`${r.GIVEN_FILES.dir}/${c}`;await t.writeFile(d,Buffer.from(await i.arrayBuffer())),n.push(d)}return n}[o]=d.then?(await d)():d,(0,s.join)(r.APP_DIR,r.PATHS.skills.default,"artifact","scripts","spreadsheet.mjs"),(0,l.promisify)(n.execFile),e.s(["keepGivenFiles",0,h]),a()}catch(e){a(e)}},!1)];
18
+ ${r(e.text)}`,relayIds:[e.id],threadId:i.id,text:e.text,show:u(e.bot,`${e.bot} ${s[e.kind]}`)})}return t.sort((e,t)=>e.rank-t.rank)},"questionKey",0,o])},317613,e=>e.a(async(t,a)=>{try{var n=e.i(874533);e.i(666680);var i=e.i(912714),s=e.i(750227),l=e.i(812057),r=e.i(333925),o=e.i(5509);e.i(375814);var c=e.i(871096),d=t([o,c]);async function h(e){let t=await (0,c.openWorkspace)(),a=new Set(await (0,i.readdir)((0,s.join)(c.WORKSPACE,r.GIVEN_FILES.dir)).catch(()=>[])),n=[];for(let i of e){let e=i.name.normalize("NFC").replace(/[^\p{L}\p{N}._-]+/gu,"-").replace(/^[-.]+|-+$/g,"")||"file",s=e.lastIndexOf("."),l=s>0?e.slice(0,s):e,o=s>0?e.slice(s):"",c=e;for(let e=2;a.has(c);e++)c=`${l}-${e}${o}`;a.add(c);let d=`${r.GIVEN_FILES.dir}/${c}`;await t.writeFile(d,Buffer.from(await i.arrayBuffer())),n.push(d)}return n}[o,c]=d.then?(await d)():d,(0,s.join)(r.APP_DIR,r.PATHS.skills.default,"artifact","scripts","spreadsheet.mjs"),(0,l.promisify)(n.execFile),e.s(["keepGivenFiles",0,h]),a()}catch(e){a(e)}},!1)];
19
19
 
20
20
  //# sourceMappingURL=features_1jd2zjm._.js.map