thursday-agent 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +2 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +12 -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.html +1 -1
  14. package/.next/server/app/_not-found.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  18. package/.next/server/app/api/artifact/route.js +9 -8
  19. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/memory/route.js +8 -7
  22. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/route.js +8 -7
  24. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bot/thread/[id]/route.js +4 -4
  26. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/bot/thread/route.js +3 -3
  28. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  29. package/.next/server/app/api/config/route.js.nft.json +1 -1
  30. package/.next/server/app/api/events/route.js.nft.json +1 -1
  31. package/.next/server/app/api/favicon/[host]/route.js +4 -3
  32. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  34. package/.next/server/app/api/llm-model/automatic/route/app-paths-manifest.json +3 -0
  35. package/.next/server/app/api/llm-model/automatic/route/build-manifest.json +12 -0
  36. package/.next/server/app/api/llm-model/automatic/route/server-reference-manifest.json +4 -0
  37. package/.next/server/app/api/llm-model/automatic/route.js +17 -0
  38. package/.next/server/app/api/llm-model/automatic/route.js.map +5 -0
  39. package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -0
  40. package/.next/server/app/api/llm-model/automatic/route_client-reference-manifest.js +3 -0
  41. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  42. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  43. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  44. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  45. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  46. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  47. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  48. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  49. package/.next/server/app/api/memory/edit/route.js +14 -13
  50. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  51. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  52. package/.next/server/app/api/reach/route.js +17 -16
  53. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  54. package/.next/server/app/api/routine/route.js +10 -10
  55. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  56. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  57. package/.next/server/app/api/skills/[source]/[name]/route.js +9 -8
  58. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  59. package/.next/server/app/api/skills/route.js +9 -8
  60. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  61. package/.next/server/app/api/thursday/call/end/route/app-paths-manifest.json +3 -0
  62. package/.next/server/app/api/thursday/call/end/route/build-manifest.json +12 -0
  63. package/.next/server/app/api/thursday/call/end/route/server-reference-manifest.json +4 -0
  64. package/.next/server/app/api/thursday/call/end/route.js +17 -0
  65. package/.next/server/app/api/thursday/call/end/route.js.map +5 -0
  66. package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -0
  67. package/.next/server/app/api/thursday/call/end/route_client-reference-manifest.js +3 -0
  68. package/.next/server/app/api/thursday/call/route.js +6 -6
  69. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  70. package/.next/server/app/api/thursday/settings/route.js +5 -5
  71. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  72. package/.next/server/app/api/thursday/text/route.js +16 -15
  73. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  74. package/.next/server/app/api/thursday/tool-call/route.js +13 -12
  75. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  76. package/.next/server/app/api/workspace/files/route.js +5 -5
  77. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  78. package/.next/server/app/api/workspace/route.js +5 -5
  79. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  80. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +3 -3
  81. package/.next/server/app/artifact/[...path]/page.js +2 -2
  82. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  83. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  85. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  86. package/.next/server/app/page/server-reference-manifest.json +60 -60
  87. package/.next/server/app/page.js +8 -8
  88. package/.next/server/app/page.js.nft.json +1 -1
  89. package/.next/server/app/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app-paths-manifest.json +2 -0
  91. package/.next/server/chunks/{[externals]__178rv3v._.js → [externals]__12stas-._.js} +1 -1
  92. package/.next/server/chunks/[root-of-the-server]__00qyw01._.js +1 -1
  93. package/.next/server/chunks/{[root-of-the-server]__1ignh6-._.js → [root-of-the-server]__01k3vi3._.js} +1 -1
  94. package/.next/server/chunks/[root-of-the-server]__01ypm_z._.js +1 -1
  95. package/.next/server/chunks/[root-of-the-server]__021dkui._.js +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__03vunn6._.js +1 -1
  97. package/.next/server/chunks/[root-of-the-server]__03xamry._.js +1 -1
  98. package/.next/server/chunks/[root-of-the-server]__05dp5tr._.js +1 -1
  99. package/.next/server/chunks/{[root-of-the-server]__208vmyf._.js → [root-of-the-server]__061o2_x._.js} +1 -1
  100. package/.next/server/chunks/[root-of-the-server]__09gdscj._.js +3 -3
  101. package/.next/server/chunks/[root-of-the-server]__0bqveex._.js +5 -0
  102. package/.next/server/chunks/[root-of-the-server]__0eivkvk._.js +5 -0
  103. package/.next/server/chunks/[root-of-the-server]__0f7m79q._.js +3 -0
  104. package/.next/server/chunks/[root-of-the-server]__0g38-aj._.js +2 -2
  105. package/.next/server/chunks/[root-of-the-server]__0h656y-._.js +2 -2
  106. package/.next/server/chunks/[root-of-the-server]__0hkxwim._.js +3 -0
  107. package/.next/server/chunks/[root-of-the-server]__0hm3tiq._.js +5 -0
  108. package/.next/server/chunks/[root-of-the-server]__0hzdqnv._.js +5 -0
  109. package/.next/server/chunks/[root-of-the-server]__0liwkmx._.js +4 -4
  110. package/.next/server/chunks/[root-of-the-server]__0ljizgj._.js +2 -2
  111. package/.next/server/chunks/[root-of-the-server]__0mgyt8p._.js +5 -0
  112. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  113. package/.next/server/chunks/[root-of-the-server]__0nmust6._.js +2 -2
  114. package/.next/server/chunks/[root-of-the-server]__0p80i1n._.js +3 -0
  115. package/.next/server/chunks/[root-of-the-server]__0qzho69._.js +3 -0
  116. package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +1 -1
  117. package/.next/server/chunks/[root-of-the-server]__0svzjwa._.js +3 -3
  118. package/.next/server/chunks/{[root-of-the-server]__0b36yfw._.js → [root-of-the-server]__0ts7ai0._.js} +1 -1
  119. package/.next/server/chunks/[root-of-the-server]__1-18_pz._.js +3 -0
  120. package/.next/server/chunks/[root-of-the-server]__1-rmal0._.js +5 -0
  121. package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
  123. package/.next/server/chunks/[root-of-the-server]__1_h4hf9._.js +3 -3
  124. package/.next/server/chunks/[root-of-the-server]__1ceammd._.js +1 -1
  125. package/.next/server/chunks/[root-of-the-server]__1ckt1yj._.js +3 -0
  126. package/.next/server/chunks/[root-of-the-server]__1cu5f3z._.js +5 -0
  127. package/.next/server/chunks/[root-of-the-server]__1hviq62._.js +5 -0
  128. package/.next/server/chunks/{[root-of-the-server]__12m24xl._.js → [root-of-the-server]__1k2qs1m._.js} +1 -1
  129. package/.next/server/chunks/[root-of-the-server]__1kmnkbk._.js +3 -0
  130. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  131. package/.next/server/chunks/[root-of-the-server]__1p47fbb._.js +2 -2
  132. package/.next/server/chunks/[root-of-the-server]__1pugoq0._.js +3 -0
  133. package/.next/server/chunks/[root-of-the-server]__1t02-1p._.js +1 -1
  134. package/.next/server/chunks/[root-of-the-server]__1t0jj1j._.js +1 -1
  135. package/.next/server/chunks/[root-of-the-server]__1vlxv19._.js +2 -2
  136. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  137. package/.next/server/chunks/[root-of-the-server]__1zn039k._.js +1 -1
  138. package/.next/server/chunks/_05gl-xy._.js +5 -5
  139. package/.next/server/chunks/_06hnfi8._.js +8 -0
  140. package/.next/server/chunks/_06u9yo-._.js +1 -1
  141. package/.next/server/chunks/_07nxi75._.js +25 -21
  142. package/.next/server/chunks/_08354bn._.js +25 -21
  143. package/.next/server/chunks/_08btiir._.js +3 -3
  144. package/.next/server/chunks/_0c49lmw._.js +5 -0
  145. package/.next/server/chunks/_0ey0s6v._.js +3 -0
  146. package/.next/server/chunks/_0hgvg55._.js +5 -0
  147. package/.next/server/chunks/_0j0-gq6._.js +2 -2
  148. package/.next/server/chunks/_0nn99o2._.js +1 -1
  149. package/.next/server/chunks/_0p6v1fr._.js +2 -2
  150. package/.next/server/chunks/_0s8ao8z._.js +3 -0
  151. package/.next/server/chunks/_0srlnvd._.js +1 -1
  152. package/.next/server/chunks/_0t_7gji._.js +1 -1
  153. package/.next/server/chunks/_0ucx1jv._.js +3 -0
  154. package/.next/server/chunks/_0uzj57i._.js +1 -1
  155. package/.next/server/chunks/_0xygcxs._.js +25 -21
  156. package/.next/server/chunks/_1-sk_q4._.js +1 -1
  157. package/.next/server/chunks/{_1xcnogc._.js → _108gsm8._.js} +4 -4
  158. package/.next/server/chunks/{_20oecmn._.js → _15negpy._.js} +4 -4
  159. package/.next/server/chunks/_19fh9t2._.js +3 -0
  160. package/.next/server/chunks/_19kea1l._.js +18 -18
  161. package/.next/server/chunks/_1dtm9bs._.js +1 -1
  162. package/.next/server/chunks/_1dxq827._.js +2 -2
  163. package/.next/server/chunks/_1e54wxa._.js +1 -1
  164. package/.next/server/chunks/_1frcwj1._.js +3 -0
  165. package/.next/server/chunks/_1gn2r2q._.js +5 -5
  166. package/.next/server/chunks/_1gxankq._.js +2 -2
  167. package/.next/server/chunks/_1i3uucm._.js +5 -0
  168. package/.next/server/chunks/_1m88lkh._.js +9 -9
  169. package/.next/server/chunks/_1mx9sfo._.js +1 -1
  170. package/.next/server/chunks/_1q6e56i._.js +5 -5
  171. package/.next/server/chunks/_1qxheoa._.js +1 -1
  172. package/.next/server/chunks/_1t5ijzv._.js +3 -0
  173. package/.next/server/chunks/_1wwl_7o._.js +1 -1
  174. package/.next/server/chunks/_1zfxb7j._.js +1 -1
  175. package/.next/server/chunks/_211dn2c._.js +1 -1
  176. package/.next/server/chunks/_next-internal_server_app_api_llm-model_automatic_route_actions_1-eyan7.js +3 -0
  177. package/.next/server/chunks/_next-internal_server_app_api_thursday_call_end_route_actions_0u5xjft.js +3 -0
  178. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  179. package/.next/server/chunks/{features_0wm-ujw._.js → features_bot_08z387_._.js} +4 -4
  180. package/.next/server/chunks/{ssr/[root-of-the-server]__07660xu._.js → features_bot_0zy_q8y._.js} +8 -9
  181. package/.next/server/chunks/features_bot_1dfrdsb._.js +37 -0
  182. package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +3 -3
  183. package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +3 -3
  184. package/.next/server/chunks/node_modules_103lpef._.js +3 -0
  185. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0_nz09c._.js → node_modules_consola_dist_chunks_prompt_mjs_0-t5tbs._.js} +1 -1
  186. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_1341cnf._.js → node_modules_consola_dist_chunks_prompt_mjs_039fwo9._.js} +1 -1
  187. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_1x3bsmx._.js → node_modules_consola_dist_chunks_prompt_mjs_0pce1b3._.js} +1 -1
  188. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0tvy5lq._.js +3 -0
  189. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0wxw35t._.js +3 -0
  190. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1dlthym._.js +3 -0
  191. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1smfi4-._.js +3 -0
  192. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1x1omfi._.js +3 -0
  193. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_20is7e3._.js +3 -0
  194. package/.next/server/chunks/ssr/{[root-of-the-server]__149x25m._.js → [root-of-the-server]__0-af_o7._.js} +2 -2
  195. package/.next/server/chunks/ssr/[root-of-the-server]__09f39cp._.js +4 -0
  196. package/.next/server/chunks/ssr/[root-of-the-server]__0ouu4qp._.js +3 -0
  197. package/.next/server/chunks/ssr/[root-of-the-server]__0q9g9ea._.js +5 -0
  198. package/.next/server/chunks/ssr/[root-of-the-server]__17h1ggo._.js +11 -9
  199. package/.next/server/chunks/ssr/[root-of-the-server]__1jyeu61._.js +1 -1
  200. package/.next/server/chunks/ssr/{_0aeknva._.js → _01al00i._.js} +2 -2
  201. package/.next/server/chunks/ssr/_088vzgn._.js +1 -1
  202. package/.next/server/chunks/ssr/_0afrpci._.js +1 -1
  203. package/.next/server/chunks/ssr/_0bgse1c._.js +162 -0
  204. package/.next/server/chunks/ssr/_0cd6g3l._.js +15 -15
  205. package/.next/server/chunks/ssr/_0cv9tmv._.js +1 -1
  206. package/.next/server/chunks/ssr/{_0_vnw9v._.js → _0e2fnvg._.js} +2 -2
  207. package/.next/server/chunks/ssr/_0fo4552._.js +25 -21
  208. package/.next/server/chunks/ssr/_0jstvlg._.js +39 -0
  209. package/.next/server/chunks/ssr/{_0r0g9ki._.js → _0l7rjg5._.js} +2 -2
  210. package/.next/server/chunks/ssr/_0qsmpcu._.js +1 -1
  211. package/.next/server/chunks/ssr/_0v9r8g2._.js +1 -1
  212. package/.next/server/chunks/ssr/{_18-e7zi._.js → _0vo_oym._.js} +4 -4
  213. package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
  214. package/.next/server/chunks/ssr/{_0ztbn5q._.js → _0xfafez._.js} +2 -2
  215. package/.next/server/chunks/ssr/_0z38nha._.js +1 -1
  216. package/.next/server/chunks/ssr/_10-_awu._.js +1 -1
  217. package/.next/server/chunks/ssr/{_1z6pirx._.js → _10_ph1t._.js} +2 -2
  218. package/.next/server/chunks/ssr/_116lfdc._.js +3 -0
  219. package/.next/server/chunks/ssr/_14dfh7a._.js +1 -1
  220. package/.next/server/chunks/ssr/_14oirtb._.js +3 -0
  221. package/.next/server/chunks/ssr/{_1umbr78._.js → _163dr78._.js} +2 -2
  222. package/.next/server/chunks/ssr/{_1c5iqz1._.js → _17a4qyk._.js} +3 -3
  223. package/.next/server/chunks/ssr/{_1sttj8x._.js → _1_5xof_._.js} +2 -2
  224. package/.next/server/chunks/ssr/{_1hbjh6n._.js → _1aqjk-1._.js} +2 -2
  225. package/.next/server/chunks/ssr/{_0n2scfq._.js → _1dfv66y._.js} +2 -2
  226. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  227. package/.next/server/chunks/ssr/_1ou5sj0._.js +1 -1
  228. package/.next/server/chunks/ssr/{_15m5ctz._.js → _1tmw842._.js} +2 -2
  229. package/.next/server/chunks/ssr/_1uij_rj._.js +1 -1
  230. package/.next/server/chunks/ssr/_1w9w1ok._.js +1 -1
  231. package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
  232. package/.next/server/chunks/ssr/features_bot_0ouemw8._.js +3 -0
  233. package/.next/server/chunks/ssr/{features_133mpna._.js → features_bot_0tb4ui-._.js} +2 -2
  234. package/.next/server/chunks/ssr/{features_config_0n0zu89._.js → features_config_09n-q9q._.js} +3 -3
  235. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  236. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  237. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  238. package/.next/server/chunks/ssr/features_workspace_workspace_ts_1wc7_u_._.js +4 -4
  239. package/.next/server/chunks/ssr/{node_modules_1hefp6h._.js → node_modules_021lid9._.js} +1 -1
  240. package/.next/server/chunks/ssr/{node_modules_0kwie-o._.js → node_modules_04x5wyv._.js} +1 -1
  241. package/.next/server/chunks/ssr/{node_modules_180l3i0._.js → node_modules_096up6a._.js} +1 -1
  242. package/.next/server/chunks/ssr/{node_modules_00h1t1j._.js → node_modules_0__0tvm._.js} +1 -1
  243. package/.next/server/chunks/ssr/{node_modules_03uejh6._.js → node_modules_0cjnmzp._.js} +1 -1
  244. package/.next/server/chunks/ssr/{node_modules_1ubln7w._.js → node_modules_0d6j33x._.js} +1 -1
  245. package/.next/server/chunks/ssr/{node_modules_1_n9o9s._.js → node_modules_0gd9hbz._.js} +1 -1
  246. package/.next/server/chunks/ssr/{node_modules_0zf3wuu._.js → node_modules_0k8-y89._.js} +1 -1
  247. package/.next/server/chunks/ssr/{node_modules_0u_8z64._.js → node_modules_0m73b88._.js} +1 -1
  248. package/.next/server/chunks/ssr/{node_modules_09ikzel._.js → node_modules_0msrhxf._.js} +1 -1
  249. package/.next/server/chunks/ssr/{node_modules_0f5bmkb._.js → node_modules_0nmkv-v._.js} +1 -1
  250. package/.next/server/chunks/ssr/{node_modules_07mo9rn._.js → node_modules_0nw5jz7._.js} +1 -1
  251. package/.next/server/chunks/ssr/{node_modules_09e8kz_._.js → node_modules_0q-klni._.js} +1 -1
  252. package/.next/server/chunks/ssr/{node_modules_02ficyi._.js → node_modules_10_fv2a._.js} +1 -1
  253. package/.next/server/chunks/ssr/{node_modules_142z3o5._.js → node_modules_113l3e5._.js} +1 -1
  254. package/.next/server/chunks/ssr/{node_modules_1wyhtw9._.js → node_modules_13bqv6i._.js} +1 -1
  255. package/.next/server/chunks/ssr/{node_modules_0_d_7gq._.js → node_modules_13g-d25._.js} +1 -1
  256. package/.next/server/chunks/ssr/{node_modules_0r-9e4n._.js → node_modules_156kv_t._.js} +1 -1
  257. package/.next/server/chunks/ssr/{node_modules_06grs09._.js → node_modules_1_8-jcj._.js} +1 -1
  258. package/.next/server/chunks/ssr/{node_modules_1fw32pg._.js → node_modules_1gq3ght._.js} +1 -1
  259. package/.next/server/chunks/ssr/{node_modules_0_p8w7p._.js → node_modules_1k5i-_9._.js} +1 -1
  260. package/.next/server/chunks/ssr/{node_modules_03q71_j._.js → node_modules_1lmyts8._.js} +1 -1
  261. package/.next/server/chunks/ssr/{node_modules_1irot3r._.js → node_modules_1p_6sq7._.js} +1 -1
  262. package/.next/server/chunks/ssr/{node_modules_1om2itc._.js → node_modules_1qstb1x._.js} +1 -1
  263. package/.next/server/chunks/ssr/{node_modules_197vh1s._.js → node_modules_1ri_eip._.js} +1 -1
  264. package/.next/server/chunks/ssr/{node_modules_1-7fc7h._.js → node_modules_1xb-ndg._.js} +1 -1
  265. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0aczkbn._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0amkw0b._.js} +1 -1
  266. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0ah684s._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0zq3l45._.js} +1 -1
  267. package/.next/server/middleware-build-manifest.js +3 -3
  268. package/.next/server/middleware.js +1 -1
  269. package/.next/server/pages/404.html +1 -1
  270. package/.next/server/pages/500.html +1 -1
  271. package/.next/server/server-reference-manifest.js +1 -1
  272. package/.next/server/server-reference-manifest.json +61 -61
  273. package/.next/static/chunks/{38edd4rpcbvzp.js → 01l7kw74vfp32.js} +1 -1
  274. package/.next/static/chunks/0a5_-jqhaktjj.js +1 -0
  275. package/.next/static/chunks/{0_b_bi2pobasx.js → 0obogzscwwekj.js} +2 -2
  276. package/.next/static/chunks/{1-63yde5eaz7i.js → 0p2f6uv4xytfm.js} +1 -1
  277. package/.next/static/chunks/{2v6e_9p95o2e3.js → 0uxq_vs6uxi-b.js} +1 -1
  278. package/.next/static/chunks/{024plctckvq-1.js → 166smhw8v-s3j.js} +1 -1
  279. package/.next/static/chunks/{1wbqaidq7vc3_.js → 1bnhw-5fj7aiz.js} +1 -1
  280. package/.next/static/chunks/1cglo3a2mbeou.js +1 -0
  281. package/.next/static/chunks/{0sv142q1yrva2.js → 1in6nxpu33iab.js} +1 -1
  282. package/.next/static/chunks/1u7kg91f9qy3g.js +1 -0
  283. package/.next/static/chunks/{0sowxe4nnl5qu.js → 1xv4g10m-cl1s.js} +1 -1
  284. package/.next/static/chunks/{0dfvwgnyrp8qt.js → 2ajs12-fcdwzm.js} +1 -1
  285. package/.next/static/chunks/2i7qtmxc1kuqg.js +1 -0
  286. package/.next/static/chunks/{3-qp777vtfglj.js → 2kz1f6r59nky0.js} +1 -1
  287. package/.next/static/chunks/2qgkbdshzpq1c.js +1 -0
  288. package/.next/static/chunks/{1bgvxd3xny53w.js → 2zbl41hed17g3.js} +2 -2
  289. package/.next/static/chunks/35jj-5u4te56r.js +1 -0
  290. package/.next/static/chunks/37ixzapa06xlo.js +1 -0
  291. package/.next/static/chunks/3b96xy59nl_gd.js +1 -0
  292. package/.next/static/chunks/{0f47nnshdlucs.js → 3gsxnqqqphh-1.js} +1 -1
  293. package/.next/static/chunks/{44vre0f7xqsh-.js → 3jtcieuk1l6tw.js} +1 -1
  294. package/.next/static/chunks/{05scfrgo_a_5_.js → 3k1d8y03t5nax.js} +1 -1
  295. package/.next/static/chunks/3sla-dm1puqd1.js +35 -0
  296. package/.next/static/chunks/3t2c76awm9k_p.js +1 -0
  297. package/.next/static/chunks/3vrmcm31ih7gb.js +1 -0
  298. package/.next/static/chunks/3yiqr95d7ybeq.js +15 -0
  299. package/bin/autostart.mjs +4 -1
  300. package/bin/database.mjs +26 -4
  301. package/bin/lock.mjs +59 -0
  302. package/bin/node-check.mjs +21 -0
  303. package/bin/thursday.mjs +8 -1
  304. package/guide/bots.md +4 -2
  305. package/guide/calls.md +11 -9
  306. package/guide/memory.md +3 -2
  307. package/guide/phone.md +7 -4
  308. package/guide/setup.md +26 -9
  309. package/guide/trouble.md +11 -4
  310. package/package.json +1 -1
  311. package/public/voices/intro/asleepBare-15199d56.ogg +0 -0
  312. package/public/voices/intro/style-88adf274.ogg +0 -0
  313. package/seed-skills/concierge/travel/scripts/itinerary.mjs +6 -4
  314. package/skills/artifact/references/book.md +2 -1
  315. package/skills/artifact/references/sheet.md +12 -7
  316. package/skills/artifact/runtime/sheet/format.mjs +16 -9
  317. package/skills/artifact/scripts/book.mjs +19 -6
  318. package/skills/artifact/scripts/spreadsheet.mjs +194 -97
  319. package/skills/browser/SKILL.md +9 -6
  320. package/.next/server/chunks/[root-of-the-server]__03b09q0._.js +0 -5
  321. package/.next/server/chunks/[root-of-the-server]__05n-hql._.js +0 -5
  322. package/.next/server/chunks/[root-of-the-server]__0j_nz36._.js +0 -3
  323. package/.next/server/chunks/[root-of-the-server]__0jzwdg-._.js +0 -3
  324. package/.next/server/chunks/[root-of-the-server]__0tsded0._.js +0 -5
  325. package/.next/server/chunks/[root-of-the-server]__12tahb4._.js +0 -3
  326. package/.next/server/chunks/[root-of-the-server]__1de1o6m._.js +0 -3
  327. package/.next/server/chunks/[root-of-the-server]__1yl5l25._.js +0 -3
  328. package/.next/server/chunks/_02lipqs._.js +0 -5
  329. package/.next/server/chunks/_05sa7xl._.js +0 -3
  330. package/.next/server/chunks/_074f2ts._.js +0 -3
  331. package/.next/server/chunks/_0caua_s._.js +0 -3
  332. package/.next/server/chunks/_0p-h6xe._.js +0 -5
  333. package/.next/server/chunks/_0up2a9o._.js +0 -3
  334. package/.next/server/chunks/_17i1lt2._.js +0 -3
  335. package/.next/server/chunks/_1hy9x9_._.js +0 -3
  336. package/.next/server/chunks/_1hyvcgk._.js +0 -5
  337. package/.next/server/chunks/_1wl2g8_._.js +0 -6
  338. package/.next/server/chunks/_1y3mnz4._.js +0 -3
  339. package/.next/server/chunks/ssr/[root-of-the-server]__10eb-1x._.js +0 -3
  340. package/.next/server/chunks/ssr/[root-of-the-server]__19s8qyj._.js +0 -3
  341. package/.next/server/chunks/ssr/_0o_o9ji._.js +0 -3
  342. package/.next/server/chunks/ssr/_0qne8xs._.js +0 -3
  343. package/.next/server/chunks/ssr/_0rvbegp._.js +0 -7
  344. package/.next/server/chunks/ssr/_1vtgiou._.js +0 -162
  345. package/.next/server/chunks/ssr/features_bot_1kr0_m-._.js +0 -3
  346. package/.next/static/chunks/04toe_3nqfjqt.js +0 -1
  347. package/.next/static/chunks/0mtfu8adz57qz.js +0 -1
  348. package/.next/static/chunks/0tp868040z9nn.js +0 -35
  349. package/.next/static/chunks/14qitm0kwsb6g.js +0 -15
  350. package/.next/static/chunks/1cyrrz4q871aj.js +0 -1
  351. package/.next/static/chunks/1st3b0c9vhxg3.js +0 -1
  352. package/.next/static/chunks/28sxb_k460e9h.js +0 -1
  353. package/.next/static/chunks/33ekkscpcq-z1.js +0 -1
  354. package/.next/static/chunks/388l-zszwa_jf.js +0 -1
  355. package/.next/static/chunks/3bwrvpjk95_x4.js +0 -1
  356. package/.next/static/chunks/3itdg6t243u6f.js +0 -1
  357. package/.next/static/chunks/3kj0pri2oc1g1.js +0 -1
  358. package/public/voices/intro/style-cb6fa4f7.ogg +0 -0
  359. /package/.next/static/{VtbCMn-0G969p8QJsWdGv → 8I2hKtciyA9LXvd8txuOz}/_buildManifest.js +0 -0
  360. /package/.next/static/{VtbCMn-0G969p8QJsWdGv → 8I2hKtciyA9LXvd8txuOz}/_clientMiddlewareManifest.js +0 -0
  361. /package/.next/static/{VtbCMn-0G969p8QJsWdGv → 8I2hKtciyA9LXvd8txuOz}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[673701,a=>{"use strict";var b=a.i(187924),c=a.i(676459),d=a.i(926184),e=a.i(400187),f=a.i(497895);let g=(0,e.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,e.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),a.s(["Bubble",0,function({variant:a="default",align:c="start",className:d,...e}){return(0,b.jsx)("div",{"data-slot":"bubble","data-variant":a,"data-align":c,className:(0,f.cn)(g({variant:a}),d),...e})},"BubbleContent",0,function({className:a,render:b,...e}){var g;return g={defaultTagName:"div",props:(0,c.mergeProps)({className:(0,f.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",a)},e),render:b,state:{slot:"bubble-content"}},(0,d.useRenderElement)(g.defaultTagName??"div",g,g)}],673701)},613350,a=>{"use strict";var b=a.i(187924),c=a.i(589027),d=a.i(572131),e=a.i(497895);a.s(["FoldedText",0,function({text:a,subject:f,clamp:g="line-clamp-3",tall:h="max-h-40",className:i}){let[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(null),[o,p]=(0,d.useState)(a);return o!==a&&(p(a),k(!1)),(0,d.useEffect)(()=>{let a=n.current;a&&!j&&m(a.scrollHeight>a.clientHeight+1)},[j,a]),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-start gap-1",i),children:[(0,b.jsx)("p",{ref:n,className:(0,e.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep wrap-anywhere",j?(0,e.cn)(h,"overflow-y-auto scrollbar-none"):g),children:a}),(l||j)&&(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),"aria-label":j?`Fold the ${f}`:`Read the whole ${f}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(c.ChevronDown,{className:(0,e.cn)("size-3.5",j&&"rotate-180")})})]})}])},42380,a=>{"use strict";var b=a.i(187924),c=a.i(913834);a.s(["BotRoster",0,function({bots:a}){return a.length<2?null:(0,b.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:a.map(a=>a.name).join(", "),children:[(0,b.jsx)("span",{className:"flex items-center gap-0.5",children:a.slice(0,3).map(a=>(0,b.jsx)(c.BotMark,{size:18,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"},a.name))}),(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[a.length," bots"]})]})}])},181809,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(256711),f=a.i(752562),g=a.i(589027),h=a.i(707963),i=a.i(802550),j=a.i(585650),k=a.i(851528),l=a.i(875160),m=a.i(748819),n=a.i(474215),o=a.i(572131),p=a.i(673701),q=a.i(613350),r=a.i(846991),s=a.i(545097),t=a.i(621958),u=a.i(864037),v=a.i(786195),w=a.i(321799),x=a.i(913834),y=a.i(346075),z=a.i(369768),A=a.i(199169),B=a.i(313237),C=a.i(497895),D=a.i(983874),E=a.i(135432),F=a.i(8468),G=b([r,w,z,F]);function H({onClick:a}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(n.X,{className:"size-3.5"})})}function I({thread:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(J,{thread:a}),(0,d.jsx)(K,{thread:a}),(0,d.jsx)(L,{thread:a})]})}function J({thread:a}){let{contextTokens:b,tokens:c}=a;return b?(0,d.jsx)("span",{title:`Last step ${(0,C.formatCount)(b)} tokens \xb7 in total in ${(0,C.formatCount)(c.input)} \xb7 out ${(0,C.formatCount)(c.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,C.formatCount)(b)}):null}function K({thread:a}){let{contextTokens:b,contextBudget:c}=a,[e,f]=(0,o.useState)(!1),[g,h]=(0,B.useServerAction)(v.compactThreadAction,{onOk:()=>f(!0)}),[i,j]=(0,o.useState)(b);if(i!==b&&(j(b),f(!1)),!b||!c)return null;let k=Math.min(1,b/c);return(0,d.jsx)("button",{type:"button",disabled:h||e,onClick:()=>void g(a.id,a.bot.name),title:e?"It summarizes itself at its next step":`Context ${(0,C.formatCount)(b)} of ${(0,C.formatCount)(c)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,d.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("span",{className:(0,C.cn)("block h-full rounded-full",e?"animate-pulse bg-muted-foreground/40":k>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*k))}%`}})})})}[r,w,z,F]=G.then?(await G)():G;let ai={working:"text-muted-foreground",waiting:C.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"},aj={working:"working",waiting:"waiting",done:"done",cancelled:"stopped"};function L({thread:a}){let b="done"===a.status&&a.seen?"text-muted-foreground":ai[a.status];return"working"===a.status?(0,d.jsx)(s.ShinyText,{text:aj.working,speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,C.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:aj[a.status]})}function M({thread:a,roster:b,side:c,onPick:e,className:f}){return(0,d.jsx)(t.Tabs,{value:c??a.bot.name,onValueChange:b=>e(b===a.bot.name?null:String(b)),className:(0,C.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",f),children:(0,d.jsx)(t.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:b.map(b=>{let c=N(a,b.name);return(0,d.jsxs)(t.TabsTrigger,{value:b.name,className:(0,C.cn)(ak,"pl-1.5"),children:[(0,d.jsx)(x.BotMark,{size:16,seed:b.name,color:b.icon?.color,shape:b.icon?.shape,outline:b.icon?.outline,paint:b.icon?.paint,notify:"asking"===c,className:"shrink-0"}),(0,d.jsx)("span",{className:"max-w-28 truncate",children:b.name}),"running"===c&&(0,d.jsx)(l.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},b.name)})})})}let ak="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function N(a,b){let{room:c}=a;return c.questions.some(a=>a.bot===b)?"asking":"working"===a.status&&c.participants.some(a=>a.bot===b&&"running"===a.state)?"running":null}function O({turn:a,thread:b,self:c}){let e=a.speaker.name===c,f=e?"none":a.speaker.name===al.name?"dark":"secondary",g=null;return(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)($,{side:e?"start":"end",name:a.speaker.name,mark:(0,d.jsx)(Y,{bot:a.speaker}),children:a.entries.map(h=>{if("work"===h.kind)return e?(0,d.jsx)(Q,{lines:h.lines,trailing:h.open,bot:a.speaker,thread:b},h.key):(0,d.jsx)(P,{lines:h.lines,trailing:h.open,bot:a.speaker,thread:b},h.key);let i=(0,E.heardBy)(h.line),j=i&&i.name!==a.speaker.name&&i.name!==c&&i.name!==al.name&&i.name!==g?i:null;return i&&(g=i.name),(0,d.jsx)(_,{line:h.line,surface:f,mention:j},h.key)})})})}function P({lines:a,trailing:b,bot:c,thread:e}){var f;let[g,h]=(0,o.useState)(!1),[i,j]=(0,o.useState)(null),k=b?N(e,c.name):null,m=(f=a,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([a,b])=>[f.filter(b=>b.kind===a).length,b]).filter(([a])=>a>0).map(([a,b])=>`${a} ${b}${1===a?"":"s"}`).join(" · ")),n=a.filter(a=>a.tool?.results!==void 0);if(!k&&!m)return null;let p=a.findLast(a=>"tool"===a.kind||"say"===a.kind),q=g&&a.length>0;return(0,d.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",q?"w-full":"w-fit max-w-full"),children:[(0,d.jsxs)("button",{type:"button",disabled:!a.length,"aria-expanded":q,onClick:()=>{h(a=>!a),j(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===k&&(0,d.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),k?(0,d.jsx)(s.ShinyText,{text:"asking"===k?"waiting on you":p?U(p):"working",tone:"asking"===k?"waiting":"muted",speed:2.4,className:(0,C.cn)("min-w-0 truncate text-[12px] leading-4",q&&"flex-1")}):(0,d.jsx)(S,{words:p?U(p):"",facts:[m,function(a){let b=a.flatMap(a=>a.at?[(0,A.toDate)(a.at).getTime()]:[]);if(b.length<2)return"";let c=Math.round((Math.max(...b)-Math.min(...b))/1e3);if(c<1)return"";if(c<60)return`${c}s`;let d=Math.round(c/60);return d<60?`${d} min`:`${Math.floor(d/60)}h ${d%60}m`}(a)].filter(Boolean).join(" · "),grow:q}),a.length>0&&(0,d.jsx)(T,{open:q})]}),!q&&n.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:n.map(a=>a.tool&&(0,d.jsx)(F.StepTile,{tool:a.tool,onOpen:()=>{j(a.id),h(!0)}},a.id))}),q&&(0,d.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ah(a).map(a=>"tools"===a.kind?a.lines.map(a=>a.tool&&(0,d.jsx)(F.BotTool,{tool:a.tool,threadId:e.id,collapsed:a.id!==i},a.id)):"stops"===a.kind?(0,d.jsx)("div",{className:"px-1.5 py-1",children:(0,d.jsx)(ag,{lines:a.lines})},a.key):a.lines.map(a=>(0,d.jsx)(ae,{line:a,inset:!0},a.id)))})]})}function Q({lines:a,trailing:b,bot:c,thread:e}){let f=b?N(e,c.name):null,g=a.some(a=>a.tool&&void 0===a.tool.results);return(0,d.jsxs)(d.Fragment,{children:[ah(a).map(a=>"tools"===a.kind?(0,d.jsx)(R,{lines:a.lines,threadId:e.id},a.key):"stops"===a.kind?(0,d.jsx)(ag,{lines:a.lines},a.key):a.lines.map(a=>(0,d.jsx)(ae,{line:a},a.id))),f&&!g&&(0,d.jsx)(s.ShinyText,{text:"asking"===f?"waiting on you":"on the next step…",tone:"asking"===f?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function R({lines:a,threadId:b}){return(0,d.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:a.map(a=>a.tool&&(0,d.jsx)(F.BotTool,{tool:a.tool,threadId:b,collapsed:!0},a.id))})}function S({words:a,facts:b,grow:c=!1}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:(0,C.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",c&&"flex-1"),children:a}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:b})]})}function T({open:a}){return(0,d.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,d.jsx)(g.ChevronDown,{className:(0,C.cn)("size-3.5 transition-transform",a&&"rotate-180")})})}function U(a){return"tool"===a.kind&&a.tool?a.tool.note??`${a.tool.name} \xb7 ${a.tool.input}`:(0,C.plainText)(a.text).replace(/\s+/g," ").trim()}function V({thread:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(W,{from:al,to:a.bot}),(0,d.jsx)($,{side:"end",name:al.name,mark:(0,d.jsx)(Y,{bot:al}),children:(0,d.jsx)(Z,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,d.jsx)(q.FoldedText,{text:a.request,subject:"request",className:"wrap-anywhere"})})})]})}let al={name:D.ROOM_THURSDAY};function W({from:a,to:b}){return(0,d.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,d.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(X,{bot:a}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,d.jsx)(X,{bot:b})]})})}function X({bot:a}){return(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[a.name===al.name?(0,d.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,d.jsx)(x.BotMark,{size:15,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function Y({bot:a}){return a.name===al.name?(0,d.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,d.jsx)(x.BotMark,{size:26,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function Z({dark:a=!1,children:b,className:c}){return(0,d.jsx)(p.Bubble,{align:"end",variant:a?"default":"secondary",className:"max-w-full",children:(0,d.jsx)(p.BubbleContent,{className:(0,C.cn)("rounded-tr-md px-3.5",c),children:(0,d.jsx)("div",{className:(0,C.cn)("min-w-0",a&&"inverse"),children:b})})})}function $({side:a,mark:b,name:c,children:e}){return(0,d.jsxs)("div",{className:(0,C.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===a&&"items-end"),children:[(0,d.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:c}),e]})]})}function _({line:a,surface:b,mention:c}){let e=!!a.question,f="result"===a.kind,g="none"!==b,h=(0,w.shortenPaths)(a.text),i=(0,d.jsxs)(d.Fragment,{children:[e&&(0,d.jsx)(ad,{}),c?(0,d.jsx)(ac,{bot:c,bubble:g,children:h}):(0,d.jsx)(aa,{bubble:g,className:(0,C.cn)(!f&&"leading-snug"),children:h}),(0,d.jsx)(w.Attachments,{text:a.text,onBubble:g,className:"mt-2"})]});return(0,d.jsxs)(d.Fragment,{children:[g?(0,d.jsx)(Z,{dark:"dark"===b,children:i}):(0,d.jsx)("div",{className:"min-w-0 max-w-full px-1",children:i}),a.steppedIn&&(0,d.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(k.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),f&&(0,d.jsx)("div",{className:"flex px-1",children:(0,d.jsx)(af,{text:a.text})})]})}function aa({children:a,bubble:b=!1,className:c}){return(0,d.jsx)(r.Markdown,{className:(0,C.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",b&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",c),children:a})}function ab({bot:a,bubble:b}){return(0,d.jsxs)("span",{className:(0,C.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",b?"bg-background":"bg-muted"),children:[(0,d.jsx)(x.BotMark,{size:14,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function ac({bot:a,bubble:b,children:c}){return(0,d.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,d.jsx)(ab,{bot:a,bubble:b}),(0,d.jsx)(aa,{bubble:b,className:"contents leading-snug [&>p:first-child]:inline",children:c})]})}function ad(){return(0,d.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,d.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function ae({line:a,inset:b=!1}){return"note"===a.kind?(0,d.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,d.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,d.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,d.jsx)(aa,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:a.text})]}):(0,d.jsx)(aa,{className:(0,C.cn)("text-[12.5px] text-muted-foreground",b?"px-2.5 py-1":"px-1"),children:a.text})}function af({text:a}){let[b,c]=(0,o.useState)(!1),e=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,d.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1400)}catch(a){u.toast.add({type:"error",title:"Could not copy the answer",description:(0,C.errorToString)(a)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:b?(0,d.jsx)(f.Check,{className:"size-3"}):(0,d.jsx)(j.Copy,{className:"size-3"})})}function ag({lines:a}){return(0,d.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)(m.RotateCw,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:am(a[0].text)}),a.length>1&&(0,d.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",a.length]}),(0,d.jsx)(g.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,d.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:a.map(a=>(0,d.jsxs)("p",{className:"flex gap-2 break-keep wrap-anywhere",children:[a.at&&(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,e.format)((0,A.toDate)(a.at),"HH:mm:ss")}),(0,d.jsx)("span",{className:"min-w-0",children:a.text})]},a.id))})]})}let am=a=>a.split(" (")[0].replace(/\.$/,"");function ah(a){let b=[];for(let c of a){let a="tool"===c.kind&&c.tool?"tools":"stop"===c.kind?"stops":"said",d=b.at(-1),e=d?.kind===a&&("stops"!==a||am(d.lines[0].text)===am(c.text));d&&e?d.lines.push(c):b.push({kind:a,key:c.id,lines:[c]})}return b}a.s(["Conversation",0,function({thread:a,tab:b=null,onTab:c,className:e,tabsClassName:f}){let g,h=(0,o.useRef)(null),i=(0,o.useRef)(!0),j=a.roster,k=c&&b!==a.bot.name&&j.some(a=>a.name===b)?b:null,l=k??a.bot.name,m=j.filter(b=>(!k||b.name===k)&&N(a,b.name)),n=(0,E.threadItems)((g=new Set(a.room.questions.map(a=>a.id))).size?{...a,lines:a.lines.filter(a=>!("ask"===a.kind&&void 0!==a.questionId&&g.has(a.questionId)))}:a,l,m);return(0,o.useEffect)(()=>{i.current=!0},[a.id,k]),(0,o.useEffect)(()=>{let a=h.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[a.lines,a.status,k]),(0,o.useEffect)(()=>{let a=h.current;if(!a)return;let b=new ResizeObserver(()=>{i.current&&(a.scrollTop=a.scrollHeight)});for(let c of Array.from(a.children))b.observe(c);return()=>b.disconnect()},[n.length,a.lines,k]),(0,d.jsxs)(z.FileViewer,{children:[c&&(0,d.jsx)(M,{thread:a,roster:j,side:k,onPick:c,className:f}),(0,d.jsxs)("div",{ref:h,onScroll:a=>{let b=a.currentTarget;i.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:(0,C.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",e),children:[!k&&(0,d.jsx)(V,{thread:a}),n.map(b=>"invite"===b.kind?(0,d.jsx)(W,{from:b.from,to:b.to},b.key):(0,d.jsx)(O,{turn:b,thread:a,self:l},b.key))]})]})},"FoldButton",0,H,"TAB",0,ak,"THURSDAY",0,al,"ThreadFacts",0,I,"ThreadHeader",0,function({thread:a,onBack:b,onClose:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(h.ChevronLeft,{className:"size-4"})}),(0,d.jsx)(x.BotMark,{size:22,seed:a.bot.name,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,paint:a.bot.icon?.paint,notify:!1}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:a.label}),(0,d.jsx)(I,{thread:a}),(0,d.jsx)(H,{onClick:c})]})},"leadOf",0,am,"stepOf",0,U]),c()}catch(a){c(a)}},!1),988422,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(327598),f=a.i(589027),g=a.i(707963),h=a.i(141146),i=a.i(231500),j=a.i(851528),k=a.i(875160),l=a.i(127774),m=a.i(19895),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(340695),r=a.i(676504),s=a.i(613350),t=a.i(846991),u=a.i(545097),v=a.i(546893),w=a.i(608726),x=a.i(85973),y=a.i(174486),z=a.i(411509),A=a.i(913834),B=a.i(135432),C=a.i(217464),D=a.i(866460),E=a.i(332033),F=a.i(313237),G=a.i(759497),H=a.i(497895),I=b([t,D]);function J({className:a,children:b}){return(0,d.jsx)("div",{className:(0,H.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",a),children:b})}function K({bot:a,word:b,children:c}){return(0,d.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{title:a.name,className:"shrink-0 leading-none",children:(0,d.jsx)(O,{bot:a,size:16})}),(0,d.jsx)("span",{className:(0,H.cn)("truncate text-[12px] leading-4 font-medium",H.WAITING_INK),children:b}),c]})}function L({options:a,picked:b,busy:c,onChoose:e}){return(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(a=>(0,d.jsxs)(q.Button,{type:"button",size:"sm",variant:"ghost",loading:b===a,disabled:c,onClick:()=>e(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[a===z.THREAD_CONTINUE&&b!==a&&(0,d.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a]},a))})}function M({threadId:a,recipient:b,draftKey:c,send:f,busy:g,placeholder:h,label:i,autoFocus:j=!1,onEscape:m,leading:n,trailing:p,className:r}){let[s,t]=(0,o.useState)(()=>B.threadDrafts.get(a,b,c)),[u,w]=(0,o.useState)(!1),x=d=>{t(d),B.threadDrafts.set(a,b,d,c)},y=(0,D.useGivenFiles)(),z=(0,o.useRef)(null),{take:A}=y;(0,o.useEffect)(()=>D.roomDrop.claim(a=>void A(a)),[A]);let C=!!s.trim()&&!g&&!y.arriving,F=async()=>{C&&(w(!0),await f(y.withPaths(s))&&(x(""),y.clear()),w(!1))};return(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),F()},className:(0,H.cn)("flex min-w-0 flex-wrap items-end gap-1",r),children:[y.files.length>0&&(0,d.jsx)(D.GivenFiles,{dense:!0,files:y.files,onRemove:y.remove,className:"w-full pb-1"}),n,(0,d.jsx)(v.Textarea,{value:s,rows:1,disabled:g,autoFocus:j,onChange:a=>x(a.target.value),onPaste:a=>{let b=[...a.clipboardData.files];b.length&&(a.preventDefault(),A(b))},onKeyDown:a=>{let b=(0,E.composing)(a);if("Escape"===a.key&&m&&!b){a.preventDefault(),m();return}"Enter"!==a.key||a.shiftKey||b||(a.preventDefault(),F())},placeholder:h,"aria-label":i,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,d.jsx)("input",{ref:z,type:"file",multiple:!0,hidden:!0,onChange:a=>{A([...a.target.files??[]]),a.target.value=""}}),(0,d.jsx)(q.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:g,"aria-label":"Add files",onClick:()=>z.current?.click(),className:"rounded-full text-muted-foreground",children:(0,d.jsx)(l.Paperclip,{})}),p,(0,d.jsx)(q.Button,{type:"submit",size:"icon-sm",variant:C?"default":"ghost",disabled:!C,"aria-label":"Send",className:"rounded-full",children:u?(0,d.jsx)(k.Loader2,{className:"animate-spin"}):(0,d.jsx)(e.ArrowUp,{})})]})}function N({current:a,bots:b,disabled:c,onPick:e}){return(0,d.jsxs)(r.DropdownMenu,{children:[(0,d.jsxs)(r.DropdownMenuTrigger,{render:(0,d.jsx)("button",{type:"button",disabled:c,"aria-label":`Message ${a.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,d.jsx)("span",{className:"pl-1 text-muted-foreground",children:"To"}),(0,d.jsx)(O,{bot:a,size:14}),(0,d.jsx)("span",{className:"max-w-32 truncate",children:a.name}),(0,d.jsx)(f.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,d.jsx)(r.DropdownMenuContent,{align:"start",children:(0,d.jsx)(r.DropdownMenuGroup,{children:b.map(a=>(0,d.jsxs)(r.DropdownMenuItem,{onClick:()=>e(a.name),children:[(0,d.jsx)(O,{bot:a,size:16}),a.name]},a.name))})})]})}function O({bot:a,size:b}){return(0,d.jsx)(A.BotMark,{size:b,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"})}function P(){let[a,b]=(0,F.useServerAction)(w.answerThreadAction,{onOk:()=>(0,G.revalidate)(p.queryKey.threads)});return[async(b,c,d,e)=>{let f=c.trim();if(!f)return!1;try{let c=await a(b.id,f,d,e);return B.screenActs.announce({kind:"answered",id:c.id,label:c.label,answer:f,recipient:d,replyTo:e}),!0}catch{return!1}},b]}[t,D]=I.then?(await I)():I,a.s(["ThreadReply",0,function({thread:a,status:b,faces:c=[],to:e=null,className:f}){let[i,l]=(0,o.useState)(),[r,v]=(0,o.useState)(()=>B.threadDrafts.recipient(a.id)??a.bot),[w,A]=(0,o.useState)(!1),[D,E]=(0,o.useState)(null),[I,O]=(0,o.useState)({id:a.id,bot:a.bot});(I.id!==a.id||I.bot!==a.bot)&&(O({id:a.id,bot:a.bot}),v(B.threadDrafts.recipient(a.id)??a.bot),l(void 0),A(!1)),(0,o.useEffect)(()=>{e&&(B.threadDrafts.select(a.id,e),v(e))},[a.id,e]);let Q=a.room.participants,R=a.room.questions,S=Math.max(0,R.findIndex(a=>a.id===i)),T=R[S],U="waiting"===b?a.ask:null,V=(0,z.isAppStop)(U),W=T?.bot??(Q.some(a=>a.bot===r)?r:a.bot),X=T?.id,[Y,Z]=P(),[$,_]=(0,F.useServerAction)(x.cancelThreadAction,{onOk:a=>{(0,G.revalidate)(p.queryKey.threads),B.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),aa=Z||_,ab=a.room.deliveries.filter(a=>!a.delivered),[ac,ad]=(0,F.useServerAction)(y.withdrawStepInAction,{onOk:()=>(0,G.revalidate)(p.queryKey.threads)}),ae=ab.map(a=>`${a.bot}: ${a.text}`).join(" · "),af=Q.filter(a=>"running"===a.state).map(a=>a.bot),ag=af.join(", ")||a.bot,ah="running"===b&&Q.some(a=>a.bot===W&&("running"===a.state||"queued"===a.state)),ai="running"===b&&!ah,aj=W!==a.bot,ak=a=>c.find(b=>b.name===a)??{name:a},al=async b=>{if(aa)return!1;let c=await Y(a,b,W,X);return c&&ah&&A(!1),c},am=async a=>{E(a),await al(a),E(null)},an=(c=!1)=>"running"===b||"waiting"===b?(0,d.jsxs)(q.Button,{type:"button",size:"sm",variant:"ghost",loading:_,disabled:aa,onClick:()=>$(a.id),"aria-label":"Stop this thread",className:(0,H.cn)("h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",c&&"bg-background px-3 hover:bg-background/60 dark:hover:bg-background/60"),children:[!_&&(0,d.jsx)(m.Square,{className:"size-2.5 fill-current"}),"Stop"]}):null;if(T){let b=T.options??[],c=T.text;return(0,d.jsxs)(J,{className:f,children:[(0,d.jsx)(K,{bot:ak(W),word:"Question",children:(0,d.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[R.length>1&&(0,d.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,d.jsx)(q.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:aa||0===S,onClick:()=>l(R[S-1].id),children:(0,d.jsx)(g.ChevronLeft,{})}),(0,d.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[S+1," / ",R.length]}),(0,d.jsx)(q.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:aa||S===R.length-1,onClick:()=>l(R[S+1].id),children:(0,d.jsx)(h.ChevronRight,{})})]}),an(!0)]})}),c&&(0,d.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,d.jsx)(t.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:c})}),b.length>0&&(0,d.jsx)(L,{options:b,picked:D,busy:aa,onChoose:am}),(0,d.jsx)(C.SignInAsk,{bot:W,onAllowed:al}),(0,d.jsx)(M,{threadId:a.id,recipient:W,draftKey:T.id,send:al,busy:aa,placeholder:b.length?"Or write your own answer…":"Your answer…",label:`Answer for ${W}`},JSON.stringify([a.id,W,T.id]))]})}return V?(0,d.jsxs)(J,{className:f,children:[(0,d.jsx)(K,{bot:ak(a.bot),word:"Paused",children:(0,d.jsx)("span",{className:"ml-auto flex shrink-0",children:an(!0)})}),U?.question&&(0,d.jsx)(s.FoldedText,{text:U.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,d.jsx)(L,{options:U?.options.length?U.options:[z.THREAD_CONTINUE],picked:D,busy:aa,onChoose:am}),(0,d.jsx)(M,{threadId:a.id,recipient:W,send:al,busy:aa,placeholder:"Or put it another way…",label:`Message for ${W}`},JSON.stringify([a.id,W,"paused"]))]}):ah&&!w?(0,d.jsxs)("div",{className:(0,H.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",f),children:[ab.map(b=>(0,d.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,d.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,d.jsx)(k.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,d.jsx)(u.ShinyText,{text:`Step-in \xb7 waits for ${b.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,d.jsx)("p",{className:"whitespace-pre-wrap break-keep wrap-anywhere text-[13px] leading-snug",children:b.text})]}),(0,d.jsx)(q.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ad,onClick:()=>ac(a.id,b.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,d.jsx)(n.X,{})})]},b.id)),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,d.jsx)(u.ShinyText,{text:`${ag} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,d.jsxs)(q.Button,{type:"button",size:"sm",variant:"ghost",disabled:aa,onClick:()=>A(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,d.jsx)(j.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,d.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),an()]})]}):(0,d.jsxs)("div",{className:(0,H.cn)("flex min-w-0 flex-col gap-1.5",f),children:[ai&&(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2 pr-1.5 pl-3.5",children:[(0,d.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px] leading-5",children:[(0,d.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[W," is idle"]}),af.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,d.jsx)(u.ShinyText,{text:`${af.join(", ")} working`,speed:2.4,className:"min-w-0 truncate"})]})]}),(0,d.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),an()]}),(0,d.jsx)(M,{threadId:a.id,recipient:W,send:al,busy:aa,autoFocus:ah,onEscape:ah?()=>A(!1):void 0,placeholder:ah?`What's off? ${W} reads this before its next step`:ai?`Anything for ${W}? It starts again as soon as you send`:"Anything more? It picks up where it left off",label:`Message for ${W}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:Q.length>1?(0,d.jsx)(N,{current:ak(W),bots:Q.map(a=>ak(a.bot)),disabled:aa,onPick:b=>{B.threadDrafts.select(a.id,b),v(b)}}):null,trailing:ah?(0,d.jsx)(q.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:aa,onClick:()=>A(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,d.jsx)(n.X,{})}):null},JSON.stringify([a.id,W])),aj&&(0,d.jsxs)("p",{className:"min-w-0 truncate px-1 text-xs text-muted-foreground",children:[W,"’s answer goes back to ",a.bot]}),!!ae&&!ah&&(0,d.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,d.jsx)(k.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,d.jsxs)("span",{className:"truncate",children:["Sending to ",ae]})]})]})},"useAnswerThread",0,P]),c()}catch(a){c(a)}},!1),786195,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fc7b254c43cff117cb083333d0a1edb0982da7f89",b.callServer,void 0,b.findSourceMapURL,"compactThreadAction");a.s(["compactThreadAction",0,c])},608726,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f97f3d8097e9dd928e8380c0b2ae11b6a3ed0f837",b.callServer,void 0,b.findSourceMapURL,"answerThreadAction");a.s(["answerThreadAction",0,c])},174486,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f4834f38f44ede53e8ea16cf59cfd81cbca6481d4",b.callServer,void 0,b.findSourceMapURL,"withdrawStepInAction");a.s(["withdrawStepInAction",0,c])},85973,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fd1c34898b1d9b8c18a494235f4d821ea402d2c13",b.callServer,void 0,b.findSourceMapURL,"cancelThreadAction");a.s(["cancelThreadAction",0,c])},217464,a=>{"use strict";var b=a.i(187924),c=a.i(767561),d=a.i(340695),e=a.i(313237),f=a.i(759497),g=a.i(288660);a.s(["SignInAsk",0,function({bot:a,onAllowed:h}){let{data:i}=(0,f.useServerRoute)(c.queryKey.signIns),[j,k]=(0,e.useServerAction)(g.setSignInBotAction,{onOk:()=>(0,f.revalidate)(c.queryKey.signIns)}),l=(i??[]).filter(b=>b.asking.includes(a));return l.length?(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map(c=>(0,b.jsxs)(d.Button,{type:"button",size:"sm",loading:k,onClick:()=>void j(c.site,a,!0).then(()=>h(`Yes — you may use my ${c.site} sign-in.`)).catch(()=>{}),children:["Let ",a," use ",c.site," (",c.account,")"]},c.site))}):null}])},866460,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(875160),f=a.i(474215),g=a.i(572131),h=a.i(864037),i=a.i(287702),j=a.i(38793),k=a.i(460861),l=a.i(313237),m=a.i(497895),n=b([j]);[j]=n.then?(await n)():n;let o=null;a.s(["GivenFiles",0,function({files:a,onRemove:b,dense:c=!1,children:g,className:h}){let i=c?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,d.jsxs)("div",{className:(0,m.cn)("flex flex-wrap gap-1.5",h),children:[a.map(a=>{let g;return(0,d.jsxs)("span",{className:(0,m.cn)("flex max-w-64 items-center bg-muted/70",c?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[a.path?(0,d.jsx)(j.FileThumb,{path:a.path,bytes:a.bytes,className:(0,m.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,d.jsx)("span",{className:(0,m.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,d.jsx)(e.Loader2,{className:"size-3.5 animate-spin"})}),(0,d.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,d.jsx)("span",{className:(0,m.cn)("truncate",c?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:a.name}),(0,d.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[(g=a.bytes)<1048576?`${Math.max(1,Math.round(g/1024))} KB`:`${(g/1024/1024).toFixed(1)} MB`,a.note&&` \xb7 ${a.note}`]})]}),(0,d.jsx)("button",{type:"button","aria-label":`Take ${a.name} out`,onClick:()=>b(a.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(f.X,{className:"size-3.5"})})]},a.key)}),g]})},"roomDrop",0,{claim:a=>(o=a,()=>{o===a&&(o=null)}),offer:(a,b)=>!!o&&!!a?.closest?.("[data-room]")&&(o(b),!0)},"useGivenFiles",0,function(a){let b=(0,g.useRef)(a?.onKept);b.current=a?.onKept;let[c,d]=(0,g.useState)([]),[e]=(0,l.useServerAction)(k.giveFilesAction),f=(0,g.useCallback)(async a=>{let f=i.GIVEN_FILES.perMessage-c.length;a.length>f&&h.toast.add({type:"error",title:`At most ${i.GIVEN_FILES.perMessage} files at a time.`});let g=a.slice(0,Math.max(0,f));if(!g.length)return;let j=g.map(a=>({key:crypto.randomUUID(),name:a.name,bytes:a.size,path:null}));d(a=>[...a,...j]);let k=new FormData;for(let a of g)k.append("file",a);try{let a=await e(k),c=b.current?.(a);d(b=>b.map(b=>{let d=j.findIndex(a=>a.key===b.key);return d<0?b:{...b,path:a[d]??null,note:c}}))}catch{d(a=>a.filter(a=>!j.some(b=>b.key===a.key)))}},[c.length,e]);return{files:c,take:f,remove:a=>d(b=>b.filter(b=>b.key!==a)),clear:()=>d([]),arriving:c.some(a=>null===a.path),withPaths:a=>[a.trim(),...c.flatMap(a=>a.path??[])].filter(Boolean).join("\n")}}]),c()}catch(a){c(a)}},!1),460861,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f437b7e9ad4bf7261b89d1fcf6c445f53cd95d337",b.callServer,void 0,b.findSourceMapURL,"giveFilesAction");a.s(["giveFilesAction",0,c])},231500,a=>{"use strict";var b=a.i(164831);let c={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronsRight",0,d],231500)},802550,a=>{"use strict";var b=a.i(164831);let c={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};c.node;let d=(0,b.default)(c);a.s(["CircleQuestionMark",0,d],802550)},851528,a=>{"use strict";var b=a.i(164831);let c={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};c.node;let d=(0,b.default)(c);a.s(["CornerDownLeft",0,d],851528)},127774,a=>{"use strict";var b=a.i(164831);let c={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};c.node;let d=(0,b.default)(c);a.s(["Paperclip",0,d],127774)},748819,a=>{"use strict";var b=a.i(164831);let c={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};c.node;let d=(0,b.default)(c);a.s(["RotateCw",0,d],748819)},19895,a=>{"use strict";var b=a.i(164831);let c={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};c.node;let d=(0,b.default)(c);a.s(["Square",0,d],19895)}];
1
+ module.exports=[673701,a=>{"use strict";var b=a.i(187924),c=a.i(676459),d=a.i(926184),e=a.i(400187),f=a.i(497895);let g=(0,e.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,e.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),a.s(["Bubble",0,function({variant:a="default",align:c="start",className:d,...e}){return(0,b.jsx)("div",{"data-slot":"bubble","data-variant":a,"data-align":c,className:(0,f.cn)(g({variant:a}),d),...e})},"BubbleContent",0,function({className:a,render:b,...e}){var g;return g={defaultTagName:"div",props:(0,c.mergeProps)({className:(0,f.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",a)},e),render:b,state:{slot:"bubble-content"}},(0,d.useRenderElement)(g.defaultTagName??"div",g,g)}],673701)},613350,a=>{"use strict";var b=a.i(187924),c=a.i(589027),d=a.i(572131),e=a.i(497895);a.s(["FoldedText",0,function({text:a,subject:f,clamp:g="line-clamp-3",tall:h="max-h-40",className:i}){let[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(null),[o,p]=(0,d.useState)(a);return o!==a&&(p(a),k(!1)),(0,d.useEffect)(()=>{let a=n.current;a&&!j&&m(a.scrollHeight>a.clientHeight+1)},[j,a]),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-start gap-1",i),children:[(0,b.jsx)("p",{ref:n,className:(0,e.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep wrap-anywhere",j?(0,e.cn)(h,"overflow-y-auto scrollbar-none"):g),children:a}),(l||j)&&(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),"aria-label":j?`Fold the ${f}`:`Read the whole ${f}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(c.ChevronDown,{className:(0,e.cn)("size-3.5",j&&"rotate-180")})})]})}])},42380,a=>{"use strict";var b=a.i(187924),c=a.i(913834);a.s(["BotRoster",0,function({bots:a}){return a.length<2?null:(0,b.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:a.map(a=>a.name).join(", "),children:[(0,b.jsx)("span",{className:"flex items-center gap-0.5",children:a.slice(0,3).map(a=>(0,b.jsx)(c.BotMark,{size:18,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"},a.name))}),(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[a.length," bots"]})]})}])},181809,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(256711),f=a.i(752562),g=a.i(589027),h=a.i(707963),i=a.i(802550),j=a.i(585650),k=a.i(851528),l=a.i(875160),m=a.i(748819),n=a.i(474215),o=a.i(572131),p=a.i(673701),q=a.i(613350),r=a.i(846991),s=a.i(545097),t=a.i(621958),u=a.i(864037),v=a.i(177640),w=a.i(321799),x=a.i(913834),y=a.i(346075),z=a.i(369768),A=a.i(199169),B=a.i(313237),C=a.i(497895),D=a.i(983874),E=a.i(135432),F=a.i(8468),G=b([r,w,z,F]);function H({onClick:a}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(n.X,{className:"size-3.5"})})}function I({thread:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(J,{thread:a}),(0,d.jsx)(K,{thread:a}),(0,d.jsx)(L,{thread:a})]})}function J({thread:a}){let{contextTokens:b,tokens:c}=a;return b?(0,d.jsx)("span",{title:`Last step ${(0,C.formatCount)(b)} tokens \xb7 in total in ${(0,C.formatCount)(c.input)} \xb7 out ${(0,C.formatCount)(c.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,C.formatCount)(b)}):null}function K({thread:a}){let{contextTokens:b,contextBudget:c}=a,[e,f]=(0,o.useState)(!1),[g,h]=(0,B.useServerAction)(v.compactThreadAction,{onOk:()=>f(!0)}),[i,j]=(0,o.useState)(b);if(i!==b&&(j(b),f(!1)),!b||!c)return null;let k=Math.min(1,b/c);return(0,d.jsx)("button",{type:"button",disabled:h||e,onClick:()=>void g(a.id,a.bot.name),title:e?"It summarizes itself at its next step":`Context ${(0,C.formatCount)(b)} of ${(0,C.formatCount)(c)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,d.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("span",{className:(0,C.cn)("block h-full rounded-full",e?"animate-pulse bg-muted-foreground/40":k>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*k))}%`}})})})}[r,w,z,F]=G.then?(await G)():G;let ai={working:"text-muted-foreground",waiting:C.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"},aj={working:"working",waiting:"waiting",done:"done",cancelled:"stopped"};function L({thread:a}){let b="done"===a.status&&a.seen?"text-muted-foreground":ai[a.status];return"working"===a.status?(0,d.jsx)(s.ShinyText,{text:aj.working,speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,C.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:aj[a.status]})}function M({thread:a,roster:b,side:c,onPick:e,className:f}){return(0,d.jsx)(t.Tabs,{value:c??a.bot.name,onValueChange:b=>e(b===a.bot.name?null:String(b)),className:(0,C.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",f),children:(0,d.jsx)(t.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:b.map(b=>{let c=N(a,b.name);return(0,d.jsxs)(t.TabsTrigger,{value:b.name,className:(0,C.cn)(ak,"pl-1.5"),children:[(0,d.jsx)(x.BotMark,{size:16,seed:b.name,color:b.icon?.color,shape:b.icon?.shape,outline:b.icon?.outline,paint:b.icon?.paint,notify:"asking"===c,className:"shrink-0"}),(0,d.jsx)("span",{className:"max-w-28 truncate",children:b.name}),"running"===c&&(0,d.jsx)(l.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},b.name)})})})}let ak="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function N(a,b){let{room:c}=a;return c.questions.some(a=>a.bot===b)?"asking":"working"===a.status&&c.participants.some(a=>a.bot===b&&"running"===a.state)?"running":null}function O({turn:a,thread:b,self:c}){let e=a.speaker.name===c,f=e?"none":a.speaker.name===al.name?"dark":"secondary",g=null;return(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)($,{side:e?"start":"end",name:a.speaker.name,mark:(0,d.jsx)(Y,{bot:a.speaker}),children:a.entries.map(h=>{if("work"===h.kind)return e?(0,d.jsx)(Q,{lines:h.lines,trailing:h.open,bot:a.speaker,thread:b},h.key):(0,d.jsx)(P,{lines:h.lines,trailing:h.open,bot:a.speaker,thread:b},h.key);let i=(0,E.heardBy)(h.line),j=i&&i.name!==a.speaker.name&&i.name!==c&&i.name!==al.name&&i.name!==g?i:null;return i&&(g=i.name),(0,d.jsx)(_,{line:h.line,surface:f,mention:j},h.key)})})})}function P({lines:a,trailing:b,bot:c,thread:e}){var f;let[g,h]=(0,o.useState)(!1),[i,j]=(0,o.useState)(null),k=b?N(e,c.name):null,m=(f=a,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([a,b])=>[f.filter(b=>b.kind===a).length,b]).filter(([a])=>a>0).map(([a,b])=>`${a} ${b}${1===a?"":"s"}`).join(" · ")),n=a.filter(a=>a.tool?.results!==void 0);if(!k&&!m)return null;let p=a.findLast(a=>"tool"===a.kind||"say"===a.kind),q=g&&a.length>0;return(0,d.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",q?"w-full":"w-fit max-w-full"),children:[(0,d.jsxs)("button",{type:"button",disabled:!a.length,"aria-expanded":q,onClick:()=>{h(a=>!a),j(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===k&&(0,d.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),k?(0,d.jsx)(s.ShinyText,{text:"asking"===k?"waiting on you":p?U(p):"working",tone:"asking"===k?"waiting":"muted",speed:2.4,className:(0,C.cn)("min-w-0 truncate text-[12px] leading-4",q&&"flex-1")}):(0,d.jsx)(S,{words:p?U(p):"",facts:[m,function(a){let b=a.flatMap(a=>a.at?[(0,A.toDate)(a.at).getTime()]:[]);if(b.length<2)return"";let c=Math.round((Math.max(...b)-Math.min(...b))/1e3);if(c<1)return"";if(c<60)return`${c}s`;let d=Math.round(c/60);return d<60?`${d} min`:`${Math.floor(d/60)}h ${d%60}m`}(a)].filter(Boolean).join(" · "),grow:q}),a.length>0&&(0,d.jsx)(T,{open:q})]}),!q&&n.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:n.map(a=>a.tool&&(0,d.jsx)(F.StepTile,{tool:a.tool,onOpen:()=>{j(a.id),h(!0)}},a.id))}),q&&(0,d.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ah(a).map(a=>"tools"===a.kind?a.lines.map(a=>a.tool&&(0,d.jsx)(F.BotTool,{tool:a.tool,threadId:e.id,collapsed:a.id!==i},a.id)):"stops"===a.kind?(0,d.jsx)("div",{className:"px-1.5 py-1",children:(0,d.jsx)(ag,{lines:a.lines})},a.key):a.lines.map(a=>(0,d.jsx)(ae,{line:a,inset:!0},a.id)))})]})}function Q({lines:a,trailing:b,bot:c,thread:e}){let f=b?N(e,c.name):null,g=a.some(a=>a.tool&&void 0===a.tool.results);return(0,d.jsxs)(d.Fragment,{children:[ah(a).map(a=>"tools"===a.kind?(0,d.jsx)(R,{lines:a.lines,threadId:e.id},a.key):"stops"===a.kind?(0,d.jsx)(ag,{lines:a.lines},a.key):a.lines.map(a=>(0,d.jsx)(ae,{line:a},a.id))),f&&!g&&(0,d.jsx)(s.ShinyText,{text:"asking"===f?"waiting on you":"on the next step…",tone:"asking"===f?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function R({lines:a,threadId:b}){return(0,d.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:a.map(a=>a.tool&&(0,d.jsx)(F.BotTool,{tool:a.tool,threadId:b,collapsed:!0},a.id))})}function S({words:a,facts:b,grow:c=!1}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:(0,C.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",c&&"flex-1"),children:a}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:b})]})}function T({open:a}){return(0,d.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,d.jsx)(g.ChevronDown,{className:(0,C.cn)("size-3.5 transition-transform",a&&"rotate-180")})})}function U(a){return"tool"===a.kind&&a.tool?a.tool.note??`${a.tool.name} \xb7 ${a.tool.input}`:(0,C.plainText)(a.text).replace(/\s+/g," ").trim()}function V({thread:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(W,{from:al,to:a.bot}),(0,d.jsx)($,{side:"end",name:al.name,mark:(0,d.jsx)(Y,{bot:al}),children:(0,d.jsx)(Z,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,d.jsx)(q.FoldedText,{text:a.request,subject:"request",className:"wrap-anywhere"})})})]})}let al={name:D.ROOM_THURSDAY};function W({from:a,to:b}){return(0,d.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,d.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(X,{bot:a}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,d.jsx)(X,{bot:b})]})})}function X({bot:a}){return(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[a.name===al.name?(0,d.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,d.jsx)(x.BotMark,{size:15,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function Y({bot:a}){return a.name===al.name?(0,d.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,d.jsx)(x.BotMark,{size:26,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function Z({dark:a=!1,children:b,className:c}){return(0,d.jsx)(p.Bubble,{align:"end",variant:a?"default":"secondary",className:"max-w-full",children:(0,d.jsx)(p.BubbleContent,{className:(0,C.cn)("rounded-tr-md px-3.5",c),children:(0,d.jsx)("div",{className:(0,C.cn)("min-w-0",a&&"inverse"),children:b})})})}function $({side:a,mark:b,name:c,children:e}){return(0,d.jsxs)("div",{className:(0,C.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===a&&"items-end"),children:[(0,d.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:c}),e]})]})}function _({line:a,surface:b,mention:c}){let e=!!a.question,f="result"===a.kind,g="none"!==b,h=(0,w.shortenPaths)(a.text),i=(0,d.jsxs)(d.Fragment,{children:[e&&(0,d.jsx)(ad,{}),c?(0,d.jsx)(ac,{bot:c,bubble:g,children:h}):(0,d.jsx)(aa,{bubble:g,className:(0,C.cn)(!f&&"leading-snug"),children:h}),(0,d.jsx)(w.Attachments,{text:a.text,onBubble:g,className:"mt-2"})]});return(0,d.jsxs)(d.Fragment,{children:[g?(0,d.jsx)(Z,{dark:"dark"===b,children:i}):(0,d.jsx)("div",{className:"min-w-0 max-w-full px-1",children:i}),a.steppedIn&&(0,d.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(k.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),f&&(0,d.jsx)("div",{className:"flex px-1",children:(0,d.jsx)(af,{text:a.text})})]})}function aa({children:a,bubble:b=!1,className:c}){return(0,d.jsx)(r.Markdown,{className:(0,C.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",b&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",c),children:a})}function ab({bot:a,bubble:b}){return(0,d.jsxs)("span",{className:(0,C.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",b?"bg-background":"bg-muted"),children:[(0,d.jsx)(x.BotMark,{size:14,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function ac({bot:a,bubble:b,children:c}){return(0,d.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,d.jsx)(ab,{bot:a,bubble:b}),(0,d.jsx)(aa,{bubble:b,className:"contents leading-snug [&>p:first-child]:inline",children:c})]})}function ad(){return(0,d.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,d.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function ae({line:a,inset:b=!1}){return"note"===a.kind?(0,d.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,d.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,d.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,d.jsx)(aa,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:a.text})]}):(0,d.jsx)(aa,{className:(0,C.cn)("text-[12.5px] text-muted-foreground",b?"px-2.5 py-1":"px-1"),children:a.text})}function af({text:a}){let[b,c]=(0,o.useState)(!1),e=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,d.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1400)}catch(a){u.toast.add({type:"error",title:"Could not copy the answer",description:(0,C.errorToString)(a)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:b?(0,d.jsx)(f.Check,{className:"size-3"}):(0,d.jsx)(j.Copy,{className:"size-3"})})}function ag({lines:a}){return(0,d.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)(m.RotateCw,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:am(a[0].text)}),a.length>1&&(0,d.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",a.length]}),(0,d.jsx)(g.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,d.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:a.map(a=>(0,d.jsxs)("p",{className:"flex gap-2 break-keep wrap-anywhere",children:[a.at&&(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,e.format)((0,A.toDate)(a.at),"HH:mm:ss")}),(0,d.jsx)("span",{className:"min-w-0",children:a.text})]},a.id))})]})}let am=a=>a.split(" (")[0].replace(/\.$/,"");function ah(a){let b=[];for(let c of a){let a="tool"===c.kind&&c.tool?"tools":"stop"===c.kind?"stops":"said",d=b.at(-1),e=d?.kind===a&&("stops"!==a||am(d.lines[0].text)===am(c.text));d&&e?d.lines.push(c):b.push({kind:a,key:c.id,lines:[c]})}return b}a.s(["Conversation",0,function({thread:a,tab:b=null,onTab:c,className:e,tabsClassName:f}){let g,h=(0,o.useRef)(null),i=(0,o.useRef)(!0),j=a.roster,k=c&&b!==a.bot.name&&j.some(a=>a.name===b)?b:null,l=k??a.bot.name,m=j.filter(b=>(!k||b.name===k)&&N(a,b.name)),n=(0,E.threadItems)((g=new Set(a.room.questions.map(a=>a.id))).size?{...a,lines:a.lines.filter(a=>!("ask"===a.kind&&void 0!==a.questionId&&g.has(a.questionId)))}:a,l,m);return(0,o.useEffect)(()=>{i.current=!0},[a.id,k]),(0,o.useEffect)(()=>{let a=h.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[a.lines,a.status,k]),(0,o.useEffect)(()=>{let a=h.current;if(!a)return;let b=new ResizeObserver(()=>{i.current&&(a.scrollTop=a.scrollHeight)});for(let c of Array.from(a.children))b.observe(c);return()=>b.disconnect()},[n.length,a.lines,k]),(0,d.jsxs)(z.FileViewer,{children:[c&&(0,d.jsx)(M,{thread:a,roster:j,side:k,onPick:c,className:f}),(0,d.jsxs)("div",{ref:h,onScroll:a=>{let b=a.currentTarget;i.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:(0,C.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",e),children:[!k&&(0,d.jsx)(V,{thread:a}),n.map(b=>"invite"===b.kind?(0,d.jsx)(W,{from:b.from,to:b.to},b.key):(0,d.jsx)(O,{turn:b,thread:a,self:l},b.key))]})]})},"FoldButton",0,H,"TAB",0,ak,"THURSDAY",0,al,"ThreadFacts",0,I,"ThreadHeader",0,function({thread:a,onBack:b,onClose:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(h.ChevronLeft,{className:"size-4"})}),(0,d.jsx)(x.BotMark,{size:22,seed:a.bot.name,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,paint:a.bot.icon?.paint,notify:!1}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:a.label}),(0,d.jsx)(I,{thread:a}),(0,d.jsx)(H,{onClick:c})]})},"leadOf",0,am,"stepOf",0,U]),c()}catch(a){c(a)}},!1),988422,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(327598),f=a.i(589027),g=a.i(707963),h=a.i(141146),i=a.i(231500),j=a.i(851528),k=a.i(875160),l=a.i(127774),m=a.i(19895),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(340695),r=a.i(676504),s=a.i(613350),t=a.i(846991),u=a.i(545097),v=a.i(546893),w=a.i(803190),x=a.i(3376),y=a.i(936666),z=a.i(411509),A=a.i(913834),B=a.i(135432),C=a.i(217464),D=a.i(866460),E=a.i(332033),F=a.i(313237),G=a.i(759497),H=a.i(497895),I=b([t,D]);function J({className:a,children:b}){return(0,d.jsx)("div",{className:(0,H.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",a),children:b})}function K({bot:a,word:b,children:c}){return(0,d.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{title:a.name,className:"shrink-0 leading-none",children:(0,d.jsx)(O,{bot:a,size:16})}),(0,d.jsx)("span",{className:(0,H.cn)("truncate text-[12px] leading-4 font-medium",H.WAITING_INK),children:b}),c]})}function L({options:a,picked:b,busy:c,onChoose:e}){return(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(a=>(0,d.jsxs)(q.Button,{type:"button",size:"sm",variant:"ghost",loading:b===a,disabled:c,onClick:()=>e(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[a===z.THREAD_CONTINUE&&b!==a&&(0,d.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a]},a))})}function M({threadId:a,recipient:b,draftKey:c,send:f,busy:g,placeholder:h,label:i,autoFocus:j=!1,onEscape:m,leading:n,trailing:p,className:r}){let[s,t]=(0,o.useState)(()=>B.threadDrafts.get(a,b,c)),[u,w]=(0,o.useState)(!1),x=d=>{t(d),B.threadDrafts.set(a,b,d,c)},y=(0,D.useGivenFiles)(),z=(0,o.useRef)(null),{take:A}=y;(0,o.useEffect)(()=>D.roomDrop.claim(a=>void A(a)),[A]);let C=!!s.trim()&&!g&&!y.arriving,F=async()=>{C&&(w(!0),await f(y.withPaths(s))&&(x(""),y.clear()),w(!1))};return(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),F()},className:(0,H.cn)("flex min-w-0 flex-wrap items-end gap-1",r),children:[y.files.length>0&&(0,d.jsx)(D.GivenFiles,{dense:!0,files:y.files,onRemove:y.remove,className:"w-full pb-1"}),n,(0,d.jsx)(v.Textarea,{value:s,rows:1,readOnly:g,"aria-busy":g,autoFocus:j,onChange:a=>x(a.target.value),onPaste:a=>{let b=[...a.clipboardData.files];b.length&&(a.preventDefault(),A(b))},onKeyDown:a=>{let b=(0,E.composing)(a);if("Escape"===a.key&&m&&!b){a.preventDefault(),m();return}"Enter"!==a.key||a.shiftKey||b||(a.preventDefault(),F())},placeholder:h,"aria-label":i,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,d.jsx)("input",{ref:z,type:"file",multiple:!0,hidden:!0,onChange:a=>{A([...a.target.files??[]]),a.target.value=""}}),(0,d.jsx)(q.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:g,"aria-label":"Add files",onClick:()=>z.current?.click(),className:"rounded-full text-muted-foreground",children:(0,d.jsx)(l.Paperclip,{})}),p,(0,d.jsx)(q.Button,{type:"submit",size:"icon-sm",variant:C?"default":"ghost",disabled:!C,"aria-label":"Send",className:"rounded-full",children:u?(0,d.jsx)(k.Loader2,{className:"animate-spin"}):(0,d.jsx)(e.ArrowUp,{})})]})}function N({current:a,bots:b,disabled:c,onPick:e}){return(0,d.jsxs)(r.DropdownMenu,{children:[(0,d.jsxs)(r.DropdownMenuTrigger,{render:(0,d.jsx)("button",{type:"button",disabled:c,"aria-label":`Message ${a.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,d.jsx)("span",{className:"pl-1 text-muted-foreground",children:"To"}),(0,d.jsx)(O,{bot:a,size:14}),(0,d.jsx)("span",{className:"max-w-32 truncate",children:a.name}),(0,d.jsx)(f.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,d.jsx)(r.DropdownMenuContent,{align:"start",children:(0,d.jsx)(r.DropdownMenuGroup,{children:b.map(a=>(0,d.jsxs)(r.DropdownMenuItem,{onClick:()=>e(a.name),children:[(0,d.jsx)(O,{bot:a,size:16}),a.name]},a.name))})})]})}function O({bot:a,size:b}){return(0,d.jsx)(A.BotMark,{size:b,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,paint:a.icon?.paint,notify:!1,className:"shrink-0"})}function P(){let[a,b]=(0,F.useServerAction)(w.answerThreadAction,{onOk:()=>(0,G.revalidate)(p.queryKey.threads)});return[async(b,c,d,e)=>{let f=c.trim();if(!f)return!1;try{let c=await a(b.id,f,d,e);return B.screenActs.announce({kind:"answered",id:c.id,label:c.label,answer:f,recipient:d,replyTo:e}),!0}catch{return!1}},b]}[t,D]=I.then?(await I)():I,a.s(["ThreadReply",0,function({thread:a,status:b,faces:c=[],to:e=null,className:f}){let[i,l]=(0,o.useState)(),[r,v]=(0,o.useState)(()=>B.threadDrafts.recipient(a.id)??a.bot),[w,A]=(0,o.useState)(!1),[D,E]=(0,o.useState)(null),[I,O]=(0,o.useState)({id:a.id,bot:a.bot});(I.id!==a.id||I.bot!==a.bot)&&(O({id:a.id,bot:a.bot}),v(B.threadDrafts.recipient(a.id)??a.bot),l(void 0),A(!1)),(0,o.useEffect)(()=>{e&&(B.threadDrafts.select(a.id,e),v(e))},[a.id,e]);let Q=a.room.participants,R=a.room.questions,S=Math.max(0,R.findIndex(a=>a.id===i)),T=R[S],U="waiting"===b?a.ask:null,V=(0,z.isAppStop)(U),W=T?.bot??(Q.some(a=>a.bot===r)?r:a.bot),X=T?.id,[Y,Z]=P(),[$,_]=(0,F.useServerAction)(x.cancelThreadAction,{onOk:a=>{(0,G.revalidate)(p.queryKey.threads),B.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),aa=Z||_,ab=a.room.deliveries.filter(a=>!a.delivered),[ac,ad]=(0,F.useServerAction)(y.withdrawStepInAction,{onOk:()=>(0,G.revalidate)(p.queryKey.threads)}),ae=ab.map(a=>`${a.bot}: ${a.text}`).join(" · "),af=Q.filter(a=>"running"===a.state).map(a=>a.bot),ag=af.join(", ")||a.bot,ah="running"===b&&Q.some(a=>a.bot===W&&("running"===a.state||"queued"===a.state)),ai="running"===b&&!ah,aj=W!==a.bot,ak=a=>c.find(b=>b.name===a)??{name:a},al=async b=>{if(aa)return!1;let c=await Y(a,b,W,X);return c&&ah&&A(!1),c},am=async a=>{E(a),await al(a),E(null)},an=(c=!1)=>"running"===b||"waiting"===b?(0,d.jsxs)(q.Button,{type:"button",size:"sm",variant:"ghost",loading:_,disabled:aa,onClick:()=>$(a.id),"aria-label":"Stop this thread",className:(0,H.cn)("h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",c&&"bg-background px-3 hover:bg-background/60 dark:hover:bg-background/60"),children:[!_&&(0,d.jsx)(m.Square,{className:"size-2.5 fill-current"}),"Stop"]}):null;if(T){let b=T.options??[],c=T.text;return(0,d.jsxs)(J,{className:f,children:[(0,d.jsx)(K,{bot:ak(W),word:"Question",children:(0,d.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[R.length>1&&(0,d.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,d.jsx)(q.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:aa||0===S,onClick:()=>l(R[S-1].id),children:(0,d.jsx)(g.ChevronLeft,{})}),(0,d.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[S+1," / ",R.length]}),(0,d.jsx)(q.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:aa||S===R.length-1,onClick:()=>l(R[S+1].id),children:(0,d.jsx)(h.ChevronRight,{})})]}),an(!0)]})}),c&&(0,d.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,d.jsx)(t.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:c})}),b.length>0&&(0,d.jsx)(L,{options:b,picked:D,busy:aa,onChoose:am}),(0,d.jsx)(C.SignInAsk,{bot:W,onAllowed:al}),(0,d.jsx)(M,{threadId:a.id,recipient:W,draftKey:T.id,send:al,busy:aa,placeholder:b.length?"Or write your own answer…":"Your answer…",label:`Answer for ${W}`},JSON.stringify([a.id,W,T.id]))]})}return V?(0,d.jsxs)(J,{className:f,children:[(0,d.jsx)(K,{bot:ak(a.bot),word:"Paused",children:(0,d.jsx)("span",{className:"ml-auto flex shrink-0",children:an(!0)})}),U?.question&&(0,d.jsx)(s.FoldedText,{text:U.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,d.jsx)(L,{options:U?.options.length?U.options:[z.THREAD_CONTINUE],picked:D,busy:aa,onChoose:am}),(0,d.jsx)(M,{threadId:a.id,recipient:W,send:al,busy:aa,placeholder:"Or put it another way…",label:`Message for ${W}`},JSON.stringify([a.id,W,"paused"]))]}):ah&&!w?(0,d.jsxs)("div",{className:(0,H.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",f),children:[ab.map(b=>(0,d.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,d.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,d.jsx)(k.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,d.jsx)(u.ShinyText,{text:`Step-in \xb7 waits for ${b.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,d.jsx)("p",{className:"whitespace-pre-wrap break-keep wrap-anywhere text-[13px] leading-snug",children:b.text})]}),(0,d.jsx)(q.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ad,onClick:()=>ac(a.id,b.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,d.jsx)(n.X,{})})]},b.id)),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,d.jsx)(u.ShinyText,{text:`${ag} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,d.jsxs)(q.Button,{type:"button",size:"sm",variant:"ghost",disabled:aa,onClick:()=>A(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,d.jsx)(j.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,d.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),an()]})]}):(0,d.jsxs)("div",{className:(0,H.cn)("flex min-w-0 flex-col gap-1.5",f),children:[ai&&(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2 pr-1.5 pl-3.5",children:[(0,d.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px] leading-5",children:[(0,d.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[W," is idle"]}),af.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,d.jsx)(u.ShinyText,{text:`${af.join(", ")} working`,speed:2.4,className:"min-w-0 truncate"})]})]}),(0,d.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),an()]}),(0,d.jsx)(M,{threadId:a.id,recipient:W,send:al,busy:aa,autoFocus:ah,onEscape:ah?()=>A(!1):void 0,placeholder:ah?`What's off? ${W} reads this before its next step`:ai?`Anything for ${W}? It starts again as soon as you send`:"Anything more? It picks up where it left off",label:`Message for ${W}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:Q.length>1?(0,d.jsx)(N,{current:ak(W),bots:Q.map(a=>ak(a.bot)),disabled:aa,onPick:b=>{B.threadDrafts.select(a.id,b),v(b)}}):null,trailing:ah?(0,d.jsx)(q.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:aa,onClick:()=>A(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,d.jsx)(n.X,{})}):null},JSON.stringify([a.id,W])),aj&&(0,d.jsxs)("p",{className:"min-w-0 truncate px-1 text-xs text-muted-foreground",children:[W,"’s answer goes back to ",a.bot]}),!!ae&&!ah&&(0,d.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,d.jsx)(k.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,d.jsxs)("span",{className:"truncate",children:["Sending to ",ae]})]})]})},"useAnswerThread",0,P]),c()}catch(a){c(a)}},!1),936666,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7ffe5d1e95a7f1d2943c4521e56ffb54e27e063552",b.callServer,void 0,b.findSourceMapURL,"withdrawStepInAction");a.s(["withdrawStepInAction",0,c])},177640,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fa7094f780825c22fbc65937ce7579ed0bcfa6792",b.callServer,void 0,b.findSourceMapURL,"compactThreadAction");a.s(["compactThreadAction",0,c])},3376,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f50f96a5538572061175821b10256cd5b16370232",b.callServer,void 0,b.findSourceMapURL,"cancelThreadAction");a.s(["cancelThreadAction",0,c])},803190,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f45b5d03ffb69691b4a35892cf6f316f73e5d371e",b.callServer,void 0,b.findSourceMapURL,"answerThreadAction");a.s(["answerThreadAction",0,c])},217464,a=>{"use strict";var b=a.i(187924),c=a.i(767561),d=a.i(340695),e=a.i(313237),f=a.i(759497),g=a.i(307883);a.s(["SignInAsk",0,function({bot:a,onAllowed:h}){let{data:i}=(0,f.useServerRoute)(c.queryKey.signIns),[j,k]=(0,e.useServerAction)(g.setSignInBotAction,{onOk:()=>(0,f.revalidate)(c.queryKey.signIns)}),l=(i??[]).filter(b=>b.asking.includes(a));return l.length?(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map(c=>(0,b.jsxs)(d.Button,{type:"button",size:"sm",loading:k,onClick:()=>void j(c.site,a,!0).then(()=>h(`Yes — you may use my ${c.site} sign-in.`)).catch(()=>{}),children:["Let ",a," use ",c.site," (",c.account,")"]},c.site))}):null}])},866460,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(875160),f=a.i(474215),g=a.i(572131),h=a.i(864037),i=a.i(287702),j=a.i(38793),k=a.i(532871),l=a.i(313237),m=a.i(497895),n=b([j]);[j]=n.then?(await n)():n;let o=null;a.s(["GivenFiles",0,function({files:a,onRemove:b,dense:c=!1,children:g,className:h}){let i=c?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,d.jsxs)("div",{className:(0,m.cn)("flex flex-wrap gap-1.5",h),children:[a.map(a=>{let g;return(0,d.jsxs)("span",{className:(0,m.cn)("flex max-w-64 items-center bg-muted/70",c?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[a.path?(0,d.jsx)(j.FileThumb,{path:a.path,bytes:a.bytes,className:(0,m.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,d.jsx)("span",{className:(0,m.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,d.jsx)(e.Loader2,{className:"size-3.5 animate-spin"})}),(0,d.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,d.jsx)("span",{className:(0,m.cn)("truncate",c?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:a.name}),(0,d.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[(g=a.bytes)<1048576?`${Math.max(1,Math.round(g/1024))} KB`:`${(g/1024/1024).toFixed(1)} MB`,a.note&&` \xb7 ${a.note}`]})]}),(0,d.jsx)("button",{type:"button","aria-label":`Take ${a.name} out`,onClick:()=>b(a.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(f.X,{className:"size-3.5"})})]},a.key)}),g]})},"roomDrop",0,{claim:a=>(o=a,()=>{o===a&&(o=null)}),offer:(a,b)=>!!o&&!!a?.closest?.("[data-room]")&&(o(b),!0)},"useGivenFiles",0,function(a){let b=(0,g.useRef)(a?.onKept);b.current=a?.onKept;let[c,d]=(0,g.useState)([]),[e]=(0,l.useServerAction)(k.giveFilesAction),f=(0,g.useCallback)(async a=>{let f=i.GIVEN_FILES.perMessage-c.length;a.length>f&&h.toast.add({type:"error",title:`At most ${i.GIVEN_FILES.perMessage} files at a time.`});let g=a.slice(0,Math.max(0,f));if(!g.length)return;let j=g.map(a=>({key:crypto.randomUUID(),name:a.name,bytes:a.size,path:null}));d(a=>[...a,...j]);let k=new FormData;for(let a of g)k.append("file",a);try{let a=await e(k),c=b.current?.(a);d(b=>b.map(b=>{let d=j.findIndex(a=>a.key===b.key);return d<0?b:{...b,path:a[d]??null,note:c}}))}catch{d(a=>a.filter(a=>!j.some(b=>b.key===a.key)))}},[c.length,e]);return{files:c,take:f,remove:a=>d(b=>b.filter(b=>b.key!==a)),clear:()=>d([]),arriving:c.some(a=>null===a.path),withPaths:a=>[a.trim(),...c.flatMap(a=>a.path??[])].filter(Boolean).join("\n")}}]),c()}catch(a){c(a)}},!1),532871,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fba562e17a4d30d1bb61b1309cdab438ecaff153f",b.callServer,void 0,b.findSourceMapURL,"giveFilesAction");a.s(["giveFilesAction",0,c])},231500,a=>{"use strict";var b=a.i(164831);let c={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronsRight",0,d],231500)},802550,a=>{"use strict";var b=a.i(164831);let c={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};c.node;let d=(0,b.default)(c);a.s(["CircleQuestionMark",0,d],802550)},851528,a=>{"use strict";var b=a.i(164831);let c={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};c.node;let d=(0,b.default)(c);a.s(["CornerDownLeft",0,d],851528)},127774,a=>{"use strict";var b=a.i(164831);let c={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};c.node;let d=(0,b.default)(c);a.s(["Paperclip",0,d],127774)},748819,a=>{"use strict";var b=a.i(164831);let c={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};c.node;let d=(0,b.default)(c);a.s(["RotateCw",0,d],748819)},19895,a=>{"use strict";var b=a.i(164831);let c={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};c.node;let d=(0,b.default)(c);a.s(["Square",0,d],19895)}];
2
2
 
3
- //# sourceMappingURL=_1sttj8x._.js.map
3
+ //# sourceMappingURL=_1_5xof_._.js.map