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,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),n=e.i(225913);e.i(271645);var s=e.i(647163);function a({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.i(652225);let r=(0,n.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...a}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,s.cn)(r({orientation:n}),e),...a})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(a,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})}],986530)},787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),a=e.i(867927),r=e.i(21357),o=e.i(77071),i=e.i(456420);let c={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};c.node;let l=(0,i.default)(c),d={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};d.node;let m=(0,i.default)(d);var u=e.i(759659),p=e.i(263676),h=e.i(271645),f=e.i(798120),g=e.i(167881),x=e.i(986530),v=e.i(23750),j=e.i(647163);let b=(0,h.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let a=(0,h.useMemo)(()=>"string"==typeof e?function(e){let t=e.trim();if(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]")))return{success:!1,data:e};try{return{success:!0,data:JSON.parse(e)}}catch{return{success:!1,data:e}}}(e).data:e,[e]);return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(k,{data:a,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let y=(e,t)=>({role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}),N="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",k=(0,h.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:a})=>{var r;let o=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,h.useState)("string"!==o&&s<a),l={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(o){case"object":case"array":let d,m,u;return m=(d=(r="array"===o)?e:Object.entries(e)).length,u={open:r?"[":"{",close:r?"]":"}",collapsed:r?"[ ... ]":"{ ... }",empty:r?"[]":"{}"},0===m?(0,t.jsxs)("div",{className:"flex items-center",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:u.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",N),...y(i,()=>c(!i)),children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),i?(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.collapsed}),(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[m," ",1===m?"item":"items"]})]})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:r?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:a})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:n,name:e,depth:s+1,initialExpandDepth:a})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:u.close})]})]});case"string":return e.length>100?(0,t.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),(0,t.jsx)("pre",{className:(0,j.cn)(l.string,"cursor-pointer group-hover:text-foreground",N),...y(i,()=>c(!i)),title:i?"Click to collapse":"Click to expand",children:i?`"${e}"`:`"${e.slice(0,100)}..."`})]}):(0,t.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsxs)("pre",{className:l.string,children:['"',e,'"']})]});case"undefined":return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l.undefined,children:"undefined"})]});default:return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l[o]||l.default,children:null===e?"null":String(e)})]})}});k.displayName="JsonNode";var S=e.i(917162),w=e.i(818125),z=e.i(319036),C=e.i(127341),O=e.i(184762),A=e.i(6799),T=e.i(95187);let P=(0,T.createServerReference)("7fbe22831bc040ecc1f8eaafddab5bdba1ee25eb16",T.callServer,void 0,T.findSourceMapURL,"callToolAction"),F=(0,T.createServerReference)("7f43b273cbb47910cab79412873a51d14c9b1bd53e",T.callServer,void 0,T.findSourceMapURL,"deleteServerAction"),$=(0,T.createServerReference)("7f98e816ec063870c70f3b3cc687c3ab9a86784e4a",T.callServer,void 0,T.findSourceMapURL,"refreshServerAction"),R=(0,T.createServerReference)("7fdc006116034da96403babb00852ffd8d552211b6",T.callServer,void 0,T.findSourceMapURL,"registerServerAction");var M=e.i(681307),D=e.i(245629);let L=M.z.object({url:M.z.url(),headers:M.z.record(M.z.string(),M.z.string()).optional()}),E=M.z.object({command:M.z.string().min(1),args:M.z.array(M.z.string()).optional(),env:M.z.record(M.z.string(),M.z.string()).optional()}),I=M.z.union([L,E]),q=M.z.object({name:M.z.string(),description:M.z.string().optional(),inputSchema:M.z.looseObject({}).optional(),outputSchema:M.z.looseObject({}).optional()});function B(e){return"url"in e}M.z.object({clientInformation:M.z.looseObject({}).optional(),tokens:M.z.looseObject({}).optional(),authorizationServer:M.z.looseObject({}).optional(),codeVerifier:M.z.string().optional(),state:M.z.string().optional()});let J=M.z.object({name:M.z.string().min(1).max(40),config:I,toolCount:M.z.number().int(),lastError:M.z.string().nullish()}),U=q.extend({id:M.z.number().int(),description:M.z.string().nullish()});J.omit({toolCount:!0}).extend({tools:U.array().default([]),toolsSyncedAt:D.DateLikeSchema});let K=M.z.object({name:M.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:I}),H=M.z.union([M.z.object({mcpServers:M.z.record(M.z.string(),I)}),M.z.record(M.z.string(),I)]),V=[{name:"todoist",icon:"todoist.com",description:"Tasks, projects, and due dates",config:{url:"https://ai.todoist.net/mcp"}},{name:"home-assistant",icon:"home-assistant.io",description:"Lights, switches, and the rest of the house — your address and a long-lived token",config:{url:"http://homeassistant.local:8123/api/mcp",headers:{Authorization:"Bearer <your-home-assistant-token>"}}},{name:"kiwi",icon:"kiwi.com",description:"Flight search — no account",config:{url:"https://mcp.kiwi.com"}},{name:"zapier",icon:"zapier.com",description:"Gmail, Google Calendar, and thousands of apps you connect there",config:{url:"https://mcp.zapier.com/api/v1/connect"}},{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}}];var W=e.i(895836),_=e.i(333999),G=e.i(609856),Q=e.i(283653);function X({name:e,onDone:n}){let[s,a]=(0,h.useState)(""),{data:r,isLoading:o}=(0,Q.useServerRoute)(f.queryKey.mcpServer(e)),[i,c]=(0,G.useServerAction)($,{...el,onOk:t=>{el.onOk(t),(0,Q.revalidate)(f.queryKey.mcpServer(e))}}),[d,m]=(0,G.useServerAction)(F,{okMessage:"Server deleted",onOk:()=>{n(),(0,Q.revalidate)(f.queryKey.mcp)}}),p=async()=>{await S.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&d(e)};if(o)return(0,t.jsx)(W.SettingSkeleton,{rows:4});if(!r)return null;let x=r.tools.length,v=s.trim().toLowerCase(),j=v?r.tools.filter(e=>`${e.name} ${e.description??""}`.toLowerCase().includes(v)):r.tools,b=B(r.config)?"HTTP":"STDIO";return(0,t.jsxs)(W.SettingDialogContent,{title:r.name,description:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:b}),(0,t.jsx)("span",{className:"truncate font-mono",children:em(r.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.Button,{variant:"ghost",loading:m,onClick:p,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(g.Button,{variant:"outline",loading:c,onClick:()=>i(r.name),children:[(0,t.jsx)(l,{}),"Reconnect"]})]}),children:[r.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:r.lastError}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(W.SettingFilter,{value:s,onChange:a,placeholder:"Filter tools"}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[x," ",1===x?"tool":"tools"]})]}),j.map(e=>(0,t.jsx)(ee,{tool:e,serverName:r.name},e.name)),0===j.length&&x>0&&(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function Y({server:e}){let s=e.toolCount,r=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{S.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(X,{name:e.name,onDone:n})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(Z,{server:e})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),"connected"===r&&(0,t.jsx)(n.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===r?(0,t.jsx)("span",{className:"text-destructive",children:e.lastError}):(0,t.jsxs)(t.Fragment,{children:[s>0?`${s} ${1===s?"tool":"tools"}`:"No tools yet",(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",em(e.config)]})]})})]}),(0,t.jsx)(a.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:e}){let n,s=(n=V.find(t=>B(t.config)?B(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!B(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??V.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)(w.SiteIcon,{host:s,className:"size-5",fallback:(0,t.jsx)(m,{className:"size-4"})}):(0,t.jsx)(m,{className:"size-4"})}function ee({tool:e,serverName:n}){let[r,o]=(0,h.useState)(!1),[i,c]=(0,h.useState)(!1),[l,d]=(0,h.useState)(!1),m=[["inputSchema",e.inputSchema],["outputSchema",e.outputSchema]].filter(([,e])=>e);return(0,t.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.name}),m.length>0&&(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>o(!r),children:[r?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Test"]})]}),e.description?(0,t.jsx)("p",{className:(0,j.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null,r?(0,t.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:m.map(([e,n])=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===e?"in":"out"}),(0,t.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function e(t,n=0){if(!t||"object"!=typeof t)return"unknown";let s=" ".repeat(n+1),a=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let r=t.anyOf??t.oneOf;if(Array.isArray(r))return r.map(t=>e(t,n)).join(" | ");if("array"===t.type){let s=e(t.items,n);return/[|{]/.test(s)?`(${s})[]`:`${s}[]`}if("object"===t.type||t.properties){let r=t.properties;if(!r||0===Object.keys(r).length)return"{}";let o=t.required??[],i=Object.entries(r).map(([t,a])=>{let r=o.includes(t)?"":"?",i=a?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${r}: ${e(a,n+1)}${c}`});return`{
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),n=e.i(225913);e.i(271645);var s=e.i(647163);function a({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.i(652225);let r=(0,n.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...a}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,s.cn)(r({orientation:n}),e),...a})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(a,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})}],986530)},787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),a=e.i(867927),r=e.i(21357),o=e.i(77071),i=e.i(456420);let c={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};c.node;let l=(0,i.default)(c),d={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};d.node;let m=(0,i.default)(d);var u=e.i(759659),p=e.i(263676),h=e.i(271645),f=e.i(798120),g=e.i(167881),x=e.i(986530),v=e.i(23750),j=e.i(647163);let b=(0,h.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let a=(0,h.useMemo)(()=>"string"==typeof e?function(e){let t=e.trim();if(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]")))return{success:!1,data:e};try{return{success:!0,data:JSON.parse(e)}}catch{return{success:!1,data:e}}}(e).data:e,[e]);return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(k,{data:a,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let y=(e,t)=>({role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}),N="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",k=(0,h.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:a})=>{var r;let o=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,h.useState)("string"!==o&&s<a),l={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(o){case"object":case"array":let d,m,u;return m=(d=(r="array"===o)?e:Object.entries(e)).length,u={open:r?"[":"{",close:r?"]":"}",collapsed:r?"[ ... ]":"{ ... }",empty:r?"[]":"{}"},0===m?(0,t.jsxs)("div",{className:"flex items-center",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:u.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",N),...y(i,()=>c(!i)),children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),i?(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.collapsed}),(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[m," ",1===m?"item":"items"]})]})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:r?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:a})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:n,name:e,depth:s+1,initialExpandDepth:a})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:u.close})]})]});case"string":return e.length>100?(0,t.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),(0,t.jsx)("pre",{className:(0,j.cn)(l.string,"cursor-pointer group-hover:text-foreground",N),...y(i,()=>c(!i)),title:i?"Click to collapse":"Click to expand",children:i?`"${e}"`:`"${e.slice(0,100)}..."`})]}):(0,t.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsxs)("pre",{className:l.string,children:['"',e,'"']})]});case"undefined":return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l.undefined,children:"undefined"})]});default:return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l[o]||l.default,children:null===e?"null":String(e)})]})}});k.displayName="JsonNode";var S=e.i(917162),w=e.i(818125),z=e.i(319036),C=e.i(127341),O=e.i(184762),A=e.i(6799),T=e.i(95187);let P=(0,T.createServerReference)("7f10eeeae5a5dfd240dc39c1c1581fc058b565613c",T.callServer,void 0,T.findSourceMapURL,"callToolAction"),F=(0,T.createServerReference)("7ffb4e07fd3bef80a532307d58a2755d5d24601cf9",T.callServer,void 0,T.findSourceMapURL,"deleteServerAction"),$=(0,T.createServerReference)("7fe1df1fac3631cbf0e1651eba77b0846c28a15eb1",T.callServer,void 0,T.findSourceMapURL,"refreshServerAction"),R=(0,T.createServerReference)("7ff56366a5a6ccb74f36a746cee8e3b6a1d2f3e691",T.callServer,void 0,T.findSourceMapURL,"registerServerAction");var M=e.i(681307),D=e.i(245629);let L=M.z.object({url:M.z.url(),headers:M.z.record(M.z.string(),M.z.string()).optional()}),E=M.z.object({command:M.z.string().min(1),args:M.z.array(M.z.string()).optional(),env:M.z.record(M.z.string(),M.z.string()).optional()}),I=M.z.union([L,E]),q=M.z.object({name:M.z.string(),description:M.z.string().optional(),inputSchema:M.z.looseObject({}).optional(),outputSchema:M.z.looseObject({}).optional()});function B(e){return"url"in e}M.z.object({clientInformation:M.z.looseObject({}).optional(),tokens:M.z.looseObject({}).optional(),authorizationServer:M.z.looseObject({}).optional(),codeVerifier:M.z.string().optional(),state:M.z.string().optional()});let J=M.z.object({name:M.z.string().min(1).max(40),config:I,toolCount:M.z.number().int(),lastError:M.z.string().nullish()}),U=q.extend({id:M.z.number().int(),description:M.z.string().nullish()});J.omit({toolCount:!0}).extend({tools:U.array().default([]),toolsSyncedAt:D.DateLikeSchema});let K=M.z.object({name:M.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:I}),H=M.z.union([M.z.object({mcpServers:M.z.record(M.z.string(),I)}),M.z.record(M.z.string(),I)]),V=[{name:"todoist",icon:"todoist.com",description:"Tasks, projects, and due dates",config:{url:"https://ai.todoist.net/mcp"}},{name:"home-assistant",icon:"home-assistant.io",description:"Lights, switches, and the rest of the house — your address and a long-lived token",config:{url:"http://homeassistant.local:8123/api/mcp",headers:{Authorization:"Bearer <your-home-assistant-token>"}}},{name:"kiwi",icon:"kiwi.com",description:"Flight search — no account",config:{url:"https://mcp.kiwi.com"}},{name:"zapier",icon:"zapier.com",description:"Gmail, Google Calendar, and thousands of apps you connect there",config:{url:"https://mcp.zapier.com/api/v1/connect"}},{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}}];var W=e.i(895836),_=e.i(333999),G=e.i(609856),Q=e.i(283653);function X({name:e,onDone:n}){let[s,a]=(0,h.useState)(""),{data:r,isLoading:o}=(0,Q.useServerRoute)(f.queryKey.mcpServer(e)),[i,c]=(0,G.useServerAction)($,{...el,onOk:t=>{el.onOk(t),(0,Q.revalidate)(f.queryKey.mcpServer(e))}}),[d,m]=(0,G.useServerAction)(F,{okMessage:"Server deleted",onOk:()=>{n(),(0,Q.revalidate)(f.queryKey.mcp)}}),p=async()=>{await S.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&d(e)};if(o)return(0,t.jsx)(W.SettingSkeleton,{rows:4});if(!r)return null;let x=r.tools.length,v=s.trim().toLowerCase(),j=v?r.tools.filter(e=>`${e.name} ${e.description??""}`.toLowerCase().includes(v)):r.tools,b=B(r.config)?"HTTP":"STDIO";return(0,t.jsxs)(W.SettingDialogContent,{title:r.name,description:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:b}),(0,t.jsx)("span",{className:"truncate font-mono",children:em(r.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.Button,{variant:"ghost",loading:m,onClick:p,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(g.Button,{variant:"outline",loading:c,onClick:()=>i(r.name),children:[(0,t.jsx)(l,{}),"Reconnect"]})]}),children:[r.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:r.lastError}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(W.SettingFilter,{value:s,onChange:a,placeholder:"Filter tools"}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[x," ",1===x?"tool":"tools"]})]}),j.map(e=>(0,t.jsx)(ee,{tool:e,serverName:r.name},e.name)),0===j.length&&x>0&&(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function Y({server:e}){let s=e.toolCount,r=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{S.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(X,{name:e.name,onDone:n})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(Z,{server:e})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),"connected"===r&&(0,t.jsx)(n.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===r?(0,t.jsx)("span",{className:"text-destructive",children:e.lastError}):(0,t.jsxs)(t.Fragment,{children:[s>0?`${s} ${1===s?"tool":"tools"}`:"No tools yet",(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",em(e.config)]})]})})]}),(0,t.jsx)(a.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:e}){let n,s=(n=V.find(t=>B(t.config)?B(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!B(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??V.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)(w.SiteIcon,{host:s,className:"size-5",fallback:(0,t.jsx)(m,{className:"size-4"})}):(0,t.jsx)(m,{className:"size-4"})}function ee({tool:e,serverName:n}){let[r,o]=(0,h.useState)(!1),[i,c]=(0,h.useState)(!1),[l,d]=(0,h.useState)(!1),m=[["inputSchema",e.inputSchema],["outputSchema",e.outputSchema]].filter(([,e])=>e);return(0,t.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.name}),m.length>0&&(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>o(!r),children:[r?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Test"]})]}),e.description?(0,t.jsx)("p",{className:(0,j.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null,r?(0,t.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:m.map(([e,n])=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===e?"in":"out"}),(0,t.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function e(t,n=0){if(!t||"object"!=typeof t)return"unknown";let s=" ".repeat(n+1),a=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let r=t.anyOf??t.oneOf;if(Array.isArray(r))return r.map(t=>e(t,n)).join(" | ");if("array"===t.type){let s=e(t.items,n);return/[|{]/.test(s)?`(${s})[]`:`${s}[]`}if("object"===t.type||t.properties){let r=t.properties;if(!r||0===Object.keys(r).length)return"{}";let o=t.required??[],i=Object.entries(r).map(([t,a])=>{let r=o.includes(t)?"":"?",i=a?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${r}: ${e(a,n+1)}${c}`});return`{
2
2
  ${i.join("\n")}
3
3
  ${a}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t.type:"unknown"}(n)})]},e))}):null,i?(0,t.jsx)(et,{tool:e,serverName:n}):null]})}function et({tool:e,serverName:n}){let[s,a]=(0,h.useState)(()=>(function(e){let t=e.inputSchema?.properties;if(!t||"object"!=typeof t)return"{}";let n={};for(let[e,s]of Object.entries(t))n[e]=s?.type==="number"||s?.type==="integer"?0:s?.type!=="boolean"&&(s?.type==="array"?[]:s?.type==="object"?{}:"");return JSON.stringify(n,null,2)})(e)),[o,i]=(0,h.useState)(""),[c,l,d,m,u]=(0,G.useServerAction)(P,{errorMessage:!1});return(0,t.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,t.jsx)(O.Textarea,{value:s,onChange:e=>a(e.target.value),spellCheck:!1,className:"min-h-24 resize-none font-mono text-xs"}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-xs text-destructive",children:o||m}),(0,t.jsxs)(g.Button,{size:"sm",loading:l,onClick:()=>{let t;try{t=s.trim()?JSON.parse(s):void 0}catch{i("Not valid JSON");return}i(""),u(),c(n,e.name,t)},children:[!l&&(0,t.jsx)(r.Play,{}),"Run"]})]}),void 0!==d&&(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg bg-muted/40 p-3",children:(0,t.jsx)(b,{data:d,initialExpandDepth:3})})]})}function en(e){return S.notify.component({className:"sm:max-w-lg",renderer:({close:n})=>(0,t.jsx)(es,{initial:e,onDone:n})})}function es({initial:e,onDone:n}){let s=e&&B(e.config)?e.config:void 0,a=e&&!B(e.config)?e.config:void 0,[r,o]=(0,_.useObjectState)({mode:a?"stdio":"http",name:e?.name??"",url:s?.url??"",headers:eo(s?.headers),command:a?.command??"",args:(a?.args??[]).join(" "),env:eo(a?.env),raw:""}),{mode:i,name:c,url:l,headers:d,command:m,args:u,env:p,raw:f}=r,[j,b]=(0,G.useServerAction)(R,{...el,onOk:e=>{el.onOk(e),"error"!==e.status&&n()}}),y=(0,h.useMemo)(()=>{var e,t,n,s,a;let r,o;return"json"===i?function(e){let t,n=e.trim();if(!n)return{value:null,error:""};try{t=JSON.parse(n)}catch{return{value:null,error:"Not valid JSON"}}let s=I.safeParse(t);if(s.success)return{value:{name:null,config:s.data},error:""};let a=H.safeParse(t);if(!a.success)return{value:null,error:"Needs a url or a command"};let r=Object.entries("mcpServers"in a.data?a.data.mcpServers:a.data)[0];return r?{value:{name:r[0],config:r[1]},error:""}:{value:null,error:"No server in there"}}(f):"http"===i?(e=l,t=d,(r=L.safeParse({url:e.trim(),headers:ei(t)})).success?{value:{name:null,config:r.data},error:""}:{value:null,error:e.trim()?"Needs a valid url":""}):(n=m,s=u,a=p,(o=E.safeParse({command:n.trim(),args:s.split(/\s+/).filter(Boolean),env:ei(a)})).success?{value:{name:null,config:o.data},error:""}:{value:null,error:n.trim()?"Needs a command":""})},[i,f,l,d,m,u,p]),N="json"===i?f:JSON.stringify([i,l,d,m,u,p]),[k,S]=(0,h.useState)(N);(0,h.useEffect)(()=>{let e=setTimeout(()=>S(N),700);return()=>clearTimeout(e)},[N]);let w=k===N?y.error:"",A=c||y.value?.name||"",T=K.safeParse({name:A,config:y.value?.config});function P(e){let t=y.value?.config;return t?"json"===e?o({mode:e,raw:JSON.stringify(t,null,2)}):"http"===e&&B(t)?o({mode:e,url:t.url,headers:eo(t.headers)}):"stdio"!==e||B(t)?void o({mode:e}):o({mode:e,command:t.command,args:(t.args??[]).join(" "),env:eo(t.env)}):o({mode:e})}let F=(0,t.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,t.jsx)(z.Switch,{size:"sm",checked:"json"===i,onCheckedChange:e=>{let t;return e?P("json"):void P((t=y.value?.config)&&!B(t)?"stdio":"http")}})]});return(0,t.jsx)(W.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to every bot.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Button,{variant:"ghost",onClick:n,children:"Cancel"}),(0,t.jsx)(g.Button,{disabled:!T.success,loading:b,onClick:()=>{T.success&&!b&&j(T.data)},children:"Connect"})]}),children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Name"}),(0,t.jsx)(v.Input,{value:A,onChange:e=>o({name:e.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===i?(0,t.jsxs)(x.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(x.FieldLabel,{children:"JSON"}),F]}),(0,t.jsx)(O.Textarea,{value:f,onChange:e=>o({raw:e.target.value}),spellCheck:!1,placeholder:ec,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,t.jsxs)(C.Tabs,{value:i,onValueChange:e=>P(e),className:"gap-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(x.FieldLabel,{children:"Transport"}),F]}),(0,t.jsxs)(C.TabsList,{className:"w-full",children:[(0,t.jsx)(C.TabsTrigger,{value:"http",children:"HTTP"}),(0,t.jsx)(C.TabsTrigger,{value:"stdio",children:"STDIO"})]})]}),(0,t.jsxs)(C.TabsContent,{value:"http",className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"URL"}),(0,t.jsx)(v.Input,{value:l,onChange:e=>o({url:e.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(ea,{label:"Headers",pairs:d,onChange:e=>o({headers:e}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."})]}),(0,t.jsxs)(C.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Command"}),(0,t.jsx)(v.Input,{value:m,onChange:e=>o({command:e.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Args"}),(0,t.jsx)(v.Input,{value:u,onChange:e=>o({args:e.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(ea,{label:"Env",pairs:p,onChange:e=>o({env:e}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),w&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:w})]})})}function ea({label:e,pairs:n,onChange:s,keyPlaceholder:a,valuePlaceholder:r}){let i=(e,t)=>s(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:e}),(0,t.jsxs)("div",{className:"space-y-2",children:[n.map(e=>(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(v.Input,{value:e.key,onChange:t=>i(e.id,{key:t.target.value}),placeholder:a,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(v.Input,{value:e.value,onChange:t=>i(e.id,{value:t.target.value}),placeholder:r,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon","aria-label":"Remove this row",onClick:()=>s(n.filter(t=>t.id!==e.id)),children:(0,t.jsx)(p.X,{})})]},e.id)),(0,t.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>s([...n,er()]),children:[(0,t.jsx)(o.Plus,{}),"Add"]})]})]})}let er=(e="",t="")=>({id:crypto.randomUUID(),key:e,value:t}),eo=e=>Object.entries(e??{}).map(([e,t])=>er(e,t)),ei=e=>{let t=e.filter(e=>e.key.trim());if(t.length)return Object.fromEntries(t.map(e=>[e.key.trim(),e.value]))},ec=`/** STDIO Example */
4
4
  {
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,107941,e=>{"use strict";var t=e.i(843476),n=e.i(24071),i=e.i(867927),s=e.i(482022),r=e.i(829600),a=e.i(456420);let o={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};o.node;let l=(0,a.default)(o);var d=e.i(905015),c=e.i(226091),u=e.i(726067),m=e.i(569644),x=e.i(815170),h=e.i(51921);let f={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};f.node;let p=(0,a.default)(f);var g=e.i(759659),v=e.i(438583),y=e.i(271645),k=e.i(798120),j=e.i(167881),b=e.i(917162),S=e.i(41533),w=e.i(895836),N=e.i(621285),A=e.i(742032),F=e.i(95187);let C=(0,F.createServerReference)("7fcb96e35b94bbe0a1a67aa6a0844d6a26346965f3",F.callServer,void 0,F.findSourceMapURL,"emptyScratchAction");var P=e.i(837012),$=e.i(245629),R=e.i(609856),z=e.i(283653),E=e.i(647163);let T={markdown:c.FileText,csv:p,json:d.FileJson,text:c.FileText,frame:l,image:x.Image,audio:h.Music,video:v.Video,none:r.File};function M({label:e,rows:n,children:i}){return 0===n.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:e}),i]})}function W({entry:e,active:n,onPick:s}){let r="dir"===e.kind?u.Folder:T[e.view];return(0,t.jsxs)("button",{type:"button",onClick:s,title:"file"===e.kind?`${e.name} \xb7 ${(0,$.shortAgo)(e.at)}`:e.name,className:(0,E.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",n?(0,E.cn)(w.PICKED_ROW,"font-medium"):"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,t.jsx)(r,{className:"size-3.5 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),"file"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:(0,E.formatBytes)(e.bytes)}),(0,t.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,t.jsx)(i.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function O({empty:e}){return(0,t.jsx)("div",{className:"space-y-4 p-8",children:e?(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,t.jsxs)("span",{className:"font-mono text-[13px] text-foreground",children:[S.PATHS.artifacts,"/"]})," ","— a page, a table, a picture — and shows up here to open."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder, at the foot, opens everything else."})]})})}function K({file:e,onGone:n}){let i=e.path,[r]=(0,R.useServerAction)(P.revealFileAction),[a,o]=(0,R.useServerAction)(A.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,z.revalidate)(k.queryKey.workspace),n()}}),l=async()=>{await b.notify.confirm({title:`Delete ${i.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&a(i)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,t.jsx)(B,{path:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:[(0,E.formatBytes)(e.bytes)," · ",(0,$.shortAgo)(e.at)]}),(0,t.jsx)("a",{href:k.queryKey.fileView(i),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>r(i),children:(0,t.jsx)(m.FolderOpen,{})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:o,className:"text-muted-foreground",onClick:l,children:(0,t.jsx)(g.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,t.jsx)(N.FilePreview,{path:i,bytes:e.bytes})})]})}function B({path:e}){let n=["workspace",...e.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(i.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,E.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}e.s(["WorkspaceSetting",0,function(){let[e,i]=(0,y.useState)(""),[s,r]=(0,y.useState)(S.WORKSPACE_VIEW.rows),[a,o]=(0,y.useState)(null),[l,d]=(0,y.useState)(""),{data:c,isLoading:u,error:x}=(0,z.useServerRoute)(k.queryKey.workspaceFolder(e,s),{keepPreviousData:!0}),h=e=>{i(e),r(S.WORKSPACE_VIEW.rows)},[f,p]=(0,R.useServerAction)(C,{okMessage:"Scratch emptied",onOk:()=>(0,z.revalidate)(k.queryKey.workspace)}),[g]=(0,R.useServerAction)(P.revealFileAction),v=async()=>{await b.notify.confirm({title:"Empty scratch?",description:`Everything under ${S.PATHS.scratch}/ is deleted for good. ${S.PATHS.artifacts}/ and ${S.PATHS.projects}/ are untouched.`,okText:"Empty",destructive:!0})&&f()};if(u)return(0,t.jsx)(w.SettingPanesSkeleton,{});if(x)return(0,t.jsx)(w.SettingError,{message:x.message});let N=c?.entries??[],A=c?.total??0,F=l.trim().toLowerCase(),$=F?N.filter(e=>e.name.toLowerCase().includes(F)):N,E=$.filter(e=>"dir"===e.kind),T=$.filter(e=>"file"===e.kind),B=""!==e||N.some(e=>"dir"===e.kind&&e.name===S.PATHS.scratch),V=N.find(e=>"file"===e.kind&&e.path===a?.path)??a;return(0,t.jsx)(w.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:`${S.PATHS.workspace}${e?`/${e}`:""}`}),` \xb7 ${function(e,t){let n=e.filter(e=>"dir"===e.kind).length,i=e.length-n,s=[n&&`${n} ${1===n?"folder":"folders"}`,i&&`${i} ${1===i?"file":"files"}`].filter(Boolean);if(!s.length)return"empty";let r=s.join(" · ");return t>e.length?`${r} of ${t.toLocaleString("en")}`:r}(N,A)}`]})}),(0,t.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>g(e||"."),children:[(0,t.jsx)(m.FolderOpen,{}),"Reveal folder"]}),B&&(0,t.jsx)(j.Button,{variant:"outline",size:"sm",loading:p,onClick:v,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(w.SettingFilter,{value:l,onChange:d,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),e&&(0,t.jsxs)("button",{type:"button",onClick:()=>h(e.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.split("/").slice(0,-1).pop()??"workspace"})]}),0===$.length?(0,t.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:F?"Nothing matches":"Empty folder"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{label:"folders",rows:E,children:E.map(e=>(0,t.jsx)(W,{entry:e,onPick:()=>h(e.path)},e.path))}),(0,t.jsx)(M,{label:"files",rows:T,children:T.map(e=>(0,t.jsx)(W,{entry:e,active:e.path===a?.path,onPick:()=>"file"===e.kind&&o(e)},e.path))})]}),A>N.length&&(0,t.jsx)("button",{type:"button",onClick:()=>r(s+S.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(S.WORKSPACE_VIEW.rows,A-N.length)} more of ${A.toLocaleString("en")}`})]}),right:V?.kind==="file"?(0,t.jsx)(K,{file:V,onGone:()=>o(null)},V.path):(0,t.jsx)(O,{empty:!e&&0===N.length})})}],107941)},742032,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f63eb7eb8847592bfa5a261159d6461de9da119dd",t.callServer,void 0,t.findSourceMapURL,"deleteWorkspaceFileAction");e.s(["deleteWorkspaceFileAction",0,n])},726067,e=>{"use strict";var t=e.i(456420);let n={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};n.node;let i=(0,t.default)(n);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let i=(0,t.default)(n);e.s(["Trash2",0,i],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,107941,e=>{"use strict";var t=e.i(843476),n=e.i(24071),i=e.i(867927),s=e.i(482022),r=e.i(829600),a=e.i(456420);let o={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};o.node;let l=(0,a.default)(o);var d=e.i(905015),c=e.i(226091),u=e.i(726067),m=e.i(569644),f=e.i(815170),x=e.i(51921);let h={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};h.node;let p=(0,a.default)(h);var g=e.i(759659),v=e.i(438583),y=e.i(271645),k=e.i(798120),j=e.i(167881),b=e.i(917162),S=e.i(41533),w=e.i(895836),N=e.i(621285),A=e.i(125740),F=e.i(95187);let C=(0,F.createServerReference)("7f9f13c0736fd96048021c33f7bad4d5dff7852dd3",F.callServer,void 0,F.findSourceMapURL,"emptyScratchAction");var P=e.i(201830),$=e.i(245629),R=e.i(609856),z=e.i(283653),E=e.i(647163);let T={markdown:c.FileText,csv:p,json:d.FileJson,text:c.FileText,frame:l,image:f.Image,audio:x.Music,video:v.Video,none:r.File};function M({label:e,rows:n,children:i}){return 0===n.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:e}),i]})}function W({entry:e,active:n,onPick:s}){let r="dir"===e.kind?u.Folder:T[e.view];return(0,t.jsxs)("button",{type:"button",onClick:s,title:"file"===e.kind?`${e.name} \xb7 ${(0,$.shortAgo)(e.at)}`:e.name,className:(0,E.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",n?(0,E.cn)(w.PICKED_ROW,"font-medium"):"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,t.jsx)(r,{className:"size-3.5 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),"file"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:(0,E.formatBytes)(e.bytes)}),(0,t.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,t.jsx)(i.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function O({empty:e}){return(0,t.jsx)("div",{className:"space-y-4 p-8",children:e?(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,t.jsxs)("span",{className:"font-mono text-[13px] text-foreground",children:[S.PATHS.artifacts,"/"]})," ","— a page, a table, a picture — and shows up here to open."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder, at the foot, opens everything else."})]})})}function K({file:e,onGone:n}){let i=e.path,[r]=(0,R.useServerAction)(P.revealFileAction),[a,o]=(0,R.useServerAction)(A.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,z.revalidate)(k.queryKey.workspace),n()}}),l=async()=>{await b.notify.confirm({title:`Delete ${i.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&a(i)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,t.jsx)(B,{path:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:[(0,E.formatBytes)(e.bytes)," · ",(0,$.shortAgo)(e.at)]}),(0,t.jsx)("a",{href:k.queryKey.fileView(i),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>r(i),children:(0,t.jsx)(m.FolderOpen,{})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:o,className:"text-muted-foreground",onClick:l,children:(0,t.jsx)(g.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,t.jsx)(N.FilePreview,{path:i,bytes:e.bytes})})]})}function B({path:e}){let n=["workspace",...e.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(i.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,E.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}e.s(["WorkspaceSetting",0,function(){let[e,i]=(0,y.useState)(""),[s,r]=(0,y.useState)(S.WORKSPACE_VIEW.rows),[a,o]=(0,y.useState)(null),[l,d]=(0,y.useState)(""),{data:c,isLoading:u,error:f}=(0,z.useServerRoute)(k.queryKey.workspaceFolder(e,s),{keepPreviousData:!0}),x=e=>{i(e),r(S.WORKSPACE_VIEW.rows)},[h,p]=(0,R.useServerAction)(C,{okMessage:"Scratch emptied",onOk:()=>(0,z.revalidate)(k.queryKey.workspace)}),[g]=(0,R.useServerAction)(P.revealFileAction),v=async()=>{await b.notify.confirm({title:"Empty scratch?",description:`Everything under ${S.PATHS.scratch}/ is deleted for good. ${S.PATHS.artifacts}/ and ${S.PATHS.projects}/ are untouched.`,okText:"Empty",destructive:!0})&&h()};if(u)return(0,t.jsx)(w.SettingPanesSkeleton,{});if(f)return(0,t.jsx)(w.SettingError,{message:f.message});let N=c?.entries??[],A=c?.total??0,F=l.trim().toLowerCase(),$=F?N.filter(e=>e.name.toLowerCase().includes(F)):N,E=$.filter(e=>"dir"===e.kind),T=$.filter(e=>"file"===e.kind),B=""!==e||N.some(e=>"dir"===e.kind&&e.name===S.PATHS.scratch),V=N.find(e=>"file"===e.kind&&e.path===a?.path)??a;return(0,t.jsx)(w.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:`${S.PATHS.workspace}${e?`/${e}`:""}`}),` \xb7 ${function(e,t){let n=e.filter(e=>"dir"===e.kind).length,i=e.length-n,s=[n&&`${n} ${1===n?"folder":"folders"}`,i&&`${i} ${1===i?"file":"files"}`].filter(Boolean);if(!s.length)return"empty";let r=s.join(" · ");return t>e.length?`${r} of ${t.toLocaleString("en")}`:r}(N,A)}`]})}),(0,t.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>g(e||"."),children:[(0,t.jsx)(m.FolderOpen,{}),"Reveal folder"]}),B&&(0,t.jsx)(j.Button,{variant:"outline",size:"sm",loading:p,onClick:v,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(w.SettingFilter,{value:l,onChange:d,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),e&&(0,t.jsxs)("button",{type:"button",onClick:()=>x(e.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.split("/").slice(0,-1).pop()??"workspace"})]}),0===$.length?(0,t.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:F?"Nothing matches":"Empty folder"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{label:"folders",rows:E,children:E.map(e=>(0,t.jsx)(W,{entry:e,onPick:()=>x(e.path)},e.path))}),(0,t.jsx)(M,{label:"files",rows:T,children:T.map(e=>(0,t.jsx)(W,{entry:e,active:e.path===a?.path,onPick:()=>"file"===e.kind&&o(e)},e.path))})]}),A>N.length&&(0,t.jsx)("button",{type:"button",onClick:()=>r(s+S.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(S.WORKSPACE_VIEW.rows,A-N.length)} more of ${A.toLocaleString("en")}`})]}),right:V?.kind==="file"?(0,t.jsx)(K,{file:V,onGone:()=>o(null)},V.path):(0,t.jsx)(O,{empty:!e&&0===N.length})})}],107941)},125740,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7fa31daf369b37a1ff41ebd3e394698f03ca2c7c7f",t.callServer,void 0,t.findSourceMapURL,"deleteWorkspaceFileAction");e.s(["deleteWorkspaceFileAction",0,n])},726067,e=>{"use strict";var t=e.i(456420);let n={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};n.node;let i=(0,t.default)(n);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let i=(0,t.default)(n);e.s(["Trash2",0,i],759659)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null),[p,b]=(0,a.useState)(e);return p!==e&&(b(e),c(!1)),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep wrap-anywhere",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,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,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),h=e.i(660302),f=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7fc7b254c43cff117cb083333d0a1edb0982da7f89",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),T=e.i(647163),C=e.i(553429),_=e.i(978411),M=e.i(222055);function A({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"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,t.jsx)(u.X,{className:"size-3.5"})})}function B({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R,{thread:e}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(q,{thread:e})]})}function R({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,T.formatCount)(n)} tokens \xb7 in total in ${(0,T.formatCount)(a.input)} \xb7 out ${(0,T.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,T.formatCount)(n)}):null}function $({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)}),[l,d]=(0,m.useState)(n);if(l!==n&&(d(n),r(!1)),!n||!a)return null;let c=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name),title:s?"It summarizes itself at its next step":`Context ${(0,T.formatCount)(n)} of ${(0,T.formatCount)(a)} — 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,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,T.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":c>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*c))}%`}})})})}let D={working:"text-muted-foreground",waiting:T.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"},I={working:"working",waiting:"waiting",done:"done",cancelled:"stopped"};function q({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(h.ShinyText,{text:I.working,speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,T.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:I[e.status]})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(f.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,T.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(f.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:n.map(n=>{let a=O(e,n.name);return(0,t.jsxs)(f.TabsTrigger,{value:n.name,className:(0,T.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="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 O(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===W.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(ee,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(J,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(H,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==W.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(et,{line:o.line,surface:r,mention:d},o.key)})})})}function K({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?O(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),f=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",f?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":f,onClick:()=>{o(e=>!e),c(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"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(h.ShinyText,{text:"asking"===u?"waiting on you":b?V(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:(0,T.cn)("min-w-0 truncate text-[12px] leading-4",f&&"flex-1")}):(0,t.jsx)(U,{words:b?V(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · "),grow:f}),e.length>0&&(0,t.jsx)(G,{open:f})]}),!f&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),f&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ec(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(el,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e,inset:!0},e.id)))})]})}function H({lines:e,trailing:n,bot:a,thread:s}){let r=n?O(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ec(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(el,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e},e.id))),r&&!i&&(0,t.jsx)(h.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,T.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function G({open:e}){return(0,t.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,t.jsx)(s.ChevronDown,{className:(0,T.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function V(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,T.plainText)(e.text).replace(/\s+/g," ").trim()}function Q({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X,{from:W,to:e.bot}),(0,t.jsx)(ee,{side:"end",name:W.name,mark:(0,t.jsx)(J,{bot:W}),children:(0,t.jsx)(Z,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let W={name:C.ROOM_THURSDAY};function X({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.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,t.jsx)(Y,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(Y,{bot:n})]})})}function Y({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function J({bot:e}){return e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function Z({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,T.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,T.cn)("min-w-0",e&&"inverse"),children:n})})})}function ee({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,T.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function et({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(er,{}),a?(0,t.jsx)(es,{bot:a,bubble:i,children:o}):(0,t.jsx)(en,{bubble:i,className:(0,T.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(Z,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(eo,{text:e.text})})]})}function en({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,T.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",n&&"[&_[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!",a),children:e})}function ea({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,T.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",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function es({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(ea,{bot:e,bubble:n}),(0,t.jsx)(en,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function er(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function ei({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(en,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(en,{className:(0,T.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function eo({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,T.errorToString)(e)})}},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:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function el({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.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,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:ed(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep wrap-anywhere",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let ed=e=>e.split(" (")[0].replace(/\.$/,"");function ec(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||ed(a.lines[0].text)===ed(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=e.roster,c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&O(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>e.id))).size?{...e,lines:e.lines.filter(e=>!("ask"===e.kind&&void 0!==e.questionId&&i.has(e.questionId)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{l.current&&(e.scrollTop=e.scrollHeight)});for(let n of Array.from(e.children))t.observe(n);return()=>t.disconnect()},[p.length,e.lines,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,T.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",s),children:[!c&&(0,t.jsx)(Q,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(X,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,A,"TAB",0,L,"THURSDAY",0,W,"ThreadFacts",0,B,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"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,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:e.label}),(0,t.jsx)(B,{thread:e}),(0,t.jsx)(A,{onClick:a})]})},"leadOf",0,ed,"stepOf",0,V],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),h=e.i(496336),f=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(186882),v=e.i(750456),w=e.i(95187);let y=(0,w.createServerReference)("7f4834f38f44ede53e8ea16cf59cfd81cbca6481d4",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),T=e.i(609856),C=e.i(283653),_=e.i(730206);function M({bot:e,onAllowed:n}){let{data:a}=(0,C.useServerRoute)(x.queryKey.signIns),[s,r]=(0,T.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,C.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var A=e.i(6799),B=e.i(41533),R=e.i(83928);let $=(0,w.createServerReference)("7f437b7e9ad4bf7261b89d1fcf6c445f53cd95d337",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,T.useServerAction)($),r=(0,m.useCallback)(async e=>{let r=B.GIVEN_FILES.perMessage-n.length;e.length>r&&A.toast.add({type:"error",title:`At most ${B.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function q({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"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:[e.path?(0,t.jsx)(R.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[O(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.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,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let F=null,L={claim:e=>(F=e,()=>{F===e&&(F=null)}),offer:(e,t)=>!!F&&!!e?.closest?.("[data-room]")&&(F(t),!0)},O=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;e.s(["GivenFiles",0,q,"roomDrop",0,L,"useGivenFiles",0,I],709190);var E=e.i(319841);function K({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function H({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(V,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),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:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:h,className:f}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:T}=N;(0,m.useEffect)(()=>L.claim(e=>void T(e)),[T]);let C=!!g.trim()&&!i&&!N.arriving,_=async()=>{C&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",f),children:[N.files.length>0&&(0,t.jsx)(q,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),T(t))},onKeyDown:e=>{let t=(0,E.composing)(e);if("Escape"===e.key&&x&&!t){e.preventDefault(),x();return}"Enter"!==e.key||e.shiftKey||t||(e.preventDefault(),_())},placeholder:o,"aria-label":c,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,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{T([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),h,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:C?"default":"ghost",disabled:!C,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function G({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.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,t.jsx)("span",{className:"pl-1 text-muted-foreground",children:"To"}),(0,t.jsx)(V,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(V,{bot:e,size:16}),e.name]},e.name))})})]})}function V({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function Q(){let[e,t]=(0,T.useServerAction)(j.answerThreadAction,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[A,B]=(0,m.useState)(null),[R,$]=(0,m.useState)({id:e.id,bot:e.bot});(R.id!==e.id||R.bot!==e.bot)&&($({id:e.id,bot:e.bot}),w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let I=e.room.participants,q=e.room.questions,F=Math.max(0,q.findIndex(e=>e.id===b)),L=q[F],O="waiting"===n?e.ask:null,E=(0,N.isAppStop)(O),V=L?.bot??(I.some(e=>e.bot===j)?j:e.bot),W=L?.id,[X,Y]=Q(),[J,Z]=(0,T.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,C.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),ee=Y||Z,et=e.room.deliveries.filter(e=>!e.delivered),[en,ea]=(0,T.useServerAction)(y,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)}),es=et.map(e=>`${e.bot}: ${e.text}`).join(" · "),er=I.filter(e=>"running"===e.state).map(e=>e.bot),ei=er.join(", ")||e.bot,eo="running"===n&&I.some(e=>e.bot===V&&("running"===e.state||"queued"===e.state)),el="running"===n&&!eo,ed=V!==e.bot,ec=e=>a.find(t=>t.name===e)??{name:e},eu=async t=>{if(ee)return!1;let n=await X(e,t,V,W);return n&&eo&&_(!1),n},em=async e=>{B(e),await eu(e),B(null)},ex=(a=!1)=>"running"===n||"waiting"===n?(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:Z,disabled:ee,onClick:()=>J(e.id),"aria-label":"Stop this thread",className:(0,D.cn)("h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",a&&"bg-background px-3 hover:bg-background/60 dark:hover:bg-background/60"),children:[!Z&&(0,t.jsx)(c.Square,{className:"size-2.5 fill-current"}),"Stop"]}):null;if(L){let n=L.options??[],a=L.text;return(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(V),word:"Question",children:(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[q.length>1&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:ee||0===F,onClick:()=>k(q[F-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[F+1," / ",q.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:ee||F===q.length-1,onClick:()=>k(q[F+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]}),ex(!0)]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(f.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:A,busy:ee,onChoose:em}),(0,t.jsx)(M,{bot:V,onAllowed:eu}),(0,t.jsx)(U,{threadId:e.id,recipient:V,draftKey:L.id,send:eu,busy:ee,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${V}`},JSON.stringify([e.id,V,L.id]))]})}return E?(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(e.bot),word:"Paused",children:(0,t.jsx)("span",{className:"ml-auto flex shrink-0",children:ex(!0)})}),O?.question&&(0,t.jsx)(h.FoldedText,{text:O.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:O?.options.length?O.options:[N.THREAD_CONTINUE],picked:A,busy:ee,onChoose:em}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,placeholder:"Or put it another way…",label:`Message for ${V}`},JSON.stringify([e.id,V,"paused"]))]}):eo&&!S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[et.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep wrap-anywhere text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ea,onClick:()=>en(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ei} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:ee,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[el&&(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 pr-1.5 pl-3.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px] leading-5",children:[(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[V," is idle"]}),er.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)(g.ShinyText,{text:`${er.join(", ")} working`,speed:2.4,className:"min-w-0 truncate"})]})]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,autoFocus:eo,onEscape:eo?()=>_(!1):void 0,placeholder:eo?`What's off? ${V} reads this before its next step`:el?`Anything for ${V}? It starts again as soon as you send`:"Anything more? It picks up where it left off",label:`Message for ${V}`,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:I.length>1?(0,t.jsx)(G,{current:ec(V),bots:I.map(e=>ec(e.bot)),disabled:ee,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:eo?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ee,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,V])),ed&&(0,t.jsxs)("p",{className:"min-w-0 truncate px-1 text-xs text-muted-foreground",children:[V,"’s answer goes back to ",e.bot]}),!!es&&!eo&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",es]})]})]})},"useAnswerThread",0,Q],399512)},186882,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f97f3d8097e9dd928e8380c0b2ae11b6a3ed0f837",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},750456,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7fd1c34898b1d9b8c18a494235f4d821ea402d2c13",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={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"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.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,o.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"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.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",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null),[p,b]=(0,a.useState)(e);return p!==e&&(b(e),c(!1)),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep wrap-anywhere",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,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,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),h=e.i(660302),f=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7fa7094f780825c22fbc65937ce7579ed0bcfa6792",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),T=e.i(647163),C=e.i(553429),_=e.i(978411),M=e.i(222055);function A({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"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,t.jsx)(u.X,{className:"size-3.5"})})}function B({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R,{thread:e}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(q,{thread:e})]})}function R({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,T.formatCount)(n)} tokens \xb7 in total in ${(0,T.formatCount)(a.input)} \xb7 out ${(0,T.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,T.formatCount)(n)}):null}function $({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)}),[l,d]=(0,m.useState)(n);if(l!==n&&(d(n),r(!1)),!n||!a)return null;let c=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name),title:s?"It summarizes itself at its next step":`Context ${(0,T.formatCount)(n)} of ${(0,T.formatCount)(a)} — 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,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,T.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":c>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*c))}%`}})})})}let D={working:"text-muted-foreground",waiting:T.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"},I={working:"working",waiting:"waiting",done:"done",cancelled:"stopped"};function q({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(h.ShinyText,{text:I.working,speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,T.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:I[e.status]})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(f.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,T.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(f.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:n.map(n=>{let a=O(e,n.name);return(0,t.jsxs)(f.TabsTrigger,{value:n.name,className:(0,T.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="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 O(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===W.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(ee,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(J,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(H,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==W.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(et,{line:o.line,surface:r,mention:d},o.key)})})})}function K({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?O(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),f=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",f?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":f,onClick:()=>{o(e=>!e),c(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"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(h.ShinyText,{text:"asking"===u?"waiting on you":b?V(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:(0,T.cn)("min-w-0 truncate text-[12px] leading-4",f&&"flex-1")}):(0,t.jsx)(U,{words:b?V(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · "),grow:f}),e.length>0&&(0,t.jsx)(G,{open:f})]}),!f&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),f&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ec(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(el,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e,inset:!0},e.id)))})]})}function H({lines:e,trailing:n,bot:a,thread:s}){let r=n?O(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ec(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(el,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e},e.id))),r&&!i&&(0,t.jsx)(h.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,T.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function G({open:e}){return(0,t.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,t.jsx)(s.ChevronDown,{className:(0,T.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function V(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,T.plainText)(e.text).replace(/\s+/g," ").trim()}function Q({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X,{from:W,to:e.bot}),(0,t.jsx)(ee,{side:"end",name:W.name,mark:(0,t.jsx)(J,{bot:W}),children:(0,t.jsx)(Z,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let W={name:C.ROOM_THURSDAY};function X({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.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,t.jsx)(Y,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(Y,{bot:n})]})})}function Y({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function J({bot:e}){return e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function Z({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,T.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,T.cn)("min-w-0",e&&"inverse"),children:n})})})}function ee({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,T.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function et({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(er,{}),a?(0,t.jsx)(es,{bot:a,bubble:i,children:o}):(0,t.jsx)(en,{bubble:i,className:(0,T.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(Z,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(eo,{text:e.text})})]})}function en({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,T.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",n&&"[&_[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!",a),children:e})}function ea({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,T.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",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function es({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(ea,{bot:e,bubble:n}),(0,t.jsx)(en,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function er(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function ei({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(en,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(en,{className:(0,T.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function eo({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,T.errorToString)(e)})}},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:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function el({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.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,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:ed(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep wrap-anywhere",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let ed=e=>e.split(" (")[0].replace(/\.$/,"");function ec(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||ed(a.lines[0].text)===ed(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=e.roster,c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&O(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>e.id))).size?{...e,lines:e.lines.filter(e=>!("ask"===e.kind&&void 0!==e.questionId&&i.has(e.questionId)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{l.current&&(e.scrollTop=e.scrollHeight)});for(let n of Array.from(e.children))t.observe(n);return()=>t.disconnect()},[p.length,e.lines,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,T.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",s),children:[!c&&(0,t.jsx)(Q,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(X,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,A,"TAB",0,L,"THURSDAY",0,W,"ThreadFacts",0,B,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"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,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:e.label}),(0,t.jsx)(B,{thread:e}),(0,t.jsx)(A,{onClick:a})]})},"leadOf",0,ed,"stepOf",0,V],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),h=e.i(496336),f=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(293735),v=e.i(856338),w=e.i(95187);let y=(0,w.createServerReference)("7ffe5d1e95a7f1d2943c4521e56ffb54e27e063552",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),T=e.i(609856),C=e.i(283653),_=e.i(475005);function M({bot:e,onAllowed:n}){let{data:a}=(0,C.useServerRoute)(x.queryKey.signIns),[s,r]=(0,T.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,C.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var A=e.i(6799),B=e.i(41533),R=e.i(83928);let $=(0,w.createServerReference)("7fba562e17a4d30d1bb61b1309cdab438ecaff153f",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,T.useServerAction)($),r=(0,m.useCallback)(async e=>{let r=B.GIVEN_FILES.perMessage-n.length;e.length>r&&A.toast.add({type:"error",title:`At most ${B.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function q({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"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:[e.path?(0,t.jsx)(R.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[O(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.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,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let F=null,L={claim:e=>(F=e,()=>{F===e&&(F=null)}),offer:(e,t)=>!!F&&!!e?.closest?.("[data-room]")&&(F(t),!0)},O=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;e.s(["GivenFiles",0,q,"roomDrop",0,L,"useGivenFiles",0,I],709190);var E=e.i(319841);function K({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function H({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(V,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),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:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:h,className:f}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:T}=N;(0,m.useEffect)(()=>L.claim(e=>void T(e)),[T]);let C=!!g.trim()&&!i&&!N.arriving,_=async()=>{C&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",f),children:[N.files.length>0&&(0,t.jsx)(q,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,readOnly:i,"aria-busy":i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),T(t))},onKeyDown:e=>{let t=(0,E.composing)(e);if("Escape"===e.key&&x&&!t){e.preventDefault(),x();return}"Enter"!==e.key||e.shiftKey||t||(e.preventDefault(),_())},placeholder:o,"aria-label":c,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,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{T([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),h,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:C?"default":"ghost",disabled:!C,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function G({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.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,t.jsx)("span",{className:"pl-1 text-muted-foreground",children:"To"}),(0,t.jsx)(V,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(V,{bot:e,size:16}),e.name]},e.name))})})]})}function V({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function Q(){let[e,t]=(0,T.useServerAction)(j.answerThreadAction,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[A,B]=(0,m.useState)(null),[R,$]=(0,m.useState)({id:e.id,bot:e.bot});(R.id!==e.id||R.bot!==e.bot)&&($({id:e.id,bot:e.bot}),w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let I=e.room.participants,q=e.room.questions,F=Math.max(0,q.findIndex(e=>e.id===b)),L=q[F],O="waiting"===n?e.ask:null,E=(0,N.isAppStop)(O),V=L?.bot??(I.some(e=>e.bot===j)?j:e.bot),W=L?.id,[X,Y]=Q(),[J,Z]=(0,T.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,C.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),ee=Y||Z,et=e.room.deliveries.filter(e=>!e.delivered),[en,ea]=(0,T.useServerAction)(y,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)}),es=et.map(e=>`${e.bot}: ${e.text}`).join(" · "),er=I.filter(e=>"running"===e.state).map(e=>e.bot),ei=er.join(", ")||e.bot,eo="running"===n&&I.some(e=>e.bot===V&&("running"===e.state||"queued"===e.state)),el="running"===n&&!eo,ed=V!==e.bot,ec=e=>a.find(t=>t.name===e)??{name:e},eu=async t=>{if(ee)return!1;let n=await X(e,t,V,W);return n&&eo&&_(!1),n},em=async e=>{B(e),await eu(e),B(null)},ex=(a=!1)=>"running"===n||"waiting"===n?(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:Z,disabled:ee,onClick:()=>J(e.id),"aria-label":"Stop this thread",className:(0,D.cn)("h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",a&&"bg-background px-3 hover:bg-background/60 dark:hover:bg-background/60"),children:[!Z&&(0,t.jsx)(c.Square,{className:"size-2.5 fill-current"}),"Stop"]}):null;if(L){let n=L.options??[],a=L.text;return(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(V),word:"Question",children:(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[q.length>1&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:ee||0===F,onClick:()=>k(q[F-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[F+1," / ",q.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:ee||F===q.length-1,onClick:()=>k(q[F+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]}),ex(!0)]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(f.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:A,busy:ee,onChoose:em}),(0,t.jsx)(M,{bot:V,onAllowed:eu}),(0,t.jsx)(U,{threadId:e.id,recipient:V,draftKey:L.id,send:eu,busy:ee,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${V}`},JSON.stringify([e.id,V,L.id]))]})}return E?(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(e.bot),word:"Paused",children:(0,t.jsx)("span",{className:"ml-auto flex shrink-0",children:ex(!0)})}),O?.question&&(0,t.jsx)(h.FoldedText,{text:O.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:O?.options.length?O.options:[N.THREAD_CONTINUE],picked:A,busy:ee,onChoose:em}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,placeholder:"Or put it another way…",label:`Message for ${V}`},JSON.stringify([e.id,V,"paused"]))]}):eo&&!S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[et.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep wrap-anywhere text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ea,onClick:()=>en(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ei} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:ee,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[el&&(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 pr-1.5 pl-3.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px] leading-5",children:[(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[V," is idle"]}),er.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)(g.ShinyText,{text:`${er.join(", ")} working`,speed:2.4,className:"min-w-0 truncate"})]})]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,autoFocus:eo,onEscape:eo?()=>_(!1):void 0,placeholder:eo?`What's off? ${V} reads this before its next step`:el?`Anything for ${V}? It starts again as soon as you send`:"Anything more? It picks up where it left off",label:`Message for ${V}`,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:I.length>1?(0,t.jsx)(G,{current:ec(V),bots:I.map(e=>ec(e.bot)),disabled:ee,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:eo?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ee,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,V])),ed&&(0,t.jsxs)("p",{className:"min-w-0 truncate px-1 text-xs text-muted-foreground",children:[V,"’s answer goes back to ",e.bot]}),!!es&&!eo&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",es]})]})]})},"useAnswerThread",0,Q],399512)},856338,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f50f96a5538572061175821b10256cd5b16370232",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},293735,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f45b5d03ffb69691b4a35892cf6f316f73e5d371e",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={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"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={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"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.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,o.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"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.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",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8912,e=>{"use strict";var s=e.i(843476),t=e.i(437750),i=e.i(375775),n=e.i(91511),a=e.i(758925),o=e.i(97923),r=e.i(456420);let l={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};l.node;let d=(0,r.default)(l),c={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};c.node;let u=(0,r.default)(c);var m=e.i(263676),h=e.i(511769),x=e.i(798120),p=e.i(167881),g=e.i(917162),f=e.i(818125),k=e.i(635963),b=e.i(895836),j=e.i(245629),y=e.i(609856),v=e.i(283653),w=e.i(647163),N=e.i(95187);let S=(0,N.createServerReference)("7fd123792ee763eed5994fae785cacd75c479932dc",N.callServer,void 0,N.findSourceMapURL,"removeSignInAction");var z=e.i(475005);let A=[[t.AppWindow,"A bot opens a window","When its work needs you signed in to a site, it opens that site on your screen and asks."],[o.LogIn,"You sign in there","The app keeps that sign-in here — the site's session, never your password."],[u,"Only that bot uses it","Later work is signed in without asking. Another bot has to ask you first."]];function I(){return(0,s.jsx)("ol",{className:"grid gap-3 pb-5 sm:grid-cols-3",children:A.map(([e,t,i],n)=>(0,s.jsxs)("li",{className:"flex gap-3 rounded-xl bg-muted/40 p-3.5",children:[(0,s.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-background text-muted-foreground ring-1 ring-border/60",children:(0,s.jsx)(e,{className:"size-4"})}),(0,s.jsxs)("span",{className:"min-w-0 space-y-0.5",children:[(0,s.jsxs)("span",{className:"block text-[13px] font-medium",children:[n+1,". ",t]}),(0,s.jsx)("span",{className:"block text-xs leading-relaxed text-muted-foreground",children:i})]})]},t))})}function O({signIn:e,bots:t}){let i=()=>(0,v.revalidate)(x.queryKey.signIns),[n,o]=(0,y.useServerAction)(z.setSignInBotAction,{onOk:i}),[r,l]=(0,y.useServerAction)(S,{onOk:i}),c=async()=>{await g.notify.confirm({title:`Sign out of ${e.site}?`,description:"What is kept here is removed, and the bots that used it ask you to sign in again. The site itself may still list the session until it ends it.",okText:"Sign out",destructive:!0})&&r(e.site)};return(0,s.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-xl bg-muted/60",children:(0,s.jsx)(f.SiteIcon,{host:e.site,className:"size-5 rounded-[5px]",fallback:(0,s.jsx)(a.KeyRound,{className:"size-4 text-muted-foreground"})})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,s.jsx)("span",{className:"block truncate text-sm font-medium",children:e.site}),(0,s.jsx)("span",{className:"block truncate text-[13px] text-muted-foreground",children:e.account})]}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:e.usedAt?`used ${(0,j.whenOf)(e.usedAt)}`:`kept ${(0,j.whenOf)(e.keptAt)}`}),(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",loading:l,onClick:()=>void c(),children:[(0,s.jsx)(d,{}),"Sign out"]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pl-13",children:[e.bots.map(i=>(0,s.jsxs)("span",{className:"flex h-7 items-center gap-1.5 rounded-full bg-muted/60 pr-1 pl-1.5 text-[13px]",children:[(0,s.jsx)(k.BotMark,{size:18,seed:i,...(0,k.markOf)(i,t)}),i,(0,s.jsx)("button",{type:"button",disabled:o,"aria-label":`${i} may no longer use it`,onClick:()=>void n(e.site,i,!1),className:"grid size-5 place-items-center rounded-full text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(m.X,{className:"size-3"})})]},i)),0===e.bots.length&&0===e.asking.length&&(0,s.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"No bot may use it. One that needs it will ask."}),e.asking.map(i=>(0,s.jsxs)("span",{className:(0,w.cn)("flex h-7 items-center gap-1.5 rounded-full pr-1 pl-1.5 text-[13px] ring-1 ring-border ring-inset",w.WAITING_INK),children:[(0,s.jsx)(k.BotMark,{size:18,seed:i,...(0,k.markOf)(i,t)}),i," asks",(0,s.jsx)(p.Button,{size:"sm",variant:"secondary",className:"h-5 rounded-full px-2 text-[11px]",disabled:o,onClick:()=>void n(e.site,i,!0),children:"Allow"})]},i))]})]})}let R="https://chromewebstore.google.com/detail/playwright-extension/mmlmfjhmonkocbjadbfplnigmagldckm";function C(){return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,s.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-xl bg-muted/60",children:(0,s.jsx)(f.SiteIcon,{host:new URL(R).host,className:"size-5 rounded-[5px]",fallback:(0,s.jsx)(n.Globe,{className:"size-4 text-muted-foreground"})})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,s.jsx)("span",{className:"block text-sm font-medium",children:"Your own Chrome"}),(0,s.jsx)("span",{className:"block text-[13px] text-muted-foreground",children:"For a site that will not stay signed in. A bot gets a tab of its own, signed in as you — to every site your Chrome is, not only that one."})]}),(0,s.jsxs)("a",{href:R,target:"_blank",rel:"noreferrer",className:(0,w.cn)((0,p.buttonVariants)({variant:"outline",size:"sm"})),children:["Get the extension",(0,s.jsx)(i.ArrowUpRight,{})]})]})}e.s(["SignInsSetting",0,function(){let{data:e,isLoading:t,error:i}=(0,v.useServerRoute)(x.queryKey.signIns),{data:n}=(0,v.useServerRoute)(x.queryKey.bot);if((0,h.useAppEvent)({signins:()=>void(0,v.revalidate)(x.queryKey.signIns)}),t)return(0,s.jsx)(b.SettingSkeleton,{rows:3});if(i)return(0,s.jsx)(b.SettingError,{message:i.message});let a=e??[];return(0,s.jsxs)(b.SettingScreen,{footer:(0,s.jsx)(b.SettingRailNote,{children:"A site's session as the browser held it — never a password. Kept on this machine, outside the folder the bots work in. It is the whole session: signed in with Google, it carries the Google sign-in too."}),children:[(0,s.jsx)(I,{}),(0,s.jsxs)(b.SettingItems,{children:[0===a.length?(0,s.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:"Nothing is kept yet. When a bot needs you signed in somewhere, it opens a window for you to sign in — and that sign-in is kept here for its later work."}):a.map(e=>(0,s.jsx)(O,{signIn:e,bots:n},e.site)),(0,s.jsx)(C,{})]})]})}],8912)},437750,e=>{"use strict";var s=e.i(456420);let t={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};t.node;let i=(0,s.default)(t);e.s(["AppWindow",0,i],437750)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94682,e=>{"use strict";var t=e.i(843476),n=e.i(24071),s=e.i(482022),r=e.i(569644),i=e.i(456420);let o={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};o.node;let a=(0,i.default)(o);var l=e.i(759659),c=e.i(271645),d=e.i(798120),u=e.i(167881),f=e.i(917162),m=e.i(671428),h=e.i(41533),x=e.i(95187);let p=(0,x.createServerReference)("7f9ae96ef603048090cece48f8a4dd0914bfc72a3e",x.callServer,void 0,x.findSourceMapURL,"deleteArtifactAction");var g=e.i(635963),b=e.i(895836),v=e.i(83928),j=e.i(621285),y=e.i(837012),k=e.i(245629),N=e.i(609856),w=e.i(283653),S=e.i(647163);function A(e){let t=new Map;for(let n of e){let e=t.get(n.bot)??[];e.push(n),t.set(n.bot,e)}return[...t].map(([e,t])=>({bot:e,rows:t}))}function C({label:e,mark:n,count:s,active:r,onPick:i}){return(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,S.cn)("mx-2 flex h-9 items-center gap-2 rounded-md px-2 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",r?(0,S.cn)(b.PICKED_ROW,"font-medium"):"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[n??(0,t.jsx)(a,{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] text-muted-foreground/70 tabular-nums",children:s})]})}function $({row:e,file:i,onOpen:o,onBack:a,onGone:c,onShelf:m}){let[h]=(0,N.useServerAction)(y.revealFileAction),[x,g]=(0,N.useServerAction)(p,{okMessage:"Deleted",onOk:()=>{(0,w.revalidate)(d.queryKey.artifacts),i?a():c()}}),b=i?{path:i.path,bytes:i.bytes,at:i.at}:"file"===e.kind?{path:e.path,bytes:e.bytes,at:e.at}:null,v=async e=>{await f.notify.confirm({title:`Delete ${e.split("/").pop()}?`,description:b?"It is deleted from disk for good.":"The folder and everything in it are deleted from disk for good.",okText:"Delete",destructive:!0})&&x(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-3 border-b border-border/60 px-6",children:[(0,t.jsxs)("button",{type:"button",onClick:i?a:m,className:"-ml-1 flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3"}),i?e.name:"Shelf"]}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:b?b.path.split("/").pop()??e.name:e.name}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:b?`${(0,S.formatBytes)(b.bytes)} \xb7 ${(0,k.shortAgo)(b.at)}`:`${e.count} ${1===e.count?"file":"files"} \xb7 ${(0,k.shortAgo)(e.at)}`}),b&&(0,t.jsx)("a",{href:d.queryKey.fileView(b.path),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>h(b?.path??e.path),children:(0,t.jsx)(r.FolderOpen,{})}),(0,t.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:g,className:"ml-1.5 text-muted-foreground hover:text-destructive",onClick:()=>v(b?.path??e.path),children:(0,t.jsx)(l.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:b?(0,t.jsx)(j.FilePreview,{path:b.path,bytes:b.bytes}):(0,t.jsx)(T,{path:e.path,onOpen:o})})]})}function T({path:e,onOpen:n}){let{data:s,isLoading:r,error:i}=(0,w.useServerRoute)(d.queryKey.artifactSet(e,h.ARTIFACT_VIEW.setFiles));if(r)return(0,t.jsx)("div",{className:"grid grid-cols-4 gap-3 p-5",children:Array.from({length:8},(e,n)=>(0,t.jsx)(m.Skeleton,{className:"aspect-4/3 w-full rounded-xl"},n))});if(i)return(0,t.jsx)(b.SettingError,{message:i.message});let o=s?.files??[];return 0===o.length?(0,t.jsx)("p",{className:"p-5 text-xs text-muted-foreground/60",children:"Nothing in here the app can open."}):(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsx)("div",{className:"grid grid-cols-4 gap-3",children:o.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>n(e),title:`${e.name} \xb7 ${(0,S.formatBytes)(e.bytes)}`,className:"flex flex-col gap-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-2",children:[(0,t.jsx)(F,{file:e}),(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.name})]},e.path))}),s&&s.total>o.length&&(0,t.jsx)("p",{className:"pt-4 font-mono text-[11px] text-muted-foreground/60",children:`${o.length} of ${s.total.toLocaleString("en")} — the rest are in the folder`})]})}function F({file:e}){return(0,t.jsx)(v.FileThumb,{path:e.path,bytes:e.bytes,glyph:"size-5",className:"aspect-4/3 w-full rounded-xl ring-1 ring-foreground/5 ring-inset"})}function z({entries:e,bots:n,onPick:s}){return(0,t.jsx)("div",{className:"space-y-7 p-6",children:A(e).map(({bot:e,rows:i})=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[e&&(0,t.jsx)(g.BotMark,{size:20,seed:e,...(0,g.markOf)(e,n),notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e??"Unsorted"}),(0,t.jsx)("span",{className:"font-mono text-[11px] font-normal text-muted-foreground",children:i.length})]}),(0,t.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))] gap-x-4 gap-y-5",children:i.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>s(e),className:"group flex min-w-0 flex-col gap-1.5 rounded-xl text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:["set"===e.kind?(0,t.jsx)("span",{className:"grid aspect-4/3 w-full place-items-center rounded-xl bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,t.jsx)(r.FolderOpen,{className:"size-5"})}):(0,t.jsx)(v.FileThumb,{path:e.path,bytes:e.bytes,glyph:"size-5",className:"aspect-4/3 w-full rounded-xl ring-1 ring-foreground/5 ring-inset"}),(0,t.jsxs)("span",{className:"min-w-0 space-y-0.5 px-0.5",children:[(0,t.jsx)("span",{className:"block truncate text-[13px]",children:e.name}),(0,t.jsxs)("span",{className:"block truncate font-mono text-[10.5px] text-muted-foreground",children:["set"===e.kind?`${e.count} ${1===e.count?"file":"files"} \xb7 `:"",(0,k.shortAgo)(e.at)]})]})]},e.path))})]},e??""))})}function R({empty:e}){return(0,t.jsx)("div",{className:"p-8",children:(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:e?"Nothing finished yet. When a bot ends a job with something to hand over — a page, a report, a set of pictures — it lands here.":"Pick something on the left. Each bot's work is under its face; a folder it filled is one row, and opens as a sheet."})})}e.s(["ArtifactSetting",0,function(){let[e,n]=(0,c.useState)(null),[s,i]=(0,c.useState)(""),[o,a]=(0,c.useState)(void 0),[l,f]=(0,c.useState)(h.ARTIFACT_VIEW.rows),{data:m,isLoading:x,error:p}=(0,w.useServerRoute)(d.queryKey.artifactShelf(l),{keepPreviousData:!0}),{data:v}=(0,w.useServerRoute)(d.queryKey.bot),[j]=(0,N.useServerAction)(y.revealFileAction);if(x)return(0,t.jsx)(b.SettingPanesSkeleton,{});if(p)return(0,t.jsx)(b.SettingError,{message:p.message});let k=m?.entries??[],S=m?.total??0,T=s.trim().toLowerCase(),F=k.filter(e=>(void 0===o||e.bot===o)&&(!T||e.name.toLowerCase().includes(T)||e.bot?.toLowerCase().includes(T))),M=k.find(t=>t.path===e?.row.path)??e?.row;return(0,t.jsx)(b.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"finished"}),` \xb7 ${function(e,t,n){if(0===t)return"empty";let s=t>e.length?`${e.length} of ${t.toLocaleString("en")} results`:`${t} ${1===t?"result":"results"}`;return n>t?`${s} \xb7 ${n.toLocaleString("en")} files`:s}(k,S,m?.files??0)}`]})}),(0,t.jsxs)(u.Button,{variant:"outline",size:"sm",onClick:()=>j(h.PATHS.artifacts),children:[(0,t.jsx)(r.FolderOpen,{}),"Reveal folder"]})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(b.SettingFilter,{value:s,onChange:i,placeholder:"Filter files",className:"mx-2 mb-1.5 w-auto"}),(0,t.jsx)(C,{label:"Everyone",count:k.length,active:void 0===o,onPick:()=>{a(void 0),n(null)}}),A(k).map(({bot:e,rows:s})=>(0,t.jsx)(C,{label:e??"Unsorted",mark:e?(0,t.jsx)(g.BotMark,{size:18,seed:e,...(0,g.markOf)(e,v),notify:!1,className:"shrink-0"}):void 0,count:s.length,active:o===e,onPick:()=>{a(e),n(null)}},e??"")),S>k.length&&(0,t.jsx)("button",{type:"button",onClick:()=>f(l+h.ARTIFACT_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(h.ARTIFACT_VIEW.rows,S-k.length)} more of ${S.toLocaleString("en")}`})]}),right:M?(0,t.jsx)($,{row:M,file:e?.file??null,onOpen:e=>n({row:M,file:e}),onBack:()=>n({row:M,file:null}),onGone:()=>n(null),onShelf:()=>n(null)},M.path):F.length>0?(0,t.jsx)(z,{entries:F,bots:v,onPick:e=>n({row:e,file:null})}):(0,t.jsx)(R,{empty:0===S})})}],94682)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94682,e=>{"use strict";var t=e.i(843476),n=e.i(24071),s=e.i(482022),r=e.i(569644),i=e.i(456420);let o={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};o.node;let a=(0,i.default)(o);var l=e.i(759659),c=e.i(271645),d=e.i(798120),u=e.i(167881),f=e.i(917162),m=e.i(671428),h=e.i(41533),x=e.i(95187);let p=(0,x.createServerReference)("7fea6d23a7dab8c72ed2a5c075f724064f8a9ff379",x.callServer,void 0,x.findSourceMapURL,"deleteArtifactAction");var g=e.i(635963),b=e.i(895836),v=e.i(83928),j=e.i(621285),y=e.i(201830),k=e.i(245629),N=e.i(609856),w=e.i(283653),S=e.i(647163);function A(e){let t=new Map;for(let n of e){let e=t.get(n.bot)??[];e.push(n),t.set(n.bot,e)}return[...t].map(([e,t])=>({bot:e,rows:t}))}function C({label:e,mark:n,count:s,active:r,onPick:i}){return(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,S.cn)("mx-2 flex h-9 items-center gap-2 rounded-md px-2 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",r?(0,S.cn)(b.PICKED_ROW,"font-medium"):"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[n??(0,t.jsx)(a,{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] text-muted-foreground/70 tabular-nums",children:s})]})}function $({row:e,file:i,onOpen:o,onBack:a,onGone:c,onShelf:m}){let[h]=(0,N.useServerAction)(y.revealFileAction),[x,g]=(0,N.useServerAction)(p,{okMessage:"Deleted",onOk:()=>{(0,w.revalidate)(d.queryKey.artifacts),i?a():c()}}),b=i?{path:i.path,bytes:i.bytes,at:i.at}:"file"===e.kind?{path:e.path,bytes:e.bytes,at:e.at}:null,v=async e=>{await f.notify.confirm({title:`Delete ${e.split("/").pop()}?`,description:b?"It is deleted from disk for good.":"The folder and everything in it are deleted from disk for good.",okText:"Delete",destructive:!0})&&x(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-3 border-b border-border/60 px-6",children:[(0,t.jsxs)("button",{type:"button",onClick:i?a:m,className:"-ml-1 flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3"}),i?e.name:"Shelf"]}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:b?b.path.split("/").pop()??e.name:e.name}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:b?`${(0,S.formatBytes)(b.bytes)} \xb7 ${(0,k.shortAgo)(b.at)}`:`${e.count} ${1===e.count?"file":"files"} \xb7 ${(0,k.shortAgo)(e.at)}`}),b&&(0,t.jsx)("a",{href:d.queryKey.fileView(b.path),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>h(b?.path??e.path),children:(0,t.jsx)(r.FolderOpen,{})}),(0,t.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:g,className:"ml-1.5 text-muted-foreground hover:text-destructive",onClick:()=>v(b?.path??e.path),children:(0,t.jsx)(l.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:b?(0,t.jsx)(j.FilePreview,{path:b.path,bytes:b.bytes}):(0,t.jsx)(T,{path:e.path,onOpen:o})})]})}function T({path:e,onOpen:n}){let{data:s,isLoading:r,error:i}=(0,w.useServerRoute)(d.queryKey.artifactSet(e,h.ARTIFACT_VIEW.setFiles));if(r)return(0,t.jsx)("div",{className:"grid grid-cols-4 gap-3 p-5",children:Array.from({length:8},(e,n)=>(0,t.jsx)(m.Skeleton,{className:"aspect-4/3 w-full rounded-xl"},n))});if(i)return(0,t.jsx)(b.SettingError,{message:i.message});let o=s?.files??[];return 0===o.length?(0,t.jsx)("p",{className:"p-5 text-xs text-muted-foreground/60",children:"Nothing in here the app can open."}):(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsx)("div",{className:"grid grid-cols-4 gap-3",children:o.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>n(e),title:`${e.name} \xb7 ${(0,S.formatBytes)(e.bytes)}`,className:"flex flex-col gap-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-2",children:[(0,t.jsx)(F,{file:e}),(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.name})]},e.path))}),s&&s.total>o.length&&(0,t.jsx)("p",{className:"pt-4 font-mono text-[11px] text-muted-foreground/60",children:`${o.length} of ${s.total.toLocaleString("en")} — the rest are in the folder`})]})}function F({file:e}){return(0,t.jsx)(v.FileThumb,{path:e.path,bytes:e.bytes,glyph:"size-5",className:"aspect-4/3 w-full rounded-xl ring-1 ring-foreground/5 ring-inset"})}function z({entries:e,bots:n,onPick:s}){return(0,t.jsx)("div",{className:"space-y-7 p-6",children:A(e).map(({bot:e,rows:i})=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[e&&(0,t.jsx)(g.BotMark,{size:20,seed:e,...(0,g.markOf)(e,n),notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e??"Unsorted"}),(0,t.jsx)("span",{className:"font-mono text-[11px] font-normal text-muted-foreground",children:i.length})]}),(0,t.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))] gap-x-4 gap-y-5",children:i.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>s(e),className:"group flex min-w-0 flex-col gap-1.5 rounded-xl text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:["set"===e.kind?(0,t.jsx)("span",{className:"grid aspect-4/3 w-full place-items-center rounded-xl bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,t.jsx)(r.FolderOpen,{className:"size-5"})}):(0,t.jsx)(v.FileThumb,{path:e.path,bytes:e.bytes,glyph:"size-5",className:"aspect-4/3 w-full rounded-xl ring-1 ring-foreground/5 ring-inset"}),(0,t.jsxs)("span",{className:"min-w-0 space-y-0.5 px-0.5",children:[(0,t.jsx)("span",{className:"block truncate text-[13px]",children:e.name}),(0,t.jsxs)("span",{className:"block truncate font-mono text-[10.5px] text-muted-foreground",children:["set"===e.kind?`${e.count} ${1===e.count?"file":"files"} \xb7 `:"",(0,k.shortAgo)(e.at)]})]})]},e.path))})]},e??""))})}function R({empty:e}){return(0,t.jsx)("div",{className:"p-8",children:(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:e?"Nothing finished yet. When a bot ends a job with something to hand over — a page, a report, a set of pictures — it lands here.":"Pick something on the left. Each bot's work is under its face; a folder it filled is one row, and opens as a sheet."})})}e.s(["ArtifactSetting",0,function(){let[e,n]=(0,c.useState)(null),[s,i]=(0,c.useState)(""),[o,a]=(0,c.useState)(void 0),[l,f]=(0,c.useState)(h.ARTIFACT_VIEW.rows),{data:m,isLoading:x,error:p}=(0,w.useServerRoute)(d.queryKey.artifactShelf(l),{keepPreviousData:!0}),{data:v}=(0,w.useServerRoute)(d.queryKey.bot),[j]=(0,N.useServerAction)(y.revealFileAction);if(x)return(0,t.jsx)(b.SettingPanesSkeleton,{});if(p)return(0,t.jsx)(b.SettingError,{message:p.message});let k=m?.entries??[],S=m?.total??0,T=s.trim().toLowerCase(),F=k.filter(e=>(void 0===o||e.bot===o)&&(!T||e.name.toLowerCase().includes(T)||e.bot?.toLowerCase().includes(T))),M=k.find(t=>t.path===e?.row.path)??e?.row;return(0,t.jsx)(b.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"finished"}),` \xb7 ${function(e,t,n){if(0===t)return"empty";let s=t>e.length?`${e.length} of ${t.toLocaleString("en")} results`:`${t} ${1===t?"result":"results"}`;return n>t?`${s} \xb7 ${n.toLocaleString("en")} files`:s}(k,S,m?.files??0)}`]})}),(0,t.jsxs)(u.Button,{variant:"outline",size:"sm",onClick:()=>j(h.PATHS.artifacts),children:[(0,t.jsx)(r.FolderOpen,{}),"Reveal folder"]})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(b.SettingFilter,{value:s,onChange:i,placeholder:"Filter files",className:"mx-2 mb-1.5 w-auto"}),(0,t.jsx)(C,{label:"Everyone",count:k.length,active:void 0===o,onPick:()=>{a(void 0),n(null)}}),A(k).map(({bot:e,rows:s})=>(0,t.jsx)(C,{label:e??"Unsorted",mark:e?(0,t.jsx)(g.BotMark,{size:18,seed:e,...(0,g.markOf)(e,v),notify:!1,className:"shrink-0"}):void 0,count:s.length,active:o===e,onPick:()=>{a(e),n(null)}},e??"")),S>k.length&&(0,t.jsx)("button",{type:"button",onClick:()=>f(l+h.ARTIFACT_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(h.ARTIFACT_VIEW.rows,S-k.length)} more of ${S.toLocaleString("en")}`})]}),right:M?(0,t.jsx)($,{row:M,file:e?.file??null,onOpen:e=>n({row:M,file:e}),onBack:()=>n({row:M,file:null}),onGone:()=>n(null),onShelf:()=>n(null)},M.path):F.length>0?(0,t.jsx)(z,{entries:F,bots:v,onPick:e=>n({row:e,file:null})}):(0,t.jsx)(R,{empty:0===S})})}],94682)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)}]);