thursday-agent 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +6 -0
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +13 -13
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +12 -12
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  20. package/.next/server/app/api/artifact/route.js +1 -1
  21. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/notes/route/app-paths-manifest.json +3 -0
  23. package/.next/server/app/api/bot/notes/route/build-manifest.json +12 -0
  24. package/.next/server/app/api/bot/notes/route/server-reference-manifest.json +4 -0
  25. package/.next/server/app/api/bot/notes/route.js +14 -0
  26. package/.next/server/app/api/bot/notes/route.js.map +5 -0
  27. package/.next/server/app/api/bot/notes/route.js.nft.json +1 -0
  28. package/.next/server/app/api/bot/notes/route_client-reference-manifest.js +3 -0
  29. package/.next/server/app/api/bot/route.js +4 -4
  30. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  31. package/.next/server/app/api/bot/task/[id]/route.js +6 -6
  32. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/bot/task/route.js +6 -6
  34. package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
  35. package/.next/server/app/api/config/route.js +3 -3
  36. package/.next/server/app/api/config/route.js.nft.json +1 -1
  37. package/.next/server/app/api/events/route.js +1 -1
  38. package/.next/server/app/api/events/route.js.nft.json +1 -1
  39. package/.next/server/app/api/file/[...path]/route.js +1 -1
  40. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  41. package/.next/server/app/api/llm-model/catalog/route.js +6 -6
  42. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  43. package/.next/server/app/api/llm-model/route.js +3 -3
  44. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  45. package/.next/server/app/api/mcp/[name]/route.js +3 -3
  46. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/mcp/oauth/callback/route.js +5 -5
  48. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  49. package/.next/server/app/api/mcp/route.js +3 -3
  50. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  51. package/.next/server/app/api/mcp/tools/route.js +3 -3
  52. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  53. package/.next/server/app/api/memory/route.js +7 -7
  54. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  55. package/.next/server/app/api/memory/tidy/route.js +10 -11
  56. package/.next/server/app/api/memory/tidy/route.js.nft.json +1 -1
  57. package/.next/server/app/api/skills/[source]/[name]/route.js +1 -1
  58. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  59. package/.next/server/app/api/skills/route.js +1 -1
  60. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  61. package/.next/server/app/api/thursday/call/route.js +8 -8
  62. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  63. package/.next/server/app/api/thursday/skills/route.js +8 -8
  64. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  65. package/.next/server/app/api/thursday/tool-call/route.js +11 -12
  66. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  67. package/.next/server/app/api/workspace/route.js +1 -1
  68. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  69. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  70. package/.next/server/app/artifact/[...path]/page.js +3 -3
  71. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  72. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  74. package/.next/server/app/page/server-reference-manifest.json +63 -41
  75. package/.next/server/app/page.js +7 -7
  76. package/.next/server/app/page.js.nft.json +1 -1
  77. package/.next/server/app/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app-paths-manifest.json +1 -0
  79. package/.next/server/chunks/0d-b_next_dist_server_app-render_after-task-async-storage_external_0-exn7p.js +3 -0
  80. package/.next/server/chunks/{[root-of-the-server]__0t_dqaj._.js → [root-of-the-server]__0-npkh_._.js} +1 -1
  81. package/.next/server/chunks/[root-of-the-server]__005var5._.js +3 -0
  82. package/.next/server/chunks/[root-of-the-server]__019dx9f._.js +2 -2
  83. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +3 -0
  84. package/.next/server/chunks/{[root-of-the-server]__1mzp_el._.js → [root-of-the-server]__04_8spk._.js} +2 -2
  85. package/.next/server/chunks/[root-of-the-server]__06t77t4._.js +1 -1
  86. package/.next/server/chunks/[root-of-the-server]__0bed6hu._.js +4 -4
  87. package/.next/server/chunks/[root-of-the-server]__0cro2dz._.js +5 -0
  88. package/.next/server/chunks/[root-of-the-server]__0emr6go._.js +3 -0
  89. package/.next/server/chunks/[root-of-the-server]__0le4d-p._.js +1 -1
  90. package/.next/server/chunks/[root-of-the-server]__0m8ywyo._.js +5 -5
  91. package/.next/server/chunks/{[root-of-the-server]__113fqg5._.js → [root-of-the-server]__0p32jfz._.js} +3 -3
  92. package/.next/server/chunks/[root-of-the-server]__0phdgco._.js +4 -4
  93. package/.next/server/chunks/[root-of-the-server]__0wvgrsl._.js +1 -1
  94. package/.next/server/chunks/[root-of-the-server]__11j52t0._.js +5 -0
  95. package/.next/server/chunks/{[root-of-the-server]__0j_n5l3._.js → [root-of-the-server]__1692zrv._.js} +2 -2
  96. package/.next/server/chunks/[root-of-the-server]__16thabu._.js +1 -1
  97. package/.next/server/chunks/[root-of-the-server]__173nhwf._.js +3 -3
  98. package/.next/server/chunks/[root-of-the-server]__1bn73ih._.js +10 -0
  99. package/.next/server/chunks/[root-of-the-server]__1bqhuh9._.js +4 -4
  100. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +10 -0
  101. package/.next/server/chunks/[root-of-the-server]__1cqizfq._.js +1 -1
  102. package/.next/server/chunks/{[root-of-the-server]__1u_qvc7._.js → [root-of-the-server]__1fboj2j._.js} +2 -2
  103. package/.next/server/chunks/{[root-of-the-server]__1dow0bz._.js → [root-of-the-server]__1oli73c._.js} +2 -2
  104. package/.next/server/chunks/[root-of-the-server]__1txedx6._.js +4 -4
  105. package/.next/server/chunks/[root-of-the-server]__1untqv8._.js +5 -0
  106. package/.next/server/chunks/_0-73of8._.js +55 -0
  107. package/.next/server/chunks/{_2050gwn._.js → _00_584r._.js} +66 -28
  108. package/.next/server/chunks/{_0y8is-s._.js → _03a0897._.js} +1 -1
  109. package/.next/server/chunks/_05h2cii._.js +1 -1
  110. package/.next/server/chunks/_06mxlgn._.js +1 -1
  111. package/.next/server/chunks/_0a351g7._.js +1 -1
  112. package/.next/server/chunks/{_0hin38_._.js → _0khihjk._.js} +5 -5
  113. package/.next/server/chunks/_0kjjmag._.js +1 -1
  114. package/.next/server/chunks/{_1t8fv7b._.js → _0n74zsf._.js} +5 -5
  115. package/.next/server/chunks/_0nn99o2._.js +3 -0
  116. package/.next/server/chunks/_0pppbb5._.js +10 -6
  117. package/.next/server/chunks/{_1icgbi8._.js → _0rnf-6n._.js} +5 -5
  118. package/.next/server/chunks/_0u10wmw._.js +55 -0
  119. package/.next/server/chunks/{_0kl37zl._.js → _0vnutv9._.js} +1 -1
  120. package/.next/server/chunks/_0wp4le3._.js +1 -1
  121. package/.next/server/chunks/_0y5fg-x._.js +1 -1
  122. package/.next/server/chunks/_106co2o._.js +3 -0
  123. package/.next/server/chunks/_12bbv5i._.js +10 -6
  124. package/.next/server/chunks/_15hq89o._.js +1 -1
  125. package/.next/server/chunks/_15q1pig._.js +1 -1
  126. package/.next/server/chunks/_18-1wcc._.js +55 -0
  127. package/.next/server/chunks/_19wg5yn._.js +138 -0
  128. package/.next/server/chunks/_1_5mnq4._.js +18 -0
  129. package/.next/server/chunks/_1bt95p9._.js +55 -0
  130. package/.next/server/chunks/_1cbk7ms._.js +9 -9
  131. package/.next/server/chunks/_1drgfx4._.js +18 -0
  132. package/.next/server/chunks/_1drv2et._.js +10 -6
  133. package/.next/server/chunks/{_10qam6o._.js → _1e48czp._.js} +5 -5
  134. package/.next/server/chunks/{_1skgy7b._.js → _1kg70wc._.js} +5 -5
  135. package/.next/server/chunks/_1php4eq._.js +1 -1
  136. package/.next/server/chunks/_1rysr-r._.js +10 -0
  137. package/.next/server/chunks/_1u3rwbr._.js +3 -0
  138. package/.next/server/chunks/_1x7p319._.js +1 -1
  139. package/.next/server/chunks/_1yuv4vp._.js +1 -1
  140. package/.next/server/chunks/_next-internal_server_app_api_bot_notes_route_actions_0qcsyu7.js +3 -0
  141. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  142. package/.next/server/chunks/features_bot_task_query_ts_11xuzl3._.js +1 -1
  143. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0228f43._.js → node_modules_consola_dist_chunks_prompt_mjs_02s3hjt._.js} +1 -1
  144. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0ir-vo2._.js → node_modules_consola_dist_chunks_prompt_mjs_06067w6._.js} +1 -1
  145. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0otw8ef._.js → node_modules_consola_dist_chunks_prompt_mjs_096ais_._.js} +1 -1
  146. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0tf290y._.js → node_modules_consola_dist_chunks_prompt_mjs_0a1rd09._.js} +1 -1
  147. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0gzvgfv._.js +3 -0
  148. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0j61-ma._.js +3 -0
  149. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0tvkfgh._.js +3 -0
  150. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_11zjo-1._.js +3 -0
  151. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1pycqsq._.js +3 -0
  152. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1tpvamf._.js +3 -0
  153. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1y9-wcr._.js +3 -0
  154. package/.next/server/chunks/ssr/[externals]__0dizgek._.js +3 -0
  155. package/.next/server/chunks/ssr/[root-of-the-server]__0f6s48x._.js +1 -1
  156. package/.next/server/chunks/ssr/[root-of-the-server]__0m1b5ky._.js +3 -0
  157. package/.next/server/chunks/ssr/{[root-of-the-server]__0dfwvr4._.js → [root-of-the-server]__0un-erv._.js} +2 -2
  158. package/.next/server/chunks/ssr/[root-of-the-server]__1-mnhyd._.js +5 -3
  159. package/.next/server/chunks/ssr/[root-of-the-server]__1bww500._.js +3 -0
  160. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  161. package/.next/server/chunks/ssr/[root-of-the-server]__1qfqvmg._.js +3 -0
  162. package/.next/server/chunks/ssr/[root-of-the-server]__1vcdast._.js +3 -0
  163. package/.next/server/chunks/ssr/[root-of-the-server]__1xwnu-h._.js +3 -0
  164. package/.next/server/chunks/ssr/_03webdr._.js +3 -0
  165. package/.next/server/chunks/ssr/{_0gd4vaa._.js → _040sk32._.js} +71 -29
  166. package/.next/server/chunks/ssr/_077-g6s._.js +1 -1
  167. package/.next/server/chunks/ssr/{_0lc_7c8._.js → _09ja_w1._.js} +2 -2
  168. package/.next/server/chunks/ssr/{_1dcxzqe._.js → _0f_b_9s._.js} +2 -2
  169. package/.next/server/chunks/ssr/_0h7zdni._.js +1 -1
  170. package/.next/server/chunks/ssr/_0lu1n_x._.js +3 -0
  171. package/.next/server/chunks/ssr/_0sf1isi._.js +1 -1
  172. package/.next/server/chunks/ssr/_0su6_08._.js +3 -0
  173. package/.next/server/chunks/ssr/{_0nso8tp._.js → _0w5bgak._.js} +2 -2
  174. package/.next/server/chunks/ssr/{_19_o9d-._.js → _0x_nu5e._.js} +2 -2
  175. package/.next/server/chunks/ssr/_1-teee5._.js +3 -3
  176. package/.next/server/chunks/ssr/_13punpm._.js +1 -1
  177. package/.next/server/chunks/ssr/{_0ay6b01._.js → _1ciyoo3._.js} +2 -2
  178. package/.next/server/chunks/ssr/_1e-dgz0._.js +1 -1
  179. package/.next/server/chunks/ssr/_1fq7zgb._.js +1 -1
  180. package/.next/server/chunks/ssr/{_0cvjbuz._.js → _1g6l4uj._.js} +2 -2
  181. package/.next/server/chunks/ssr/{_0q_2f2x._.js → _1lip4th._.js} +2 -2
  182. package/.next/server/chunks/ssr/_1m3bsfr._.js +3 -0
  183. package/.next/server/chunks/ssr/_1mznrxk._.js +1 -1
  184. package/.next/server/chunks/ssr/_1ruzehw._.js +3 -0
  185. package/.next/server/chunks/ssr/_1vyd1ji._.js +3 -0
  186. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +2 -2
  187. package/.next/server/chunks/ssr/features_config_components_14jqgy4._.js +1 -1
  188. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  189. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  190. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  191. package/.next/server/chunks/ssr/lib_realtime_12wg_dd._.js +27 -0
  192. package/.next/server/chunks/ssr/lib_realtime_15h_v1v._.js +27 -0
  193. package/.next/server/chunks/ssr/{node_modules_108wd2o._.js → node_modules_004qlr4._.js} +1 -1
  194. package/.next/server/chunks/ssr/{node_modules_1ub40gk._.js → node_modules_01qnv-a._.js} +1 -1
  195. package/.next/server/chunks/ssr/{node_modules_1y8_3vg._.js → node_modules_04n7mjs._.js} +1 -1
  196. package/.next/server/chunks/ssr/{node_modules_0_j7-g4._.js → node_modules_08d8bke._.js} +1 -1
  197. package/.next/server/chunks/ssr/{node_modules_0y2-av4._.js → node_modules_09xhur7._.js} +1 -1
  198. package/.next/server/chunks/ssr/{node_modules_043-236._.js → node_modules_0_n241r._.js} +1 -1
  199. package/.next/server/chunks/ssr/{node_modules_0ls96je._.js → node_modules_0iz1rzd._.js} +1 -1
  200. package/.next/server/chunks/ssr/{node_modules_0xwx4u-._.js → node_modules_0kl7-tn._.js} +1 -1
  201. package/.next/server/chunks/ssr/{node_modules_1jatz7w._.js → node_modules_0kxz4gt._.js} +1 -1
  202. package/.next/server/chunks/ssr/{node_modules_1t0y5jt._.js → node_modules_0lrjk5t._.js} +1 -1
  203. package/.next/server/chunks/ssr/{node_modules_13f2md6._.js → node_modules_0m93zeg._.js} +1 -1
  204. package/.next/server/chunks/ssr/{node_modules_1nhw9qg._.js → node_modules_0n1kj4p._.js} +1 -1
  205. package/.next/server/chunks/ssr/{node_modules_1k29j1j._.js → node_modules_0ndvxub._.js} +1 -1
  206. package/.next/server/chunks/ssr/{node_modules_16i4o_3._.js → node_modules_13r44jq._.js} +1 -1
  207. package/.next/server/chunks/ssr/{node_modules_0fbw5-u._.js → node_modules_17lrt3y._.js} +1 -1
  208. package/.next/server/chunks/ssr/{node_modules_1d-is1o._.js → node_modules_18_dk7_._.js} +1 -1
  209. package/.next/server/chunks/ssr/{node_modules_1hn_sd5._.js → node_modules_19dp7ko._.js} +1 -1
  210. package/.next/server/chunks/ssr/{node_modules_20ynonm._.js → node_modules_1dwguw_._.js} +1 -1
  211. package/.next/server/chunks/ssr/{node_modules_00d6675._.js → node_modules_1hd-5tv._.js} +1 -1
  212. package/.next/server/chunks/ssr/{node_modules_1ee8gav._.js → node_modules_1hn8z1f._.js} +1 -1
  213. package/.next/server/chunks/ssr/{node_modules_0bue6gy._.js → node_modules_1n5ygqe._.js} +1 -1
  214. package/.next/server/chunks/ssr/{node_modules_1_588_4._.js → node_modules_1q0p85z._.js} +1 -1
  215. package/.next/server/chunks/ssr/{node_modules_0ipn1ho._.js → node_modules_1toafc-._.js} +1 -1
  216. package/.next/server/chunks/ssr/{node_modules_0_fvxnt._.js → node_modules_1xyd7ov._.js} +1 -1
  217. package/.next/server/chunks/ssr/{node_modules_1v0077l._.js → node_modules_1zu988w._.js} +1 -1
  218. package/.next/server/chunks/ssr/{node_modules_06kvvuo._.js → node_modules_20yebtj._.js} +1 -1
  219. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_092s8nx._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0m9a4y0._.js} +1 -1
  220. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1nvexgu._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_13w_wy9._.js} +1 -1
  221. package/.next/server/chunks/ssr/node_modules_consola_dist_chunks_prompt_mjs_05cwqv2._.js +47 -0
  222. package/.next/server/middleware-build-manifest.js +3 -3
  223. package/.next/server/pages/404.html +1 -1
  224. package/.next/server/pages/500.html +1 -1
  225. package/.next/server/server-reference-manifest.js +1 -1
  226. package/.next/server/server-reference-manifest.json +64 -42
  227. package/.next/static/chunks/05b6nx_o3_f_n.js +1 -0
  228. package/.next/static/chunks/{3aquirz5h71da.js → 07kl352c-lvcz.js} +1 -1
  229. package/.next/static/chunks/0dmns-gi0raa4.js +1 -0
  230. package/.next/static/chunks/0oc4_xoia77dg.css +1 -0
  231. package/.next/static/chunks/0pheo8m3a-rzi.js +1 -0
  232. package/.next/static/chunks/{2ihkf6l2jowo9.js → 18vhba44l1fc9.js} +3 -3
  233. package/.next/static/chunks/19i8h2t-5evjx.js +1 -0
  234. package/.next/static/chunks/{1gy3bbv7usnjo.js → 1c5fcj473025q.js} +1 -1
  235. package/.next/static/chunks/1pi_hbmjw-f-z.js +1 -0
  236. package/.next/static/chunks/{0tydnn2kybibk.js → 1twt6k09vg4np.js} +1 -1
  237. package/.next/static/chunks/{21rk8w7bda-su.js → 28gotuisldmom.js} +1 -1
  238. package/.next/static/chunks/{3xxa2j56-f3nm.js → 2998p0y7k1c8z.js} +1 -1
  239. package/.next/static/chunks/2l233xfycjpd8.js +1 -0
  240. package/.next/static/chunks/2p5n7pa3c40t-.js +2 -0
  241. package/.next/static/chunks/2ru1q132af7h7.js +1 -0
  242. package/.next/static/chunks/{2fq_86jvq9ymq.js → 2t8wqycwg3y04.js} +2 -2
  243. package/.next/static/chunks/32z_ypgtchw48.js +1 -0
  244. package/.next/static/chunks/{247d-r95j8xs0.js → 33pyjb3xd1iez.js} +1 -1
  245. package/.next/static/chunks/3786h5vayt80-.js +28 -0
  246. package/.next/static/chunks/3_h9txt3tq8t8.js +28 -0
  247. package/.next/static/chunks/{1khakdu_iuedc.js → 3ard_noqapnw1.js} +1 -1
  248. package/.next/static/chunks/{1fr5m75pwtyic.js → 3omud5xunrk1f.js} +1 -1
  249. package/.next/static/chunks/42dnrkbph9e-1.js +1 -0
  250. package/app/api/events/app-event.client.ts +24 -0
  251. package/app/api/events/app-event.server.ts +45 -0
  252. package/app/api/events/app-event.ts +44 -0
  253. package/app/api/llm-model/catalog/route.ts +12 -0
  254. package/app/api/llm-model/route.ts +21 -0
  255. package/app/api/query-key.ts +144 -0
  256. package/app/api/thursday/tool-call/route.ts +67 -0
  257. package/components/ui/button-group.tsx +45 -0
  258. package/components/ui/custom-icon.tsx +259 -0
  259. package/components/ui/dropdown-menu.tsx +271 -0
  260. package/components/ui/folded-text.tsx +68 -0
  261. package/components/ui/input-group.tsx +157 -0
  262. package/components/ui/json-view.tsx +240 -0
  263. package/components/ui/shiny-text.tsx +141 -0
  264. package/components/ui/text-type.tsx +213 -0
  265. package/components/ui/theme-sync.tsx +9 -0
  266. package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260909060813_optimal_sabretooth}/migration.sql +7 -0
  267. package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260909060813_optimal_sabretooth}/snapshot.json +54 -1
  268. package/database/migrations/20260909063821_bitter_tenebrous/migration.sql +1 -0
  269. package/database/migrations/20260909063821_bitter_tenebrous/snapshot.json +1285 -0
  270. package/docs/how-it-works.md +59 -0
  271. package/docs/images/keeps-going.png +0 -0
  272. package/docs/images/task-thread.png +0 -0
  273. package/docs/images/two-minds.png +0 -0
  274. package/features/ai/load-tools.ts +55 -5
  275. package/features/ai/prompts/bot.prompt.ts +121 -26
  276. package/features/ai/prompts/memory-tidy.prompt.ts +7 -1
  277. package/features/ai/prompts/prompt-helper.ts +31 -5
  278. package/features/ai/prompts/thursday.prompt.ts +2 -0
  279. package/features/ai/tools/bot.tool.ts +37 -18
  280. package/features/ai/tools/mcp.tool.ts +5 -5
  281. package/features/ai/tools/memory.tool.ts +17 -10
  282. package/features/ai/tools/studio.tool.ts +5 -5
  283. package/features/ai/tools/tool-name.ts +2 -0
  284. package/features/ai/tools/workspace.tool.ts +33 -5
  285. package/features/bot/bot.action.ts +31 -4
  286. package/features/bot/bot.notes.ts +120 -0
  287. package/features/bot/bot.query.ts +56 -1
  288. package/features/bot/bot.run.ts +43 -3
  289. package/features/bot/bot.runner.ts +94 -20
  290. package/features/bot/bot.schema.ts +17 -0
  291. package/features/bot/components/bot-room.tsx +405 -306
  292. package/features/bot/components/bot-setting.tsx +123 -20
  293. package/features/bot/task.query.ts +18 -5
  294. package/features/memory/components/memory-setting.tsx +11 -2
  295. package/features/memory/memory.query.ts +9 -2
  296. package/features/memory/memory.schema.ts +30 -0
  297. package/features/skills/components/skills-setting.tsx +9 -1
  298. package/features/workspace/workspace.ts +136 -3
  299. package/hooks/use-draft.ts +37 -0
  300. package/hooks/use-hotkey.ts +105 -0
  301. package/hooks/use-object-state.ts +51 -0
  302. package/hooks/use-on-visible.ts +72 -0
  303. package/hooks/use-theme.ts +106 -0
  304. package/hooks/use-wake-word.ts +262 -0
  305. package/lib/realtime/realtime.driver.ts +34 -1
  306. package/lib/realtime/realtime.protocol.ts +6 -0
  307. package/lib/sandbox.ts +9 -1
  308. package/lib/tokens.ts +19 -0
  309. package/package.json +1 -1
  310. package/.next/server/chunks/[root-of-the-server]__02kt8yn._.js +0 -10
  311. package/.next/server/chunks/[root-of-the-server]__0h59di-._.js +0 -5
  312. package/.next/server/chunks/[root-of-the-server]__0qjqtwo._.js +0 -5
  313. package/.next/server/chunks/[root-of-the-server]__0yk6s3w._.js +0 -5
  314. package/.next/server/chunks/[root-of-the-server]__0z3gelv._.js +0 -3
  315. package/.next/server/chunks/[root-of-the-server]__11w_7_3._.js +0 -3
  316. package/.next/server/chunks/[root-of-the-server]__1_0q_9w._.js +0 -3
  317. package/.next/server/chunks/[root-of-the-server]__1gmn1cs._.js +0 -10
  318. package/.next/server/chunks/_0fzqt2y._.js +0 -100
  319. package/.next/server/chunks/_0jgm3b8._.js +0 -55
  320. package/.next/server/chunks/_0ks6_sg._.js +0 -55
  321. package/.next/server/chunks/_0tzfesa._.js +0 -3
  322. package/.next/server/chunks/_0zmestz._.js +0 -55
  323. package/.next/server/chunks/_12nr4xc._.js +0 -3
  324. package/.next/server/chunks/_1hzrsvg._.js +0 -55
  325. package/.next/server/chunks/_1uj4_io._.js +0 -10
  326. package/.next/server/chunks/_1yldgo4._.js +0 -55
  327. package/.next/server/chunks/features_0scmr4i._.js +0 -3
  328. package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +0 -3
  329. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0ykklj0._.js +0 -3
  330. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1ryg3wh._.js +0 -3
  331. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1vwbnq_._.js +0 -3
  332. package/.next/server/chunks/ssr/[root-of-the-server]__01id-v3._.js +0 -3
  333. package/.next/server/chunks/ssr/[root-of-the-server]__0b-0i32._.js +0 -3
  334. package/.next/server/chunks/ssr/[root-of-the-server]__185grso._.js +0 -3
  335. package/.next/server/chunks/ssr/[root-of-the-server]__1minz8_._.js +0 -3
  336. package/.next/server/chunks/ssr/_0j4v8of._.js +0 -3
  337. package/.next/server/chunks/ssr/_0l81bzy._.js +0 -3
  338. package/.next/server/chunks/ssr/_10uvw3l._.js +0 -3
  339. package/.next/server/chunks/ssr/_1jbv7m1._.js +0 -3
  340. package/.next/server/chunks/ssr/lib_realtime_0aetuyp._.js +0 -24
  341. package/.next/server/chunks/ssr/lib_realtime_18k_aj-._.js +0 -24
  342. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_errors_05xv7vp.js +0 -3
  343. package/.next/static/chunks/0yysv1gzin17t.js +0 -1
  344. package/.next/static/chunks/1keib_gt066gc.js +0 -1
  345. package/.next/static/chunks/28g42tw8tsvhd.js +0 -1
  346. package/.next/static/chunks/2cwjgkt_hoyhj.js +0 -22
  347. package/.next/static/chunks/2rbf1fpd8n80-.js +0 -22
  348. package/.next/static/chunks/2ukj8k69y89um.js +0 -1
  349. package/.next/static/chunks/2wngeetfnzxkp.js +0 -2
  350. package/.next/static/chunks/388-t2v72jh39.css +0 -1
  351. package/.next/static/chunks/3fqvc0cg-atq_.js +0 -1
  352. package/.next/static/chunks/3p4egvfjxpatb.js +0 -1
  353. package/.next/static/chunks/3qe1w1ei-huhl.js +0 -1
  354. package/.next/static/chunks/3y40riycdip-i.js +0 -1
  355. package/.next/static/chunks/45a6zbtkelph9.js +0 -1
  356. /package/.next/static/{X34BUd9bfdH27ripuwwBm → YR4NWcDDuzwLbTTU7U7Vr}/_buildManifest.js +0 -0
  357. /package/.next/static/{X34BUd9bfdH27ripuwwBm → YR4NWcDDuzwLbTTU7U7Vr}/_clientMiddlewareManifest.js +0 -0
  358. /package/.next/static/{X34BUd9bfdH27ripuwwBm → YR4NWcDDuzwLbTTU7U7Vr}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),r=e.i(867927),o=e.i(456420);let a={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};a.node;let i=(0,o.default)(a);var c=e.i(77071);let l={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"}]]};l.node;let d=(0,o.default)(l),m={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"}]]};m.node;let p=(0,o.default)(m);var u=e.i(759659),h=e.i(263676),g=e.i(271645),f=e.i(798120),x=e.i(167881),v=e.i(986530),j=e.i(23750),b=e.i(647163);let y=(0,g.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let r=(0,g.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 transition-all duration-300",children:(0,t.jsx)(N,{data:r,name:n,depth:0,initialExpandDepth:s})})});y.displayName="JsonView";let N=(0,g.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:r})=>{var o;let a=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,g.useState)("string"!==a&&s<r),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(a){case"object":case"array":let d,m,p;return m=(d=(o="array"===a)?e:Object.entries(e)).length,p={open:o?"[":"{",close:o?"]":"}",collapsed:o?"[ ... ]":"{ ... }",empty:o?"[]":"{}"},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:p.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",onClick:()=>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:p.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:p.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:o?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:r})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:n,name:e,depth:s+1,initialExpandDepth:r})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:p.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,b.cn)(l.string,"cursor-pointer group-hover:text-foreground"),onClick:()=>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[a]||l.default,children:null===e?"null":String(e)})]})}});N.displayName="JsonNode";var k=e.i(917162),S=e.i(319036),C=e.i(127341),w=e.i(184762),z=e.i(6799),O=e.i(95187);let T=(0,O.createServerReference)("7f0319a99086ee3cd1918985c144e87ea4dc20d07e",O.callServer,void 0,O.findSourceMapURL,"callToolAction"),A=(0,O.createServerReference)("7f5032afb7983c1d0f61fd3693eebdadead290f6b7",O.callServer,void 0,O.findSourceMapURL,"deleteServerAction"),I=(0,O.createServerReference)("7f46495bb3a4bf849eb1e2069dbb9063be852be5bd",O.callServer,void 0,O.findSourceMapURL,"refreshServerAction"),P=(0,O.createServerReference)("7f860ba40e6a0fac88f2c4e6b892e39b044b4bcba0",O.callServer,void 0,O.findSourceMapURL,"registerServerAction");var F=e.i(681307),$=e.i(245629);let M=F.z.object({url:F.z.url(),headers:F.z.record(F.z.string(),F.z.string()).optional(),oauthClient:F.z.object({clientId:F.z.string().min(1),clientSecret:F.z.string().optional()}).optional()}),R=F.z.object({command:F.z.string().min(1),args:F.z.array(F.z.string()).optional(),env:F.z.record(F.z.string(),F.z.string()).optional()}),D=F.z.union([M,R]),E=F.z.object({name:F.z.string(),description:F.z.string().optional(),inputSchema:F.z.looseObject({}).optional(),outputSchema:F.z.looseObject({}).optional()});function L(e){return"url"in e}F.z.object({clientInformation:F.z.looseObject({}).optional(),tokens:F.z.looseObject({}).optional(),authorizationServer:F.z.looseObject({}).optional(),codeVerifier:F.z.string().optional(),state:F.z.string().optional()});let q=F.z.object({name:F.z.string().min(1).max(40),config:D,toolCount:F.z.number().int(),lastError:F.z.string().nullish()}),B=E.extend({id:F.z.number().int(),description:F.z.string().nullish()});q.omit({toolCount:!0}).extend({tools:B.array().default([]),toolsSyncedAt:$.DateLikeSchema});let J=F.z.object({name:F.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:D}),U=F.z.union([F.z.object({mcpServers:F.z.record(F.z.string(),D)}),F.z.record(F.z.string(),D)]),K=[{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.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:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/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:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"figma",icon:"figma.com",description:"Design files and components",config:{url:"https://mcp.figma.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/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:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/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:"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"}},{name:"playwright",icon:"playwright.dev",description:"Drive a real browser",config:{command:"npx",args:["@playwright/mcp@latest"]}},{name:"chrome-devtools",icon:"developer.chrome.com",description:"Inspect and debug Chrome",config:{command:"npx",args:["chrome-devtools-mcp@latest"]}}];var _=e.i(895836),H=e.i(333999),W=e.i(609856),V=e.i(283653);function G({name:e,onDone:n}){let{data:s,isLoading:r}=(0,V.useServerRoute)(f.queryKey.mcpServer(e)),[o,a]=(0,W.useServerAction)(I,{...ec,onOk:t=>{ec.onOk(t),(0,V.revalidate)(f.queryKey.mcpServer(e))}}),[i,c]=(0,W.useServerAction)(A,{okMessage:"Server deleted",onOk:()=>{n(),(0,V.revalidate)(f.queryKey.mcp)}}),l=async()=>{await k.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&i(e)};if(r)return(0,t.jsx)(_.SettingSkeleton,{rows:4});if(!s)return null;let m=s.tools.length,p=L(s.config)?"HTTP":"STDIO";return(0,t.jsxs)(_.SettingDialogContent,{title:s.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:p}),(0,t.jsx)("span",{className:"truncate font-mono",children:ed(s.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.Button,{variant:"ghost",loading:c,onClick:l,children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(x.Button,{variant:"outline",loading:a,onClick:()=>o(s.name),children:[(0,t.jsx)(d,{}),"Reconnect"]})]}),children:[s.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:s.lastError}),(0,t.jsxs)("p",{className:"text-right font-mono text-xs text-muted-foreground",children:[m," ",1===m?"tool":"tools"]}),s.tools.map(e=>(0,t.jsx)(Y,{tool:e,serverName:s.name},e.name))]})}function Q({server:e}){let s=e.toolCount,o=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{k.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(G,{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)(X,{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"===o&&(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"===o?(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:[" · ",ed(e.config)]})]})})]}),(0,t.jsx)(r.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function X({server:e}){let n,s=(n=K.find(t=>L(t.config)?L(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!L(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??K.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)("img",{src:(0,b.faviconUrl)(s),alt:"",className:"size-5"}):(0,t.jsx)(p,{className:"size-4"})}function Y({tool:e,serverName:n}){let[o,a]=(0,g.useState)(!1),[i,c]=(0,g.useState)(!1),[l,d]=(0,g.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:"min-w-0 space-y-1",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-sm",children:e.name}),e.description?(0,t.jsx)("p",{className:(0,b.cn)("text-xs text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null]}),(0,t.jsxs)("div",{className:"mt-2 flex justify-end gap-1",children:[m.length>0&&(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(!o),children:[o?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Test"]})]}),o?(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),r=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let o=t.anyOf??t.oneOf;if(Array.isArray(o))return o.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 o=t.properties;if(!o||0===Object.keys(o).length)return"{}";let a=t.required??[],i=Object.entries(o).map(([t,r])=>{let o=a.includes(t)?"":"?",i=r?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${o}: ${e(r,n+1)}${c}`});return`{
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),r=e.i(867927),o=e.i(456420);let a={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};a.node;let i=(0,o.default)(a);var c=e.i(77071);let l={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"}]]};l.node;let d=(0,o.default)(l),m={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"}]]};m.node;let p=(0,o.default)(m);var u=e.i(759659),h=e.i(263676),g=e.i(271645),f=e.i(798120),x=e.i(167881),v=e.i(986530),j=e.i(23750),y=e.i(647163);let b=(0,g.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let r=(0,g.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 transition-all duration-300",children:(0,t.jsx)(N,{data:r,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let N=(0,g.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:r})=>{var o;let a=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,g.useState)("string"!==a&&s<r),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(a){case"object":case"array":let d,m,p;return m=(d=(o="array"===a)?e:Object.entries(e)).length,p={open:o?"[":"{",close:o?"]":"}",collapsed:o?"[ ... ]":"{ ... }",empty:o?"[]":"{}"},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:p.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",onClick:()=>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:p.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:p.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:o?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:r})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:n,name:e,depth:s+1,initialExpandDepth:r})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:p.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,y.cn)(l.string,"cursor-pointer group-hover:text-foreground"),onClick:()=>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[a]||l.default,children:null===e?"null":String(e)})]})}});N.displayName="JsonNode";var k=e.i(917162),S=e.i(319036),C=e.i(127341),w=e.i(184762),z=e.i(6799),O=e.i(95187);let T=(0,O.createServerReference)("7fab1dd91d615032cf1deeda259f7b758bb7276c70",O.callServer,void 0,O.findSourceMapURL,"callToolAction"),A=(0,O.createServerReference)("7ff20864cdea076900a776fbaca0f394664cf1fc26",O.callServer,void 0,O.findSourceMapURL,"deleteServerAction"),I=(0,O.createServerReference)("7f51ee4209873ffb16ed0bf786dee13dd0ea5a776e",O.callServer,void 0,O.findSourceMapURL,"refreshServerAction"),P=(0,O.createServerReference)("7fc8bdee6fb9b42daee324c78238a8cc8c8f5316b9",O.callServer,void 0,O.findSourceMapURL,"registerServerAction");var F=e.i(681307),$=e.i(245629);let M=F.z.object({url:F.z.url(),headers:F.z.record(F.z.string(),F.z.string()).optional(),oauthClient:F.z.object({clientId:F.z.string().min(1),clientSecret:F.z.string().optional()}).optional()}),R=F.z.object({command:F.z.string().min(1),args:F.z.array(F.z.string()).optional(),env:F.z.record(F.z.string(),F.z.string()).optional()}),D=F.z.union([M,R]),E=F.z.object({name:F.z.string(),description:F.z.string().optional(),inputSchema:F.z.looseObject({}).optional(),outputSchema:F.z.looseObject({}).optional()});function L(e){return"url"in e}F.z.object({clientInformation:F.z.looseObject({}).optional(),tokens:F.z.looseObject({}).optional(),authorizationServer:F.z.looseObject({}).optional(),codeVerifier:F.z.string().optional(),state:F.z.string().optional()});let q=F.z.object({name:F.z.string().min(1).max(40),config:D,toolCount:F.z.number().int(),lastError:F.z.string().nullish()}),B=E.extend({id:F.z.number().int(),description:F.z.string().nullish()});q.omit({toolCount:!0}).extend({tools:B.array().default([]),toolsSyncedAt:$.DateLikeSchema});let J=F.z.object({name:F.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:D}),U=F.z.union([F.z.object({mcpServers:F.z.record(F.z.string(),D)}),F.z.record(F.z.string(),D)]),K=[{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.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:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/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:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"figma",icon:"figma.com",description:"Design files and components",config:{url:"https://mcp.figma.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/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:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/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:"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"}},{name:"playwright",icon:"playwright.dev",description:"Drive a real browser",config:{command:"npx",args:["@playwright/mcp@latest"]}},{name:"chrome-devtools",icon:"developer.chrome.com",description:"Inspect and debug Chrome",config:{command:"npx",args:["chrome-devtools-mcp@latest"]}}];var _=e.i(895836),H=e.i(333999),W=e.i(609856),V=e.i(283653);function G({name:e,onDone:n}){let{data:s,isLoading:r}=(0,V.useServerRoute)(f.queryKey.mcpServer(e)),[o,a]=(0,W.useServerAction)(I,{...ec,onOk:t=>{ec.onOk(t),(0,V.revalidate)(f.queryKey.mcpServer(e))}}),[i,c]=(0,W.useServerAction)(A,{okMessage:"Server deleted",onOk:()=>{n(),(0,V.revalidate)(f.queryKey.mcp)}}),l=async()=>{await k.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&i(e)};if(r)return(0,t.jsx)(_.SettingSkeleton,{rows:4});if(!s)return null;let m=s.tools.length,p=L(s.config)?"HTTP":"STDIO";return(0,t.jsxs)(_.SettingDialogContent,{title:s.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:p}),(0,t.jsx)("span",{className:"truncate font-mono",children:ed(s.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.Button,{variant:"ghost",loading:c,onClick:l,children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(x.Button,{variant:"outline",loading:a,onClick:()=>o(s.name),children:[(0,t.jsx)(d,{}),"Reconnect"]})]}),children:[s.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:s.lastError}),(0,t.jsxs)("p",{className:"text-right font-mono text-xs text-muted-foreground",children:[m," ",1===m?"tool":"tools"]}),s.tools.map(e=>(0,t.jsx)(Y,{tool:e,serverName:s.name},e.name))]})}function Q({server:e}){let s=e.toolCount,o=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{k.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(G,{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)(X,{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"===o&&(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"===o?(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:[" · ",ed(e.config)]})]})})]}),(0,t.jsx)(r.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function X({server:e}){let n,s=(n=K.find(t=>L(t.config)?L(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!L(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??K.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)("img",{src:(0,y.faviconUrl)(s),alt:"",className:"size-5"}):(0,t.jsx)(p,{className:"size-4"})}function Y({tool:e,serverName:n}){let[o,a]=(0,g.useState)(!1),[i,c]=(0,g.useState)(!1),[l,d]=(0,g.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:"min-w-0 space-y-1",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-sm",children:e.name}),e.description?(0,t.jsx)("p",{className:(0,y.cn)("text-xs text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null]}),(0,t.jsxs)("div",{className:"mt-2 flex justify-end gap-1",children:[m.length>0&&(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(!o),children:[o?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Test"]})]}),o?(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),r=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let o=t.anyOf??t.oneOf;if(Array.isArray(o))return o.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 o=t.properties;if(!o||0===Object.keys(o).length)return"{}";let a=t.required??[],i=Object.entries(o).map(([t,r])=>{let o=a.includes(t)?"":"?",i=r?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${o}: ${e(r,n+1)}${c}`});return`{
2
2
  ${i.join("\n")}
3
- ${r}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t.type:"unknown"}(n)})]},e))}):null,i?(0,t.jsx)(Z,{tool:e,serverName:n}):null]})}function Z({tool:e,serverName:n}){let[s,r]=(0,g.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,a]=(0,g.useState)(""),[c,l,d,m,p]=(0,W.useServerAction)(T,{errorMessage:!1});return(0,t.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,t.jsx)(w.Textarea,{value:s,onChange:e=>r(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)(x.Button,{size:"sm",loading:l,onClick:()=>{let t;try{t=s.trim()?JSON.parse(s):void 0}catch{a("Not valid JSON");return}a(""),p(),c(n,e.name,t)},children:[!l&&(0,t.jsx)(i,{}),"Run"]})]}),void 0!==d&&(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg bg-muted/40 p-3",children:(0,t.jsx)(y,{data:d,initialExpandDepth:3})})]})}function ee(e){return k.notify.component({className:"sm:max-w-lg",renderer:({close:n})=>(0,t.jsx)(et,{initial:e,onDone:n})})}function et({initial:e,onDone:n}){let s=e&&L(e.config)?e.config:void 0,r=e&&!L(e.config)?e.config:void 0,[o,a]=(0,H.useObjectState)({mode:r?"stdio":"http",name:e?.name??"",url:s?.url??"",headers:er(s?.headers),clientId:s?.oauthClient?.clientId??"",clientSecret:s?.oauthClient?.clientSecret??"",command:r?.command??"",args:(r?.args??[]).join(" "),env:er(r?.env),raw:""}),{mode:i,name:c,url:l,headers:d,clientId:m,clientSecret:p,command:u,args:h,env:f,raw:b}=o,[y,N]=(0,W.useServerAction)(P,{...ec,onOk:e=>{ec.onOk(e),"error"!==e.status&&n()}}),k=(0,g.useMemo)(()=>{var e,t,n,s,r,o,a;let c,g;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=D.safeParse(t);if(s.success)return{value:{name:null,config:s.data},error:""};let r=U.safeParse(t);if(!r.success)return{value:null,error:"Needs a url or a command"};let o=Object.entries("mcpServers"in r.data?r.data.mcpServers:r.data)[0];return o?{value:{name:o[0],config:o[1]},error:""}:{value:null,error:"No server in there"}}(b):"http"===i?(e=l,t=d,n=m,s=p,(c=M.safeParse({url:e.trim(),headers:eo(t),oauthClient:n.trim()?{clientId:n.trim(),clientSecret:s.trim()}:void 0})).success?{value:{name:null,config:c.data},error:""}:{value:null,error:e.trim()?"Needs a valid url":""}):(r=u,o=h,a=f,(g=R.safeParse({command:r.trim(),args:o.split(/\s+/).filter(Boolean),env:eo(a)})).success?{value:{name:null,config:g.data},error:""}:{value:null,error:r.trim()?"Needs a command":""})},[i,b,l,d,m,p,u,h,f]),z="json"===i?b:JSON.stringify([i,l,d,m,p,u,h,f]),[O,T]=(0,g.useState)(z);(0,g.useEffect)(()=>{let e=setTimeout(()=>T(z),700);return()=>clearTimeout(e)},[z]);let A=O===z?k.error:"",I=c||k.value?.name||"",F=J.safeParse({name:I,config:k.value?.config});function $(e){let t=k.value?.config;return t?"json"===e?a({mode:e,raw:JSON.stringify(t,null,2)}):"http"===e&&L(t)?a({mode:e,url:t.url,headers:er(t.headers),clientId:t.oauthClient?.clientId??"",clientSecret:t.oauthClient?.clientSecret??""}):"stdio"!==e||L(t)?void a({mode:e}):a({mode:e,command:t.command,args:(t.args??[]).join(" "),env:er(t.env)}):a({mode:e})}let E=(0,t.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,t.jsx)(S.Switch,{size:"sm",checked:"json"===i,onCheckedChange:e=>{let t;return e?$("json"):void $((t=k.value?.config)&&!L(t)?"stdio":"http")}})]});return(0,t.jsx)(_.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to Thursday and every sub-agent.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Button,{variant:"ghost",onClick:n,children:"Cancel"}),(0,t.jsx)(x.Button,{disabled:!F.success,loading:N,onClick:()=>{F.success&&!N&&y(F.data)},children:"Connect"})]}),children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Name"}),(0,t.jsx)(j.Input,{value:I,onChange:e=>a({name:e.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===i?(0,t.jsxs)(v.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(v.FieldLabel,{children:"JSON"}),E]}),(0,t.jsx)(w.Textarea,{value:b,onChange:e=>a({raw:e.target.value}),spellCheck:!1,placeholder:ea,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,t.jsxs)(C.Tabs,{value:i,onValueChange:e=>$(e),className:"gap-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(v.FieldLabel,{children:"Transport"}),E]}),(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)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"URL"}),(0,t.jsx)(j.Input,{value:l,onChange:e=>a({url:e.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(en,{label:"Headers",pairs:d,onChange:e=>a({headers:e}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."}),(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"OAuth client"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(j.Input,{value:m,onChange:e=>a({clientId:e.target.value}),placeholder:"Client ID",spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(j.Input,{value:p,onChange:e=>a({clientSecret:e.target.value}),placeholder:"Client secret",spellCheck:!1,type:"password",className:"font-mono text-xs"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Only for servers that refuse to register clients on their own, like Figma. Leave empty and one is created during sign-in."})]})]}),(0,t.jsxs)(C.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Command"}),(0,t.jsx)(j.Input,{value:u,onChange:e=>a({command:e.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Args"}),(0,t.jsx)(j.Input,{value:h,onChange:e=>a({args:e.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(en,{label:"Env",pairs:f,onChange:e=>a({env:e}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),A&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:A})]})})}function en({label:e,pairs:n,onChange:s,keyPlaceholder:r,valuePlaceholder:o}){let a=(e,t)=>s(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.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)(j.Input,{value:e.key,onChange:t=>a(e.id,{key:t.target.value}),placeholder:r,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(j.Input,{value:e.value,onChange:t=>a(e.id,{value:t.target.value}),placeholder:o,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",onClick:()=>s(n.filter(t=>t.id!==e.id)),children:(0,t.jsx)(h.X,{})})]},e.id)),(0,t.jsxs)(x.Button,{variant:"outline",size:"sm",onClick:()=>s([...n,es()]),children:[(0,t.jsx)(c.Plus,{}),"Add"]})]})]})}let es=(e="",t="")=>({id:crypto.randomUUID(),key:e,value:t}),er=e=>Object.entries(e??{}).map(([e,t])=>es(e,t)),eo=e=>{let t=e.filter(e=>e.key.trim());if(t.length)return Object.fromEntries(t.map(e=>[e.key.trim(),e.value]))},ea=`/** STDIO Example */
3
+ ${r}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t.type:"unknown"}(n)})]},e))}):null,i?(0,t.jsx)(Z,{tool:e,serverName:n}):null]})}function Z({tool:e,serverName:n}){let[s,r]=(0,g.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,a]=(0,g.useState)(""),[c,l,d,m,p]=(0,W.useServerAction)(T,{errorMessage:!1});return(0,t.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,t.jsx)(w.Textarea,{value:s,onChange:e=>r(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)(x.Button,{size:"sm",loading:l,onClick:()=>{let t;try{t=s.trim()?JSON.parse(s):void 0}catch{a("Not valid JSON");return}a(""),p(),c(n,e.name,t)},children:[!l&&(0,t.jsx)(i,{}),"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 ee(e){return k.notify.component({className:"sm:max-w-lg",renderer:({close:n})=>(0,t.jsx)(et,{initial:e,onDone:n})})}function et({initial:e,onDone:n}){let s=e&&L(e.config)?e.config:void 0,r=e&&!L(e.config)?e.config:void 0,[o,a]=(0,H.useObjectState)({mode:r?"stdio":"http",name:e?.name??"",url:s?.url??"",headers:er(s?.headers),clientId:s?.oauthClient?.clientId??"",clientSecret:s?.oauthClient?.clientSecret??"",command:r?.command??"",args:(r?.args??[]).join(" "),env:er(r?.env),raw:""}),{mode:i,name:c,url:l,headers:d,clientId:m,clientSecret:p,command:u,args:h,env:f,raw:y}=o,[b,N]=(0,W.useServerAction)(P,{...ec,onOk:e=>{ec.onOk(e),"error"!==e.status&&n()}}),k=(0,g.useMemo)(()=>{var e,t,n,s,r,o,a;let c,g;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=D.safeParse(t);if(s.success)return{value:{name:null,config:s.data},error:""};let r=U.safeParse(t);if(!r.success)return{value:null,error:"Needs a url or a command"};let o=Object.entries("mcpServers"in r.data?r.data.mcpServers:r.data)[0];return o?{value:{name:o[0],config:o[1]},error:""}:{value:null,error:"No server in there"}}(y):"http"===i?(e=l,t=d,n=m,s=p,(c=M.safeParse({url:e.trim(),headers:eo(t),oauthClient:n.trim()?{clientId:n.trim(),clientSecret:s.trim()}:void 0})).success?{value:{name:null,config:c.data},error:""}:{value:null,error:e.trim()?"Needs a valid url":""}):(r=u,o=h,a=f,(g=R.safeParse({command:r.trim(),args:o.split(/\s+/).filter(Boolean),env:eo(a)})).success?{value:{name:null,config:g.data},error:""}:{value:null,error:r.trim()?"Needs a command":""})},[i,y,l,d,m,p,u,h,f]),z="json"===i?y:JSON.stringify([i,l,d,m,p,u,h,f]),[O,T]=(0,g.useState)(z);(0,g.useEffect)(()=>{let e=setTimeout(()=>T(z),700);return()=>clearTimeout(e)},[z]);let A=O===z?k.error:"",I=c||k.value?.name||"",F=J.safeParse({name:I,config:k.value?.config});function $(e){let t=k.value?.config;return t?"json"===e?a({mode:e,raw:JSON.stringify(t,null,2)}):"http"===e&&L(t)?a({mode:e,url:t.url,headers:er(t.headers),clientId:t.oauthClient?.clientId??"",clientSecret:t.oauthClient?.clientSecret??""}):"stdio"!==e||L(t)?void a({mode:e}):a({mode:e,command:t.command,args:(t.args??[]).join(" "),env:er(t.env)}):a({mode:e})}let E=(0,t.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,t.jsx)(S.Switch,{size:"sm",checked:"json"===i,onCheckedChange:e=>{let t;return e?$("json"):void $((t=k.value?.config)&&!L(t)?"stdio":"http")}})]});return(0,t.jsx)(_.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to Thursday and every sub-agent.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Button,{variant:"ghost",onClick:n,children:"Cancel"}),(0,t.jsx)(x.Button,{disabled:!F.success,loading:N,onClick:()=>{F.success&&!N&&b(F.data)},children:"Connect"})]}),children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Name"}),(0,t.jsx)(j.Input,{value:I,onChange:e=>a({name:e.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===i?(0,t.jsxs)(v.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(v.FieldLabel,{children:"JSON"}),E]}),(0,t.jsx)(w.Textarea,{value:y,onChange:e=>a({raw:e.target.value}),spellCheck:!1,placeholder:ea,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,t.jsxs)(C.Tabs,{value:i,onValueChange:e=>$(e),className:"gap-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(v.FieldLabel,{children:"Transport"}),E]}),(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)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"URL"}),(0,t.jsx)(j.Input,{value:l,onChange:e=>a({url:e.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(en,{label:"Headers",pairs:d,onChange:e=>a({headers:e}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."}),(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"OAuth client"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(j.Input,{value:m,onChange:e=>a({clientId:e.target.value}),placeholder:"Client ID",spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(j.Input,{value:p,onChange:e=>a({clientSecret:e.target.value}),placeholder:"Client secret",spellCheck:!1,type:"password",className:"font-mono text-xs"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Only for servers that refuse to register clients on their own, like Figma. Leave empty and one is created during sign-in."})]})]}),(0,t.jsxs)(C.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Command"}),(0,t.jsx)(j.Input,{value:u,onChange:e=>a({command:e.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Args"}),(0,t.jsx)(j.Input,{value:h,onChange:e=>a({args:e.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(en,{label:"Env",pairs:f,onChange:e=>a({env:e}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),A&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:A})]})})}function en({label:e,pairs:n,onChange:s,keyPlaceholder:r,valuePlaceholder:o}){let a=(e,t)=>s(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.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)(j.Input,{value:e.key,onChange:t=>a(e.id,{key:t.target.value}),placeholder:r,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(j.Input,{value:e.value,onChange:t=>a(e.id,{value:t.target.value}),placeholder:o,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",onClick:()=>s(n.filter(t=>t.id!==e.id)),children:(0,t.jsx)(h.X,{})})]},e.id)),(0,t.jsxs)(x.Button,{variant:"outline",size:"sm",onClick:()=>s([...n,es()]),children:[(0,t.jsx)(c.Plus,{}),"Add"]})]})]})}let es=(e="",t="")=>({id:crypto.randomUUID(),key:e,value:t}),er=e=>Object.entries(e??{}).map(([e,t])=>es(e,t)),eo=e=>{let t=e.filter(e=>e.key.trim());if(t.length)return Object.fromEntries(t.map(e=>[e.key.trim(),e.value]))},ea=`/** STDIO Example */
4
4
  {
5
5
  "command": "node",
6
6
  "args": ["index.js"],
@@ -15,4 +15,4 @@ ${r}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t
15
15
  "headers": {
16
16
  "Authorization": "Bearer sk-..."
17
17
  }
18
- }`;function ei(e){if("auth_required"===e.status&&e.authorizationUrl){let t=window.open(e.authorizationUrl,"thursday-oauth","popup,width=520,height=720");z.toast.add({title:`${e.name} needs authorization`,description:"Approve access in the window that just opened"});let n=Date.now()+3e5,s=setInterval(()=>{let e=!t||t.closed;!(!e&&Date.now()<n)&&(clearInterval(s),e&&(0,V.revalidate)(f.queryKey.mcp))},700);return}"error"===e.status?z.toast.add({type:"error",title:`${e.name} could not connect`,description:e.error}):z.toast.add({type:"success",title:`${e.name} connected`,description:`${e.toolCount} ${1===e.toolCount?"tool":"tools"} available`})}let ec={onOk:e=>{(0,V.revalidate)(f.queryKey.mcp),ei(e)}};function el({filter:e,onFilter:n,onPreset:s}){let r=e.trim().toLowerCase(),o=K.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r));return(0,t.jsx)(_.SettingGroup,{label:"Presets",filter:(0,t.jsx)(_.SettingFilter,{value:e,onChange:n,placeholder:"Filter presets",className:"w-56"}),right:r?`${o.length} of ${K.length}`:void 0,children:(0,t.jsx)("div",{className:"grid grid-cols-[repeat(4,minmax(0,1fr))] gap-3",children:o.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>s(e),className:"group relative flex flex-col gap-2 rounded-xl border border-border/60 p-3 text-left text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(c.Plus,{className:"absolute top-3 right-3 size-3.5 shrink-0 text-muted-foreground/50 group-hover:text-foreground"}),(0,t.jsx)("span",{className:"grid size-6 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground",children:e.icon?(0,t.jsx)("img",{src:(0,b.faviconUrl)(e.icon),alt:"",className:"size-4"}):(0,t.jsx)(p,{className:"size-3.5"})}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-xs font-semibold",children:e.name}),(0,t.jsx)("span",{className:"block truncate text-xs",children:e.description})]})]},e.name))})})}function ed(e){return L(e)?e.url:[e.command,...e.args??[]].join(" ")}e.s(["CONNECT_OPTIONS",0,ec,"McpSetting",0,function(){let[e,n]=(0,g.useState)(""),{data:s=[],isLoading:r,error:o}=(0,V.useServerRoute)(f.queryKey.mcp);if(r)return(0,t.jsx)(_.SettingSkeleton,{rows:3});if(o)return(0,t.jsx)(_.SettingError,{message:o.message});let a=s.reduce((e,t)=>e+t.toolCount,0),i=s.filter(e=>e.lastError).length;return(0,t.jsxs)(_.SettingScreen,{footer:(0,t.jsx)(_.SettingRailNote,{children:0===s.length?"Nothing connected yet — a preset is the shortest way in":(0,t.jsxs)(t.Fragment,{children:[s.length," connected · ",a," tools",i>0&&` \xb7 ${i} failed`]})}),children:[(0,t.jsx)(_.SettingGroup,{label:"Connected",children:(0,t.jsx)(_.SettingItems,{addRow:{label:"Add server",onClick:()=>ee()},children:s.map(e=>(0,t.jsx)(Q,{server:e},e.name))})}),(0,t.jsx)(el,{filter:e,onFilter:n,onPreset:ee})]})},"openMcpRegister",0,ee,"reportConnect",0,ei],787800)},333999,e=>{"use strict";var t=e.i(271645),n=e.i(647163);e.s(["useObjectState",0,e=>{let[s,r]=(0,t.useState)(e);return[s,(0,t.useMemo)(()=>{let e=e=>{r(t=>{let s=(0,n.isFunction)(e)?e(t):e;return Object.keys(s).some(e=>!Object.is(t[e],s[e]))?{...t,...s}:t})},t=new Map;return new Proxy(e,{get(s,r,o){if("symbol"==typeof r)return Reflect.get(s,r,o);let a=t.get(r);return a||(a=t=>{e(e=>({[r]:(0,n.isFunction)(t)?t(e[r]):t}))},t.set(r,a)),a}})},[])]}])},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)}]);
18
+ }`;function ei(e){if("auth_required"===e.status&&e.authorizationUrl){let t=window.open(e.authorizationUrl,"thursday-oauth","popup,width=520,height=720");z.toast.add({title:`${e.name} needs authorization`,description:"Approve access in the window that just opened"});let n=Date.now()+3e5,s=setInterval(()=>{let e=!t||t.closed;!(!e&&Date.now()<n)&&(clearInterval(s),e&&(0,V.revalidate)(f.queryKey.mcp))},700);return}"error"===e.status?z.toast.add({type:"error",title:`${e.name} could not connect`,description:e.error}):z.toast.add({type:"success",title:`${e.name} connected`,description:`${e.toolCount} ${1===e.toolCount?"tool":"tools"} available`})}let ec={onOk:e=>{(0,V.revalidate)(f.queryKey.mcp),ei(e)}};function el({filter:e,onFilter:n,onPreset:s}){let r=e.trim().toLowerCase(),o=K.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r));return(0,t.jsx)(_.SettingGroup,{label:"Presets",filter:(0,t.jsx)(_.SettingFilter,{value:e,onChange:n,placeholder:"Filter presets",className:"w-56"}),right:r?`${o.length} of ${K.length}`:void 0,children:(0,t.jsx)("div",{className:"grid grid-cols-[repeat(4,minmax(0,1fr))] gap-3",children:o.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>s(e),className:"group relative flex flex-col gap-2 rounded-xl border border-border/60 p-3 text-left text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(c.Plus,{className:"absolute top-3 right-3 size-3.5 shrink-0 text-muted-foreground/50 group-hover:text-foreground"}),(0,t.jsx)("span",{className:"grid size-6 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground",children:e.icon?(0,t.jsx)("img",{src:(0,y.faviconUrl)(e.icon),alt:"",className:"size-4"}):(0,t.jsx)(p,{className:"size-3.5"})}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-xs font-semibold",children:e.name}),(0,t.jsx)("span",{className:"block truncate text-xs",children:e.description})]})]},e.name))})})}function ed(e){return L(e)?e.url:[e.command,...e.args??[]].join(" ")}e.s(["CONNECT_OPTIONS",0,ec,"McpSetting",0,function(){let[e,n]=(0,g.useState)(""),{data:s=[],isLoading:r,error:o}=(0,V.useServerRoute)(f.queryKey.mcp);if(r)return(0,t.jsx)(_.SettingSkeleton,{rows:3});if(o)return(0,t.jsx)(_.SettingError,{message:o.message});let a=s.reduce((e,t)=>e+t.toolCount,0),i=s.filter(e=>e.lastError).length;return(0,t.jsxs)(_.SettingScreen,{footer:(0,t.jsx)(_.SettingRailNote,{children:0===s.length?"Nothing connected yet — a preset is the shortest way in":(0,t.jsxs)(t.Fragment,{children:[s.length," connected · ",a," tools",i>0&&` \xb7 ${i} failed`]})}),children:[(0,t.jsx)(_.SettingGroup,{label:"Connected",children:(0,t.jsx)(_.SettingItems,{addRow:{label:"Add server",onClick:()=>ee()},children:s.map(e=>(0,t.jsx)(Q,{server:e},e.name))})}),(0,t.jsx)(el,{filter:e,onFilter:n,onPreset:ee})]})},"openMcpRegister",0,ee,"reportConnect",0,ei],787800)},333999,e=>{"use strict";var t=e.i(271645),n=e.i(647163);e.s(["useObjectState",0,e=>{let[s,r]=(0,t.useState)(e);return[s,(0,t.useMemo)(()=>{let e=e=>{r(t=>{let s=(0,n.isFunction)(e)?e(t):e;return Object.keys(s).some(e=>!Object.is(t[e],s[e]))?{...t,...s}:t})},t=new Map;return new Proxy(e,{get(s,r,o){if("symbol"==typeof r)return Reflect.get(s,r,o);let a=t.get(r);return a||(a=t=>{e(e=>({[r]:(0,n.isFunction)(t)?t(e[r]):t}))},t.set(r,a)),a}})},[])]}])},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)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,e=>{"use strict";var t=e.i(843476),n=e.i(456420);let i={name:"audio-lines",size:24,node:[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]};i.node;let s=(0,n.default)(i),o={name:"captions",size:24,node:[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]],aliases:["subtitles"]};o.node;let r=(0,n.default)(o);var a=e.i(689664),l=e.i(867927);let d={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};d.node;let c=(0,n.default)(d);var u=e.i(815170),g=e.i(466787),m=e.i(271645),h=e.i(798120),f=e.i(167881),x=e.i(23750),k=e.i(917162),p=e.i(146538),y=e.i(968978),v=e.i(265402),j=e.i(635963),b=e.i(95187);let N=(0,b.createServerReference)("7f250a5798c865a049782fe8ddb8318b44778fc093",b.callServer,void 0,b.findSourceMapURL,"removeConfigAction");var S=e.i(63638),C=e.i(992112),M=e.i(895836),A=e.i(609856),w=e.i(283653),z=e.i(647163);let R={image:u.Image,video:c,speech:s,transcription:r};function I({section:e}){let{data:n,isLoading:i,error:s}=(0,w.useServerRoute)(h.queryKey.config);if(i)return(0,t.jsx)(M.SettingSkeleton,{rows:4});if(s)return(0,t.jsx)(M.SettingError,{message:s.message});let o=e=>(0,C.isConfigSet)(n,e),r=e=>n?.find(t=>t.key===e)?.value,a=C.CONFIG_GROUPS.filter(t=>t.section===e),l=a.flatMap(e=>e.entries);return(0,t.jsx)(M.SettingScreen,{footer:(0,t.jsx)(M.SettingRailNote,{children:"keys"===e?(0,t.jsxs)(t.Fragment,{children:[l.filter(e=>o(e.key)).length," of"," ",l.length," set",a.some(e=>!(0,C.groupSatisfied)(e,o))?" · a call needs one voice key":" · your keys stay on this machine"]}):(0,t.jsxs)(t.Fragment,{children:[l.length," of ",l.length," resolved ·"," ",l.filter(e=>r(e.key)).length," pinned"]})}),children:a.map(e=>(0,t.jsx)(M.SettingGroup,{label:e.title,hint:e.hint,right:(0,t.jsx)(K,{group:e,isSet:o}),children:(0,t.jsx)(M.SettingItems,{children:e.entries.map(n=>n.choices?(0,t.jsx)($,{entry:n,choices:n.choices,value:r(n.key),isSet:o},n.key):(0,t.jsx)(T,{entry:n,set:o(n.key),needed:!(0,C.groupSatisfied)(e,o)},n.key))})},e.id))})}function K({group:e,isSet:n}){return"none"===e.require?null:(0,C.groupSatisfied)(e,n)?(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(a.Check,{className:"size-3"}),"ready"]}):(0,t.jsxs)("span",{className:(0,z.cn)("flex items-center gap-1 font-mono text-[11px]",z.WAITING_INK),children:[(0,t.jsx)(g.TriangleAlert,{className:"size-3"}),e.note??"Required"]})}function T({entry:e,set:n,needed:i}){return(0,t.jsxs)("button",{type:"button",onClick:()=>{var i,s;return i=e,s=n,k.notify.component({className:"sm:max-w-md",renderer:({close:e})=>(0,t.jsx)(O,{entry:i,set:s,onDone:e})})},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:[e.provider&&(0,t.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,t.jsx)(y.ProviderIcon,{provider:e.provider,className:"size-4"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.label}),(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:e.key})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",n?"text-muted-foreground":i?z.WAITING_INK:"text-muted-foreground/60"),children:[n&&(0,t.jsx)(a.Check,{className:"size-3"}),!n&&i&&(0,t.jsx)(g.TriangleAlert,{className:"size-3"}),n?"Set":i?"Needed":"Not set"]}),(0,t.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function $({entry:e,choices:n,value:i,isSet:s}){let o=n.find(e=>e.value===i),r=n.filter(e=>s(e.needs)),a=i&&!o?i:null,d=e.kind?R[e.kind]:j.BotsMark;return(0,t.jsxs)("button",{type:"button",onClick:()=>{var i,s,o;return e.kind||e.text?(i=e,k.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(q,{entry:i,onDone:e})})):(s=e,o=n,k.notify.component({className:"sm:max-w-md",renderer:({close:e})=>(0,t.jsx)(B,{entry:s,choices:o,onDone:e})}))},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-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,t.jsx)(d,{className:"size-4 text-muted-foreground"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.label}),(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[!o&&!a&&(0,t.jsx)("span",{className:(0,z.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",e.kind?z.WAITING_INK:"text-muted-foreground"),children:e.kind?"off":"auto"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground",children:o?.label??a??(e.kind?"Not offered to bots until you pick one":r[0]?.label??"No key for any of these yet")})]})]}),(0,t.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function q({entry:e,onDone:n}){let{data:i}=(0,w.useServerRoute)(h.queryKey.config),s=i?.find(t=>t.key===e.key)?.value,[o,r]=(0,m.useState)(()=>{let t=e.text?(0,v.parseTextModel)(s):(0,v.parseMediaModel)(s);return{provider:t?.provider??null,model:t?.model??""}}),a=()=>{(0,w.revalidate)(h.queryKey.config),n()},[l]=(0,A.useServerAction)(S.setConfigAction,{okMessage:`${e.label} saved`,onOk:a}),[d,c]=(0,A.useServerAction)(N,{okMessage:e.kind?`${e.label} switched off`:`${e.label} back to automatic`,onOk:a});return(0,t.jsx)(M.SettingDialogContent,{title:e.label,description:e.hint,footer:(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(f.Button,{variant:"ghost",loading:c,onClick:()=>d(e.key),children:e.kind?"Turn off":"Automatic"}),(0,t.jsx)(f.Button,{variant:"ghost",onClick:n,children:"Close"})]}),children:(0,t.jsx)(p.ModelPicker,{kind:e.kind,provider:o.provider,model:o.model,onChange:t=>{r(t),t.model.trim()&&l(e.key,`${t.provider}/${t.model.trim()}`)}})})}function B({entry:e,choices:n,onDone:i}){let{data:s}=(0,w.useServerRoute)(h.queryKey.config),o=s?.find(t=>t.key===e.key)?.value,r=()=>{(0,w.revalidate)(h.queryKey.config),i()},[a,l]=(0,A.useServerAction)(S.setConfigAction,{okMessage:`${e.label} saved`,onOk:r}),[d,c]=(0,A.useServerAction)(N,{okMessage:e.kind?`${e.label} switched off`:`${e.label} back to automatic`,onOk:r});return(0,t.jsx)(M.SettingDialogContent,{title:e.label,description:e.hint,footer:(0,t.jsxs)(t.Fragment,{children:[o&&(0,t.jsx)(f.Button,{variant:"ghost",loading:c,onClick:()=>d(e.key),children:e.kind?"Turn off":"Automatic"}),(0,t.jsx)(f.Button,{variant:"ghost",onClick:i,children:"Close"})]}),children:(0,t.jsx)(M.SettingChoiceRows,{options:n.map(e=>({value:e.value,label:e.label,disabled:!(0,C.isConfigSet)(s,e.needs)&&`needs ${e.needs}`})),value:o,onChange:t=>a(e.key,t),disabled:l})})}function O({entry:e,set:n,onDone:i}){let[s,o]=(0,m.useState)(""),r=()=>{(0,w.revalidate)(h.queryKey.config),(0,w.revalidate)(h.queryKey.llmModel)},[a,l]=(0,A.useServerAction)(S.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{r(),i()}}),[d,c]=(0,A.useServerAction)(N,{okMessage:`${e.label} key removed`,onOk:()=>{r(),i()}});return(0,t.jsx)(M.SettingDialogContent,{title:e.label,description:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-mono",children:e.key}),e.hint&&(0,t.jsxs)(t.Fragment,{children:[" · ",e.hint]})]}),footer:(0,t.jsxs)(t.Fragment,{children:[n&&(0,t.jsx)(f.Button,{variant:"ghost",loading:c,onClick:()=>d(e.key),children:"Remove"}),(0,t.jsx)(f.Button,{variant:"ghost",onClick:i,children:"Cancel"}),(0,t.jsx)(f.Button,{loading:l,disabled:s.trim().length<8,onClick:()=>a(e.key,s),children:n?"Replace":"Save"})]}),children:(0,t.jsx)(x.Input,{value:s,onChange:e=>o(e.target.value),onKeyDown:t=>{"Enter"===t.key&&s.trim().length>=8&&a(e.key,s)},placeholder:n?"New value — replaces the current key":e.key,spellCheck:!1,type:"password",autoFocus:!0})})}e.s(["ConfigGroups",0,I,"ConfigSetting",0,function(){return(0,t.jsx)(I,{section:"keys"})}],805995)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25481,e=>{"use strict";var t=e.i(843476),n=e.i(716327),r=e.i(632781),s=e.i(456420);let i={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};i.node;let a=(0,s.default)(i);var l=e.i(929272),o=e.i(759659),u=e.i(271645),c=e.i(798120),d=e.i(167881),f=e.i(463415),x=e.i(917162),m=e.i(660302),h=e.i(671428),g=e.i(996272),p=e.i(95187);let k=(0,p.createServerReference)("7f08787ba9fc8824b7a875687443bbce164e04905e",p.callServer,void 0,p.findSourceMapURL,"clearFinishedTasksAction"),v=(0,p.createServerReference)("7f46407252db150b0c510d36e20dccf5a544e9107f",p.callServer,void 0,p.findSourceMapURL,"deleteTaskAction");var b=e.i(451888),j=e.i(635963),y=e.i(279265),w=e.i(835878),N=e.i(222055),S=e.i(240829),T=e.i(895836),C=e.i(245629),M=e.i(609856),R=e.i(661504),I=e.i(283653),z=e.i(647163),_=e.i(206721);let A="w-36";function D({task:e,bots:s,open:i,onToggle:c,onStop:x,onDelete:h}){var g,p;let k,v="running"===e.status||"waiting"===e.status,N="running"===e.status,T=(0,u.useMemo)(()=>(0,S.taskFromRow)(e,s),[e,s]),M=function(e){if("waiting"===e.status&&e.ask)return(0,b.isBudgetAsk)(e.ask)?{text:(0,z.plainText)(e.outcome??e.ask.question),tone:"text-muted-foreground"}:{text:e.ask.question,tone:z.WAITING_INK};if("failed"===e.status)return{text:(0,z.plainText)(e.outcome??"Failed"),tone:"text-destructive"};if("done"===e.status)return{text:(0,z.plainText)(e.outcome??"Done"),tone:e.reported?"text-muted-foreground":"text-foreground/80"};for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("tool"===n.kind)return{text:n.note??n.input,tone:"text-muted-foreground",tool:n.name,shine:!0};if("text"===n.kind)return{text:n.text,tone:"text-muted-foreground",shine:!0};if("user"===n.kind||"waiting"===n.kind)break}return{text:`${e.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(e),R=e.tokens.input+e.tokens.output;return(0,t.jsxs)("div",{className:"group/row relative transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsxs)("button",{type:"button",onClick:c,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(j.BotMark,{size:40,seed:e.bot,vary:e.id,...(g=e.bot,p=s,k=p?.find(e=>e.name===g)?.icon,{color:k?.color,shape:k?.shape,outline:k?.outline}),state:N?"thinking":"idle",notify:"waiting"===e.status,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),(0,t.jsx)(w.BotRoster,{bots:(0,S.rosterOf)(T),taskId:e.id}),N&&(0,t.jsx)(r.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),M&&(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[M.tool&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:M.tool}),M.shine?(0,t.jsx)(m.default,{text:M.text,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 truncate",M.tone),children:M.text})]})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",A),children:[(0,t.jsx)("span",{children:(0,C.whenOf)(e.updatedAt)}),(0,t.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:R>0?`${e.id} \xb7 in ${(0,z.formatCount)(e.tokens.input)} \xb7 out ${(0,z.formatCount)(e.tokens.output)}`:e.id,children:[e.bot,R>0&&` \xb7 ${(0,z.formatCount)(R)}`]})]}),(0,t.jsx)(n.ChevronDown,{className:(0,z.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)(d.Button,{size:"icon-sm",variant:"ghost"}),children:(0,t.jsx)(a,{})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"end",children:[v&&(0,t.jsxs)(f.DropdownMenuItem,{onClick:x,children:[(0,t.jsx)(l.Square,{}),"Stop"]}),(0,t.jsxs)(f.DropdownMenuItem,{variant:"destructive",onClick:h,children:[(0,t.jsx)(o.Trash2,{}),"Delete"]})]})]})]}),N&&!i&&(0,t.jsx)($,{task:e}),i&&(0,t.jsxs)("div",{className:"mx-4 mb-4 space-y-2",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border/60 bg-background",children:(0,t.jsx)(y.Conversation,{task:T})}),(0,t.jsx)(_.TaskReply,{task:{id:e.id,label:e.label,bot:e.bot,ask:e.ask},status:e.status})]})]})}function $({task:e}){let n=[];if(e.lines.forEach((t,r)=>{if("tool"!==t.kind)return;let s=e.lines[r+1];n.push({step:t,took:s?(0,C.toDate)(s.at).getTime()-(0,C.toDate)(t.at).getTime():null})}),0===n.length)return null;let s=(0,C.toDate)(e.updatedAt).getTime()-(0,C.toDate)(e.createdAt).getTime();return(0,t.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.bot}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsxs)("span",{children:[n.length," ",1===n.length?"step":"steps"]}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsx)("span",{children:E(s)})]}),n.slice(-6).map(({step:e,took:n})=>{let s=(0,N.toolIcon)(e.name);return(0,t.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===n?(0,t.jsx)(r.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,t.jsx)(s,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:e.name}),null===n?(0,t.jsx)(m.default,{text:e.note??e.input,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.note??e.input}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===n?"":E(n)})]},e.id)})]})}function E(e){let t=Math.max(0,e)/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60);return`${n}m ${Math.round(t-60*n)}s`}function K(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)(h.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(h.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,t.jsx)(h.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-1.5",A),children:[(0,t.jsx)(h.Skeleton,{className:"h-2.5 w-12"}),(0,t.jsx)(h.Skeleton,{className:"h-2.5 w-24"})]}),(0,t.jsx)("span",{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"size-7 shrink-0"})]})}e.s(["TaskSetting",0,function(){let[e,n]=(0,u.useState)(null),[r,s]=(0,u.useState)(""),{data:i}=(0,I.useServerRoute)(c.queryKey.bot),{items:a,isLoading:l,isLoadingMore:o,error:f,hasMore:m,sentinelRef:h}=(0,R.useServerPages)({key:(e,t)=>{if(0===e)return c.queryKey.taskHistory(null);let n=t?.at(-1);return n?c.queryKey.taskHistory((0,C.toDate)(n.updatedAt).toISOString()):null},size:b.TASK_HISTORY_PAGE,swr:{revalidateFirstPage:!0,refreshInterval:e=>3e3*!!e?.[0]?.some(e=>"running"===e.status)}}),[p]=(0,M.useServerAction)(g.cancelTaskAction,{okMessage:"Task stopped",onOk:e=>{(0,I.revalidate)(c.queryKey.tasks),S.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),[j]=(0,M.useServerAction)(v,{okMessage:"Task deleted",onOk:()=>(0,I.revalidate)(c.queryKey.tasks)}),[y]=(0,M.useServerAction)(k,{onOk:()=>(0,I.revalidate)(c.queryKey.tasks)}),w=async()=>{await x.notify.confirm({title:"Clear finished jobs?",description:"Everything done or failed goes, threads included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&y()},N=async e=>{await x.notify.confirm({title:`Delete "${e.label}"?`,description:"The thread goes with it — nothing can be picked back up.",okText:"Delete",destructive:!0})&&j(e.id)};if(l)return(0,t.jsx)(T.SettingSkeleton,{rows:3});if(f)return(0,t.jsx)(T.SettingError,{message:f.message});let z=r.trim().toLowerCase(),_=z?a.filter(e=>[e.label,e.outcome,e.bot].join(" ").toLowerCase().includes(z)):a,A=a.filter(e=>"waiting"===e.status).length,$=a.filter(e=>"failed"===e.status).length;return(0,t.jsx)(T.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(T.SettingRailNote,{children:[a.length," loaded",A>0&&` \xb7 ${A} waiting on you`,$>0&&` \xb7 ${$} failed`]}),(0,t.jsx)(d.Button,{variant:"outline",size:"sm",onClick:w,children:"Clear finished"})]}),children:(0,t.jsx)(T.SettingGroup,{filter:(0,t.jsx)(T.SettingFilter,{value:r,onChange:s,placeholder:"Filter by label, bot or word"}),right:z?`${_.length} of ${a.length}`:void 0,children:(0,t.jsxs)(T.SettingItems,{children:[0===_.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:z?"Nothing loaded matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):_.map(r=>(0,t.jsx)(D,{task:r,bots:i,open:e===r.id,onToggle:()=>n(e=>e===r.id?null:r.id),onStop:()=>p(r.id),onDelete:()=>N(r)},r.id)),(0,t.jsx)(T.SettingMore,{hasMore:m,loading:o,sentinelRef:h,ghost:(0,t.jsx)(K,{}),className:"divide-y divide-border/60"})]})})})}],25481)},661504,e=>{"use strict";var t=e.i(271645),n=e.i(699018),r=e.i(677309),s=e.i(271235),i=e.i(802239),a=e.i(646192);let l=Promise.resolve(),o=(0,s.withMiddleware)(n.u,e=>(n,s,o)=>{let u,c=(0,t.useRef)(!1),{cache:d,initialSize:f=1,revalidateAll:x=!1,persistSize:m=!1,revalidateFirstPage:h=!0,revalidateOnMount:g=!1,parallel:p=!1}=o,[,,,k]=r.a.get(r.o);try{(u=(0,r.s)(n?n(0,null):null)[0])&&(u=a.INFINITE_PREFIX+u)}catch(e){}let[v,b,j]=(0,r.c)(d,u),y=(0,t.useCallback)(()=>(0,r.i)(v()._l)?f:v()._l,[d,u,f]);(0,i.useSyncExternalStore)((0,t.useCallback)(e=>u?j(u,()=>{e()}):()=>{},[d,u]),y,y);let w=(0,t.useCallback)(()=>{let e=v()._l;return(0,r.i)(e)?f:e},[u,f]),N=(0,t.useRef)(w());(0,r.u)(()=>{if(!c.current){c.current=!0;return}u&&b({_l:m?N.current:w()})},[u,d]);let S=g&&!c.current,T=e(u,async e=>{let t=v()._i,i=v()._r,a=r.a.get(d),l=a[8],u=()=>a[8]!==l;b({_r:r.U});let c=[],f=w(),[m]=(0,r.c)(d,e),g=m().data,j=[],y=null;for(let e=0;e<f;++e){let[a,l]=(0,r.s)(n(e,p?null:y));if(!a)break;let[f,m]=(0,r.c)(d,a),v=f().data,b=x||t||(0,r.i)(v)||h&&!e&&!(0,r.i)(g)||S||g&&!(0,r.i)(g[e])&&!o.compare(g[e],v);if(s&&("function"==typeof i?i(v,l):b)){let t=async()=>{if(a in k){let e=k[a];delete k[a],v=await e}else v=await s(l);u()||m({data:v,_k:l}),c[e]=v};p?j.push(t):await t()}else c[e]=v;p||(y=v)}return p&&await Promise.all(j.map(e=>e())),u()||b({_i:r.U}),c},o),C=(0,t.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},s=!1!==n.revalidate;return u?(s&&((0,r.i)(e)?b({_i:!0,_r:n.revalidate}):b({_i:!1,_r:n.revalidate})),arguments.length?T.mutate(e,{...n,revalidate:s}):T.mutate()):l},[u,d]),M=(0,t.useCallback)(e=>{let t;if(!u)return l;let[,s]=(0,r.c)(d,u);if((0,r.e)(e)?t=e(w()):"number"==typeof e&&(t=e),"number"!=typeof t)return l;s({_l:t}),N.current=t;let i=[],[a]=(0,r.c)(d,u),o=null;for(let e=0;e<t;++e){let[t]=(0,r.s)(n(e,o)),[s]=(0,r.c)(d,t),l=t?s().data:r.U;if((0,r.i)(l))return C(a().data);i.push(l),o=l}return C(i)},[u,d,C,w]);return{size:w(),setSize:M,mutate:C,get data(){return T.data},get error(){return T.error},get isValidating(){return T.isValidating},get isLoading(){return T.isLoading}}});var u=e.i(41533),c=e.i(283653);e.s(["useServerPages",0,function(e){let n=e.size??u.PAGE_SIZE,{key:r}=e,{data:s,error:i,isLoading:a,isValidating:l,setSize:d,mutate:f}=o((e,t)=>(0,c.resolveKey)(r(e,t)),c.fetchRoute,{dedupingInterval:500,revalidateOnMount:!0,revalidateOnFocus:!0,revalidateOnReconnect:!0,focusThrottleInterval:1e3,revalidateFirstPage:!1,...e.swr}),x=s??[],m=x.flat(),h=x.at(-1),g=void 0!==h&&h.length>=n,p=(0,t.useRef)(0),k=l&&x.length>0&&p.current>x.length,v=(0,t.useRef)({isValidating:l,setSize:d,pages:x.length});v.current={isValidating:l,setSize:d,pages:x.length};let b=(0,c.resolveKey)(r(0,null)),j="string"==typeof b?b:b?.url;(0,t.useEffect)(()=>{if(j)return(0,c.registerPagedReader)({url:j,refresh:()=>f()})},[j,f]);let y=function(e,n={}){let{enabled:r=!0,margin:s="600px",revision:i}=n,a=(0,t.useRef)(e);a.current=e;let l=(0,t.useRef)(null),o=(0,t.useRef)(null),u=(0,t.useCallback)(e=>{l.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=l.current;if(e&&r)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&a.current()},{root:function(e){let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e),rootMargin:s}),o.current.observe(e),()=>o.current?.disconnect()},[r,s,i]),u}(()=>{let e=v.current;e.isValidating||(p.current=e.pages+1,e.setSize(e.pages+1))},{enabled:g,revision:`${x.length}:${l}`});return{items:m,isLoading:a,isLoadingMore:k,error:i,hasMore:g,sentinelRef:y,refresh:()=>f()}}],661504)},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 r=(0,t.default)(n);e.s(["Trash2",0,r],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25481,e=>{"use strict";var t=e.i(843476),n=e.i(716327),r=e.i(632781),s=e.i(456420);let a={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};a.node;let i=(0,s.default)(a);var l=e.i(929272),o=e.i(759659),u=e.i(271645),d=e.i(798120),c=e.i(167881),f=e.i(463415),x=e.i(917162),m=e.i(660302),h=e.i(671428),g=e.i(133014),p=e.i(95187);let k=(0,p.createServerReference)("7f80816611593aeb950e1104f1dbc9de5d7fba0f77",p.callServer,void 0,p.findSourceMapURL,"clearFinishedTasksAction"),v=(0,p.createServerReference)("7f9f887848ed2939266697558b2b53dad0f36a12a9",p.callServer,void 0,p.findSourceMapURL,"deleteTaskAction");var b=e.i(451888),j=e.i(635963),y=e.i(279265),w=e.i(835878),N=e.i(222055),S=e.i(240829),T=e.i(895836),C=e.i(245629),M=e.i(609856),R=e.i(661504),I=e.i(283653),z=e.i(647163),_=e.i(206721);let A="w-36";function D({task:e,bots:s,open:a,onToggle:d,onStop:x,onDelete:h}){var g,p;let k,v="running"===e.status||"waiting"===e.status,N="running"===e.status,T=(0,u.useMemo)(()=>(0,S.taskFromRow)(e,s),[e,s]),M=function(e){if("waiting"===e.status&&e.ask)return(0,b.isBudgetAsk)(e.ask)?{text:(0,z.plainText)(e.outcome??e.ask.question),tone:"text-muted-foreground"}:{text:e.ask.question,tone:z.WAITING_INK};if("failed"===e.status)return{text:(0,z.plainText)(e.outcome??"Failed"),tone:"text-destructive"};if("done"===e.status)return{text:(0,z.plainText)(e.outcome??"Done"),tone:e.reported?"text-muted-foreground":"text-foreground/80"};for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("tool"===n.kind)return{text:n.note??n.input,tone:"text-muted-foreground",tool:n.name,shine:!0};if("text"===n.kind)return{text:n.text,tone:"text-muted-foreground",shine:!0};if("user"===n.kind||"waiting"===n.kind)break}return{text:`${e.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(e),R=e.tokens.input+e.tokens.output;return(0,t.jsxs)("div",{className:"group/row relative transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsxs)("button",{type:"button",onClick:d,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(j.BotMark,{size:40,seed:e.bot,vary:e.id,...(g=e.bot,p=s,k=p?.find(e=>e.name===g)?.icon,{color:k?.color,shape:k?.shape,outline:k?.outline}),state:N?"thinking":"idle",notify:"waiting"===e.status,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),(0,t.jsx)(w.BotRoster,{bots:(0,S.rosterOf)(T),taskId:e.id}),N&&(0,t.jsx)(r.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),M&&(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[M.tool&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:M.tool}),M.shine?(0,t.jsx)(m.default,{text:M.text,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 truncate",M.tone),children:M.text})]})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",A),children:[(0,t.jsx)("span",{children:(0,C.whenOf)(e.updatedAt)}),(0,t.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:R>0?`${e.id} \xb7 in ${(0,z.formatCount)(e.tokens.input)} \xb7 out ${(0,z.formatCount)(e.tokens.output)}`:e.id,children:[e.bot,R>0&&` \xb7 ${(0,z.formatCount)(R)}`]})]}),(0,t.jsx)(n.ChevronDown,{className:(0,z.cn)("size-4 shrink-0 text-muted-foreground transition-transform",a&&"rotate-180")})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)(c.Button,{size:"icon-sm",variant:"ghost"}),children:(0,t.jsx)(i,{})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"end",children:[v&&(0,t.jsxs)(f.DropdownMenuItem,{onClick:x,children:[(0,t.jsx)(l.Square,{}),"Stop"]}),(0,t.jsxs)(f.DropdownMenuItem,{variant:"destructive",onClick:h,children:[(0,t.jsx)(o.Trash2,{}),"Delete"]})]})]})]}),N&&!a&&(0,t.jsx)($,{task:e}),a&&(0,t.jsxs)("div",{className:"mx-4 mb-4 space-y-2",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border/60 bg-background",children:(0,t.jsx)(y.Conversation,{task:T})}),(0,t.jsx)(_.TaskReply,{task:{id:e.id,label:e.label,bot:e.bot,ask:e.ask},status:e.status})]})]})}function $({task:e}){let n=[];if(e.lines.forEach((t,r)=>{if("tool"!==t.kind)return;let s=e.lines[r+1];n.push({step:t,took:s?(0,C.toDate)(s.at).getTime()-(0,C.toDate)(t.at).getTime():null})}),0===n.length)return null;let s=(0,C.toDate)(e.updatedAt).getTime()-(0,C.toDate)(e.createdAt).getTime();return(0,t.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.bot}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsxs)("span",{children:[n.length," ",1===n.length?"step":"steps"]}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsx)("span",{children:E(s)})]}),n.slice(-6).map(({step:e,took:n})=>{let s=(0,N.toolIcon)(e.name);return(0,t.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===n?(0,t.jsx)(r.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,t.jsx)(s,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:e.name}),null===n?(0,t.jsx)(m.default,{text:e.note??e.input,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.note??e.input}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===n?"":E(n)})]},e.id)})]})}function E(e){let t=Math.max(0,e)/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60);return`${n}m ${Math.round(t-60*n)}s`}function K(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)(h.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(h.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,t.jsx)(h.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-1.5",A),children:[(0,t.jsx)(h.Skeleton,{className:"h-2.5 w-12"}),(0,t.jsx)(h.Skeleton,{className:"h-2.5 w-24"})]}),(0,t.jsx)("span",{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"size-7 shrink-0"})]})}e.s(["TaskSetting",0,function(){let[e,n]=(0,u.useState)(null),[r,s]=(0,u.useState)(""),{data:a}=(0,I.useServerRoute)(d.queryKey.bot),{items:i,isLoading:l,isLoadingMore:o,error:f,hasMore:m,sentinelRef:h}=(0,R.useServerPages)({key:(e,t)=>{if(0===e)return d.queryKey.taskHistory(null);let n=t?.at(-1);return n?d.queryKey.taskHistory((0,C.toDate)(n.updatedAt).toISOString()):null},size:b.TASK_HISTORY_PAGE,swr:{revalidateFirstPage:!0,refreshInterval:e=>3e3*!!e?.[0]?.some(e=>"running"===e.status)}}),[p]=(0,M.useServerAction)(g.cancelTaskAction,{okMessage:"Task stopped",onOk:e=>{(0,I.revalidate)(d.queryKey.tasks),S.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),[j]=(0,M.useServerAction)(v,{okMessage:"Task deleted",onOk:()=>(0,I.revalidate)(d.queryKey.tasks)}),[y]=(0,M.useServerAction)(k,{onOk:()=>(0,I.revalidate)(d.queryKey.tasks)}),w=async()=>{await x.notify.confirm({title:"Clear finished jobs?",description:"Everything done or failed goes, threads included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&y()},N=async e=>{await x.notify.confirm({title:`Delete "${e.label}"?`,description:"The thread goes with it — nothing can be picked back up.",okText:"Delete",destructive:!0})&&j(e.id)};if(l)return(0,t.jsx)(T.SettingSkeleton,{rows:3});if(f)return(0,t.jsx)(T.SettingError,{message:f.message});let z=r.trim().toLowerCase(),_=z?i.filter(e=>[e.label,e.outcome,e.bot].join(" ").toLowerCase().includes(z)):i,A=i.filter(e=>"waiting"===e.status).length,$=i.filter(e=>"failed"===e.status).length;return(0,t.jsx)(T.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(T.SettingRailNote,{children:[i.length," loaded",A>0&&` \xb7 ${A} waiting on you`,$>0&&` \xb7 ${$} failed`]}),(0,t.jsx)(c.Button,{variant:"outline",size:"sm",onClick:w,children:"Clear finished"})]}),children:(0,t.jsx)(T.SettingGroup,{filter:(0,t.jsx)(T.SettingFilter,{value:r,onChange:s,placeholder:"Filter by label, bot or word"}),right:z?`${_.length} of ${i.length}`:void 0,children:(0,t.jsxs)(T.SettingItems,{children:[0===_.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:z?"Nothing loaded matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):_.map(r=>(0,t.jsx)(D,{task:r,bots:a,open:e===r.id,onToggle:()=>n(e=>e===r.id?null:r.id),onStop:()=>p(r.id),onDelete:()=>N(r)},r.id)),(0,t.jsx)(T.SettingMore,{hasMore:m,loading:o,sentinelRef:h,ghost:(0,t.jsx)(K,{}),className:"divide-y divide-border/60"})]})})})}],25481)},661504,e=>{"use strict";var t=e.i(271645),n=e.i(699018),r=e.i(677309),s=e.i(271235),a=e.i(802239),i=e.i(646192);let l=Promise.resolve(),o=(0,s.withMiddleware)(n.u,e=>(n,s,o)=>{let u,d=(0,t.useRef)(!1),{cache:c,initialSize:f=1,revalidateAll:x=!1,persistSize:m=!1,revalidateFirstPage:h=!0,revalidateOnMount:g=!1,parallel:p=!1}=o,[,,,k]=r.a.get(r.o);try{(u=(0,r.s)(n?n(0,null):null)[0])&&(u=i.INFINITE_PREFIX+u)}catch(e){}let[v,b,j]=(0,r.c)(c,u),y=(0,t.useCallback)(()=>(0,r.i)(v()._l)?f:v()._l,[c,u,f]);(0,a.useSyncExternalStore)((0,t.useCallback)(e=>u?j(u,()=>{e()}):()=>{},[c,u]),y,y);let w=(0,t.useCallback)(()=>{let e=v()._l;return(0,r.i)(e)?f:e},[u,f]),N=(0,t.useRef)(w());(0,r.u)(()=>{if(!d.current){d.current=!0;return}u&&b({_l:m?N.current:w()})},[u,c]);let S=g&&!d.current,T=e(u,async e=>{let t=v()._i,a=v()._r,i=r.a.get(c),l=i[8],u=()=>i[8]!==l;b({_r:r.U});let d=[],f=w(),[m]=(0,r.c)(c,e),g=m().data,j=[],y=null;for(let e=0;e<f;++e){let[i,l]=(0,r.s)(n(e,p?null:y));if(!i)break;let[f,m]=(0,r.c)(c,i),v=f().data,b=x||t||(0,r.i)(v)||h&&!e&&!(0,r.i)(g)||S||g&&!(0,r.i)(g[e])&&!o.compare(g[e],v);if(s&&("function"==typeof a?a(v,l):b)){let t=async()=>{if(i in k){let e=k[i];delete k[i],v=await e}else v=await s(l);u()||m({data:v,_k:l}),d[e]=v};p?j.push(t):await t()}else d[e]=v;p||(y=v)}return p&&await Promise.all(j.map(e=>e())),u()||b({_i:r.U}),d},o),C=(0,t.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},s=!1!==n.revalidate;return u?(s&&((0,r.i)(e)?b({_i:!0,_r:n.revalidate}):b({_i:!1,_r:n.revalidate})),arguments.length?T.mutate(e,{...n,revalidate:s}):T.mutate()):l},[u,c]),M=(0,t.useCallback)(e=>{let t;if(!u)return l;let[,s]=(0,r.c)(c,u);if((0,r.e)(e)?t=e(w()):"number"==typeof e&&(t=e),"number"!=typeof t)return l;s({_l:t}),N.current=t;let a=[],[i]=(0,r.c)(c,u),o=null;for(let e=0;e<t;++e){let[t]=(0,r.s)(n(e,o)),[s]=(0,r.c)(c,t),l=t?s().data:r.U;if((0,r.i)(l))return C(i().data);a.push(l),o=l}return C(a)},[u,c,C,w]);return{size:w(),setSize:M,mutate:C,get data(){return T.data},get error(){return T.error},get isValidating(){return T.isValidating},get isLoading(){return T.isLoading}}});var u=e.i(41533),d=e.i(283653);e.s(["useServerPages",0,function(e){let n=e.size??u.PAGE_SIZE,{key:r}=e,{data:s,error:a,isLoading:i,isValidating:l,setSize:c,mutate:f}=o((e,t)=>(0,d.resolveKey)(r(e,t)),d.fetchRoute,{dedupingInterval:500,revalidateOnMount:!0,revalidateOnFocus:!0,revalidateOnReconnect:!0,focusThrottleInterval:1e3,revalidateFirstPage:!1,...e.swr}),x=s??[],m=x.flat(),h=x.at(-1),g=void 0!==h&&h.length>=n,p=(0,t.useRef)(0),k=l&&x.length>0&&p.current>x.length,v=(0,t.useRef)({isValidating:l,setSize:c,pages:x.length});v.current={isValidating:l,setSize:c,pages:x.length};let b=(0,d.resolveKey)(r(0,null)),j="string"==typeof b?b:b?.url;(0,t.useEffect)(()=>{if(j)return(0,d.registerPagedReader)({url:j,refresh:()=>f()})},[j,f]);let y=function(e,n={}){let{enabled:r=!0,margin:s="600px",revision:a}=n,i=(0,t.useRef)(e);i.current=e;let l=(0,t.useRef)(null),o=(0,t.useRef)(null),u=(0,t.useCallback)(e=>{l.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=l.current;if(e&&r)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&i.current()},{root:function(e){let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e),rootMargin:s}),o.current.observe(e),()=>o.current?.disconnect()},[r,s,a]),u}(()=>{let e=v.current;e.isValidating||(p.current=e.pages+1,e.setSize(e.pages+1))},{enabled:g,revision:`${x.length}:${l}`});return{items:m,isLoading:i,isLoadingMore:k,error:a,hasMore:g,sentinelRef:y,refresh:()=>f()}}],661504)},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 r=(0,t.default)(n);e.s(["Trash2",0,r],759659)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,213377,e=>{"use strict";e.s(["TOOL_NAMES",0,{memory_recall:"memory_recall",memory_remember:"memory_remember",memory_forget:"memory_forget",memory_show:"memory_show",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",delegate:"delegate",task:"task",ask_bot:"ask_bot",ask_thursday:"ask_thursday",ask_back:"ask_back",report:"report",end_call:"end_call",tidy_done:"tidy_done",update_notes:"update_notes"}])},692329,e=>{"use strict";var t=e.i(843476),r=e.i(493801),n=e.i(456420);let a={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};a.node;let s=(0,n.default)(a);var i=e.i(867927),l=e.i(632781);let o={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};o.node;let c=(0,n.default)(o);var d=e.i(751898);let h={name:"pin-off",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]};h.node;let u=(0,n.default)(h);var m=e.i(77071),f=e.i(466787),g=e.i(271645),p=e.i(511769),x=e.i(798120),y=e.i(167881),M=e.i(917162),v=e.i(671428),b=e.i(6799),k=e.i(146538),A=e.i(852116),S=e.i(95187);let w=(0,S.createServerReference)("7f6c0cc153c7ab548fc2f550c0e10690f4f99e2113",S.callServer,void 0,S.findSourceMapURL,"cancelMemoryTidyAction"),N=(0,S.createServerReference)("7fd29793642e2fe44a0c80a6349e5646773644c688",S.callServer,void 0,S.findSourceMapURL,"runMemoryTidyAction"),_=(0,S.createServerReference)("7f926a3e4c76c8e2fd5834a27de8748daff8dbfd64",S.callServer,void 0,S.findSourceMapURL,"setMemoryTidyModelAction"),j=(0,S.createServerReference)("7ff8ab55aac487839ef7a0ccdb756e470c8bdd0509",S.callServer,void 0,S.findSourceMapURL,"setMemoryTidyOnAction");var O=e.i(536015),R=e.i(895836),E=e.i(989409),T=e.i(245629),L=e.i(609856),C=e.i(283653),I=e.i(647163);function P({status:e}){let r=e.current,n=e.last;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"border-t border-border/60",children:[(0,t.jsx)(z,{value:e.model}),(0,t.jsxs)("div",{className:"flex items-center gap-3 border-t border-border/60 py-2",children:[(0,t.jsx)("span",{className:"w-20 shrink-0 text-[13px] text-muted-foreground",children:r?"Reading":"Last read"}),r?(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3.5 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["the last ",r.messages," ",1===r.messages?"message":"messages"]})]}):(0,t.jsx)($,{run:n}),(0,t.jsx)(F,{run:r??n})]})]}),(0,t.jsx)(R.SettingNote,{className:(0,I.cn)(!e.model&&I.WAITING_INK),children:e.model?`Reads back after every ${e.every} messages of talk. ${e.pending} since the last one.`:"Nothing is read back until a model is picked — this never runs on the app default."})]})}function z({value:e}){return(0,t.jsxs)("button",{type:"button",onClick:()=>{var r;return r=e,M.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(H,{current:r,onDone:e})})},className:"flex w-full items-center gap-3 py-2 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)("span",{className:"w-20 shrink-0 text-[13px] text-muted-foreground",children:"Model"}),(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 flex-1 truncate font-mono text-[11px]",e?"text-muted-foreground":I.WAITING_INK),children:e??"Not picked"}),(0,t.jsx)(i.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60"})]})}function $({run:e}){if(!e)return(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:"Nothing read back yet"});let n=(0,r.formatDistanceToNowStrict)((0,T.toDate)(e.endedAt??e.startedAt),{addSuffix:!0});return"done"!==e.status?(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-destructive",children:[(0,t.jsx)(f.TriangleAlert,{className:"size-3.5 shrink-0"}),(0,t.jsxs)("span",{className:"truncate font-mono text-[11px]",children:["failed"===e.status?"Failed":"Stopped"," ",n,e.error?` — ${e.error}`:""]})]}):(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:[n," · ",(0,O.tidyTally)(e.changes)]})}function F({run:e}){return e?(0,t.jsx)("button",{type:"button","aria-label":"What the last read changed",onClick:()=>D(),className:"shrink-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(i.ChevronRight,{className:"size-4 text-muted-foreground/60"})}):(0,t.jsx)("span",{className:"size-4 shrink-0"})}function H({current:e,onDone:r}){let[n,a]=(0,L.useServerAction)(_,{onOk:()=>{(0,C.revalidate)(x.queryKey.memoryTidy),r()}}),s=e?.split("/")??null,[i,l]=(0,g.useState)({provider:s?.[0]??null,model:s?.slice(1).join("/")??""});return(0,t.jsx)(R.SettingDialogContent,{title:"Model",description:"What re-reads a call. There is no default: without a pick nothing is read back, so a model nobody chose never spends.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{variant:"ghost",onClick:()=>n(""),children:"Clear"}),(0,t.jsx)(y.Button,{loading:a,disabled:!i.provider||!i.model.trim(),onClick:()=>n(`${i.provider}/${i.model.trim()}`),children:"Save"})]}),children:(0,t.jsx)(k.ModelPicker,{provider:i.provider,model:i.model,onChange:l})})}function D(){return M.notify.component({className:"sm:max-w-2xl",renderer:()=>(0,t.jsx)(K,{})})}function K(){let{data:e}=(0,C.useServerRoute)(x.queryKey.memoryTidy),n={onOk:()=>(0,C.revalidate)(x.queryKey.memoryTidy)},[a,s]=(0,L.useServerAction)(N,n),[i,l]=(0,L.useServerAction)(w,n);if(!e)return(0,t.jsx)(R.SettingDialogContent,{title:"What the last read changed",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(v.Skeleton,{className:"h-4 w-2/3"}),(0,t.jsx)(v.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(v.Skeleton,{className:"h-4 w-4/5"})]})});let o=e.current??e.last,c=o?(0,r.formatDistanceToNowStrict)((0,T.toDate)(o.endedAt??o.startedAt),{addSuffix:!0}):"";return(0,t.jsx)(R.SettingDialogContent,{title:"What the last read changed",description:"Memory as it stands after the model read those messages back. Every line here is one it wrote, revised or dropped.",footer:e.current?(0,t.jsx)(y.Button,{variant:"outline",loading:l,onClick:()=>i(),children:"Stop"}):(0,t.jsxs)(y.Button,{variant:"outline",loading:s,disabled:0===e.pending||!e.model,onClick:()=>a(),children:[!s&&(0,t.jsx)(A.MemoryMark,{className:"size-3.5"}),"Read now"]}),children:o?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 text-sm",children:e.current?`Reading the last ${o.messages} messages`:`${o.messages} messages, ${c}`}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:["-"!==o.provider&&o.model,o.inputTokens>0&&` \xb7 ${o.inputTokens.toLocaleString()} in / ${o.outputTokens.toLocaleString()} out`]})]}),o.error&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:o.error}),o.changes.length>0?(0,t.jsx)("ul",{className:"border-b border-border/60",children:o.changes.map((e,r)=>(0,t.jsx)(B,{change:e},`${r}-${e.op}-${e.text}`))}):!e.current&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Nothing needed changing."})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Nothing has been read back yet."})})}let q={add:{icon:m.Plus,label:"added"},replace:{icon:s,label:"revised"},forget:{icon:c,label:"dropped"},carry:{icon:d.Pin,label:"carried into every call"},uncarry:{icon:u,label:"no longer carried"}};function B({change:e}){let{icon:r,label:n}=q[e.op];return(0,t.jsxs)("li",{className:"flex gap-3 border-t border-border/60 py-3",children:[(0,t.jsxs)("span",{className:"flex w-3.5 shrink-0 justify-center pt-1 text-muted-foreground",children:[(0,t.jsx)(r,{className:"size-3.5"}),(0,t.jsx)("span",{className:"sr-only",children:n})]}),(0,t.jsx)("span",{className:"min-w-0 flex-1 text-sm leading-relaxed text-foreground/90",children:e.text}),(0,t.jsx)("span",{className:"shrink-0 pt-0.5 font-mono text-[11px] text-muted-foreground/50",children:e.path})]})}e.s(["MemoryTidyNotice",0,function(){return(0,p.useAppEvent)({"memory-tidied":e=>{b.toast.add({type:e.failed?"error":"success",title:e.failed?"Could not read the call back":"Memory tidied",description:e.tally,actionProps:{children:"Show",onClick:()=>{(0,E.openSettings)("thursday"),D()}}})}}),null},"TidySetting",0,function(){let{data:e}=(0,C.useServerRoute)(x.queryKey.memoryTidy),[r]=(0,L.useServerAction)(j,{onOk:()=>(0,C.revalidate)(x.queryKey.memoryTidy)});return(0,t.jsx)(R.SettingGroup,{label:"After a call",children:(0,t.jsx)(R.SettingToggle,{label:"Read the call back",description:"During a call she saves what she catches between sentences. Afterwards a model reads the whole thing back and fixes what she missed.",checked:e?.on??!1,disabled:!e,onChange:e=>r(e),children:e&&(0,t.jsx)(P,{status:e})})})}],692329)},567334,e=>{"use strict";e.s(["ALPHA_TOP",0,.82,"CHAR_RATE",0,2.2,"EMOJI_CHAR_RATE",0,.6,"EMOJI_MIN_LEVEL",0,6,"EMOJI_POOL",0,["🍎","🌹","🍓","❤️","🎈","🧨","🔴","🍊","🔥","🦊","🏀","🧡","🍑","⭐","🍋","🌻","💛","🐥","🌟","🍌","🍀","🌿","🐸","🥝","💚","🌵","🥑","💧","🌊","🫐","🐳","💙","🔵","🧊","🍇","💜","🔮","🟣","🪻","🍆","🌸","🌷","💗","🦩","🩷","🍫","🐻","🌰","🥐","🤍","☁️","🖤","⚪","⚫","🦢","🌈","🦜","🎨","🪩","🦄","✨","🍬","🎡"],"EMOJI_RATIO",0,.11,"RAMP",0,[[" "],[" ",".","`"],[".",",","·","'"],[":",";","-","^"],["=","+","~",'"'],["*","?","◦","j"],["c","v","○","7"],["o","x","◇","い"],["s","y","t","あ"],["e","a","u","な"],["k","w","z","や"],["q","h","n","米"]],"hash",0,function(e,t){let r=43758.5453*Math.sin(127.1*e+311.7*t);return r-Math.floor(r)},"smoothstep",0,function(e,t,r){let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)}])},67045,e=>{"use strict";let t,r;var n=e.i(768834);let a=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>a(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>a(t)(e)}}};var s=e.i(671228);let i=s.ThursdaySettingsSchema.extend({wake:s.WakeSchema.catch(s.WAKE_DEFAULT),hotkey:s.HotkeySchema.catch(s.HOTKEY_DEFAULT),callBack:s.CallBackSchema.catch(s.CALL_BACK_DEFAULT),captionView:s.CaptionViewSchema.catch("center")}),l={systemPrompt:null,model:null,wake:s.WAKE_DEFAULT,hotkey:s.HOTKEY_DEFAULT,callBack:s.CALL_BACK_DEFAULT,captionView:"center"},o=(0,n.create)()((t=e=>({...l,patch:t=>e(t)}),r={name:"thursday.settings",merge:(e,t)=>{let r=i.safeParse(e);return{...t,...r.success?r.data:l}}},(e,n,s)=>{let i,l={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...r},o=!1,c=0,d=new Set,h=new Set,u=l.storage;if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),e(...t)});let m=()=>{let e=l.partialize({...n()});return u.setItem(l.name,{state:e,version:l.version})},f=s.setState;s.setState=(e,t)=>(f(e,t),m());let g=t((...t)=>(e(...t),m()));s.getInitialState=()=>g;let p=()=>{var t,r;if(!u)return;let s=++c;o=!1,d.forEach(e=>{var t;return e(null!=(t=n())?t:g)});let f=(null==(r=l.onRehydrateStorage)?void 0:r.call(l,null!=(t=n())?t:g))||void 0;return a(u.getItem.bind(u))(l.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===l.version)return[!1,e.state];else{if(l.migrate){let t=l.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var r;if(s!==c)return;let[a,o]=t;if(e(i=l.merge(o,null!=(r=n())?r:g),!0),a)return m()}).then(()=>{s===c&&(null==f||f(n(),void 0),i=n(),o=!0,h.forEach(e=>e(i)))}).catch(e=>{s===c&&(null==f||f(void 0,e))})};return s.persist={setOptions:e=>{l={...l,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++c,null==u||u.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:e=>(d.add(e),()=>{d.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},l.skipHydration||p(),i||g}));e.s(["thursdaySettings",0,()=>{let{systemPrompt:e,model:t}=o.getState();return{systemPrompt:e,model:t,locale:"u"<typeof navigator?null:navigator.language??null}},"useThursdayStore",0,o],67045)},561540,333495,e=>{"use strict";var t=e.i(213377);let r={[t.TOOL_NAMES.memory_recall]:"Checking your notes",[t.TOOL_NAMES.memory_remember]:"Noting that down",[t.TOOL_NAMES.memory_forget]:"Forgetting that",[t.TOOL_NAMES.memory_show]:"Putting your notes on screen",[t.TOOL_NAMES.bash]:"Doing it on this computer",[t.TOOL_NAMES.web_search]:"Searching the web",[t.TOOL_NAMES.load_skill]:"Reading how to do this",[t.TOOL_NAMES.end_call]:"Ending the call"};e.s(["toolLine",0,function(e,n){let a;if(e===t.TOOL_NAMES.tool_search||e===t.TOOL_NAMES.tool_call)return"Reaching a connected service";let s=null;if(n)try{let e=JSON.parse(n);e&&"object"==typeof e&&!Array.isArray(e)&&(s=e)}catch{}return(s&&function(e,r){if(e===t.TOOL_NAMES.delegate){let e="string"==typeof r.bot?r.bot.trim():"";return e?`Handing this to ${e}`:"Handing this over"}if(e===t.TOOL_NAMES.task){let e="string"==typeof r.task?r.task.trim():"";return"answer"===r.action?"Passing that back":"cancel"===r.action?"Stopping that":e?`Checking on ${e}`:"Checking the jobs"}return null}(e,s))??r[e]??((a=e.indexOf("__"))<=0?null:`Reaching ${e.slice(0,a).replace(/[-_]/g," ")}`)}],561540);var n=e.i(843476),a=e.i(271645),s=e.i(635963),i=e.i(567334);let l=[235,235,235],o=["████ ███ ███ ██ ███ ","█ █ █ █ █ █ █ █ █","███ ███ ███ █ █ ███ ","█ █ █ █ █ █ █ █ █ ","████ █ █ █ █ ██ █ █"],c={happy:[".....................",".....................","....███.......███....","...█████.....█████...","...█████.....█████...","....███.......███....",".....................",".....................","█...................█",".██...............██.","...███.........███...","......█████████......","....................."],sad:[".....................",".....................","....███.......███....","...█████.....█████...","...█████.....█████...","....███.......███....",".....................",".....................","......█████████......","...███.........███...",".██...............██.","█...................█","....................."],love:[".....................","...██.██.....██.██...","..███████...███████..","..███████...███████..","...█████.....█████...","....███.......███....",".....█.........█.....",".....................","█...................█",".██...............██.","...███.........███...","......█████████......","....................."]};function d(e,t){let r=1-(0,i.smoothstep)(104.50000000000001,190,e.dist);return(.58+.2*Math.sin(.05*e.dist-.4*t)+.07*Math.sin(.35*t))*r}function h(e,t,r,n,a){switch(e){case"idle":return d(t,r)*(0,i.smoothstep)(0,1,Math.min(1,n/1.5));case"connecting":{let e=(0,i.smoothstep)(0,1,Math.min(1,n/1.8)),a=t.dist-235*e;return Math.exp(-(a*a)/6e3)*(.2+.85*(0,i.hash)(Math.floor(t.dist/9),Math.floor(11*t.angle))+.5*(0,i.hash)(137*t.seed,7))*e+d(t,r)*(1-e)}case"speaking":{let e=(0,i.smoothstep)(0,1,Math.min(1,n/.8)),s=190+(58*a.slow+58*a.bob)*e;for(let r=0;r<4;r++)s+=40*a.amp[r]*Math.sin((r+2)*t.angle+a.phase[r])*e;let l=Math.max(130,Math.min(278,s)),o=t.dist-l,c=Math.exp(-(o*o)/900),d=.55*Math.exp(-(t.dist*t.dist)/6e3),h=t.dist<l?.3*(1-t.dist/l)**.6:0,u=0;for(let e=0;e<a.rings.length;e++){let n=a.rings[e],s=r-n.born,i=t.dist-(l+100*s);u+=Math.exp(-(i*i)/2200)*n.power*Math.max(0,1-s/.55)}return c+d+h+.8*u}case"working":{let e=(0,i.smoothstep)(0,1,Math.min(1,n/.7)),a=t.dist-238,s=Math.exp(-(a*a)/1100),l=t.angle-3*r,o=Math.atan2(Math.sin(l),Math.cos(l));return s*Math.exp(-(o*o)/(o<0?2.8:.16))*e+d(t,r)*(1-e)}case"error":{if(t.letter<0)return 0;let e=n%9.2,a=t.letter,s=.12*t.seed;return Math.max(0,(0,i.smoothstep)(0,1,(e-.65*a-s)/.8)-(0,i.smoothstep)(0,1,(e-5.6-.5*a-s)/.7))*(.86+.14*Math.sin(3.5*r+6*t.seed))}}}function u({className:e,mode:t="idle",charset:r="ascii",emotion:s=null,fontSize:d=8,density:m=1.4,size:f=680,color:g=l,getSpectrum:p}){let x=(0,a.useRef)(null),y=(0,a.useRef)(null),M=(0,a.useRef)([]),v=(0,a.useRef)(null),b=(0,a.useRef)(r),k=(0,a.useRef)({cur:[...g],target:g}),A=(0,a.useRef)({cw:1,ch:1,errScale:3,faceScale:3,size:0}),S=(0,a.useRef)({cur:s,prev:null,start:-1/0}),w=(0,a.useRef)(p);w.current=p;let N=(0,a.useRef)({fast:0,mid:0,slow:0,bob:0,bobVel:0,lastOnset:-1/0,amp:[,,,,].fill(0),phase:Array.from({length:4},(e,t)=>2.1*t),rings:[]}),_=(0,a.useRef)({mode:t,start:0}),j=(0,a.useRef)(null),O=(0,a.useRef)(-1/0);return(0,a.useEffect)(()=>{let e=x.current;if(!e)return;let t=.95*d/m,r=1.25*d/m,n=680/f,a=t*n,s=r*n,l=Math.max(1,Math.floor(625.6/(o[0].length*a))),c=Math.max(1,Math.floor(557.6/(21*a)));A.current={cw:a,ch:s,errScale:l,faceScale:c,size:f};let h=[],u=Math.ceil(f/t),g=Math.ceil(f/r);for(let e=0;e<g;e++)for(let c=0;c<u;c++){let d=c*t,u=e*r,m=(d-f/2)*n,g=(u-f/2)*n,p=Math.hypot(m,g),x=function(e,t,r,n,a){let s=o.length,i=Math.floor(e/(r*a)+o[0].length/2),l=Math.floor(t/(n*a)+s/2);if(l<0||l>=s)return -1;let c=o[l];return i<0||i>=c.length||"█"!==c[i]?-1:Math.floor(i/5)}(m,g,a,s,l);x<0&&p>328||h.push({x:d+t/2,y:u+r/2,dx:m,dy:g,dist:p,angle:Math.atan2(g,m),seed:(0,i.hash)(c,e),grain:(0,i.hash)(5.7*c+19,2.3*e+53),gap:.05+.3*(0,i.hash)(7.3*c+11,3.1*e+5),birth:(0,i.hash)(3.1*c+7,5.7*e+2),death:(0,i.hash)(9.4*c+3,2.6*e+8),emoji:(0,i.hash)(2.7*c+31,5.9*e+17)<i.EMOJI_RATIO,letter:x})}M.current=h,v.current={ascii:Array.from({length:i.RAMP.length},()=>new Int32Array(h.length)),emoji:Array.from({length:i.RAMP.length},()=>new Int32Array(h.length)),asciiN:new Int32Array(i.RAMP.length),emojiN:new Int32Array(i.RAMP.length),glyph:Array(h.length)};let p=Math.min(2,window.devicePixelRatio||1);e.width=f*p,e.height=f*p,e.style.width=`${f}px`,e.style.height=`${f}px`;let b=e.getContext("2d");return b&&(b.setTransform(p,0,0,p,0,0),b.font=`700 ${d}px ui-monospace,SFMono-Regular,Menlo,monospace`,b.textAlign="center",b.textBaseline="middle",y.current=b),()=>{b?.clearRect(0,0,f,f),M.current=[],v.current=null}},[d,m,f]),(0,a.useEffect)(()=>{let e=S.current;e.cur!==s&&(S.current={cur:s,prev:e.cur,start:.001*performance.now()})},[s]),(0,a.useEffect)(()=>{b.current=r},[r]),(0,a.useEffect)(()=>{k.current.target=g},[g]),(0,a.useEffect)(()=>{let e=.001*performance.now();_.current.mode!==t?(j.current={..._.current},_.current={mode:t,start:e},O.current=e):_.current={mode:t,start:e}},[t]),(0,a.useEffect)(()=>{let e=0,t=Array(28),r=.001*performance.now(),n=a=>{let s=.001*a,l=Math.min(.05,Math.max(0,s-r));r=s;let o=y.current,d=v.current;if(!o||!d){e=requestAnimationFrame(n);return}let u=b.current,{cw:m,ch:f,faceScale:g,size:p}=A.current;d.asciiN.fill(0),d.emojiN.fill(0);let x=w.current?.();if(x&&x.length>1){let e=x.length-1;for(let r=0;r<28;r++){let n=Math.abs((r/28*2+1)%2-1)*e,a=Math.floor(n),s=Math.min(e,a+1);t[r]=x[a]+(x[s]-x[a])*(n-a)}}else for(let e=0;e<28;e++){let r=.5*Math.sin(1.7*s+1.7*e)+.3*Math.sin(.8*s+.6*e)+.2*Math.sin(3*s+2.9*e);t[e]=.5*r+.5}let R=N.current,E=0;for(let e=0;e<28;e++)E+=t[e];if(E=Math.min(1,E/28*2.6),R.fast+=(E-R.fast)*.3,R.mid+=(E-R.mid)*.06,R.slow+=(E-R.slow)*.02,R.fast>1.25*R.mid+.02&&R.fast>.07&&s-R.lastOnset>.14){R.lastOnset=s;let e=Math.min(1,1.7*R.fast);R.bobVel+=.05*e,R.rings.push({born:s,power:e}),R.rings.length>5&&R.rings.shift()}R.bobVel+=-(.012*R.bob)-.09*R.bobVel,R.bob+=R.bobVel;for(let e=0;e<4;e++){let r=e/4*28|0,n=(e+1)/4*28|0,a=0;for(let e=r;e<n;e++)a+=t[e];a=Math.min(1,a/Math.max(1,n-r)*2.6);let o=.7+.6*(0,i.hash)((.9*s|0)+31*e,e);R.amp[e]+=(a*o-R.amp[e])*(.02+.012*e),R.phase[e]+=l*(.5+.37*e)*(e%2?-1:1)}for(;R.rings.length>0&&s-R.rings[0].born>.55;)R.rings.shift();let T=_.current,L=j.current,C=(0,i.smoothstep)(0,1,Math.min(1,(s-O.current)/1.5)),I=null!==L&&C<1,P="error"===T.mode||I&&L?.mode==="error",z=S.current,$=s-z.start,F=Math.min(1,Math.max(0,$/.36)),H=Math.min(1,Math.max(0,($-.36-.14)/.95)),D=null!==z.cur||$<1.45,K=(e,t)=>{var r,n;let a,s;return r=t.dx,n=t.dy,a=Math.floor(r/(m*g)+10.5),(s=Math.floor(n/(f*g)+6.5))<0||s>=13||a<0||a>=21||"█"!==c[e][s][a]?0:s<7?1:2},q=(e,t)=>0===e?0:(1===e?1:.88)*(.74+.26*(1-Math.min(1,t.dist/270)))*(.42+.85*(0,i.hash)(Math.floor(.09*t.dx+.25*s),Math.floor(.09*t.dy-.18*s))),B=e=>{if(e.seed<.976)return 0;let t=195+160*(0,i.hash)(311*e.seed,9);return Math.exp(-((e.dist-t)**2)/7e3)*(.5+.5*Math.sin(s*(.5+1.5*(0,i.hash)(47*e.seed,21))+300*e.seed))*.36},U=M.current;for(let e=0;e<U.length;e++){let t=U[e],r=h(T.mode,t,s,s-T.start,R);if(I&&L){let e=h(L.mode,t,s,s-L.start,R);r=e+(r-e)*C}!(P&&t.letter>=0)&&((r*=(.66+.72*t.grain)*(.8+.4*(0,i.hash)(Math.floor(.05*t.dx+.5*s),Math.floor(.05*t.dy-.3*s))))>.3&&(0,i.hash)(31.7*Math.floor(1.6*s),613*t.seed)>.992&&(r=Math.max(r,.9)),r<t.gap+.05*Math.sin(.28*s+6.283*t.seed)&&(r=0));let n=!1;if(D){let e=(0,i.smoothstep)(0,1,(1.1*F-t.death)/.08),a=(0,i.smoothstep)(0,1,(1.1*H-t.birth)/.08),s=z.cur?K(z.cur,t):0,l=z.prev?K(z.prev,t):0,o=B(t);r=(z.prev?q(l,t)+o:r)*(1-e)+(z.cur?q(s,t)+o:r)*a,n=s>0&&a>.05||l>0&&e<.95}let a=(r=r<0?0:r>1?1:r)*(i.RAMP.length-1)|0;if(0===a)continue;let l=s*(n?.75:"emojiOnly"===u?i.EMOJI_CHAR_RATE:i.CHAR_RATE)+7*t.seed|0;if("emojiOnly"===u||"emoji"===u&&t.emoji&&a>=i.EMOJI_MIN_LEVEL){let r=((t.seed*i.EMOJI_POOL.length|0)+l)%i.EMOJI_POOL.length;d.glyph[e]=i.EMOJI_POOL[r],d.emoji[a][d.emojiN[a]++]=e}else{let r=i.RAMP[a],n=((t.seed*r.length|0)+l)%r.length;d.glyph[e]=r[n],d.ascii[a][d.asciiN[a]++]=e}}o.clearRect(0,0,p,p);let J=M.current,V=i.RAMP.length-1,W=k.current;for(let e=0;e<3;e++)W.cur[e]+=(W.target[e]-W.cur[e])*.05;o.fillStyle=`rgb(${0|W.cur[0]},${0|W.cur[1]},${0|W.cur[2]})`;for(let e=1;e<=V;e++){let t=d.asciiN[e];if(0===t)continue;o.globalAlpha=i.ALPHA_TOP*(e/V);let r=d.ascii[e];for(let e=0;e<t;e++){let t=J[r[e]];o.fillText(d.glyph[r[e]],t.x,t.y)}}for(let e=1;e<=V;e++){let t=d.emojiN[e];if(0===t)continue;o.globalAlpha=.35+e/V*.65;let r=d.emoji[e];for(let e=0;e<t;e++){let t=J[r[e]];o.fillText(d.glyph[r[e]],t.x,t.y)}}o.globalAlpha=1,!I&&L&&(j.current=null),e=requestAnimationFrame(n)};return e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[]),(0,n.jsx)("canvas",{ref:x,className:e,"aria-hidden":!0,style:{display:"block",pointerEvents:"none"}})}var m=e.i(922521),f=e.i(647163);let g={idle:"idle",connecting:"connecting",listening:"listening",speaking:"speaking",working:"thinking",delegating:"delegating"},p={ripple:14,pulse:0,punch:0,stretch:0},x={idle:"idle",connecting:"connecting",listening:"connecting",speaking:"speaking",working:"working",delegating:"working"},y=[247,247,247],M=[10,10,10],v={mark:{label:"Mark",hint:"A silhouette with eyes. Blinks, glances, leans into a voice.",render:function({status:e,size:t,getSpectrum:r,look:a,className:i}){return(0,n.jsx)(s.BotMark,{size:t,seed:"thursday",color:a.color,shape:a.shape,outline:a.outline,state:g[e],getSpectrum:r,options:p,notify:!1,className:i})}},ascii:{label:"Ascii",hint:"A field of characters. No eyes — the whole orb is the expression.",render:function({status:e,size:t,getSpectrum:r,look:a,className:s}){let i="dark"===(0,m.useResolvedTheme)();return(0,n.jsx)(u,{mode:x[e],size:t,color:i?y:M,getSpectrum:r,charset:a.charset,fontSize:a.fontSize,density:a.density,className:s})}}},b=(0,a.memo)(function({look:e,status:t="idle",size:r=448,className:s,...i}){let l=(0,a.useRef)(null),[o,c]=(0,a.useState)(r),[d,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>{let t=Math.round(e.contentRect.width);t>0&&c(t)});return t.observe(e),()=>t.disconnect()},[]),(0,a.useEffect)(()=>{let e=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(e)},[]);let u=v[e.kind].render;return(0,n.jsx)("div",{ref:l,className:(0,f.cn)("aspect-square transition-opacity duration-700 ease-out",d?"opacity-100":"opacity-0",s),children:(0,n.jsx)(u,{...i,look:e,status:t,size:o})})});e.s(["FACES",0,v,"Face",0,b],333495)},319841,e=>{"use strict";var t=e.i(271645);let r=["ctrl","alt","meta"],n=/^(Control|Alt|Shift|Meta|OS)/,a=/^(input|textarea|select)$/i;function s(e){let{code:t,ctrlKey:r,altKey:a,shiftKey:s,metaKey:i}=e;if(!t||n.test(t)||!r&&!a&&!i)return null;let l=[];return r&&l.push("ctrl"),a&&l.push("alt"),s&&l.push("shift"),i&&l.push("meta"),[...l,t].join("+")}let i={ctrl:["Ctrl","⌃"],alt:["Alt","⌥"],shift:["Shift","⇧"],meta:["Meta","⌘"]};e.s(["HOTKEY_CAPTURE",0,{"data-hotkey-capture":""},"comboOf",0,s,"isCombo",0,e=>{let t=e.split("+"),a=t.at(-1);return!!(a&&!n.test(a)&&t.slice(0,-1).some(e=>r.includes(e)))},"useHotkey",0,function({enabled:e,combo:r,onPress:n}){let i=(0,t.useRef)(n);i.current=n,(0,t.useEffect)(()=>{if(!e||!r)return;let t=e=>{var t;e.repeat||(t=e.target)&&(a.test(t.tagName)||t.isContentEditable||t.closest?.("[data-hotkey-capture]"))||s(e)===r&&(e.preventDefault(),i.current())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,r])},"useHotkeyLabel",0,function(e){let[r,n]=(0,t.useState)(!1);return(0,t.useEffect)(()=>n(/mac/i.test(navigator.userAgent)),[]),e?function(e,t=!1){let r=e.split("+"),n=r.at(-1)??"",a=r.slice(0,-1).map(e=>i[e]?.[+!!t]??e),s=n.replace(/^(Key|Digit|Numpad)/,"").replace(/([a-z])([A-Z])/g,"$1 $2")||n;return t?[...a,s].join(""):[...a,s].join(" + ")}(e,r):null}])}]);