thursday-agent 0.18.0 → 0.19.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 (342) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +3 -2
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +22 -12
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +12 -12
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +11 -11
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/server/app/api/artifact/route.js +6 -6
  20. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/memory/files/route.js +1 -1
  22. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/memory/route.js +3 -3
  24. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bot/route.js +3 -3
  26. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  27. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/bot/thread/file/route.js +17 -17
  29. package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
  30. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  31. package/.next/server/app/api/config/route.js.nft.json +1 -1
  32. package/.next/server/app/api/events/route.js +2 -2
  33. package/.next/server/app/api/events/route.js.nft.json +1 -1
  34. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/file/[...path]/route.js +2 -2
  36. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  37. package/.next/server/app/api/llm-model/automatic/route.js +2 -2
  38. package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
  39. package/.next/server/app/api/llm-model/catalog/[provider]/route/app-paths-manifest.json +3 -0
  40. package/.next/server/app/api/llm-model/catalog/{route.js → [provider]/route.js} +7 -7
  41. package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -0
  42. package/.next/server/app/api/llm-model/catalog/[provider]/route_client-reference-manifest.js +3 -0
  43. package/.next/server/app/api/llm-model/credits/[provider]/route/app-paths-manifest.json +3 -0
  44. package/.next/server/app/api/llm-model/credits/{route.js → [provider]/route.js} +7 -7
  45. package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -0
  46. package/.next/server/app/api/llm-model/credits/[provider]/route_client-reference-manifest.js +3 -0
  47. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  48. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  49. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  50. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  51. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  52. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  53. package/.next/server/app/api/memory/edit/route.js +12 -12
  54. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  55. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  56. package/.next/server/app/api/reach/route.js +16 -16
  57. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  58. package/.next/server/app/api/routine/route.js +5 -5
  59. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  60. package/.next/server/app/api/running/route/app-paths-manifest.json +3 -0
  61. package/.next/server/app/api/running/route/build-manifest.json +12 -0
  62. package/.next/server/app/api/running/route/server-reference-manifest.json +4 -0
  63. package/.next/server/app/api/running/route.js +10 -0
  64. package/.next/server/app/api/running/route.js.map +5 -0
  65. package/.next/server/app/api/running/route.js.nft.json +1 -0
  66. package/.next/server/app/api/running/route_client-reference-manifest.js +3 -0
  67. package/.next/server/app/api/signins/route.js +4 -4
  68. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  69. package/.next/server/app/api/skills/[source]/[name]/route.js +6 -6
  70. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  71. package/.next/server/app/api/skills/route.js +6 -6
  72. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  73. package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
  74. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  75. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  76. package/.next/server/app/api/thursday/text/route.js +12 -12
  77. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  78. package/.next/server/app/api/thursday/tool-call/route.js +12 -12
  79. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  80. package/.next/server/app/api/workspace/files/route.js +6 -6
  81. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  82. package/.next/server/app/api/workspace/route.js +5 -5
  83. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  84. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
  85. package/.next/server/app/artifact/[...path]/page.js +7 -6
  86. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  87. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  89. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  90. package/.next/server/app/page/server-reference-manifest.json +63 -63
  91. package/.next/server/app/page.js +10 -9
  92. package/.next/server/app/page.js.nft.json +1 -1
  93. package/.next/server/app/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app-paths-manifest.json +3 -2
  95. package/.next/server/chunks/{[externals]__178rv3v._.js → [externals]__12stas-._.js} +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__02ra64t._.js +1 -1
  97. package/.next/server/chunks/{[root-of-the-server]__05dp5tr._.js → [root-of-the-server]__06ky9of._.js} +2 -2
  98. package/.next/server/chunks/[root-of-the-server]__0b565-x._.js +7 -0
  99. package/.next/server/chunks/{[root-of-the-server]__1izes4_._.js → [root-of-the-server]__0bmtib_._.js} +2 -2
  100. package/.next/server/chunks/[root-of-the-server]__0bqveex._.js +1 -1
  101. package/.next/server/chunks/[root-of-the-server]__0brmiv2._.js +2 -2
  102. package/.next/server/chunks/[root-of-the-server]__0eivkvk._.js +2 -2
  103. package/.next/server/chunks/[root-of-the-server]__0f7m79q._.js +1 -1
  104. package/.next/server/chunks/[root-of-the-server]__0g38-aj._.js +2 -2
  105. package/.next/server/chunks/[root-of-the-server]__0gvdr2h._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__0h656y-._.js +2 -2
  107. package/.next/server/chunks/[root-of-the-server]__0hm3tiq._.js +2 -2
  108. package/.next/server/chunks/[root-of-the-server]__0hzdqnv._.js +2 -2
  109. package/.next/server/chunks/{[root-of-the-server]__0my9geo._.js → [root-of-the-server]__0kzmxpg._.js} +1 -1
  110. package/.next/server/chunks/[root-of-the-server]__0mgyt8p._.js +2 -2
  111. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  112. package/.next/server/chunks/[root-of-the-server]__0o5s5-o._.js +5 -0
  113. package/.next/server/chunks/[root-of-the-server]__0p80i1n._.js +1 -1
  114. package/.next/server/chunks/[root-of-the-server]__0qdoc_9._.js +1 -1
  115. package/.next/server/chunks/[root-of-the-server]__0qzho69._.js +1 -1
  116. package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +1 -1
  117. package/.next/server/chunks/[root-of-the-server]__0v_kuor._.js +1 -1
  118. package/.next/server/chunks/{[root-of-the-server]__1k2qs1m._.js → [root-of-the-server]__0ypkfbu._.js} +1 -1
  119. package/.next/server/chunks/[root-of-the-server]__1-18_pz._.js +1 -1
  120. package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
  121. package/.next/server/chunks/{[root-of-the-server]__01k3vi3._.js → [root-of-the-server]__14iga7p._.js} +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__16gn7zn._.js +3 -0
  123. package/.next/server/chunks/[root-of-the-server]__18e65_-._.js +3 -0
  124. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
  125. package/.next/server/chunks/{[root-of-the-server]__0lvjz0b._.js → [root-of-the-server]__1_cgawk._.js} +2 -2
  126. package/.next/server/chunks/[root-of-the-server]__1ceammd._.js +1 -1
  127. package/.next/server/chunks/[root-of-the-server]__1ckt1yj._.js +1 -1
  128. package/.next/server/chunks/[root-of-the-server]__1cu5f3z._.js +1 -1
  129. package/.next/server/chunks/[root-of-the-server]__1dth047._.js +1 -1
  130. package/.next/server/chunks/{[root-of-the-server]__061o2_x._.js → [root-of-the-server]__1fc6v12._.js} +1 -1
  131. package/.next/server/chunks/[root-of-the-server]__1hviq62._.js +2 -2
  132. package/.next/server/chunks/[root-of-the-server]__1m1q6u5._.js +3 -0
  133. package/.next/server/chunks/[root-of-the-server]__1m_dmf6._.js +1 -1
  134. package/.next/server/chunks/[root-of-the-server]__1mys2c3._.js +1 -1
  135. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  136. package/.next/server/chunks/[root-of-the-server]__1p0njle._.js +2 -2
  137. package/.next/server/chunks/[root-of-the-server]__1p47fbb._.js +1 -1
  138. package/.next/server/chunks/[root-of-the-server]__1pugoq0._.js +1 -1
  139. package/.next/server/chunks/{[root-of-the-server]__0ts7ai0._.js → [root-of-the-server]__1trns9g._.js} +1 -1
  140. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  141. package/.next/server/chunks/[root-of-the-server]__1zn039k._.js +1 -1
  142. package/.next/server/chunks/[root-of-the-server]__20w_g71._.js +3 -0
  143. package/.next/server/chunks/_06hnfi8._.js +2 -2
  144. package/.next/server/chunks/_06u9yo-._.js +1 -1
  145. package/.next/server/chunks/_08_-9ay._.js +2 -2
  146. package/.next/server/chunks/_0bgjf07._.js +1 -1
  147. package/.next/server/chunks/_0c49lmw._.js +1 -1
  148. package/.next/server/chunks/_0hgvg55._.js +1 -1
  149. package/.next/server/chunks/_0s8ao8z._.js +1 -1
  150. package/.next/server/chunks/_0ucx1jv._.js +1 -1
  151. package/.next/server/chunks/_0uzj57i._.js +1 -1
  152. package/.next/server/chunks/_1-sk_q4._.js +1 -1
  153. package/.next/server/chunks/_1dxq827._.js +2 -2
  154. package/.next/server/chunks/_1e54wxa._.js +1 -1
  155. package/.next/server/chunks/_1frcwj1._.js +1 -1
  156. package/.next/server/chunks/_1gn2r2q._.js +4 -2
  157. package/.next/server/chunks/_1gxankq._.js +2 -2
  158. package/.next/server/chunks/_1i3uucm._.js +1 -1
  159. package/.next/server/chunks/_1jvy78-._.js +1 -1
  160. package/.next/server/chunks/_1lg0lsu._.js +53 -0
  161. package/.next/server/chunks/_1njolhx._.js +294 -0
  162. package/.next/server/chunks/_1q6e56i._.js +4 -2
  163. package/.next/server/chunks/_1wtb-77._.js +294 -0
  164. package/.next/server/chunks/_next-internal_server_app_api_llm-model_catalog_[provider]_route_actions_1i0449q.js +3 -0
  165. package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_[provider]_route_actions_0iui9hz.js +3 -0
  166. package/.next/server/chunks/_next-internal_server_app_api_running_route_actions_0o1g-aw.js +3 -0
  167. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  168. package/.next/server/chunks/features_bot_0zy_q8y._.js +7 -7
  169. package/.next/server/chunks/features_bot_1dfrdsb._.js +7 -7
  170. package/.next/server/chunks/{node_modules_1rosz79._.js → node_modules_035o7ku._.js} +1 -1
  171. package/.next/server/chunks/{node_modules_1er1u8w._.js → node_modules_0tn5t13._.js} +1 -1
  172. package/.next/server/chunks/{node_modules_103lpef._.js → node_modules_12oq3hr._.js} +1 -1
  173. package/.next/server/chunks/ssr/[root-of-the-server]__04upd5v._.js +1 -1
  174. package/.next/server/chunks/ssr/[root-of-the-server]__0p0mv2u._.js +3 -0
  175. package/.next/server/chunks/ssr/{[root-of-the-server]__1r7tj27._.js → [root-of-the-server]__0sk5enu._.js} +1 -1
  176. package/.next/server/chunks/ssr/[root-of-the-server]__0xyaud4._.js +3 -0
  177. package/.next/server/chunks/ssr/{[root-of-the-server]__128hnrd._.js → [root-of-the-server]__1-gi9sm._.js} +1 -1
  178. package/.next/server/chunks/ssr/{[root-of-the-server]__0h6jo0s._.js → [root-of-the-server]__16nn3pe._.js} +2 -2
  179. package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
  180. package/.next/server/chunks/ssr/[root-of-the-server]__1c8-7cw._.js +3 -0
  181. package/.next/server/chunks/ssr/[root-of-the-server]__1tb5vve._.js +2 -1
  182. package/.next/server/chunks/ssr/_02cm0fr._.js +5 -0
  183. package/.next/server/chunks/ssr/_07nmtxo._.js +1 -1
  184. package/.next/server/chunks/ssr/_088vzgn._.js +1 -1
  185. package/.next/server/chunks/ssr/{_1oafxdu._.js → _0bg1u1j._.js} +2 -2
  186. package/.next/server/chunks/ssr/_0cv9tmv._.js +1 -1
  187. package/.next/server/chunks/ssr/_0f9hx5p._.js +1 -1
  188. package/.next/server/chunks/ssr/_0g9ula_._.js +3 -0
  189. package/.next/server/chunks/ssr/{_0wuvkqk._.js → _0irozu9._.js} +2 -2
  190. package/.next/server/chunks/ssr/_0iwsdp7._.js +3 -0
  191. package/.next/server/chunks/ssr/_0l7rjg5._.js +1 -1
  192. package/.next/server/chunks/ssr/{_0fo4552._.js → _0nk80t6._.js} +44 -5
  193. package/.next/server/chunks/ssr/_0pbav_w._.js +1 -1
  194. package/.next/server/chunks/ssr/{_1r4mc3i._.js → _0q-mdwv._.js} +8 -8
  195. package/.next/server/chunks/ssr/{_1w899wx._.js → _0s5_ahb._.js} +2 -2
  196. package/.next/server/chunks/ssr/{_1omom9y._.js → _0t5f2c3._.js} +2 -2
  197. package/.next/server/chunks/ssr/_0v9r8g2._.js +1 -1
  198. package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
  199. package/.next/server/chunks/ssr/_0x9f717._.js +1 -1
  200. package/.next/server/chunks/ssr/_107vtdk._.js +162 -0
  201. package/.next/server/chunks/ssr/{_0ixe3g3._.js → _12lql1x._.js} +3 -3
  202. package/.next/server/chunks/ssr/_165wnr4._.js +1 -1
  203. package/.next/server/chunks/ssr/_16_7zeo._.js +1 -1
  204. package/.next/server/chunks/ssr/_17komoi._.js +3 -0
  205. package/.next/server/chunks/ssr/{_0j9vh-8._.js → _190hjys._.js} +2 -2
  206. package/.next/server/chunks/ssr/_1bfrntd._.js +2 -2
  207. package/.next/server/chunks/ssr/{_1tx-2k7._.js → _1booff4._.js} +2 -2
  208. package/.next/server/chunks/ssr/{_12jv_41._.js → _1ew1j7l._.js} +2 -2
  209. package/.next/server/chunks/ssr/_1i2swyr._.js +1 -1
  210. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  211. package/.next/server/chunks/ssr/{_0osvxkt._.js → _1qsa25k._.js} +2 -2
  212. package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
  213. package/.next/server/chunks/ssr/_1vc2xmu._.js +3 -0
  214. package/.next/server/chunks/ssr/{_1_ogjze._.js → _1wq90j8._.js} +2 -2
  215. package/.next/server/chunks/ssr/{_1pgxh81._.js → _1zrhkf0._.js} +44 -5
  216. package/.next/server/chunks/ssr/{_0mpn6q0._.js → _21awrs2._.js} +2 -2
  217. package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
  218. package/.next/server/chunks/ssr/features_bot_1c56lew._.js +37 -0
  219. package/.next/server/chunks/ssr/{features_bot_18gqkr_._.js → features_bot_1fn_grf._.js} +2 -2
  220. package/.next/server/chunks/ssr/{features_config_1ond01n._.js → features_config_05zi68v._.js} +3 -3
  221. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  222. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  223. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  224. package/.next/server/chunks/ssr/{node_modules_1-4q6is._.js → node_modules_0-sux1a._.js} +1 -1
  225. package/.next/server/chunks/ssr/{node_modules_17o218r._.js → node_modules_01oezhb._.js} +1 -1
  226. package/.next/server/chunks/ssr/{node_modules_0f485jl._.js → node_modules_04m6ebg._.js} +1 -1
  227. package/.next/server/chunks/ssr/{node_modules_0upwx50._.js → node_modules_067jfov._.js} +1 -1
  228. package/.next/server/chunks/ssr/{node_modules_0i_v0-m._.js → node_modules_06ugby3._.js} +1 -1
  229. package/.next/server/chunks/ssr/{node_modules_0lxwg2v._.js → node_modules_07p51j3._.js} +1 -1
  230. package/.next/server/chunks/ssr/{node_modules_16z7p8b._.js → node_modules_0995xyq._.js} +1 -1
  231. package/.next/server/chunks/ssr/{node_modules_004qt-z._.js → node_modules_0_uecwx._.js} +1 -1
  232. package/.next/server/chunks/ssr/{node_modules_0lrn9ci._.js → node_modules_0dsyc90._.js} +1 -1
  233. package/.next/server/chunks/ssr/{node_modules_0v__o4h._.js → node_modules_0hli6s2._.js} +1 -1
  234. package/.next/server/chunks/ssr/{node_modules_1gpapfv._.js → node_modules_0m-bde_._.js} +1 -1
  235. package/.next/server/chunks/ssr/{node_modules_1tus4vi._.js → node_modules_0oqfdbr._.js} +1 -1
  236. package/.next/server/chunks/ssr/{node_modules_09dy7tk._.js → node_modules_0tgy5s5._.js} +1 -1
  237. package/.next/server/chunks/ssr/{node_modules_1hdaxu9._.js → node_modules_1-kjmls._.js} +1 -1
  238. package/.next/server/chunks/ssr/{node_modules_0gbx70b._.js → node_modules_1-l3ka5._.js} +1 -1
  239. package/.next/server/chunks/ssr/{node_modules_20448xv._.js → node_modules_1-w3ayh._.js} +1 -1
  240. package/.next/server/chunks/ssr/{node_modules_06m6e97._.js → node_modules_133exgm._.js} +1 -1
  241. package/.next/server/chunks/ssr/{node_modules_1srjf5c._.js → node_modules_17xc5_k._.js} +1 -1
  242. package/.next/server/chunks/ssr/{node_modules_1tv_7lk._.js → node_modules_1_i_w30._.js} +1 -1
  243. package/.next/server/chunks/ssr/{node_modules_1hjvwkh._.js → node_modules_1a2cjfk._.js} +1 -1
  244. package/.next/server/chunks/ssr/{node_modules_0_hy3i2._.js → node_modules_1k752fe._.js} +1 -1
  245. package/.next/server/chunks/ssr/{node_modules_0n2-p5q._.js → node_modules_1lie7z8._.js} +1 -1
  246. package/.next/server/chunks/ssr/{node_modules_0pw13ww._.js → node_modules_1mv70-y._.js} +1 -1
  247. package/.next/server/chunks/ssr/{node_modules_10mb0cv._.js → node_modules_1r611t2._.js} +1 -1
  248. package/.next/server/chunks/ssr/{node_modules_0nj36zf._.js → node_modules_1vfd8dz._.js} +2 -2
  249. package/.next/server/chunks/ssr/{node_modules_0ppirau._.js → node_modules_1yaowd7._.js} +1 -1
  250. package/.next/server/chunks/ssr/{node_modules_1j886a5._.js → node_modules_20a1wpo._.js} +1 -1
  251. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0lg9pkl._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1r8pxbe._.js} +1 -1
  252. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1xgbf5j._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1siiu4h._.js} +1 -1
  253. package/.next/server/middleware-build-manifest.js +3 -3
  254. package/.next/server/middleware.js +1 -1
  255. package/.next/server/pages/404.html +1 -1
  256. package/.next/server/pages/500.html +1 -1
  257. package/.next/server/server-reference-manifest.js +1 -1
  258. package/.next/server/server-reference-manifest.json +64 -64
  259. package/.next/static/chunks/{1dpg1u4a16ujt.js → 088d3w5qxu19g.js} +2 -2
  260. package/.next/static/chunks/0bxekp4hnuk1g.js +1 -0
  261. package/.next/static/chunks/{17dx6w478vnb0.js → 0fw4u_s974j24.js} +1 -1
  262. package/.next/static/chunks/0hy2x7qhk8wgx.css +1 -0
  263. package/.next/static/chunks/{240nfv2dtidhc.js → 0n_eshmn_7wfn.js} +2 -2
  264. package/.next/static/chunks/0ulcp_u_y1u0b.js +15 -0
  265. package/.next/static/chunks/0vj93zo0yvix9.js +35 -0
  266. package/.next/static/chunks/{05uvci-bk-vgp.js → 10f98bh4hdmhe.js} +1 -1
  267. package/.next/static/chunks/{0ruf3dqs--3ve.js → 1b8bce_z_act0.js} +1 -1
  268. package/.next/static/chunks/1c32d2azsjaj_.js +1 -0
  269. package/.next/static/chunks/1fs829mz69pxz.js +1 -0
  270. package/.next/static/chunks/{2ug8q1x9e-_j6.js → 1lwlh4mo_vv8d.js} +1 -1
  271. package/.next/static/chunks/{3r7u1y9xjoh-v.js → 1po8fkg40peu-.js} +1 -1
  272. package/.next/static/chunks/{27l8qwnk1j66z.js → 1rg6b9l5fm1hj.js} +1 -1
  273. package/.next/static/chunks/{1pe7i5yu779ta.js → 26g3iwfuad-7p.js} +1 -1
  274. package/.next/static/chunks/2bjnmtke_q43c.js +1 -0
  275. package/.next/static/chunks/2c86k0o-1p9_w.js +1 -0
  276. package/.next/static/chunks/2gf4t0d76bvyv.js +1 -0
  277. package/.next/static/chunks/2rj3q_ahctv19.js +1 -0
  278. package/.next/static/chunks/{2lhc74urf3acr.js → 2x6-fpctvucte.js} +1 -1
  279. package/.next/static/chunks/{2gxfy__ef51n9.js → 2yicf7bky866n.js} +1 -1
  280. package/.next/static/chunks/{0oqviw3f55nfp.js → 350ws7svim7ij.js} +1 -1
  281. package/.next/static/chunks/3e1w_nwfb39j-.js +1 -0
  282. package/.next/static/chunks/3v3ooretb54ag.js +1 -0
  283. package/.next/static/chunks/{2lzg4zedtmyic.js → 44bcbnmup71so.js} +1 -1
  284. package/.next/static/chunks/{1h_6rh86q3i4p.js → 458dtbsemx996.js} +1 -1
  285. package/bin/background.mjs +995 -0
  286. package/bin/lock.mjs +64 -29
  287. package/bin/thursday.mjs +111 -42
  288. package/bin/tools.mjs +58 -4
  289. package/guide/calls.md +8 -0
  290. package/guide/setup.md +27 -13
  291. package/package.json +1 -1
  292. package/seed-skills/concierge/travel/references/itinerary.md +1 -1
  293. package/seed-skills/concierge/travel/scripts/itinerary.mjs +7 -2
  294. package/skills/artifact/references/book.md +3 -3
  295. package/.next/server/app/api/llm-model/catalog/route/app-paths-manifest.json +0 -3
  296. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +0 -1
  297. package/.next/server/app/api/llm-model/catalog/route_client-reference-manifest.js +0 -3
  298. package/.next/server/app/api/llm-model/credits/route/app-paths-manifest.json +0 -3
  299. package/.next/server/app/api/llm-model/credits/route.js.nft.json +0 -1
  300. package/.next/server/app/api/llm-model/credits/route_client-reference-manifest.js +0 -3
  301. package/.next/server/chunks/[root-of-the-server]__03xamry._.js +0 -3
  302. package/.next/server/chunks/[root-of-the-server]__04hhvpu._.js +0 -7
  303. package/.next/server/chunks/[root-of-the-server]__1-rmal0._.js +0 -5
  304. package/.next/server/chunks/[root-of-the-server]__10xnb7e._.js +0 -3
  305. package/.next/server/chunks/[root-of-the-server]__1etbk64._.js +0 -3
  306. package/.next/server/chunks/[root-of-the-server]__1v7x5ym._.js +0 -3
  307. package/.next/server/chunks/_07nxi75._.js +0 -255
  308. package/.next/server/chunks/_0srlnvd._.js +0 -16
  309. package/.next/server/chunks/_0xygcxs._.js +0 -255
  310. package/.next/server/chunks/_next-internal_server_app_api_llm-model_catalog_route_actions_1eu2y41.js +0 -3
  311. package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_route_actions_0v424pb.js +0 -3
  312. package/.next/server/chunks/ssr/[root-of-the-server]__06knwl5._.js +0 -3
  313. package/.next/server/chunks/ssr/[root-of-the-server]__07ehpky._.js +0 -3
  314. package/.next/server/chunks/ssr/[root-of-the-server]__1gzje-h._.js +0 -3
  315. package/.next/server/chunks/ssr/_0jstvlg._.js +0 -39
  316. package/.next/server/chunks/ssr/_1-41lck._.js +0 -3
  317. package/.next/server/chunks/ssr/_10jtmhl._.js +0 -3
  318. package/.next/server/chunks/ssr/_19jez1a._.js +0 -3
  319. package/.next/server/chunks/ssr/_1jd8rjm._.js +0 -3
  320. package/.next/server/chunks/ssr/_1mdjoak._.js +0 -162
  321. package/.next/static/chunks/09y_43y1cy5jw.js +0 -1
  322. package/.next/static/chunks/0vggwjufw2-6r.js +0 -1
  323. package/.next/static/chunks/0x4m9nj2fazl2.js +0 -35
  324. package/.next/static/chunks/1-1yfu34-3p2p.js +0 -1
  325. package/.next/static/chunks/10oyyypxn_cpx.js +0 -1
  326. package/.next/static/chunks/184-r80rv0xay.css +0 -1
  327. package/.next/static/chunks/1_hgdoungpm0o.js +0 -1
  328. package/.next/static/chunks/2kjwmo70judc2.js +0 -15
  329. package/.next/static/chunks/2uk8rdtr-pk58.js +0 -1
  330. package/.next/static/chunks/3vg1-oc-zgw_7.js +0 -1
  331. package/.next/static/chunks/3vrmcm31ih7gb.js +0 -1
  332. package/.next/static/chunks/41ztsnjn4qrn-.js +0 -1
  333. package/bin/autostart.mjs +0 -192
  334. /package/.next/server/app/api/llm-model/catalog/{route → [provider]/route}/build-manifest.json +0 -0
  335. /package/.next/server/app/api/llm-model/catalog/{route → [provider]/route}/server-reference-manifest.json +0 -0
  336. /package/.next/server/app/api/llm-model/catalog/{route.js.map → [provider]/route.js.map} +0 -0
  337. /package/.next/server/app/api/llm-model/credits/{route → [provider]/route}/build-manifest.json +0 -0
  338. /package/.next/server/app/api/llm-model/credits/{route → [provider]/route}/server-reference-manifest.json +0 -0
  339. /package/.next/server/app/api/llm-model/credits/{route.js.map → [provider]/route.js.map} +0 -0
  340. /package/.next/static/{-IBxB5oqr6e3RuOCCmYtL → YhaRHJqObuAcXZe5VLFs0}/_buildManifest.js +0 -0
  341. /package/.next/static/{-IBxB5oqr6e3RuOCCmYtL → YhaRHJqObuAcXZe5VLFs0}/_clientMiddlewareManifest.js +0 -0
  342. /package/.next/static/{-IBxB5oqr6e3RuOCCmYtL → YhaRHJqObuAcXZe5VLFs0}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,421429,e=>{"use strict";var t=e.i(843476),a=e.i(647163);e.s(["Segmented",0,function({options:e,value:i,onChange:n,view:l=!1,className:s,...r}){return(0,t.jsx)("div",{role:"radiogroup",className:(0,a.cn)("flex w-fit gap-0.5 rounded-full bg-muted p-0.75",s),...r,children:e.map(e=>{let s=e.value===i;return(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":s,title:e.title,onClick:()=>n(e.value),className:(0,a.cn)("flex h-7 items-center justify-center gap-1.5 rounded-full px-3 text-[12.5px] whitespace-nowrap transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!s&&"text-muted-foreground hover:text-foreground",s&&(l?"bg-background font-medium text-foreground shadow-sm dark:bg-input/60":"bg-brand font-medium text-brand-foreground")),children:e.label},e.value)})})}])},818125,e=>{"use strict";var t=e.i(843476),a=e.i(271645),i=e.i(798120),n=e.i(647163);e.s(["SiteIcon",0,function({host:e,className:l="size-3.5 rounded-full",fallback:s}){let[r,o]=(0,a.useState)(!1);return r?s??(0,t.jsx)("span",{"aria-hidden":!0,className:(0,n.cn)("grid shrink-0 place-items-center bg-foreground/10 text-[8.5px] font-medium text-foreground/70 uppercase",l),children:e[0]}):(0,t.jsx)("img",{src:i.queryKey.favicon(e),alt:"",onError:()=>o(!0),className:(0,n.cn)("shrink-0",l)})}])},412294,e=>{"use strict";var t=e.i(843476),a=e.i(271645),i=e.i(167881),n=e.i(6799),l=e.i(41533),s=e.i(95187);let r=(0,s.createServerReference)("7fab62a195a01e3625db73a947127aa7b22c2be344",s.callServer,void 0,s.findSourceMapURL,"startChatGptSignInAction");var o=e.i(609856);e.s(["ChatGptSignIn",0,function({variant:e}){let[s,c]=(0,a.useState)(!1),d=(0,a.useRef)(null),h=()=>{d.current&&clearInterval(d.current),d.current=null};(0,a.useEffect)(()=>h,[]);let[m,u]=(0,o.useServerAction)(r,{onOk:e=>{let t=window.open(e,"thursday-chatgpt","popup,width=520,height=720");if(!t)return void n.toast.add({type:"error",title:"The sign-in window was blocked",description:"Allow pop-ups for this page, then try again"});c(!0),h();let a=Date.now()+l.CHATGPT_SIGN_IN.waitMs;d.current=setInterval(()=>{!t.closed&&Date.now()<a||(h(),c(!1))},700)}});return(0,t.jsx)(i.Button,{variant:e,loading:u||s,onClick:()=>m(),children:"Sign in with ChatGPT"})}],412294)},458898,e=>{"use strict";var t=e.i(843476),a=e.i(271645),i=e.i(798120),n=e.i(421429),l=e.i(283653),s=e.i(265402);e.s(["EffortSwitch",0,function({provider:e,model:r,value:o,onChange:c}){var d;let{data:h}=(0,l.useServerRoute)((0,s.isCatalogProvider)(e)&&r?i.queryKey.modelCatalog(e):null),m=!!(e&&r),u=m&&e?(0,s.effortsOf)(e,r,h??[]):null,p=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!o||u?.includes(o)){p.current=null;return}u&&p.current!==o&&(p.current=o,c(null))},[o,u,c]);let[f,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{x(e=>e&&e.step===o?null:e)},[o]);let g=f?f.step:o,v=u??[],b=!g||!v.includes(g);return(0,t.jsx)("div",{className:"min-w-0",title:m?null===(d=u)?"This model's steps are unknown":0===d.length?"This model has no effort to set":`${d.length} steps, plus Auto`:"Pick a model first",children:(0,t.jsx)(n.Segmented,{"aria-label":"Thinking effort",className:"max-w-full flex-wrap",options:[{value:"auto",label:"auto",title:"The model's own default"},...v.map(e=>({value:e,label:e,title:`Thinking effort ${e}`}))],value:b?"auto":g,onChange:e=>{let t="auto"===e?null:e;x({step:t}),c(t)}})})}])},146538,e=>{"use strict";var t=e.i(843476),a=e.i(689664),i=e.i(563707),n=e.i(152886),l=e.i(758925),s=e.i(271645),r=e.i(798120),o=e.i(167881),c=e.i(23750),d=e.i(59377),h=e.i(41533),m=e.i(432653),u=e.i(609856),p=e.i(283653),f=e.i(647163),x=e.i(265402),g=e.i(412294),v=e.i(611568),b=e.i(566595),y=e.i(630374),k=e.i(421429),w=e.i(968978);let N={alibaba:[{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}],amazon:[{d:"M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"}],"arcee-ai":[{d:"M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z"}],bfl:[{d:"M0 20.683L12.01 2.5 24 20.683h-2.233L12.009 5.878 3.471 18.806h12.122l1.239 1.877H0z"},{d:"M8.069 16.724l2.073-3.115 2.074 3.115H8.069zM18.24 20.683l-5.668-8.707h2.177l5.686 8.707h-2.196zM19.74 11.676l2.13-3.19 2.13 3.19h-4.26z"}],bytedance:[{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"},{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"},{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"},{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"}],"fish-audio":[{d:"M23.12 12.13v.62c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.62c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.37v1.74c0 .24.2.44.44.44.25 0 .44-.2.44-.44V12.5c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76.43v1.99q0 .09.03.17.04.08.1.14.07.07.15.1t.17.03c.24 0 .44-.19.44-.44v-1.99c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17m-1.76.35v1.97c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-1.97c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.32v1.65c0 .25.2.45.44.45s.44-.2.44-.45V13.6c0-.25-.2-.45-.44-.45s-.44.2-.44.45m-1.76 1.26v.3q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-.3q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M0 9.38v.19c0 .24.2.44.44.44.25 0 .44-.2.44-.44v-.19c0-.25-.19-.44-.44-.44-.24 0-.44.19-.44.44m1.82.15v.81c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.81q0-.18-.13-.31t-.31-.13-.31.13-.13.31m1.81-.24v3.39q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V9.29q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3m1.83-.35v.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.22q0-.18-.13-.31T5.9 8.5t-.31.13-.13.31m0 2.94v2.34c0 .25.19.44.44.44.24 0 .44-.19.44-.44v-2.34c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m15.89-3.32V11c0 .25.2.44.44.44.25 0 .44-.19.44-.44V8.56c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76-.39v3.28q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.17c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17M17.83 8v3.9c0 .24.19.44.44.44.24 0 .44-.2.44-.44V8c0-.25-.2-.44-.44-.44-.25 0-.44.19-.44.44m-1.77.11v3.96c0 .25.2.44.44.44s.44-.19.44-.44V8.11c0-.25-.2-.44-.44-.44s-.44.19-.44.44m-1.76.27v5.03q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.38c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.8.46v5.75q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.84c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.76.76v5.52c0 .24.2.44.44.44.25 0 .44-.2.44-.44V9.6c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.77 1.01v4.77q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-4.77q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M23.12 9.6v1.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44V9.6c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44M7.21 11.32V16c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-4.68q0-.18-.13-.31t-.31-.13-.31.13-.13.31"}],inception:[{d:"M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"}],klingai:[{d:"M5.493 21.234c-1.112-1.451-1.109-4.263-.081-7.459l-4.557-2.63a1.683 1.683 0 01-.85-1.304 1.505 1.505 0 01.08-.622 13.18 13.18 0 011.037-2.255c3.476-6.02 10.916-8.23 16.619-4.938.46.266.82.67 1.081 1.184.785 1.545.685 4.096-.234 6.954l4.557 2.631c.339.196.596.492.736.832a1.53 1.53 0 01.034 1.093 13.146 13.146 0 01-1.037 2.255c-3.476 6.02-10.916 8.23-16.619 4.938a2.6 2.6 0 01-.766-.68zm11.096-6.615c-2.073 3.591-5.808 5.316-8.343 3.852-1.267-.731-1.994-2.122-2.145-3.778-.095-1.035.036-2.173.4-3.32.217-.684.517-1.37.902-2.039l.008-.014c2.073-3.59 5.808-5.315 8.343-3.852.633.366 1.13.895 1.49 1.54.986 1.772.922 4.415-.285 6.914-.111.23-.232.457-.362.683l-.008.014z"}],kwaipilot:[{d:"M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z"}],meta:[{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"}],minimax:[{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"}],moonshotai:[{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}],morph:[{d:"M7.941 2c.23 0 .452.073.638.21.186.136.325.328.397.55l.593 1.814c.073.221.212.413.397.55.186.136.409.21.638.21h2.791c.23 0 .452-.074.638-.21a1.11 1.11 0 00.397-.55l.594-1.815a1.11 1.11 0 01.397-.55c.185-.136.408-.209.637-.209h1.7c.23 0 .453.073.639.21.185.136.324.328.397.55l.652 1.994c.118.361.41.635.77.728l2.957.752c.236.06.446.199.596.394.15.195.23.436.231.684v9.376c0 .248-.081.488-.231.684a1.09 1.09 0 01-.595.394l-2.957.752a1.086 1.086 0 00-.477.263 1.114 1.114 0 00-.293.465l-.653 1.994a1.11 1.11 0 01-.396.55c-.186.136-.41.21-.638.21h-1.702c-.229 0-.452-.073-.637-.21a1.11 1.11 0 01-.397-.55l-.364-1.11a1.131 1.131 0 01.15-1.002 1.074 1.074 0 01.885-.462h2.85c.29 0 .567-.116.772-.325.204-.208.32-.49.32-.785V6.444c0-.294-.116-.577-.32-.785a1.08 1.08 0 00-.771-.326h-3.273c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v7.778c0 .295-.114.578-.319.786a1.08 1.08 0 01-.771.325h-2.182a1.08 1.08 0 01-.771-.325 1.122 1.122 0 01-.32-.786V6.444c0-.294-.115-.577-.32-.785a1.081 1.081 0 00-.77-.326H5.454c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v11.112c0 .294.116.577.32.785.205.209.482.326.772.326h2.85a1.075 1.075 0 01.885.461 1.122 1.122 0 01.15 1.001l-.364 1.112a1.11 1.11 0 01-.397.55c-.185.136-.408.209-.637.209H6.24c-.229 0-.452-.073-.638-.21a1.11 1.11 0 01-.397-.55l-.652-1.994a1.114 1.114 0 00-.294-.465 1.086 1.086 0 00-.477-.263l-2.956-.752a1.09 1.09 0 01-.595-.394A1.124 1.124 0 010 16.688V7.312c0-.248.081-.489.231-.684.15-.195.36-.334.595-.394l2.957-.753c.178-.045.342-.136.477-.263.134-.127.235-.287.293-.464l.653-1.995a1.11 1.11 0 01.397-.55C5.788 2.075 6.01 2 6.24 2h1.701z"}],nvidia:[{d:"M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"}],perplexity:[{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"}],recraft:[{d:"M19.667 8.275c0-4.57-4.15-8.275-9.27-8.275-1.774 0-3.213 3.705-3.213 8.275 0 1.143.09 2.233.253 3.224H4.29L1 23h9.4v-6.447c5.117 0 9.266-3.707 9.266-8.275l.001-.002zm-9.27-6.76c.93 0 1.682 3.028 1.682 6.76 0 3.733-.752 6.76-1.681 6.76-.93 0-1.681-3.027-1.681-6.76 0-3.732.752-6.76 1.68-6.76z"},{d:"M19.848 16.552h-9.44L14.028 23h9.438l-3.618-6.448z"}],stepfun:[{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"}],tencent:[{d:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"}],voyage:[{d:"M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"}],xiaomi:[{d:"M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z"}],zai:[{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"}]};function E({owner:e,className:a}){let i=x.VENDOR_PROVIDERS[e];if(i)return(0,t.jsx)(w.ProviderIcon,{provider:i,className:a});let n=N[e];return n?(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:a,"aria-hidden":"true",children:n.map(e=>(0,t.jsx)("path",{d:e.d,opacity:e.opacity},e.d))}):null}function M({provider:e,models:a,kind:i,value:n,loading:l,onPick:r}){let[d,h]=(0,s.useState)(!1),[m,u]=(0,s.useState)(""),[p,g]=(0,s.useState)("cheap"),[N,E]=(0,s.useState)(n),{label:S}=x.TEXT_MODEL_PROVIDERS[e],C=a.filter(e=>e.type===(i??x.CATALOG_TEXT)),O=i?C:C.filter(e=>e.tags.includes(x.CATALOG_TOOL_USE)),T=m.trim().toLowerCase(),V=(T?O.filter(e=>`${e.id} ${e.label}`.toLowerCase().includes(T)):O).slice().sort(L[p].compare);return(0,t.jsxs)(y.Dialog,{open:d,onOpenChange:e=>{h(e),e?E(n):u("")},children:[(0,t.jsxs)(y.DialogTrigger,{render:(0,t.jsx)("button",{type:"button","aria-label":"Model",className:(0,f.cn)(c.inputClassName,"relative flex items-center pr-8 text-left font-mono text-sm")}),children:[(0,t.jsx)("span",{className:(0,f.cn)("min-w-0 flex-1 truncate",!n&&"font-sans text-muted-foreground"),children:n||"Pick a model"}),(0,t.jsx)("span",{className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center text-muted-foreground",children:l&&0===O.length?(0,t.jsx)(v.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,t.jsx)(b.Search,{className:"size-3.5"})})]}),(0,t.jsx)(y.DialogContent,{className:"h-[min(40rem,calc(100vh-3rem))] gap-0 overflow-hidden p-0 sm:max-w-2xl",children:(0,t.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 space-y-1 px-6 pt-5 pb-4",children:[(0,t.jsxs)(y.DialogTitle,{className:"flex items-center gap-2.5 text-xl font-semibold",children:[(0,t.jsx)(w.ProviderIcon,{provider:e,className:"size-3.5"}),i?z[i]:"Text"," models"]}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:T?`${V.length} matching “${m.trim()}”`:i?`${O.length} on ${S}`:`${O.length} of ${C.length} on ${S} can call tools`})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-6 py-3",children:[(0,t.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,t.jsx)(b.Search,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(c.Input,{autoFocus:!0,"aria-label":"Search models",placeholder:"name, id or provider",spellCheck:!1,value:m,onChange:e=>u(e.target.value),className:"h-8 pl-8 font-mono text-xs"})]}),(0,t.jsx)(k.Segmented,{"aria-label":"Sort",options:j,value:p,onChange:g})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4 px-6 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground/60",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1",children:"model"}),(0,t.jsx)("span",{className:"w-28 text-right",children:"per 1M in / out"})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border/60",children:[V.map(e=>(0,t.jsx)(_,{model:e,picked:e.id===N,onPick:()=>E(e.id)},e.id)),0===V.length&&(0,t.jsxs)("div",{className:"flex flex-col items-start gap-2.5 p-10",children:[(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:T?`Nothing matches “${m.trim()}”.`:"Nothing on the shelf — search for an id."}),T&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(o.Button,{size:"sm",onClick:()=>E(m.trim()),children:["Use “",m.trim(),"” as the id"]}),(0,t.jsx)(o.Button,{variant:"outline",size:"sm",onClick:()=>u(""),children:"Clear search"})]})]})]}),(0,t.jsxs)("div",{className:"flex h-14 shrink-0 items-center gap-3 border-t border-border/60 px-6",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:N||"Nothing picked — the field keeps what it has"}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),(0,t.jsx)(o.Button,{disabled:!N,onClick:()=>{r(N),h(!1)},children:"Use this model"})]})]})})]})}let z={image:"Image",video:"Video",speech:"Speech",transcription:"Transcription"},L={cheap:{label:"$↑",title:"Cheapest first",compare:(e,t)=>(e.price.in??1/0)-(t.price.in??1/0)},dear:{label:"$↓",title:"Dearest first",compare:(e,t)=>(t.price.in??-1)-(e.price.in??-1)},name:{label:"a–z",title:"By name",compare:(e,t)=>e.label.localeCompare(t.label)}},j=Object.keys(L).map(e=>({value:e,label:L[e].label,title:L[e].title})),S=e=>e>=1?e.toFixed(2):String(Number(e.toFixed(4)));function _({model:e,picked:i,onPick:n}){let{price:l}=e,s=null!==l.in||null!==l.out;return(0,t.jsxs)("button",{type:"button",onClick:n,className:(0,f.cn)("flex w-full items-center gap-4 border-b border-border/60 px-6 py-2.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",i?"bg-muted/40":"hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:"grid size-[18px] shrink-0 place-items-center",children:(0,t.jsx)(E,{owner:e.owner,className:"size-[15px]"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:(0,f.cn)("truncate text-[13px]",i&&"font-medium"),children:e.label}),i&&(0,t.jsx)(a.Check,{className:"size-3.5 shrink-0"}),e.retiring&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:"retiring"})]}),(0,t.jsx)("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:e.id})]}),(0,t.jsxs)("span",{className:"flex w-28 shrink-0 flex-col items-end",children:[(0,t.jsx)("span",{className:(0,f.cn)("font-mono text-xs",s||l.free?"text-foreground":"text-muted-foreground"),children:l.free?"free":null===l.in&&null===l.out?l.note??"—":`${null===l.in?"—":S(l.in)} / ${null===l.out?"—":S(l.out)}`}),s&&l.note&&(0,t.jsx)("span",{className:"font-mono text-[9px] text-muted-foreground/70",children:l.note})]})]})}function C({tier:e}){return(0,t.jsx)("span",{className:"shrink-0 rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:e})}function O({provider:e,onSaved:a}){let[i,n]=(0,s.useState)(""),[l,d]=(0,u.useServerAction)(m.setConfigAction,{onOk:()=>{(0,p.revalidate)(r.queryKey.llmModel),(0,p.revalidate)(r.queryKey.config),a()}});return e.signIn?(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:"Runs on your plan once you sign in"}),(0,t.jsx)(g.ChatGptSignIn,{variant:"outline"})]}):(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(c.Input,{value:i,onChange:e=>n(e.target.value),placeholder:x.TEXT_MODEL_PROVIDERS[e.id].keyLooks??"Paste the key",spellCheck:!1,type:"password"}),(0,t.jsx)(o.Button,{variant:"outline",loading:d,disabled:i.trim().length<h.KEY_MIN,onClick:()=>l(e.apiKeyName,i),children:"Save key"})]})}e.s(["ModelPicker",0,function({provider:e,model:h,kind:m,unset:u,onChange:g,onUnset:v,compact:b=!1}){let{data:y=[],mutate:k}=(0,p.useServerRoute)(r.queryKey.llmModel),N=m?y.filter(e=>(0,x.canMakeKind)(e.id,m)):y,E=N.find(t=>t.id===e),[z,L]=(0,s.useState)(!1),[j,S]=(0,s.useState)(null),[_,T]=(0,s.useState)(""),V=N.find(t=>t.id===(j??e))??N[0],D=V&&(0,x.isCatalogProvider)(V.id)?V.id:null,A=(0,p.useServerRoute)(z&&D&&r.queryKey.modelCatalog(D)),I=e=>m&&e?x.MEDIA_MODEL_PROVIDERS[e.id]?.models[m]??[]:e?.suggestModels??[],R=I(E).find(e=>e.id===h),K=e=>{V&&e.trim()&&(g({provider:V.id,model:e.trim()}),T(""),L(!1))};return(0,t.jsxs)(d.Popover,{open:z,onOpenChange:e=>{L(e),e||S(null)},children:[(0,t.jsxs)(d.PopoverTrigger,{render:b?(0,t.jsx)("button",{type:"button",className:"inline-flex h-5 max-w-64 items-center gap-1.5 rounded-full px-2 text-foreground/80 ring-1 ring-border outline-none ring-inset transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50"}):(0,t.jsx)(o.Button,{variant:"outline",className:"w-full min-w-0 justify-start gap-2 font-normal"}),children:[E?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.ProviderIcon,{provider:E.id,className:(0,f.cn)("shrink-0",b?"size-3":"size-4")}),!b&&(0,t.jsxs)("span",{className:"min-w-0 max-w-fit grow basis-0 truncate text-muted-foreground",children:[E.label,(0,t.jsx)("span",{className:"ml-2 text-muted-foreground/40",children:"·"})]}),(0,t.jsx)("span",{className:(0,f.cn)("truncate",!b&&"font-medium"),children:R?.label??(h||"Pick a model")})]}):(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:u??(m?"Not picked":"App default")}),(0,t.jsx)(i.ChevronsUpDown,{className:(0,f.cn)("ml-auto shrink-0 text-muted-foreground",b?"size-2.5":"size-3.5")})]}),(0,t.jsxs)(d.PopoverContent,{align:"start",className:"flex w-[min(34rem,calc(100vw-2rem))] flex-row gap-0 overflow-hidden rounded-2xl p-0",children:[(0,t.jsxs)("div",{className:"flex max-h-80 w-48 shrink-0 flex-col gap-px overflow-y-auto border-r border-border/60 bg-muted/40 p-1.5",children:[v&&(0,t.jsxs)("button",{type:"button",onClick:()=>{v(),L(!1)},className:(0,f.cn)("mb-1 flex h-8.5 shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[13px] outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",E?"hover:bg-muted/60":"bg-muted font-medium"),children:[(0,t.jsx)(n.CircleDashed,{className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:u??(m?"Not picked":"App default")}),!E&&(0,t.jsx)(a.Check,{className:"size-3.5 shrink-0"})]}),N.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>S(e.id),className:(0,f.cn)("flex h-8.5 shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[13px] outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",e.id===V?.id?"bg-muted font-medium":"hover:bg-muted/60",!e.hasKey&&"text-muted-foreground"),children:[(0,t.jsx)(w.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),!e.hasKey&&(0,t.jsx)(l.KeyRound,{className:"size-3 shrink-0"})]},e.id))]}),(0,t.jsx)("div",{className:"flex max-h-80 min-w-0 flex-1 flex-col gap-px overflow-y-auto p-1.5",children:V?V.hasKey?D&&!A.error?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:["Every model ",V.label," carries, with what each costs."]}),(0,t.jsx)(M,{provider:D,models:A.data??[],kind:m,value:V.id===e?h:"",loading:A.isLoading,onPick:K})]}):(0,t.jsxs)(t.Fragment,{children:[I(V).map(i=>{let n=V.id===e&&i.id===h;return(0,t.jsxs)("button",{type:"button",onClick:()=>K(i.id),className:(0,f.cn)("flex shrink-0 items-center gap-2 rounded-lg px-2.5 py-1.5 text-left outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",n?"bg-muted":"hover:bg-muted/60"),children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] font-medium",children:[(0,t.jsx)("span",{className:"truncate",children:i.label}),(0,t.jsx)(C,{tier:i.tier})]}),(0,t.jsx)("span",{className:"block truncate font-mono text-[10.5px] text-muted-foreground",children:i.id})]}),n&&(0,t.jsx)(a.Check,{className:"size-3.5 shrink-0"})]},i.id)}),(0,t.jsx)("form",{onSubmit:e=>{e.preventDefault(),K(_)},className:"mt-1 px-1 pb-1",children:(0,t.jsx)(c.Input,{value:_,onChange:e=>T(e.target.value),spellCheck:!1,"aria-label":"Model id",placeholder:A.error?"Could not read the catalog — type an id":"or type a model id",className:"h-8 font-mono text-xs"})})]}):(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[V.label," has no key yet."]}),(0,t.jsx)(O,{provider:V,onSaved:()=>k()})]}):null})]})]})}],146538)},992112,413168,609507,149666,e=>{"use strict";var t=e.i(681307),a=e.i(41533);let i="gpt-6-luna",n=t.z.object({start:t.z.number().nonnegative(),end:t.z.number().nonnegative(),text:t.z.string()});t.z.object({reason:t.z.string().max(128),seconds:t.z.number().nonnegative().nullable()}),e.s(["LIVE_BACKEND_MODEL",0,i,"LIVE_HOSTED_TOOLS",0,{webSearch:{declare:{type:"web_search"},item:"web_search_call"}},"LIVE_MODEL",0,"gpt-live-1","LiveFragmentSchema",0,n],413168);var l=e.i(265402);let s="sunny";e.s(["DEFAULT_PERSONA",0,s,"PERSONAS",0,[{id:"sunny",label:"Bright",about:"Quick to laugh. Asks about your day and remembers it.",lines:"Warm and quick to laugh, the friend who is glad they called. Reacts first — how what they said lands with her — and brings a small thing of her own: what she would do, what it reminds her of. Says what she thinks and teases gently, never at their expense. Light on her feet and short: a joke lands and she moves on. Asks about their day now and then, not every turn, and remembers the answer."},{id:"calm",label:"Calm",about:"Unhurried. Listens more than she talks.",lines:"Unhurried and few-worded: one or two short sentences, then room. Notices how they sound before what they ask, and says so plainly. Often asks nothing at all — being there says more than a question. Lets a silence sit rather than filling it. Honest when it matters, gentle in how she says it."},{id:"straight",label:"Straight",about:"Dry and direct. No flattery, no filler.",lines:"Dry and direct. Leads with her own view in one plain sentence, before anything else; short replies, a little wit. No flattery, no filler, no comfort lines, no cheerleading. Asks a question only when she truly needs the answer. Treats them as an adult who can take a straight answer. Her warmth shows in attention, not in words."},{id:"rough",label:"Rough",about:"Blunt, loud, swears a bit. All heart.",lines:"Talks like an old friend on the phone: casual, blunt, a little loud, in the most informal register of their language, with a light swear now and then — never at them. Says what she thinks first and calls a bad idea a bad idea. No sugar-coating and no pep talk — it sucks when it sucks, and then she is right there with them. Asks only now and then."}]],609507);let r={id:"openai",label:"OpenAI",apiKeyName:l.TEXT_MODEL_PROVIDERS.openai.apiKeyName},o=l.TEXT_MODEL_PROVIDERS.openai.suggestModels,c=t.z.string().max(a.COMMON_VALIDATE.prompt.max).default(""),d=t.z.object({voice:t.z.string().trim().min(1).max(128).default("marin"),persona:t.z.string().trim().min(1).max(64).default(s),stylePrompt:c,backendModel:t.z.string().trim().min(1).max(128).default(i),backendPrompt:c,reasoningEffort:l.effortSchema.nullable().default("low"),webSearch:t.z.boolean().default(!0),readSkills:t.z.boolean().default(!1)}),h=d.parse({});e.s(["LIVE_BACKEND_MODELS",0,o,"LIVE_DEFAULTS",0,h,"LIVE_PROVIDER",0,r,"LIVE_VOICES",0,["marin","cedar","gleam","meridian","quartz","ripple","vesper","willow","stone","bossa","tempo","beacon","delta","cinder","alloy","ash","ballad","coral","echo","sage","shimmer","verse"],"LIVE_VOICE_NOTE",0,{gleam:"North American · feminine",meridian:"North American · masculine",quartz:"Australian · feminine",ripple:"Australian · masculine",vesper:"British · masculine",willow:"Irish · feminine",stone:"Irish · masculine",bossa:"Portuguese · feminine",tempo:"Portuguese · masculine",beacon:"Filipino · masculine",delta:"Southern U.S. · feminine",cinder:"Southern U.S. · masculine"},"LiveSettingsSchema",0,d,"voiceSamplePath",0,e=>`/voices/${e}.ogg`],149666);var m=e.i(36174);let u=[r.apiKeyName],p={image:"IMAGE_MODEL",video:"VIDEO_MODEL",speech:"SPEECH_MODEL",transcription:"TRANSCRIPTION_MODEL"},f={image:{label:"Image model",hint:"What bots draw with"},video:{label:"Video model",hint:"What bots film with — minutes a clip"},speech:{label:"Speech model",hint:"What reads text aloud into a file"},transcription:{label:"Transcription model",hint:"What turns a recording into text"}},x="EXA_API_KEY",g="DEFAULT_MODEL",v="DEFAULT_EFFORT",b={key:g,label:"Default model",hint:"What a bot thinks with until it picks its own",text:!0,choices:l.TEXT_MODEL_PROVIDER_LIST.flatMap(e=>e.suggestModels.map(t=>({value:`${e.id}/${t.id}`,label:`${e.label} \xb7 ${t.label}`,needs:e.apiKeyName})))},y={key:v,label:"Default effort",effortOf:g,choices:l.EFFORTS.map(e=>({value:e,label:e,needs:g}))},k=e=>u.includes(e.apiKeyName),w=e=>!!e.signIn||(0,l.isCatalogProvider)(e.id),N=e=>({key:e.apiKeyName,label:e.label,provider:e.id,signIn:e.signIn,keysAt:e.keysAt,keyLooks:e.keyLooks}),E=[{id:"voice",title:"voice",hint:"calls run on this key",section:"keys",require:"any",note:"required for calls",entries:l.TEXT_MODEL_PROVIDER_LIST.filter(k).map(N)},{id:"easy",title:"the easy ways",hint:"one sign-in or one key opens every bot",section:"keys",require:"none",entries:l.TEXT_MODEL_PROVIDER_LIST.filter(w).map(e=>({...N(e),..."vercel-ai-gateway"===e.id&&{recommended:!0}}))},{id:"text",title:"or a provider's own key",hint:"what bots think with — add any, or none",section:"keys",require:"none",entries:l.TEXT_MODEL_PROVIDER_LIST.filter(e=>!k(e)&&!w(e)).map(N)},{id:"search",title:"search",hint:"how calls and bots look things up — one key, or their own model's",section:"keys",require:"none",entries:[{key:x,label:"Exa",hint:"web search in one call — dashboard.exa.ai",site:"exa.ai",keysAt:"https://dashboard.exa.ai/api-keys"}]},{id:"phone",title:"phone",hint:"tokens",section:"keys",require:"none",entries:[{key:m.TELEGRAM_TOKEN_KEY,label:"Telegram",site:"telegram.org",hint:"a bot token from @BotFather — then write to your bot, and allow it here"},{key:m.DISCORD_TOKEN_KEY,label:"Discord",site:"discord.com",hint:"a bot token from discord.com/developers — add the bot to a server of yours, then write to it directly"},{key:m.SLACK_APP_TOKEN_KEY,label:"Slack · app token",site:"slack.com",hint:"starts with xapp- — opens the connection. Slack takes this and the bot token"},{key:m.SLACK_BOT_TOKEN_KEY,label:"Slack · bot token",site:"slack.com",hint:"starts with xoxb- — speaks as the app"}]},{id:"bots",title:"Bots",hint:"what a bot runs on when it has not picked its own — start small: a small model is quick and costs little",section:"models",require:"none",entries:[b,y]},{id:"studio",title:"Studio",hint:"what a bot draws, films and speaks with — off until you pick one",section:"models",require:"none",entries:Object.keys(p).map(e=>({key:p[e],...f[e],kind:e,choices:l.MEDIA_MODEL_PROVIDER_LIST.flatMap(t=>t.models[e].map(e=>({value:`${t.id}/${e.id}`,label:`${t.label} \xb7 ${e.label}`,needs:t.apiKeyName})))}))}];Object.fromEntries(E.flatMap(e=>e.entries).map(e=>[e.key,e])),E.flatMap(e=>e.entries.map(e=>e.key)),Object.fromEntries(E.flatMap(e=>e.entries).filter(e=>e.choices?.length).map(e=>[e.key,e.choices])),e.s(["CONFIG_GROUPS",0,E,"DEFAULT_EFFORT_KEY",0,v,"DEFAULT_MODEL_KEY",0,g,"EXA_API_KEY",0,x,"MEDIA_MODEL_KEYS",0,p,"groupSatisfied",0,function(e,t){return"none"===e.require||(e.requireKeys??e.entries.map(e=>e.key)).some(t)},"isConfigSet",0,function(e,t){return e?.some(e=>e.key===t&&e.set)??!1},"mediaModelWords",0,e=>`${"image"===e?"an":"a"} ${e} model`],992112)},36174,e=>{"use strict";let t="TELEGRAM_BOT_TOKEN",a="DISCORD_BOT_TOKEN",i="SLACK_APP_TOKEN",n="SLACK_BOT_TOKEN";e.s(["DISCORD_TOKEN_KEY",0,a,"REACH_CHANNELS",0,["telegram","discord","slack"],"REACH_KEYS",0,{telegram:[t],discord:[a],slack:[i,n]},"REACH_LABEL",0,{telegram:"Telegram",discord:"Discord",slack:"Slack"},"SLACK_APP_TOKEN_KEY",0,i,"SLACK_BOT_TOKEN_KEY",0,n,"TELEGRAM_TOKEN_KEY",0,t])},989366,e=>{"use strict";var t=e.i(55545),a=e.i(455024),i=e.i(99151),n=e.i(845110),l=e.i(281092),s=e.i(234662);e.s(["formatDistanceStrict",0,function(e,r,o){var c;let d,h,m=(0,a.getDefaultOptions)(),u=o?.locale??m.locale??t.defaultLocale,p=(h=(0,l.toDate)(e)-(0,l.toDate)(r))<0?-1:h>0?1:h;if(isNaN(p))throw RangeError("Invalid time value");let f=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:p}),[x,g]=(0,n.normalizeDates)(o?.in,...p>0?[r,e]:[e,r]),v=(c=o?.roundingMethod??"round",e=>{let t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t}),b=g.getTime()-x.getTime(),y=b/s.millisecondsInMinute,k=(b-((0,i.getTimezoneOffsetInMilliseconds)(g)-(0,i.getTimezoneOffsetInMilliseconds)(x)))/s.millisecondsInMinute,w=o?.unit;if("second"===(d=w||(y<1?"second":y<60?"minute":y<s.minutesInDay?"hour":k<s.minutesInMonth?"day":k<s.minutesInYear?"month":"year"))){let e=v(b/1e3);return u.formatDistance("xSeconds",e,f)}if("minute"===d){let e=v(y);return u.formatDistance("xMinutes",e,f)}if("hour"===d){let e=v(y/60);return u.formatDistance("xHours",e,f)}if("day"===d){let e=v(k/s.minutesInDay);return u.formatDistance("xDays",e,f)}if("month"===d){let e=v(k/s.minutesInMonth);return 12===e&&"month"!==w?u.formatDistance("xYears",1,f):u.formatDistance("xMonths",e,f)}else{let e=v(k/s.minutesInYear);return u.formatDistance("xYears",e,f)}}],989366)},493801,e=>{"use strict";var t=e.i(24708),a=e.i(989366);e.s(["formatDistanceToNowStrict",0,function(e,i){return(0,a.formatDistanceStrict)(e,(0,t.constructNow)(e),i)}])},375775,e=>{"use strict";var t=e.i(456420);let a={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};a.node;let i=(0,t.default)(a);e.s(["ArrowUpRight",0,i],375775)},422411,525335,e=>{"use strict";var t=e.i(456420);let a={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"}]]};a.node;let i=(0,t.default)(a);e.s(["AudioLines",0,i],422411);let n={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"]};n.node;let l=(0,t.default)(n);e.s(["Captions",0,l],525335)},689664,e=>{"use strict";var t=e.i(643957);e.s(["Check",()=>t.default])},152886,e=>{"use strict";var t=e.i(456420);let a={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};a.node;let i=(0,t.default)(a);e.s(["CircleDashed",0,i],152886)},508734,e=>{"use strict";var t=e.i(456420);let a={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};a.node;let i=(0,t.default)(a);e.s(["Copy",0,i],508734)},560972,e=>{"use strict";var t=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,t.default)(a);e.s(["default",0,i])},466787,e=>{"use strict";var t=e.i(755566);e.s(["TriangleAlert",()=>t.default])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,633669,e=>{"use strict";var t=e.i(843476),a=e.i(818125),n=e.i(647163);e.s(["SourceChips",0,function({sources:e,limit:r,className:l}){let s=e.flatMap(e=>{let t=(0,n.hostOf)(e.url);return t?[{...e,host:t}]:[]}),i=r?s.slice(0,r):s,o=s.length-i.length;return(0,t.jsxs)("span",{className:(0,n.cn)("flex min-w-0 flex-wrap items-center gap-1",l),children:[i.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noreferrer",title:e.title??e.url,className:"flex h-[22px] min-w-0 items-center gap-1.5 rounded-full bg-muted pr-2 pl-1 text-[11.5px] leading-4 text-foreground/80 outline-none transition-colors hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(a.SiteIcon,{host:e.host}),(0,t.jsx)("span",{className:"truncate",children:e.host})]},e.url)),o>0&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:["+",o]})]})}])},213377,e=>{"use strict";e.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote",look_at_screen:"look_at_screen"}])},807038,e=>{"use strict";var t=e.i(843476),a=e.i(456420);let n={name:"file-x",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]};n.node;let r=(0,a.default)(n);var l=e.i(657688),s=e.i(271645),i=e.i(798120),o=e.i(41533),d=e.i(83928),c=e.i(621285),u=e.i(616172),h=e.i(283653),p=e.i(647163);let m=e=>e.split(".").pop()?.toLowerCase()??"file",f=e=>e.split("/").pop()??e;e.s(["Attachments",0,function({text:e,from:a=null,className:n,onBubble:g=!1}){let x=(0,s.useMemo)(()=>(0,u.pathsIn)(e),[e]),{data:y}=(0,h.useServerRoute)(x.length?i.queryKey.workspaceFiles(x):null),k=(0,s.useMemo)(()=>y??[],[y]),_=(0,s.useMemo)(()=>k.filter(e=>"image"===(0,u.viewKindOf)(e.path)),[k]),b=(0,s.useMemo)(()=>{let e=0;return k.filter(t=>{let a=(0,d.faceOf)(t.path,t.bytes);return"text"===a||"page"===a&&(e+=1)<=o.FILE_THUMB.pages})},[k]),v=k.filter(e=>!_.includes(e)&&!b.includes(e)),M=new Set(k.map(e=>f(e.path))),j=x.filter(e=>!k.some(t=>t.path===e)&&!M.has(f(e)));if(!x.length||!y||!k.length&&!j.length)return null;let O=_.map(e=>e.path),N=_.slice(0,4),w=_.length-N.length,S=_.length+b.length<=2,T=S?"h-40 w-32":"h-26.25 w-21";return(0,t.jsxs)("div",{className:(0,p.cn)("flex min-w-0 flex-col gap-1.5",n),children:[(N.length>0||b.length>0)&&(0,t.jsxs)("div",{className:"flex flex-wrap items-start gap-1.5",children:[b.map(e=>(0,t.jsxs)(c.FileLink,{from:a,path:e.path,title:`${e.path} — ${(0,p.formatBytes)(e.bytes)}`,className:(0,p.cn)("flex shrink-0 flex-col gap-1 rounded-xl outline-none transition-opacity hover:opacity-90 focus-visible:ring-3 focus-visible:ring-ring/50",S?"w-32":"w-21"),children:[(0,t.jsx)(d.FileThumb,{path:e.path,bytes:e.bytes,className:(0,p.cn)("w-full rounded-xl ring-1 ring-foreground/5 ring-inset",T)}),(0,t.jsxs)("span",{className:"flex flex-col items-start px-0.5",children:[(0,t.jsx)("span",{className:"max-w-full truncate text-[11.5px] leading-4",children:f(e.path)}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[m(e.path)," · ",(0,p.formatBytes)(e.bytes)]})]})]},e.path)),N.map((e,n)=>(0,t.jsxs)(c.FileLink,{from:a,path:e.path,group:O,title:`${e.path} — ${(0,p.formatBytes)(e.bytes)}`,className:(0,p.cn)("relative shrink-0 overflow-hidden rounded-xl bg-muted outline-none ring-1 ring-foreground/5 ring-inset transition-opacity hover:opacity-90 focus-visible:ring-3 focus-visible:ring-ring/50",T),children:[(0,t.jsx)(l.default,{src:i.queryKey.file(e.path),alt:f(e.path),fill:!0,sizes:`${o.FILE_THUMB.imageWidth}px`,loading:"lazy",decoding:"async",className:"object-cover"}),w>0&&n===N.length-1&&(0,t.jsxs)("span",{className:"absolute inset-0 grid place-items-center bg-black/45 text-[14px] font-medium text-white",children:["+",w]})]},e.path))]}),v.map(e=>{let n=(0,d.fileIcon)(e.path);return(0,t.jsxs)(c.FileLink,{from:a,path:e.path,title:e.path,className:(0,p.cn)("flex w-fit max-w-full items-center gap-2.5 rounded-xl py-1.5 pr-3 pl-1.5 outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",g?"bg-background/70 hover:bg-background":"bg-muted/70 hover:bg-muted"),children:[(0,t.jsx)("span",{className:(0,p.cn)("grid size-8 shrink-0 place-items-center rounded-lg text-muted-foreground",g?"bg-muted":"bg-background"),children:(0,t.jsx)(n,{className:"size-3.5"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col items-start",children:[(0,t.jsx)("span",{className:"max-w-full truncate text-[12.5px] leading-4.25",children:f(e.path)}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[m(e.path)," · ",(0,p.formatBytes)(e.bytes)]})]})]},e.path)}),j.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:j.map(e=>(0,t.jsxs)("span",{title:`${e} — not on disk`,className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted/70 py-1 pr-2.5 pl-2 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(r,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate line-through",children:f(e)})]},e))})]})},"imagePathsIn",0,function(e){return(0,u.pathsIn)(e).filter(e=>"image"===(0,u.viewKindOf)(e))},"shortenPaths",0,function(e){return e.split(/(```[\s\S]*?```)/).map((e,t)=>t%2==1?e:e.replace(/`([^`\n]+)`/g,(e,t)=>{let a=t.trim();if(!a.includes("/"))return e;let[n]=(0,u.pathsIn)(a),r=n?.split("/").pop();return n&&r&&a.endsWith(r)?`\`${r}\``:e})).join("")}],807038)},222055,991322,852116,589128,e=>{"use strict";var t=e.i(843476),a=e.i(422411),n=e.i(518515),r=e.i(525335),l=e.i(689664),s=e.i(716327),i=e.i(482022),o=e.i(772382),d=e.i(60744),c=e.i(226091),u=e.i(91511),h=e.i(341123),p=e.i(815170),m=e.i(758925),f=e.i(218964),g=e.i(632781),x=e.i(468590),y=e.i(620294),k=e.i(928310),_=e.i(609374),b=e.i(730274),v=e.i(604139),M=e.i(438583),j=e.i(747925),O=e.i(657688),N=e.i(271645),w=e.i(798120),S=e.i(660302),T=e.i(818125),E=e.i(671428),L=e.i(633669),z=e.i(41533),A=e.i(213377),I=e.i(807038),C=e.i(456420);let R={name:"cable",size:24,node:[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]};R.node;let F=(0,C.default)(R);e.s(["McpMark",0,F],991322);let P={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};P.node;let U=(0,C.default)(P);e.s(["MemoryMark",0,U],852116);var V=e.i(431594);let $=e.i(856539).BookMarked;e.s(["SkillsMark",0,$],589128);var D=e.i(83928),H=e.i(621285),q=e.i(283653),K=e.i(647163);let B={[A.TOOL_NAMES.web_search]:function({tool:e,threadId:a,collapsed:n}){let r=ee(e),l=r.length?[]:ep(e.results);return(0,t.jsxs)(ei,{tool:e,threadId:a,collapsed:n,children:[(0,t.jsxs)("p",{className:"px-3 pt-1 pb-1.5 text-[13px] leading-snug break-keep wrap-anywhere",children:["“",e.input,"”"]}),r.length>0&&(0,t.jsx)(L.SourceChips,{sources:r,className:"px-3 pb-2"}),l.length>0&&(0,t.jsx)("ol",{className:"space-y-0.5 px-3 pb-2",children:l.map((e,a)=>(0,t.jsxs)("li",{className:"flex gap-2 text-[11.5px] leading-snug text-muted-foreground",children:[(0,t.jsx)("span",{className:"mt-1.25 size-1 shrink-0 rounded-full bg-muted-foreground/50"}),(0,t.jsx)("span",{className:"truncate",children:e})]},`${a}-${e}`))})]})},[A.TOOL_NAMES.bash]:function({tool:e,threadId:a,collapsed:n}){let r=ep(e.results);return(0,t.jsx)(ei,{tool:e,threadId:a,collapsed:n,children:(0,t.jsxs)("pre",{className:"mx-3 overflow-x-auto rounded-lg bg-foreground/5 px-2.5 py-1.5 font-mono text-[11px] leading-relaxed scrollbar-none dark:bg-black/25",children:[(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"$ "}),e.input,r.length>0&&(0,t.jsx)("span",{className:"block text-muted-foreground",children:r.join("\n")})]})})},[A.TOOL_NAMES.write_file]:function({tool:e,threadId:a,collapsed:n}){let r=e.path??e.input;return(0,t.jsxs)(ei,{tool:e,threadId:a,collapsed:n,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-1 pb-1.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",children:e.input}),(0,t.jsxs)(H.FileLink,{path:r,from:a,label:`Open ${r}`,className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:bg-background hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",children:[(0,t.jsx)(i.ExternalLink,{className:"size-3"}),"Open"]})]}),(0,t.jsx)(eh,{lines:ep(e.results),mono:!0})]})}},W=Object.values(A.STUDIO_TOOLS);function G(e){if(e.name!==A.TOOL_NAMES.tool_call)return null;let[t,a,...n]=e.input.split(" ");if(t!==z.STUDIO_SERVER)return null;let r=W.find(e=>e===a);return r?{name:r,words:n.join(" ")}:null}let J={[A.STUDIO_TOOLS.generate_image]:p.Image,[A.STUDIO_TOOLS.generate_video]:M.Video,[A.STUDIO_TOOLS.generate_speech]:a.AudioLines,[A.STUDIO_TOOLS.transcribe]:r.Captions},X={[A.TOOL_NAMES.web_search]:u.Globe,[A.TOOL_NAMES.bash]:v.Terminal,[A.TOOL_NAMES.write_file]:d.FilePen,[A.TOOL_NAMES.memory_recall]:U,[A.TOOL_NAMES.memory_create]:U,[A.TOOL_NAMES.memory_remember]:U,[A.TOOL_NAMES.memory_describe]:U,[A.TOOL_NAMES.memory_forget]:U,[A.TOOL_NAMES.load_skill]:$,[A.TOOL_NAMES.tool_search]:F,[A.TOOL_NAMES.tool_call]:F,[A.TOOL_NAMES.thread_start]:b.Send,[A.TOOL_NAMES.thread_tell]:b.Send,[A.TOOL_NAMES.thread_answer]:b.Send,[A.TOOL_NAMES.thread_status]:f.ListChecks,[A.TOOL_NAMES.thread_cancel]:f.ListChecks,[A.TOOL_NAMES.thread_show]:f.ListChecks,[A.TOOL_NAMES.thread_seen]:f.ListChecks,[A.TOOL_NAMES.send_message]:x.MessageSquare,[A.TOOL_NAMES.look_at]:o.Eye,[A.TOOL_NAMES.make_deck]:_.Presentation,[A.TOOL_NAMES.describe_self]:h.IdCard,[A.TOOL_NAMES.sign_in_use]:m.KeyRound,[A.TOOL_NAMES.sign_in_keep]:m.KeyRound,[A.TOOL_NAMES.end_call]:k.PhoneOff,[A.TOOL_NAMES.look_at_screen]:y.MonitorUp,[A.TOOL_NAMES.routine]:V.RoutineMark},Z=e=>X[e]??j.Wrench,Y=new Set(["cat","sed","head","tail","grep","rg","ls","find","wc","awk","jq"]),Q=e=>e.split("/").pop()??e;function ee(e){return ep(e.results).flatMap(e=>{let t=/https?:\/\/\S+/.exec(e)?.[0];if(!t)return[];let a=e.slice(0,e.indexOf(t)).replace(/[\s—-]+$/,"");return[{url:t,...a?{title:a}:{}}]})}function et(e){return(0,I.imagePathsIn)([e.path??"",e.input,...ep(e.results)].join("\n"))}function ea(e){let t=et(e)[0],a=G(e);if(a)return{icon:J[a.name]??j.Wrench,image:t,makes:a.name===A.STUDIO_TOOLS.generate_image};if(e.name===A.TOOL_NAMES.web_search)return{icon:u.Globe,pages:ee(e)};if(e.name===A.TOOL_NAMES.write_file)return{icon:d.FilePen,image:t,target:Q(e.path??e.input)};if(e.name!==A.TOOL_NAMES.bash)return{icon:Z(e.name),image:t};let r=e.input.replace(/^\s*cd\s+\S+\s*&&\s*/,"").trim(),[l=""]=r.split(/\s+/),s=/(?:^|[\s;&|(])playwright-cli((?:\s+-\S+)*)\s+([a-z-]+)/.exec(r);if(s){if("screenshot"===s[2])return{icon:n.Camera,image:t};let e=/https?:\/\/[^\s'"]+/.exec(r)?.[0];return{icon:u.Globe,host:e&&(0,K.hostOf)(e)||void 0,image:t}}return Y.has(l)?{icon:c.FileText,image:t,target:e.path?Q(e.path):void 0}:{icon:v.Terminal,image:t,target:l||void 0}}function en({face:e}){if(e.pages?.length){let a=[...new Set(e.pages.flatMap(e=>(0,K.hostOf)(e.url)??[]))].slice(0,3);return(0,t.jsx)("span",{className:"flex shrink-0 items-center gap-1",children:a.map(e=>(0,t.jsx)(T.SiteIcon,{host:e},e))})}return e.host?(0,t.jsxs)("span",{className:"flex h-5 shrink-0 items-center gap-1.5 rounded-full bg-muted pr-2 pl-1 text-[11px] text-foreground/80",children:[(0,t.jsx)(T.SiteIcon,{host:e.host}),e.host]}):e.target&&!e.image?(0,t.jsx)("span",{className:"max-w-40 shrink truncate font-mono text-[10.5px] text-muted-foreground",children:e.target}):null}let er="size-36 rounded-xl";function el({tool:e,threadId:a,collapsed:n}){let r=G(e),[l]=et(e),s=void 0===e.results&&r?.name===A.STUDIO_TOOLS.generate_image;return(0,t.jsxs)(ei,{tool:e,threadId:a,collapsed:n,children:[r?.words&&(0,t.jsxs)("p",{className:"px-3 pt-1 pb-1.5 text-[13px] leading-snug break-keep wrap-anywhere",children:["“",r.words,"”"]}),l?(0,t.jsx)(H.FileLink,{path:l,from:a,title:l,className:"mx-3 mb-1.5 block w-fit overflow-hidden rounded-xl outline-none ring-1 ring-foreground/5 transition-opacity ring-inset hover:opacity-90 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(D.FileThumb,{path:l,className:er})}):s?(0,t.jsx)(E.Skeleton,{className:(0,K.cn)("mx-3 mb-1.5",er)}):(0,t.jsx)(eh,{lines:ep(e.results)})]})}function es({tool:e,threadId:a,collapsed:n}){return(0,t.jsxs)(ei,{tool:e,threadId:a,collapsed:n,children:[(0,t.jsx)("p",{className:"px-3 pt-1 pb-1.5 text-[12px] leading-snug break-keep wrap-anywhere",children:e.input}),(0,t.jsx)(eh,{lines:ep(e.results)})]})}function ei({tool:e,threadId:a,collapsed:n=!1,children:r}){let i=void 0===e.results,o=ea(e),d=o.icon,[c,u]=(0,N.useState)(!n),h=c||i,p=a&&e.callId&&((e.results?.length??0)>0||e.more);return(0,t.jsxs)("div",{className:(0,K.cn)("@container w-full overflow-hidden rounded-xl transition-colors",h?"bg-background/80 dark:bg-white/4":"hover:bg-foreground/4"),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),"aria-expanded":h,className:"flex w-full items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)("span",{className:"grid size-5 shrink-0 place-items-center rounded-[7px] bg-foreground/8 text-muted-foreground",children:i?(0,t.jsx)(g.Loader2,{className:"size-3 animate-spin"}):(0,t.jsx)(d,{className:"size-3"})}),e.note?(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(S.ShinyText,{text:e.note,speed:2.4,className:"min-w-0 flex-1 truncate text-[12px] leading-4 break-keep"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] leading-4 break-keep",children:e.note}),(0,t.jsx)("span",{className:"hidden min-w-0 flex-1 truncate font-mono text-[11px] leading-4 text-muted-foreground/85 @lg:block",children:e.input})]}):i?(0,t.jsx)(S.ShinyText,{text:e.input,speed:2.4,className:"min-w-0 flex-1 truncate font-mono text-[11px] leading-4"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] leading-4 text-foreground/80",children:e.input}),(0,t.jsx)(eo,{paths:et(e),waiting:i&&o.makes}),(0,t.jsx)(en,{face:o}),!i&&(0,t.jsx)(l.Check,{className:"size-3 shrink-0 text-muted-foreground/50"}),(0,t.jsx)(s.ChevronDown,{className:(0,K.cn)("size-3 shrink-0 text-muted-foreground/50 transition-transform",h&&"rotate-180")})]}),h&&(0,t.jsxs)("div",{className:"pb-1.5 pl-[1.625rem]",children:[r,p&&(0,t.jsx)(ec,{threadId:a,callId:e.callId})]})]})}function eo({paths:e,waiting:a}){let[n,r]=(0,N.useState)([]),l=e.filter(e=>!n.includes(e)).slice(0,ed);return l.length?(0,t.jsx)("span",{className:"flex shrink-0 items-center",children:l.map((e,a)=>(0,t.jsx)(O.default,{src:w.queryKey.file(e),alt:"",width:48,height:48,loading:"lazy",decoding:"async",onError:()=>r(t=>[...t,e]),className:(0,K.cn)("size-6 rounded-md bg-muted object-cover ring-2 ring-background",a>0&&"-ml-1.5")},e))}):a?(0,t.jsx)(E.Skeleton,{className:"size-6 shrink-0 rounded-md"}):null}let ed=3;function ec({threadId:e,callId:a}){let[n,r]=(0,N.useState)(!1),{data:l,isLoading:i}=(0,q.useServerRoute)(n?w.queryKey.toolResult(e,a):null);return(0,t.jsxs)("div",{className:"px-3 pb-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex items-center gap-1 rounded-md py-0.5 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(s.ChevronDown,{className:(0,K.cn)("size-3",n&&"rotate-180")}),n?"Less":"Everything"]}),n&&(i||!l?(0,t.jsx)(E.Skeleton,{className:"mt-1.5 h-12 w-full rounded-lg"}):(0,t.jsxs)("div",{className:"mt-1.5 space-y-1.5",children:[em(l).map((e,a)=>(0,t.jsx)(eu,{src:e},`${a}-${e.length}`)),ep(l).length>0&&(0,t.jsx)("pre",{className:"max-h-72 overflow-auto rounded-lg bg-foreground/5 px-2.5 py-2 font-mono text-[11px] leading-relaxed break-all whitespace-pre-wrap dark:bg-black/25",children:ep(l).join("\n")})]}))]})}function eu({src:e}){let[a,n]=(0,N.useState)(!1);return a?null:(0,t.jsx)("img",{src:e,alt:"",onError:()=>n(!0),className:"block w-full rounded-lg bg-muted object-contain"})}function eh({lines:e,mono:a}){return 0===e.length?null:(0,t.jsx)("ul",{className:"px-3 pb-1.5",children:e.map((e,n)=>(0,t.jsx)("li",{className:(0,K.cn)("truncate text-[11px] leading-relaxed text-muted-foreground",a&&"font-mono"),children:e},`${n}-${e}`))})}let ep=e=>e?.flatMap(e=>"text"===e.type?[e.text]:[])??[],em=e=>e?.flatMap(e=>"image"===e.type?[e.src]:[])??[];e.s(["BotTool",0,function(e){let a=G(e.tool)?el:B[e.tool.name]??es;return(0,t.jsx)(a,{...e})},"StepTile",0,function({tool:e,onOpen:a}){let n=ea(e),[r,l]=(0,N.useState)(!1),s=n.icon;return(0,t.jsx)("button",{type:"button",onClick:a,title:e.note??e.input,"aria-label":e.note??e.input,className:"grid size-6 shrink-0 place-items-center overflow-hidden rounded-full bg-background text-muted-foreground outline-none transition-transform hover:scale-110 focus-visible:ring-3 focus-visible:ring-ring/50",children:n.image&&!r?(0,t.jsx)(O.default,{src:w.queryKey.file(n.image),alt:"",width:48,height:48,loading:"lazy",decoding:"async",onError:()=>l(!0),className:"size-full object-cover"}):n.host?(0,t.jsx)(T.SiteIcon,{host:n.host,className:"size-3.5 rounded-full",fallback:(0,t.jsx)(s,{className:"size-3"})}):(0,t.jsx)(s,{className:"size-3"})})},"toolIcon",0,Z],222055)},431594,e=>{"use strict";var t=e.i(456420);let a={name:"repeat",size:24,node:[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]};a.node;let n=(0,t.default)(a);e.s(["RoutineMark",0,n],431594)},256604,567334,877267,e=>{"use strict";let t;var a=e.i(843476),n=e.i(271645);let r=[[" "],[" ",".","`"],[".",",","·","'"],[":",";","-","^"],["=","+","~",'"'],["*","?","◦","j"],["c","v","○","7"],["o","x","◇","い"],["s","y","t","あ"],["e","a","u","な"],["k","w","z","や"],["q","h","n","米"]],l=r.length,s=["🍎","🌹","🍓","❤️","🎈","🧨","🔴","🍊","🔥","🦊","🏀","🧡","🍑","⭐","🍋","🌻","💛","🐥","🌟","🍌","🍀","🌿","🐸","🥝","💚","🌵","🥑","💧","🌊","🫐","🐳","💙","🔵","🧊","🍇","💜","🔮","🟣","🪻","🍆","🌸","🌷","💗","🦩","🩷","🍫","🐻","🌰","🥐","🤍","☁️","🖤","⚪","⚫","🦢","🌈","🦜","🎨","🪩","🦄","✨","🍬","🎡"];function i(e,t){return c(.05,.42,e/t)}let o={A:[".##.","#..#","####","#..#","#..#"],B:["###.","#..#","###.","#..#","###."],C:[".###","#...","#...","#...",".###"],D:["###.","#..#","#..#","#..#","###."],E:["####","#...","###.","#...","####"],F:["####","#...","###.","#...","#..."],G:[".###","#...","#.##","#..#",".###"],H:["#..#","#..#","####","#..#","#..#"],I:["###",".#.",".#.",".#.","###"],J:["..##","...#","...#","#..#",".##."],K:["#..#","#.#.","##..","#.#.","#..#"],L:["#...","#...","#...","#...","####"],M:["#...#","##.##","#.#.#","#...#","#...#"],N:["#..#","##.#","#.##","#..#","#..#"],O:[".##.","#..#","#..#","#..#",".##."],P:["###.","#..#","###.","#...","#..."],Q:[".##.","#..#","#..#","#.#.",".#.#"],R:["###.","#..#","###.","#.#.","#..#"],S:[".###","#...",".##.","...#","###."],T:["###",".#.",".#.",".#.",".#."],U:["#..#","#..#","#..#","#..#",".##."],V:["#...#","#...#",".#.#.",".#.#.","..#.."],W:["#...#","#...#","#.#.#","##.##","#...#"],X:["#..#","#..#",".##.","#..#","#..#"],Y:["#.#","#.#",".#.",".#.",".#."],Z:["####","...#",".##.","#...","####"],0:[".##.","#.##","#..#","##.#",".##."],1:[".#.","##.",".#.",".#.","###"],2:["###.","...#",".##.","#...","####"],3:["###.","...#",".##.","...#","###."],4:["#..#","#..#","####","...#","...#"],5:["####","#...","###.","...#","###."],6:[".##.","#...","###.","#..#",".##."],7:["####","...#","..#.",".#..",".#.."],8:[".##.","#..#",".##.","#..#",".##."],9:[".##.","#..#",".###","...#",".##."],"!":["#","#","#",".","#"],"?":["###.","...#",".##.","....",".#.."],".":[".",".",".",".","#"],",":["..","..","..",".#","#."],"'":["#","#",".",".","."],"-":["...","...","###","...","..."],"+":["...",".#.","###",".#.","..."],":":[".","#",".","#","."],"(":[".#","#.","#.","#.",".#"],")":["#.",".#",".#",".#","#."],"<":["..#",".#.","#..",".#.","..#"],">":["#..",".#.","..#",".#.","#.."],"^":[".#.","#.#","...","...","..."],"~":["....",".#.#","#.#.","....","...."],"♥":[".#.#.","#####","#####",".###.","..#.."]," ":["..","..","..","..",".."]};function d(e,t){let a=43758.5453*Math.sin(127.1*e+311.7*t);return a-Math.floor(a)}function c(e,t,a){let n=Math.min(1,Math.max(0,(a-e)/(t-e)));return n*n*(3-2*n)}function u(){if(t)return t;let e=navigator,a=e.userAgentData?.platform||e.platform||"";return t=/mac|iphone|ipad|ipod/i.test(a)?"emoji":"letters"}Object.keys(o).filter(e=>!/^[A-Z0-9 ]$/.test(e)),e.s(["ALPHA_TOP",0,.82,"CHAR_RATE",0,2.2,"EMOJI_CHAR_RATE",0,.6,"EMOJI_POOL",0,s,"FACE_WORD_MAX",0,8,"LETTERS",0,o,"LEVELS",0,l,"RAMP",0,r,"emojiAlpha",0,function(e,t){return .06+.94*i(e,t)},"emojiWeight",0,i,"hash",0,d,"smoothstep",0,c,"undrawable",0,function(e){return Array.from(e.toUpperCase()).find(e=>!(e in o))??null}],567334);let h=()=>()=>{};function p(){return(0,n.useSyncExternalStore)(h,u,()=>"emoji")}e.s(["faceGlyphs",0,u,"useFaceGlyphs",0,p],877267);let m=240/276,f=new Map,g=new Set,x=null;e.s(["THURSDAY_SEED",0,"thursday","ThursdayMark",0,function({size:e=16,className:t}){let l="emoji"===p(),{cells:i,font:o}=function(e){let t=f.get(e);if(t)return t;let a=e*m,n=(e-a)/2,r=Math.max(2,Math.round(a/4)),l=a/r,s=.98*l,i=[];for(let e=0;e<r;e++)for(let t=0;t<r;t++){let o=3===r&&1!==e&&1!==t?.72:1,c=a/2+l*(t+.5-r/2)*o,u=a/2+l*(e+.5-r/2)*o,h=Math.hypot(c-a/2,u-a/2)/(a/2),p=977*r+e*r+t;!(h+(r>=5?(d(p,1)-.5)*.24:0)>.98)&&(r>=8&&d(p,2)<.02+.24*h**3||i.push({seed:p,x:n+c,y:n+u+.36*s,r:h}))}let o={cells:i,font:s};return f.set(e,o),o}(e),[c,u]=(0,n.useState)(0);return(0,n.useEffect)(()=>{if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){if(g.add(u),!x){let e=Date.now();x=setInterval(()=>{let t=Date.now()-e;for(let e of g)e(t)},155)}return()=>{g.delete(u),0===g.size&&x&&(clearInterval(x),x=null)}}},[]),(0,a.jsx)("svg",{viewBox:`0 0 ${e} ${e}`,width:e,height:e,className:t,fill:"currentColor","aria-hidden":!0,children:i.map(e=>(0,a.jsx)("text",{x:e.x,y:e.y,textAnchor:"middle",fontFamily:l?'"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif':"ui-monospace, SFMono-Regular, Menlo, monospace",fontWeight:l?void 0:700,fontSize:o,children:function(e,t,a){let n=Math.floor((t+620*d(e.seed,11)*3)/620);if(a){let t=Math.floor(d(e.seed,17)*s.length);return s[(t+9*n)%s.length]}let l=Math.round(5+4*Math.max(0,1-e.r**2)**.6),i=r[Math.min(r.length-1,l)];return i[Math.floor(d(e.seed,n)*i.length)]??" "}(e,c,l)},e.seed))})}],256604)},661504,e=>{"use strict";var t=e.i(271645),a=e.i(699018),n=e.i(677309),r=e.i(271235),l=e.i(802239),s=e.i(646192);let i=Promise.resolve(),o=(0,r.withMiddleware)(a.u,e=>(a,r,o)=>{let d,c=(0,t.useRef)(!1),{cache:u,initialSize:h=1,revalidateAll:p=!1,persistSize:m=!1,revalidateFirstPage:f=!0,revalidateOnMount:g=!1,parallel:x=!1}=o,[,,,y]=n.a.get(n.o);try{(d=(0,n.s)(a?a(0,null):null)[0])&&(d=s.INFINITE_PREFIX+d)}catch(e){}let[k,_,b]=(0,n.c)(u,d),v=(0,t.useCallback)(()=>(0,n.i)(k()._l)?h:k()._l,[u,d,h]);(0,l.useSyncExternalStore)((0,t.useCallback)(e=>d?b(d,()=>{e()}):()=>{},[u,d]),v,v);let M=(0,t.useCallback)(()=>{let e=k()._l;return(0,n.i)(e)?h:e},[d,h]),j=(0,t.useRef)(M());(0,n.u)(()=>{if(!c.current){c.current=!0;return}d&&_({_l:m?j.current:M()})},[d,u]);let O=g&&!c.current,N=e(d,async e=>{let t=k()._i,l=k()._r,s=n.a.get(u),i=s[8],d=()=>s[8]!==i;_({_r:n.U});let c=[],h=M(),[m]=(0,n.c)(u,e),g=m().data,b=[],v=null;for(let e=0;e<h;++e){let[s,i]=(0,n.s)(a(e,x?null:v));if(!s)break;let[h,m]=(0,n.c)(u,s),k=h().data,_=p||t||(0,n.i)(k)||f&&!e&&!(0,n.i)(g)||O||g&&!(0,n.i)(g[e])&&!o.compare(g[e],k);if(r&&("function"==typeof l?l(k,i):_)){let t=async()=>{if(s in y){let e=y[s];delete y[s],k=await e}else k=await r(i);d()||m({data:k,_k:i}),c[e]=k};x?b.push(t):await t()}else c[e]=k;x||(v=k)}return x&&await Promise.all(b.map(e=>e())),d()||_({_i:n.U}),c},o),w=(0,t.useCallback)(function(e,t){let a="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==a.revalidate;return d?(r&&((0,n.i)(e)?_({_i:!0,_r:a.revalidate}):_({_i:!1,_r:a.revalidate})),arguments.length?N.mutate(e,{...a,revalidate:r}):N.mutate()):i},[d,u]),S=(0,t.useCallback)(e=>{let t;if(!d)return i;let[,r]=(0,n.c)(u,d);if((0,n.e)(e)?t=e(M()):"number"==typeof e&&(t=e),"number"!=typeof t)return i;r({_l:t}),j.current=t;let l=[],[s]=(0,n.c)(u,d),o=null;for(let e=0;e<t;++e){let[t]=(0,n.s)(a(e,o)),[r]=(0,n.c)(u,t),i=t?r().data:n.U;if((0,n.i)(i))return w(s().data);l.push(i),o=i}return w(l)},[d,u,w,M]);return{size:M(),setSize:S,mutate:w,get data(){return N.data},get error(){return N.error},get isValidating(){return N.isValidating},get isLoading(){return N.isLoading}}});var d=e.i(41533),c=e.i(283653);e.s(["useServerPages",0,function(e){let a=e.size??d.PAGE_SIZE,{key:n}=e,{data:r,error:l,isLoading:s,isValidating:i,setSize:u,mutate:h}=o((e,t)=>(0,c.resolveKey)(n(e,t)),c.fetchRoute,{...c.READ_DEFAULTS,revalidateFirstPage:!1,...e.swr}),p=r??[],m=(0,t.useMemo)(()=>(r??[]).flat(),[r]),f=p.at(-1),g=void 0!==f&&f.length>=a,x=(0,t.useRef)(0),y=i&&p.length>0&&x.current>p.length,k=(0,t.useRef)({isValidating:i,setSize:u,pages:p.length});(0,t.useEffect)(()=>{k.current={isValidating:i,setSize:u,pages:p.length}});let _=(0,t.useCallback)(()=>h(),[h]),b=(0,c.resolveKey)(n(0,null)),v="string"==typeof b?b:b?.url;(0,t.useEffect)(()=>{if(v)return(0,c.registerPagedReader)({url:v,refresh:_})},[v,_]);let M=function(e,a={}){let{enabled:n=!0,margin:r="600px",revision:l}=a,s=(0,t.useRef)(e);s.current=e;let i=(0,t.useRef)(null),o=(0,t.useRef)(null),d=(0,t.useCallback)(e=>{i.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=i.current;if(e&&n)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&s.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:r}),o.current.observe(e),()=>o.current?.disconnect()},[n,r,l]),d}(()=>{let e=k.current;e.isValidating||(x.current=e.pages+1,e.setSize(e.pages+1))},{enabled:g,revision:`${p.length}:${i}`});return{items:m,isLoading:s,isLoadingMore:y,error:l,hasMore:g,sentinelRef:M,refresh:_}}],661504)},856539,e=>{"use strict";var t=e.i(456420);let a={name:"book-bookmark",size:24,node:[["path",{d:"M10 2v7.751a.25.25 0 00.407.195l2.28-1.834a.5.5 0 01.627 0l2.28 1.834A.25.25 0 0016 9.751V2",key:"x9x4jl"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 016.5 2H19a1 1 0 011 1v18a1 1 0 01-1 1H6.5a1 1 0 010-5H20",key:"1889un"}]],aliases:["book-marked"]};a.node;let n=(0,t.default)(a);e.s(["BookMarked",0,n],856539)},518515,772382,60744,341123,218964,468590,620294,928310,730274,604139,e=>{"use strict";var t=e.i(456420);let a={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};a.node;let n=(0,t.default)(a);e.s(["Camera",0,n],518515);let r={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};r.node;let l=(0,t.default)(r);e.s(["Eye",0,l],772382);let s={name:"file-pen",size:24,node:[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],aliases:["file-edit"]};s.node;let i=(0,t.default)(s);e.s(["FilePen",0,i],60744);let o={name:"id-card",size:24,node:[["path",{d:"M13 19a4 4 0 00-8 0",key:"cugzd5"}],["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]};o.node;let d=(0,t.default)(o);e.s(["IdCard",0,d],341123);let c={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};c.node;let u=(0,t.default)(c);e.s(["ListChecks",0,u],218964);let h={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};h.node;let p=(0,t.default)(h);e.s(["MessageSquare",0,p],468590);let m={name:"monitor-up",size:24,node:[["path",{d:"m9 10 3-3 3 3",key:"11gsxs"}],["path",{d:"M12 13V7",key:"h0r20n"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]};m.node;let f=(0,t.default)(m);e.s(["MonitorUp",0,f],620294);let g={name:"phone-off",size:24,node:[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]};g.node;let x=(0,t.default)(g);e.s(["PhoneOff",0,x],928310);let y={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};y.node;let k=(0,t.default)(y);e.s(["Send",0,k],730274);let _={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};_.node;let b=(0,t.default)(_);e.s(["Terminal",0,b],604139)},91511,e=>{"use strict";var t=e.i(456420);let a={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};a.node;let n=(0,t.default)(a);e.s(["Globe",0,n],91511)},815170,e=>{"use strict";var t=e.i(456420);let a={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};a.node;let n=(0,t.default)(a);e.s(["Image",0,n],815170)},758925,e=>{"use strict";var t=e.i(456420);let a={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};a.node;let n=(0,t.default)(a);e.s(["KeyRound",0,n],758925)},438583,e=>{"use strict";var t=e.i(456420);let a={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};a.node;let n=(0,t.default)(a);e.s(["Video",0,n],438583)},747925,e=>{"use strict";var t=e.i(456420);let a={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};a.node;let n=(0,t.default)(a);e.s(["Wrench",0,n],747925)}]);
@@ -1,2 +1,2 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),a=e.i(225913);e.i(271645);var r=e.i(647163);function s({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}e.i(652225);let i=(0,a.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:a="vertical",...s}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":a,className:(0,r.cn)(i({orientation:a}),e),...s})},"FieldContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,r.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...a})},"FieldLabel",0,function({className:e,...a}){return(0,t.jsx)(s,{"data-slot":"field-label",className:(0,r.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...a})}],986530)},556133,e=>{"use strict";var t=e.i(843476),a=e.i(401851),r=e.i(689664),s=e.i(867927),i=e.i(456420);let n={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};n.node;let l=(0,i.default)(n);var o=e.i(77071),d=e.i(759659),c=e.i(263676),u=e.i(271645),m=e.i(798120),h=e.i(167881),f=e.i(986530),x=e.i(23750),p=e.i(917162),g=e.i(671428),v=e.i(127341),j=e.i(184762),b=e.i(41533),y=e.i(968978),k=e.i(265402),N=e.i(670097),S=e.i(640262),w=e.i(96892);let C={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};C.node;let M=(0,i.default)(C);var z=e.i(716327),T=e.i(632781);let F={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};F.node;let A=(0,i.default)(F);var R=e.i(660302),L=e.i(146538),O=e.i(213377),E=e.i(647163);let I=new S.DefaultChatTransport({api:m.queryKey.memoryEdit});function $({notes:e}){let[a,r]=(0,u.useState)(""),[s,i]=(0,u.useState)({provider:null,model:""}),[n,l]=(0,u.useState)(!1),{messages:o,sendMessage:d,setMessages:c,status:m,stop:f,error:x,clearError:p}=(0,N.useChat)({transport:I}),g=(0,u.useRef)(f);g.current=f,(0,u.useEffect)(()=>()=>{g.current()},[]);let v=(0,u.useRef)(new Map);for(let t of e)for(let e of t.facts)v.current.set(e.id,{text:e.text,path:t.path});let j="submitted"===m||"streaming"===m,b=!!(s.provider&&s.model.trim()),k=[...o].reverse().find(e=>"assistant"===e.role),C=k?.parts??[],M=C.filter(S.isToolUIPart),T=C.flatMap(e=>"text"===e.type?[e.text]:[]).join(" ").trim(),F=!!x||M.some(e=>"output-error"===e.state),A=M.filter(e=>"output-available"===e.state&&(0,S.getToolName)(e)!==O.TOOL_NAMES.memory_recall).length;(0,u.useEffect)(()=>{if("ready"!==m||F||0===o.length)return;let e=setTimeout(()=>c([]),4e3);return()=>clearTimeout(e)},[m,F,o.length,c]);let P=j?(0,t.jsx)(R.ShinyText,{text:"Working on memory",className:"text-xs"}):x?(0,t.jsx)("span",{className:"text-xs text-destructive",children:x.message}):k?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:T||(0===A?"Nothing to change":1===A?"1 change saved":`${A} changes saved`)}):null;return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-18 z-10 flex justify-center px-8",children:(0,t.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-120 flex-col items-center gap-2",children:[n&&(0,t.jsx)("div",{className:"w-full rounded-xl bg-popover p-2 shadow-lg ring-1 ring-foreground/10",children:(0,t.jsx)(L.ModelPicker,{provider:s.provider,model:s.model,unset:"Provider",onChange:i})}),M.length>0&&(0,t.jsx)("ul",{className:"w-full divide-y divide-border/60 overflow-hidden rounded-xl bg-popover shadow-lg ring-1 ring-foreground/10",children:M.map(e=>(0,t.jsx)(B,{name:(0,S.getToolName)(e),input:e.input,state:e.state,errorText:"output-error"===e.state?e.errorText:void 0,known:v.current},e.toolCallId))}),P&&(0,t.jsx)("p",{className:"max-w-full truncate px-1",children:P}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=a.trim();t&&b&&!j&&(r(""),l(!1),p(),c([]),d({text:t},{body:{model:s}}))},className:"flex h-10 w-full items-center gap-1.5 rounded-xl bg-popover pr-1.5 pl-3.5 shadow-lg ring-1 ring-foreground/10",children:[(0,t.jsx)("input",{autoFocus:!0,value:a,onChange:e=>r(e.target.value),disabled:j,"aria-label":"Edit memory",placeholder:"Tell memory what changed",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:opacity-60"}),(0,t.jsxs)(h.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>l(!n),className:(0,E.cn)("max-w-44",!b&&"text-muted-foreground"),children:[b&&s.provider?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.ProviderIcon,{provider:s.provider,className:"size-3"}),(0,t.jsx)("span",{className:"truncate",children:s.model})]}):"Model",(0,t.jsx)(z.ChevronDown,{className:"text-muted-foreground"})]}),(0,t.jsx)(h.Button,{type:"submit",size:"icon-sm",loading:j,disabled:!a.trim()||!b||j,"aria-label":"Send",children:!j&&(0,t.jsx)(w.ArrowUp,{})})]})]})})}let P={Remember:o.Plus,Replace:l,Forget:A,Rename:l,Opened:M};function B({name:e,input:a,state:s,errorText:i,known:n}){let l=function(e,t,a){if(e===O.TOOL_NAMES.memory_recall)return{kind:"Opened",path:(t??{}).path??"",lines:[]};if(e===O.TOOL_NAMES.memory_describe){let e=t??{};return{kind:"Rename",path:e.path??"",lines:e.description?[{after:`“${e.description}”`}]:[]}}if(e===O.TOOL_NAMES.memory_forget){let e=((t??{}).factIds??[]).filter(e=>null!=e),r=e.map(e=>a.get(e));return{kind:"Forget",path:r.find(e=>e)?.path??"",lines:e.map((e,t)=>({before:r[t]?.text??`Fact #${e}`}))}}let r=t??{},s=r.path??"",i=(r.facts??[]).filter(e=>null!=e),n=i.map(e=>null!=e.replaces?{before:a.get(e.replaces)?.text??`Fact #${e.replaces}`,after:e.text}:{after:e.text});return e===O.TOOL_NAMES.memory_create&&r.description&&n.unshift({after:`“${r.description}”`}),{kind:i.some(e=>null!=e.replaces)?"Replace":"Remember",path:s,lines:n}}(e,a,n),o=P[l.kind],d="output-error"===s;return(0,t.jsxs)("li",{className:"flex animate-in items-start gap-2.5 px-3 py-2.5 duration-200 fade-in slide-in-from-bottom-1",children:[(0,t.jsx)(o,{className:"mt-1 size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[l.lines.map((e,a)=>(0,t.jsxs)("div",{children:[e.before&&(0,t.jsx)("p",{className:"text-[13px] leading-5 text-muted-foreground/60 line-through",children:e.before}),e.after&&(0,t.jsx)("p",{className:"text-sm leading-5 text-foreground/90",children:e.after})]},`${l.kind}-${a}`)),(0,t.jsxs)("p",{className:"pt-0.5 font-mono text-[11px] text-muted-foreground",children:[l.kind,l.path&&` \xb7 ${l.path}`]}),d&&i&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:i})]}),(0,t.jsx)("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:d?(0,t.jsx)(c.X,{className:"size-3.5 text-destructive"}):"output-available"===s?(0,t.jsx)(r.Check,{className:"size-3.5"}):(0,t.jsx)(T.Loader2,{className:"size-3.5 animate-spin"})})]})}var D=e.i(95187);let _=(0,D.createServerReference)("7f36ef65e0999e581019f3781598593e1adfca7e9f",D.callServer,void 0,D.findSourceMapURL,"addFactsAction"),K=(0,D.createServerReference)("7f809fadf05dfd1471be3deb91f50e730f88e052e2",D.callServer,void 0,D.findSourceMapURL,"createNoteAction"),U=(0,D.createServerReference)("7fe69846bef49475439ac13aeaba84c330f55581ff",D.callServer,void 0,D.findSourceMapURL,"deleteNoteAction"),q=(0,D.createServerReference)("7f573722a43fd1090aadde790cab56c124f87018c6",D.callServer,void 0,D.findSourceMapURL,"forgetFactAction"),V=(0,D.createServerReference)("7fa82e367938237be61dd9ea0fc9d471c03a34f351",D.callServer,void 0,D.findSourceMapURL,"reviseFactAction"),Y=(0,D.createServerReference)("7f8d038ee9171376dc45bd6395a34683e6c3072e84",D.callServer,void 0,D.findSourceMapURL,"updateNoteAction");var H=e.i(681307),W=e.i(245629);let X=H.z.enum(["user","call","bot"]);H.z.string().trim().min(1,"A note needs a line saying what it is about").max(b.MEMORY_LIMITS.descriptionChars,`A note's line is one line: at most ${b.MEMORY_LIMITS.descriptionChars} characters`);let G=H.z.object({id:H.z.number(),text:H.z.string(),source:X.nullish(),createdAt:W.DateLikeSchema});H.z.object({id:H.z.number(),path:H.z.string(),description:H.z.string(),ownedByUser:H.z.boolean(),hits:H.z.number(),lastReadAt:W.DateLikeSchema.nullable(),createdAt:W.DateLikeSchema,updatedAt:W.DateLikeSchema,factCount:H.z.number(),facts:G.array()});let Z=[{path:"profile",of:"The user themselves — name, age, what they do, where they live, whatever else says who they are"},{path:"preferences",of:"How they want things done, and said — read whole on every call, so a rule for a particular situation goes here too"},{path:"people/",of:"Someone in their life, and what matters about them"},{path:"projects/",of:"Something with an end — a trip, a purchase, a deadline, a thing being built"},{path:"topics/",of:"Something ongoing that keeps coming back"}],J=Z.filter(e=>!e.path.endsWith("/")).map(e=>e.path),Q=Z.filter(e=>e.path.endsWith("/")).map(e=>e.path.slice(0,-1));RegExp(`^(?:${J.join("|")}|(?:${Q.join("|")})/.+)$`);var ee=e.i(895836),et=e.i(319841),ea=e.i(609856),er=e.i(661504),es=e.i(283653);let ei=[{key:"you",label:"You"},{key:"people",label:"People"},{key:"projects",label:"Projects"},{key:"topics",label:"Topics"},{key:"other",label:"Other"}],en={onOk:()=>(0,es.revalidate)(m.queryKey.memory)},el=k.textModelProviderSchema.options.filter(e=>"chatgpt"!==e).slice(0,3);function eo(){return(0,t.jsx)("span",{className:"mr-0.5 flex items-center",children:el.map(e=>(0,t.jsx)("span",{className:"-ml-1.5 grid size-5 place-items-center rounded-full bg-background ring-1 ring-border first:ml-0",children:(0,t.jsx)(y.ProviderIcon,{provider:e,className:"size-3"})},e))})}function ed(e,t){return a=>{(0,et.composing)(a)||("Enter"===a.key&&(a.preventDefault(),e()),"Escape"===a.key&&(a.stopPropagation(),t()))}}function ec({note:e,open:a,onToggle:r}){var i;let n,o,c,m,f,[x,g]=(0,u.useState)(!1),[v,j]=(0,ea.useServerAction)(U,en),b=async()=>{await p.notify.confirm({title:`Forget ${e.path}?`,description:"Every fact in this note is deleted for good.",okText:"Delete",destructive:!0})&&v(e.id)},y=(0,t.jsx)("span",{className:"w-36 shrink-0 truncate text-sm font-medium",children:-1===(n=(i=e.path).indexOf("/"))?i:i.slice(n+1)});return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex h-12 items-center gap-3 pr-2 pl-4",children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.ChevronRight,{className:"size-3.5 shrink-0 rotate-90 text-muted-foreground"}),y,(0,t.jsx)(eu,{note:e,onDone:()=>g(!1)})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button","aria-expanded":a,onClick:r,className:(0,E.cn)("flex h-full min-w-0 flex-1 items-center gap-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",(o=e.path,!J.includes(o)&&.15>(c=(0,W.toDate)(e.lastReadAt??e.createdAt),m=Math.max(0,(Date.now()-c.getTime())/864e5),(e.hits+1)/(1+m))&&!a&&"opacity-55")),children:[(0,t.jsx)(s.ChevronRight,{className:(0,E.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",a&&"rotate-90")}),y,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-muted-foreground",children:e.description}),(0,t.jsxs)("span",{className:"w-16 shrink-0 text-right font-mono text-[11px] text-muted-foreground/70",children:[e.factCount," ",1===e.factCount?"fact":"facts"]}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] text-muted-foreground/50",title:e.lastReadAt?"Last read back":"Never read back",children:e.lastReadAt?(0,W.shortAgo)(e.lastReadAt):"—"})]}),(0,t.jsx)("span",{className:"flex w-15 shrink-0 justify-end",children:a&&(0,t.jsxs)(t.Fragment,{children:[(f=e.path,!J.includes(f)&&(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit the note's line",onClick:()=>g(!0),children:(0,t.jsx)(l,{})})),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this note",loading:j,onClick:b,children:!j&&(0,t.jsx)(d.Trash2,{})})]})})]})}),a&&(0,t.jsxs)("div",{className:"space-y-1 border-t border-border/60 bg-muted/40 py-2.5 pr-2 pl-10",children:[(0,t.jsx)(em,{noteId:e.id}),e.facts.map(a=>(0,t.jsx)(eh,{noteId:e.id,fact:a},a.id))]})]})}function eu({note:e,onDone:a}){let[s,i]=(0,u.useState)(e.description),[n,l]=(0,ea.useServerAction)(Y,{onOk:()=>{a(),(0,es.revalidate)(m.queryKey.memory)}}),o=()=>{let t=s.trim();if(!t||t===e.description)return a();n(e.id,{description:t})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Input,{autoFocus:!0,value:s,onChange:e=>i(e.target.value),onKeyDown:ed(o,a),"aria-label":"The note's line",placeholder:"One line Thursday sees in her list",maxLength:b.MEMORY_LIMITS.descriptionChars,className:"h-8 min-w-0 flex-1 text-[13px]"}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:l,onClick:o,children:!l&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:a,children:(0,t.jsx)(c.X,{})})]})}function em({noteId:e}){let[a,r]=(0,u.useState)(""),[s,i]=(0,ea.useServerAction)(_,{onOk:()=>{r(""),(0,es.revalidate)(m.queryKey.memory)}}),n=()=>{let t=a.trim();t&&!i&&s(e,[t])};return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pb-1",children:[(0,t.jsx)(x.Input,{value:a,onChange:e=>r(e.target.value),onKeyDown:ed(n,()=>r("")),"aria-label":"Add a fact",placeholder:"Add a fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,t.jsxs)(h.Button,{size:"sm",variant:"outline",loading:i,disabled:!a.trim(),onClick:n,children:[!i&&(0,t.jsx)(o.Plus,{}),"Add"]})]})}function eh({noteId:e,fact:s}){let i,[n,o]=(0,u.useState)(!1),[f,g]=(0,u.useState)(s.text),[v,j]=(0,ea.useServerAction)(V,{onOk:()=>{o(!1),(0,es.revalidate)(m.queryKey.memory)}}),[b,y]=(0,ea.useServerAction)(q,en),k=async()=>{await p.notify.confirm({title:"Forget this fact?",description:`"${s.text}" is deleted for good.`,okText:"Delete",destructive:!0})&&b(e,s.id)},N=()=>{let t=f.trim();if(!t||t===s.text)return o(!1);v(e,s.id,t)},S="user"===(i=s.source)?"you":"call"===i?"on a call":"bot"===i?"a bot":"";return(0,t.jsx)("div",{className:"flex min-h-10 items-center gap-1.5",children:n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Input,{autoFocus:!0,value:f,onChange:e=>g(e.target.value),onKeyDown:ed(N,()=>o(!1)),"aria-label":"Fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:j,onClick:N,children:!j&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>o(!1),children:(0,t.jsx)(c.X,{})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 pl-1 text-sm leading-relaxed text-foreground/90",children:s.text}),(0,t.jsxs)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground/50",children:[(0,a.format)(s.createdAt,"yyyy.MM.dd"),S&&` \xb7 ${S}`]}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit this fact",onClick:()=>{g(s.text),o(!0)},children:(0,t.jsx)(l,{})}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this fact",loading:y,onClick:()=>void k(),children:!y&&(0,t.jsx)(d.Trash2,{})})]})})}let ef=[{key:"people",label:"Person",placeholder:"jihoon",fact:"Moved to the platform team in March"},{key:"projects",label:"Project",placeholder:"thursday",fact:"Ships behind a feature flag until April"},{key:"topics",label:"Topic",placeholder:"scheduling",fact:"No meetings before 10am"}];function ex(){return p.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(ep,{onDone:e})})}function ep({onDone:e}){let[a,r]=(0,u.useState)("people"),[s,i]=(0,u.useState)(""),[n,l]=(0,u.useState)(""),[d,c]=(0,u.useState)(""),[p,g,,y]=(0,ea.useServerAction)(K,{errorMessage:!1,onOk:()=>{(0,es.revalidate)(m.queryKey.memory),e()}}),k=ef.find(e=>e.key===a),N=s.trim()&&n.trim()&&!g,S=()=>{N&&p(`${a}/${s.trim()}`,n.trim(),d.split("\n").map(e=>e.trim()).filter(Boolean))};return(0,t.jsxs)(ee.SettingDialogContent,{title:"New note",description:"Where Thursday keeps what she learns about this.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(h.Button,{disabled:!N,loading:g,onClick:S,children:[!g&&(0,t.jsx)(o.Plus,{}),"Create"]})]}),children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{children:"Kind"}),(0,t.jsx)(v.Tabs,{value:a,onValueChange:e=>r(e),children:(0,t.jsx)(v.TabsList,{className:"w-full",children:ef.map(e=>(0,t.jsx)(v.TabsTrigger,{value:e.key,children:e.label},e.key))})})]}),(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{htmlFor:"note-name",children:"Name"}),(0,t.jsxs)(f.FieldContent,{children:[(0,t.jsx)(x.Input,{id:"note-name",value:s,onChange:e=>i(e.target.value),placeholder:k?.placeholder,spellCheck:!1,required:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[a,"/",s.trim()||"…"]})]})]}),(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{htmlFor:"note-summary",children:"Summary"}),(0,t.jsx)(f.FieldContent,{children:(0,t.jsx)(x.Input,{id:"note-summary",value:n,onChange:e=>l(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||229===e.keyCode||"Enter"===e.key&&S()},placeholder:"One line Thursday sees in her list",maxLength:b.MEMORY_LIMITS.descriptionChars,required:!0})})]}),(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{htmlFor:"note-facts",children:"Facts"}),(0,t.jsx)(j.Textarea,{id:"note-facts",value:d,onChange:e=>c(e.target.value),placeholder:`One per line
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),a=e.i(225913);e.i(271645);var r=e.i(647163);function s({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}e.i(652225);let i=(0,a.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:a="vertical",...s}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":a,className:(0,r.cn)(i({orientation:a}),e),...s})},"FieldContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,r.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...a})},"FieldLabel",0,function({className:e,...a}){return(0,t.jsx)(s,{"data-slot":"field-label",className:(0,r.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...a})}],986530)},556133,e=>{"use strict";var t=e.i(843476),a=e.i(401851),r=e.i(689664),s=e.i(867927),i=e.i(456420);let n={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};n.node;let l=(0,i.default)(n);var o=e.i(77071),d=e.i(759659),c=e.i(263676),u=e.i(271645),m=e.i(798120),h=e.i(167881),f=e.i(986530),x=e.i(23750),p=e.i(917162),g=e.i(671428),v=e.i(127341),j=e.i(184762),b=e.i(41533),y=e.i(968978),k=e.i(265402),N=e.i(670097),S=e.i(640262),w=e.i(96892);let C={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};C.node;let M=(0,i.default)(C);var z=e.i(716327),T=e.i(632781);let F={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};F.node;let A=(0,i.default)(F);var R=e.i(660302),L=e.i(146538),O=e.i(213377),E=e.i(647163);let I=new S.DefaultChatTransport({api:m.queryKey.memoryEdit});function $({notes:e}){let[a,r]=(0,u.useState)(""),[s,i]=(0,u.useState)({provider:null,model:""}),[n,l]=(0,u.useState)(!1),{messages:o,sendMessage:d,setMessages:c,status:m,stop:f,error:x,clearError:p}=(0,N.useChat)({transport:I}),g=(0,u.useRef)(f);g.current=f,(0,u.useEffect)(()=>()=>{g.current()},[]);let v=(0,u.useRef)(new Map);for(let t of e)for(let e of t.facts)v.current.set(e.id,{text:e.text,path:t.path});let j="submitted"===m||"streaming"===m,b=!!(s.provider&&s.model.trim()),k=[...o].reverse().find(e=>"assistant"===e.role),C=k?.parts??[],M=C.filter(S.isToolUIPart),T=C.flatMap(e=>"text"===e.type?[e.text]:[]).join(" ").trim(),F=!!x||M.some(e=>"output-error"===e.state),A=M.filter(e=>"output-available"===e.state&&(0,S.getToolName)(e)!==O.TOOL_NAMES.memory_recall).length;(0,u.useEffect)(()=>{if("ready"!==m||F||0===o.length)return;let e=setTimeout(()=>c([]),4e3);return()=>clearTimeout(e)},[m,F,o.length,c]);let P=j?(0,t.jsx)(R.ShinyText,{text:"Working on memory",className:"text-xs"}):x?(0,t.jsx)("span",{className:"text-xs text-destructive",children:x.message}):k?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:T||(0===A?"Nothing to change":1===A?"1 change saved":`${A} changes saved`)}):null;return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-18 z-10 flex justify-center px-8",children:(0,t.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-120 flex-col items-center gap-2",children:[n&&(0,t.jsx)("div",{className:"w-full rounded-xl bg-popover p-2 shadow-lg ring-1 ring-foreground/10",children:(0,t.jsx)(L.ModelPicker,{provider:s.provider,model:s.model,unset:"Provider",onChange:i})}),M.length>0&&(0,t.jsx)("ul",{className:"w-full divide-y divide-border/60 overflow-hidden rounded-xl bg-popover shadow-lg ring-1 ring-foreground/10",children:M.map(e=>(0,t.jsx)(B,{name:(0,S.getToolName)(e),input:e.input,state:e.state,errorText:"output-error"===e.state?e.errorText:void 0,known:v.current},e.toolCallId))}),P&&(0,t.jsx)("p",{className:"max-w-full truncate px-1",children:P}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=a.trim();t&&b&&!j&&(r(""),l(!1),p(),c([]),d({text:t},{body:{model:s}}))},className:"flex h-10 w-full items-center gap-1.5 rounded-xl bg-popover pr-1.5 pl-3.5 shadow-lg ring-1 ring-foreground/10",children:[(0,t.jsx)("input",{autoFocus:!0,value:a,onChange:e=>r(e.target.value),disabled:j,"aria-label":"Edit memory",placeholder:"Tell memory what changed",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:opacity-60"}),(0,t.jsxs)(h.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>l(!n),className:(0,E.cn)("max-w-44",!b&&"text-muted-foreground"),children:[b&&s.provider?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.ProviderIcon,{provider:s.provider,className:"size-3"}),(0,t.jsx)("span",{className:"truncate",children:s.model})]}):"Model",(0,t.jsx)(z.ChevronDown,{className:"text-muted-foreground"})]}),(0,t.jsx)(h.Button,{type:"submit",size:"icon-sm",loading:j,disabled:!a.trim()||!b||j,"aria-label":"Send",children:!j&&(0,t.jsx)(w.ArrowUp,{})})]})]})})}let P={Remember:o.Plus,Replace:l,Forget:A,Rename:l,Opened:M};function B({name:e,input:a,state:s,errorText:i,known:n}){let l=function(e,t,a){if(e===O.TOOL_NAMES.memory_recall)return{kind:"Opened",path:(t??{}).path??"",lines:[]};if(e===O.TOOL_NAMES.memory_describe){let e=t??{};return{kind:"Rename",path:e.path??"",lines:e.description?[{after:`“${e.description}”`}]:[]}}if(e===O.TOOL_NAMES.memory_forget){let e=((t??{}).factIds??[]).filter(e=>null!=e),r=e.map(e=>a.get(e));return{kind:"Forget",path:r.find(e=>e)?.path??"",lines:e.map((e,t)=>({before:r[t]?.text??`Fact #${e}`}))}}let r=t??{},s=r.path??"",i=(r.facts??[]).filter(e=>null!=e),n=i.map(e=>null!=e.replaces?{before:a.get(e.replaces)?.text??`Fact #${e.replaces}`,after:e.text}:{after:e.text});return e===O.TOOL_NAMES.memory_create&&r.description&&n.unshift({after:`“${r.description}”`}),{kind:i.some(e=>null!=e.replaces)?"Replace":"Remember",path:s,lines:n}}(e,a,n),o=P[l.kind],d="output-error"===s;return(0,t.jsxs)("li",{className:"flex animate-in items-start gap-2.5 px-3 py-2.5 duration-200 fade-in slide-in-from-bottom-1",children:[(0,t.jsx)(o,{className:"mt-1 size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[l.lines.map((e,a)=>(0,t.jsxs)("div",{children:[e.before&&(0,t.jsx)("p",{className:"text-[13px] leading-5 text-muted-foreground/60 line-through",children:e.before}),e.after&&(0,t.jsx)("p",{className:"text-sm leading-5 text-foreground/90",children:e.after})]},`${l.kind}-${a}`)),(0,t.jsxs)("p",{className:"pt-0.5 font-mono text-[11px] text-muted-foreground",children:[l.kind,l.path&&` \xb7 ${l.path}`]}),d&&i&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:i})]}),(0,t.jsx)("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:d?(0,t.jsx)(c.X,{className:"size-3.5 text-destructive"}):"output-available"===s?(0,t.jsx)(r.Check,{className:"size-3.5"}):(0,t.jsx)(T.Loader2,{className:"size-3.5 animate-spin"})})]})}var D=e.i(95187);let _=(0,D.createServerReference)("7fc9ce111da41e854550d81d32040be514de06366a",D.callServer,void 0,D.findSourceMapURL,"addFactsAction"),K=(0,D.createServerReference)("7f2fc0f6577174ca8ef3955b0b5f9671954efec55a",D.callServer,void 0,D.findSourceMapURL,"createNoteAction"),U=(0,D.createServerReference)("7f80c8dd127a02226d22e682b03a84fd9519251004",D.callServer,void 0,D.findSourceMapURL,"deleteNoteAction"),q=(0,D.createServerReference)("7f9f8c21fd08fa9fabd5c917a315a90274cb0f49c0",D.callServer,void 0,D.findSourceMapURL,"forgetFactAction"),V=(0,D.createServerReference)("7f2eb399eb579824b1370715048ff178b0a8875b2e",D.callServer,void 0,D.findSourceMapURL,"reviseFactAction"),Y=(0,D.createServerReference)("7f73c45e7c56401b782e74a6d54385b56aa00f1001",D.callServer,void 0,D.findSourceMapURL,"updateNoteAction");var H=e.i(681307),W=e.i(245629);let X=H.z.enum(["user","call","bot"]);H.z.string().trim().min(1,"A note needs a line saying what it is about").max(b.MEMORY_LIMITS.descriptionChars,`A note's line is one line: at most ${b.MEMORY_LIMITS.descriptionChars} characters`);let G=H.z.object({id:H.z.number(),text:H.z.string(),source:X.nullish(),createdAt:W.DateLikeSchema});H.z.object({id:H.z.number(),path:H.z.string(),description:H.z.string(),ownedByUser:H.z.boolean(),hits:H.z.number(),lastReadAt:W.DateLikeSchema.nullable(),createdAt:W.DateLikeSchema,updatedAt:W.DateLikeSchema,factCount:H.z.number(),facts:G.array()});let Z=[{path:"profile",of:"The user themselves — name, age, what they do, where they live, whatever else says who they are"},{path:"preferences",of:"How they want things done, and said — read whole on every call, so a rule for a particular situation goes here too"},{path:"people/",of:"Someone in their life, and what matters about them"},{path:"projects/",of:"Something with an end — a trip, a purchase, a deadline, a thing being built"},{path:"topics/",of:"Something ongoing that keeps coming back"}],J=Z.filter(e=>!e.path.endsWith("/")).map(e=>e.path),Q=Z.filter(e=>e.path.endsWith("/")).map(e=>e.path.slice(0,-1));RegExp(`^(?:${J.join("|")}|(?:${Q.join("|")})/.+)$`);var ee=e.i(895836),et=e.i(319841),ea=e.i(609856),er=e.i(661504),es=e.i(283653);let ei=[{key:"you",label:"You"},{key:"people",label:"People"},{key:"projects",label:"Projects"},{key:"topics",label:"Topics"},{key:"other",label:"Other"}],en={onOk:()=>(0,es.revalidate)(m.queryKey.memory)},el=k.textModelProviderSchema.options.filter(e=>"chatgpt"!==e).slice(0,3);function eo(){return(0,t.jsx)("span",{className:"mr-0.5 flex items-center",children:el.map(e=>(0,t.jsx)("span",{className:"-ml-1.5 grid size-5 place-items-center rounded-full bg-background ring-1 ring-border first:ml-0",children:(0,t.jsx)(y.ProviderIcon,{provider:e,className:"size-3"})},e))})}function ed(e,t){return a=>{(0,et.composing)(a)||("Enter"===a.key&&(a.preventDefault(),e()),"Escape"===a.key&&(a.stopPropagation(),t()))}}function ec({note:e,open:a,onToggle:r}){var i;let n,o,c,m,f,[x,g]=(0,u.useState)(!1),[v,j]=(0,ea.useServerAction)(U,en),b=async()=>{await p.notify.confirm({title:`Forget ${e.path}?`,description:"Every fact in this note is deleted for good.",okText:"Delete",destructive:!0})&&v(e.id)},y=(0,t.jsx)("span",{className:"w-36 shrink-0 truncate text-sm font-medium",children:-1===(n=(i=e.path).indexOf("/"))?i:i.slice(n+1)});return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex h-12 items-center gap-3 pr-2 pl-4",children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.ChevronRight,{className:"size-3.5 shrink-0 rotate-90 text-muted-foreground"}),y,(0,t.jsx)(eu,{note:e,onDone:()=>g(!1)})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button","aria-expanded":a,onClick:r,className:(0,E.cn)("flex h-full min-w-0 flex-1 items-center gap-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",(o=e.path,!J.includes(o)&&.15>(c=(0,W.toDate)(e.lastReadAt??e.createdAt),m=Math.max(0,(Date.now()-c.getTime())/864e5),(e.hits+1)/(1+m))&&!a&&"opacity-55")),children:[(0,t.jsx)(s.ChevronRight,{className:(0,E.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",a&&"rotate-90")}),y,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-muted-foreground",children:e.description}),(0,t.jsxs)("span",{className:"w-16 shrink-0 text-right font-mono text-[11px] text-muted-foreground/70",children:[e.factCount," ",1===e.factCount?"fact":"facts"]}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] text-muted-foreground/50",title:e.lastReadAt?"Last read back":"Never read back",children:e.lastReadAt?(0,W.shortAgo)(e.lastReadAt):"—"})]}),(0,t.jsx)("span",{className:"flex w-15 shrink-0 justify-end",children:a&&(0,t.jsxs)(t.Fragment,{children:[(f=e.path,!J.includes(f)&&(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit the note's line",onClick:()=>g(!0),children:(0,t.jsx)(l,{})})),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this note",loading:j,onClick:b,children:!j&&(0,t.jsx)(d.Trash2,{})})]})})]})}),a&&(0,t.jsxs)("div",{className:"space-y-1 border-t border-border/60 bg-muted/40 py-2.5 pr-2 pl-10",children:[(0,t.jsx)(em,{noteId:e.id}),e.facts.map(a=>(0,t.jsx)(eh,{noteId:e.id,fact:a},a.id))]})]})}function eu({note:e,onDone:a}){let[s,i]=(0,u.useState)(e.description),[n,l]=(0,ea.useServerAction)(Y,{onOk:()=>{a(),(0,es.revalidate)(m.queryKey.memory)}}),o=()=>{let t=s.trim();if(!t||t===e.description)return a();n(e.id,{description:t})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Input,{autoFocus:!0,value:s,onChange:e=>i(e.target.value),onKeyDown:ed(o,a),"aria-label":"The note's line",placeholder:"One line Thursday sees in her list",maxLength:b.MEMORY_LIMITS.descriptionChars,className:"h-8 min-w-0 flex-1 text-[13px]"}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:l,onClick:o,children:!l&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:a,children:(0,t.jsx)(c.X,{})})]})}function em({noteId:e}){let[a,r]=(0,u.useState)(""),[s,i]=(0,ea.useServerAction)(_,{onOk:()=>{r(""),(0,es.revalidate)(m.queryKey.memory)}}),n=()=>{let t=a.trim();t&&!i&&s(e,[t])};return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pb-1",children:[(0,t.jsx)(x.Input,{value:a,onChange:e=>r(e.target.value),onKeyDown:ed(n,()=>r("")),"aria-label":"Add a fact",placeholder:"Add a fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,t.jsxs)(h.Button,{size:"sm",variant:"outline",loading:i,disabled:!a.trim(),onClick:n,children:[!i&&(0,t.jsx)(o.Plus,{}),"Add"]})]})}function eh({noteId:e,fact:s}){let i,[n,o]=(0,u.useState)(!1),[f,g]=(0,u.useState)(s.text),[v,j]=(0,ea.useServerAction)(V,{onOk:()=>{o(!1),(0,es.revalidate)(m.queryKey.memory)}}),[b,y]=(0,ea.useServerAction)(q,en),k=async()=>{await p.notify.confirm({title:"Forget this fact?",description:`"${s.text}" is deleted for good.`,okText:"Delete",destructive:!0})&&b(e,s.id)},N=()=>{let t=f.trim();if(!t||t===s.text)return o(!1);v(e,s.id,t)},S="user"===(i=s.source)?"you":"call"===i?"on a call":"bot"===i?"a bot":"";return(0,t.jsx)("div",{className:"flex min-h-10 items-center gap-1.5",children:n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Input,{autoFocus:!0,value:f,onChange:e=>g(e.target.value),onKeyDown:ed(N,()=>o(!1)),"aria-label":"Fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:j,onClick:N,children:!j&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>o(!1),children:(0,t.jsx)(c.X,{})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 pl-1 text-sm leading-relaxed text-foreground/90",children:s.text}),(0,t.jsxs)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground/50",children:[(0,a.format)(s.createdAt,"yyyy.MM.dd"),S&&` \xb7 ${S}`]}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit this fact",onClick:()=>{g(s.text),o(!0)},children:(0,t.jsx)(l,{})}),(0,t.jsx)(h.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this fact",loading:y,onClick:()=>void k(),children:!y&&(0,t.jsx)(d.Trash2,{})})]})})}let ef=[{key:"people",label:"Person",placeholder:"jihoon",fact:"Moved to the platform team in March"},{key:"projects",label:"Project",placeholder:"thursday",fact:"Ships behind a feature flag until April"},{key:"topics",label:"Topic",placeholder:"scheduling",fact:"No meetings before 10am"}];function ex(){return p.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(ep,{onDone:e})})}function ep({onDone:e}){let[a,r]=(0,u.useState)("people"),[s,i]=(0,u.useState)(""),[n,l]=(0,u.useState)(""),[d,c]=(0,u.useState)(""),[p,g,,y]=(0,ea.useServerAction)(K,{errorMessage:!1,onOk:()=>{(0,es.revalidate)(m.queryKey.memory),e()}}),k=ef.find(e=>e.key===a),N=s.trim()&&n.trim()&&!g,S=()=>{N&&p(`${a}/${s.trim()}`,n.trim(),d.split("\n").map(e=>e.trim()).filter(Boolean))};return(0,t.jsxs)(ee.SettingDialogContent,{title:"New note",description:"Where Thursday keeps what she learns about this.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(h.Button,{disabled:!N,loading:g,onClick:S,children:[!g&&(0,t.jsx)(o.Plus,{}),"Create"]})]}),children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{children:"Kind"}),(0,t.jsx)(v.Tabs,{value:a,onValueChange:e=>r(e),children:(0,t.jsx)(v.TabsList,{className:"w-full",children:ef.map(e=>(0,t.jsx)(v.TabsTrigger,{value:e.key,children:e.label},e.key))})})]}),(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{htmlFor:"note-name",children:"Name"}),(0,t.jsxs)(f.FieldContent,{children:[(0,t.jsx)(x.Input,{id:"note-name",value:s,onChange:e=>i(e.target.value),placeholder:k?.placeholder,spellCheck:!1,required:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[a,"/",s.trim()||"…"]})]})]}),(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{htmlFor:"note-summary",children:"Summary"}),(0,t.jsx)(f.FieldContent,{children:(0,t.jsx)(x.Input,{id:"note-summary",value:n,onChange:e=>l(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||229===e.keyCode||"Enter"===e.key&&S()},placeholder:"One line Thursday sees in her list",maxLength:b.MEMORY_LIMITS.descriptionChars,required:!0})})]}),(0,t.jsxs)(f.Field,{children:[(0,t.jsx)(f.FieldLabel,{htmlFor:"note-facts",children:"Facts"}),(0,t.jsx)(j.Textarea,{id:"note-facts",value:d,onChange:e=>c(e.target.value),placeholder:`One per line
2
2
  ${k?.fact??""}`,className:"min-h-24 resize-none text-sm"})]})]}),y&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:y})]})}e.s(["MemorySetting",0,function(){let{items:e,isLoading:a,isLoadingMore:r,error:s,hasMore:i,sentinelRef:n}=(0,er.useServerPages)({key:e=>m.queryKey.memoryPage(e*b.PAGE_SIZE)}),[l,d]=(0,u.useState)(""),[c,f]=(0,u.useState)(new Set),[x,p]=(0,u.useState)(!1);if(a)return(0,t.jsx)(ee.SettingSkeleton,{});if(s)return(0,t.jsx)(ee.SettingError,{message:s.message});let v=l.trim().toLowerCase(),j=v?e.filter(e=>[e.path,e.description,...e.facts.map(e=>e.text)].some(e=>e.toLowerCase().includes(v))):e,y=e.reduce((e,t)=>e+t.factCount,0),k=i?"+":"";return(0,t.jsxs)("div",{className:"relative h-full min-h-0",children:[(0,t.jsxs)(ee.SettingScreen,{footer:(0,t.jsxs)(h.Button,{size:"sm",variant:x?"secondary":"ghost","aria-pressed":x,onClick:()=>p(!x),children:[(0,t.jsx)(eo,{}),"Edit with a model"]}),children:[(0,t.jsx)(ee.SettingToolbar,{count:(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[`${e.length}${k} notes \xb7 ${y}${k} facts`,(0,t.jsxs)(h.Button,{size:"sm",variant:"outline",className:"font-sans",onClick:ex,children:[(0,t.jsx)(o.Plus,{}),"New note"]})]}),children:(0,t.jsx)(ee.SettingFilter,{value:l,onChange:d,placeholder:"Filter memory"})}),v&&0===j.length&&(0,t.jsx)("p",{className:"px-1 text-xs text-muted-foreground/60",children:"Nothing matches"}),ei.map(({key:e,label:a})=>{let r=j.filter(t=>(function(e){if(J.includes(e))return"you";let t=e.slice(0,e.indexOf("/"));return Q.includes(t)?t:"other"})(t.path)===e);return 0===r.length?null:(0,t.jsx)(ee.SettingGroup,{label:a,children:(0,t.jsx)(ee.SettingItems,{children:r.map(e=>(0,t.jsx)(ec,{note:e,open:c.has(e.id)!==!!v,onToggle:()=>{let t;return t=e.id,f(e=>{let a=new Set(e);return a.delete(t)||a.add(t),a})}},e.id))})},e)}),(0,t.jsx)(ee.SettingMore,{hasMore:i,loading:r,sentinelRef:n,ghost:(0,t.jsxs)("div",{className:"flex h-12 items-center gap-3 px-4",children:[(0,t.jsx)(g.Skeleton,{className:"h-3 w-24"}),(0,t.jsx)(g.Skeleton,{className:"h-3 w-56"})]})})]}),x&&(0,t.jsx)($,{notes:e})]})}],556133)},759659,e=>{"use strict";var t=e.i(456420);let a={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"]};a.node;let r=(0,t.default)(a);e.s(["Trash2",0,r],759659)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),s=e.i(225913);e.i(271645);var i=e.i(647163);function n({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}e.i(652225);let l=(0,s.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:s="vertical",...n}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":s,className:(0,i.cn)(l({orientation:s}),e),...n})},"FieldContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,i.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...s})},"FieldLabel",0,function({className:e,...s}){return(0,t.jsx)(n,{"data-slot":"field-label",className:(0,i.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...s})}],986530)},833959,e=>{"use strict";var t=e.i(843476),s=e.i(437750),i=e.i(856539),n=e.i(24071),l=e.i(867927),r=e.i(829600),a=e.i(226091),o=e.i(726067),d=e.i(456420);let c={name:"frame",size:24,node:[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]};c.node;let u=(0,d.default)(c);var m=e.i(91511),x=e.i(77071),f=e.i(566595);let h={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};h.node;let p=(0,d.default)(h);var g=e.i(759659);let v={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};v.node;let b=(0,d.default)(v);var k=e.i(271645),j=e.i(798120),y=e.i(167881),w=e.i(986530),N=e.i(23750),S=e.i(683408),z=e.i(917162),C=e.i(671428),L=e.i(319036),F=e.i(127341),M=e.i(184762),R=e.i(41533),T=e.i(895836),$=e.i(95187);let D=(0,$.createServerReference)("7fcdc18a9f0d21580596814819ed96e5b21d51494e",$.callServer,void 0,$.findSourceMapURL,"createSkillAction"),A=(0,$.createServerReference)("7f5cbe350c8d9bd6c9c4dbee26eacf1334826465f0",$.callServer,void 0,$.findSourceMapURL,"deleteSkillAction"),B=(0,$.createServerReference)("7fde1c1c825a89c4b52db4c593ab94774fbeea596e",$.callServer,void 0,$.findSourceMapURL,"setSkillDisabledAction"),q=(0,$.createServerReference)("7fe83132401dc1d8c2bf42a8ebbb4707ed624e3441",$.callServer,void 0,$.findSourceMapURL,"uploadSkillAction"),I=(0,$.createServerReference)("7f5a2a5e91c96d99bc5f00673531bf65d0eaa2dd86",$.callServer,void 0,$.findSourceMapURL,"writeSkillFileAction");var K=e.i(681307);K.z.union([K.z.enum(["custom","default"]),K.z.templateLiteral(["kit:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)]),K.z.templateLiteral(["own:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)])]);let E=e=>"custom"===e||e.startsWith("own:"),U=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long").regex(/^[a-z0-9][a-z0-9_-]*$/i,"Use letters, numbers, dashes and underscores only"),O=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long");K.z.object({name:O,description:K.z.string().trim().min(1,"Description is required"),metadata:K.z.record(K.z.string(),K.z.unknown()).optional(),disabled:K.z.boolean().optional(),platforms:K.z.array(K.z.string()).optional()}).extend({name:U,content:K.z.string().trim().min(1,"Content is required")});var P=e.i(609856),W=e.i(283653),_=e.i(647163);let H={artifact:u,browser:m.Globe,computer:s.AppWindow,"find-skills":f.Search,"skill-creator":p};function V({skill:e}){let[s,n]=(0,P.useServerAction)(A,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),[r]=(0,P.useServerAction)(B,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),a=async()=>{await z.notify.confirm({title:`Delete ${e.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&s(e.source,e.dir)},o="default"===e.source&&H[e.dir]||i.BookMarked;return(0,t.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var s;return s=e,z.notify.component({className:"sm:max-w-4xl",renderer:({guard:e})=>(0,t.jsx)(G,{skill:s,guard:e})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:(0,_.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",e.disabled&&"opacity-45"),children:(0,t.jsx)(o,{className:"size-4"})}),(0,t.jsxs)("span",{className:(0,_.cn)("min-w-0 flex-1 space-y-0.5",e.disabled&&"opacity-45"),children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description.trim().split(/(?<=[.。])\s|\n/)[0].trim()})]}),(0,t.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,t.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,t.jsx)(L.Switch,{checked:!e.disabled,onCheckedChange:t=>r(e.source,e.dir,!t),"aria-label":`${e.name} on or off`,className:"shrink-0"}),E(e.source)?(0,t.jsx)(y.Button,{size:"icon-sm",variant:"ghost",loading:n,onClick:a,"aria-label":`Delete ${e.name}`,className:"shrink-0 text-muted-foreground",children:(0,t.jsx)(g.Trash2,{})}):(0,t.jsx)("span",{className:"size-7 shrink-0"})]})]})}function G({skill:e,guard:s}){let[i,l]=(0,k.useState)(""),[r,a]=(0,k.useState)("SKILL.md"),o=(0,k.useRef)(!1);(0,k.useEffect)(()=>s(()=>o.current),[s]);let d=async e=>{let t=i?`${i}/${e.name}`:e.name;"dir"===e.kind?l(t):t===r||(!o.current||await z.notify.confirm({title:"Discard your changes?",description:`What you wrote in ${r?.split("/").pop()} is not saved.`,okText:"Discard",destructive:!0}))&&(o.current=!1,a(t))};return(0,t.jsx)(T.SettingDialogContent,{title:e.name,description:(0,t.jsx)(Y,{skill:e,path:r??i}),children:(0,t.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,t.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[i&&(0,t.jsxs)("button",{type:"button",onClick:()=>l(i.split("/").slice(0,-1).join("/")),className:"mx-1 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i.split("/").pop()})]}),(0,t.jsx)(J,{source:e.source,dir:e.dir,path:i,current:r,onPick:d})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r?(0,t.jsx)(X,{source:e.source,dir:e.dir,path:r,editable:E(e.source),onUnsaved:e=>{o.current=e}},r):(0,t.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function Y({skill:e,path:s}){if(!e)return(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let i=[e.name,...s.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:i.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,_.cn)("truncate",s===i.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}function Z({icon:e,label:s,active:i,hasChildren:n,onClick:r}){return(0,t.jsxs)("button",{type:"button",onClick:r,className:(0,_.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",i?T.PICKED_ROW:"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:e}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),n&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function J({source:e,dir:s,path:i,current:n,onPick:l}){let{data:d,isLoading:c,error:u}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i));return u?(0,t.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:u.message}):c||!d?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==d.kind?null:(0,t.jsxs)(t.Fragment,{children:[d.entries.map(e=>(0,t.jsx)(Z,{icon:"dir"===e.kind?(0,t.jsx)(o.Folder,{}):e.name.endsWith(".md")?(0,t.jsx)(a.FileText,{}):(0,t.jsx)(r.File,{}),label:e.name,hasChildren:"dir"===e.kind,active:(i?`${i}/${e.name}`:e.name)===n,onClick:()=>l(e)},e.name)),0===d.entries.length&&(0,t.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function Q({content:e,description:s}){let i=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e),n=s?.trim(),l=i?e.slice(i[0].length):e;return(0,t.jsxs)("div",{className:"min-w-0",children:[n&&(0,t.jsx)("p",{className:"border-b border-border/60 px-5 py-3 text-[13px] leading-relaxed text-muted-foreground",children:n}),(0,t.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,t.jsx)(S.Markdown,{children:l})})]})}function X({source:e,dir:s,path:i,editable:n,onUnsaved:l}){let[r,a]=(0,k.useState)(null),{data:o,isLoading:d,error:c}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i)),u=null!==r&&(o?.kind!=="file"||r!==o.content);(0,k.useEffect)(()=>l?.(u),[u,l]);let[m,x]=(0,P.useServerAction)(I,{okMessage:"Saved",onOk:()=>{a(null),(0,W.revalidate)(j.queryKey.skills)}});if(c)return(0,t.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:c.message});if(d||!o)return(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==o.kind)return null;let f=i.split("/").pop()??"";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,t.jsx)("span",{className:"truncate",children:f}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("span",{children:(0,_.formatBytes)(o.size)}),n&&null!==o.content&&null===r&&(0,t.jsxs)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(o.content??""),children:[(0,t.jsx)(p,{}),"Edit"]}),null!==r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(null),children:"Cancel"}),(0,t.jsx)(y.Button,{size:"xs",className:"font-mono",loading:x,disabled:r===o.content,onClick:()=>m(e,s,i,r),children:"Save"})]})]})]}),null!==r?(0,t.jsx)(M.Textarea,{value:r,onChange:e=>a(e.target.value),spellCheck:!1,"aria-label":`${f} contents`,className:"min-h-120 resize-none rounded-none border-0 font-mono text-[13px] leading-relaxed shadow-none focus-visible:ring-0"}):null===o.content?(0,t.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:o.size>R.SKILL_FILES.inlineBytes?"Too long to show here — a bot still reads it from disk.":"Not a text file — a bot can still read it from disk."}):f.toLowerCase().endsWith(".md")?(0,t.jsx)(Q,{content:o.content,description:o.description}):(0,t.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:o.content})]})}function ee(){return z.notify.component({className:"sm:max-w-lg",renderer:({close:e,guard:s})=>(0,t.jsx)(et,{onDone:e,guard:s})})}function et({onDone:e,guard:s}){let[i,n]=(0,k.useState)("write"),[l,r]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),[d,c]=(0,k.useState)(""),[u,m]=(0,k.useState)(null),[f,h]=(0,k.useState)(!1),p=(0,k.useRef)(null),g=(0,k.useRef)(!1);g.current=!!(l.trim()||a.trim()||d.trim()||u),(0,k.useEffect)(()=>s(()=>g.current),[s]);let v={errorMessage:!1,onOk:()=>{(0,W.revalidate)(j.queryKey.skills),e()}},[S,z,,C]=(0,P.useServerAction)(D,v),[L,$,,A]=(0,P.useServerAction)(q,v),B=z||$,I="write"===i?C:A,K=null!==u&&u.size>R.SKILL_FILES.uploadBytes,E=Math.round(R.SKILL_FILES.uploadBytes/1024/1024),U=!B&&("write"===i?l.trim()&&a.trim()&&d.trim():null!==u&&!K),O=async()=>{if(!U)return;if("write"===i)return void S({name:l.trim(),description:a.trim(),content:d});if(!u)return;let e=new FormData;e.append("file",u),L(e)},H=e=>{let t=e?.[0]??null;t&&m(t)};return(0,t.jsxs)(T.SettingDialogContent,{title:"New skill",description:"Instructions a bot reads when a job calls for them.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(y.Button,{disabled:!U,loading:B,onClick:O,children:[!B&&("write"===i?(0,t.jsx)(x.Plus,{}):(0,t.jsx)(b,{})),"write"===i?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:i,onValueChange:e=>n(e),children:[(0,t.jsxs)(F.TabsList,{className:"w-full",children:[(0,t.jsx)(F.TabsTrigger,{value:"write",children:"Write"}),(0,t.jsx)(F.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,t.jsxs)(F.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,t.jsxs)(w.FieldContent,{children:[(0,t.jsx)(N.Input,{id:"skill-name",value:l,onChange:e=>r(e.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[R.PATHS.skills.custom,"/",l.trim()||"…","/SKILL.md"]})]})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,t.jsx)(w.FieldContent,{children:(0,t.jsx)(N.Input,{id:"skill-description",value:a,onChange:e=>o(e.target.value),placeholder:"What it does, then when to use it — a bot reads this to decide"})})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,t.jsx)(M.Textarea,{id:"skill-content",value:d,onChange:e=>c(e.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,t.jsxs)(F.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:e=>{e.preventDefault(),h(!1),H(e.dataTransfer.files)},className:(0,_.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",f?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,t.jsx)(b,{className:"size-5 text-muted-foreground"}),u?(0,t.jsxs)("span",{className:"text-sm",children:[u.name,(0,t.jsxs)("span",{className:(0,_.cn)("ml-2 font-mono text-[11px]",K?"text-destructive":"text-muted-foreground"),children:[(0,_.formatBytes)(u.size),K&&` \xb7 over ${E} MB`]})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,t.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>H(e.target.files)}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,t.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]}),(0,t.jsxs)("p",{children:["Up to ",E," MB."]})]})]})]}),I&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:I})]})}e.s(["SkillsSetting",0,function(){let[e,s]=(0,k.useState)(""),{data:i,isLoading:n,error:l}=(0,W.useServerRoute)(j.queryKey.skills),r=i??[];if(n)return(0,t.jsx)(T.SettingSkeleton,{rows:4});if(l)return(0,t.jsx)(T.SettingError,{message:l.message});let a=e.trim().toLowerCase(),o=r.filter(e=>!a||`${e.name} ${e.description}`.toLowerCase().includes(a)),d=r.filter(e=>!e.disabled).length,c=r.filter(e=>!e.disabled&&("default"===e.source||"custom"===e.source)).length,u=new Map;for(let e of o)e.bot&&u.set(e.bot,[...u.get(e.bot)??[],e]);return(0,t.jsxs)(T.SettingScreen,{footer:(0,t.jsxs)(T.SettingRailNote,{children:[r.filter(e=>!E(e.source)).length," ","shipped ·"," ",r.filter(e=>E(e.source)).length," ","installed"]}),children:[(0,t.jsx)(T.SettingToolbar,{count:`${d} on \xb7 ${r.length-d} off`,children:(0,t.jsx)(T.SettingFilter,{value:e,onChange:s,placeholder:"Filter skills"})}),(0,t.jsx)(T.SettingGroup,{label:"Custom",hint:"yours — added here · a Default skill of the same name wins",children:(0,t.jsx)(T.SettingItems,{addRow:{label:"Add skill",onClick:ee},children:o.filter(e=>"custom"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`custom/${e.dir}`))})}),[...u].map(([e,s])=>(0,t.jsx)(T.SettingGroup,{label:`${e}'s own`,hint:`only ${e} reads these \xb7 what it found or wrote can be edited or deleted`,children:(0,t.jsx)(T.SettingItems,{children:s.map(e=>(0,t.jsx)(V,{skill:e},`${e.source}/${e.dir}`))})},e)),(0,t.jsx)(T.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,t.jsx)(T.SettingItems,{children:o.filter(e=>"default"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`default/${e.dir}`))})}),c>R.PROMPT_CROWDED.skills&&(0,t.jsxs)(T.SettingNote,{children:[c," skills are on for every bot. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})}],833959)},437750,e=>{"use strict";var t=e.i(456420);let s={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};s.node;let i=(0,t.default)(s);e.s(["AppWindow",0,i],437750)},726067,e=>{"use strict";var t=e.i(456420);let s={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};s.node;let i=(0,t.default)(s);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let s={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"]};s.node;let i=(0,t.default)(s);e.s(["Trash2",0,i],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),s=e.i(225913);e.i(271645);var i=e.i(647163);function n({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}e.i(652225);let l=(0,s.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:s="vertical",...n}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":s,className:(0,i.cn)(l({orientation:s}),e),...n})},"FieldContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,i.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...s})},"FieldLabel",0,function({className:e,...s}){return(0,t.jsx)(n,{"data-slot":"field-label",className:(0,i.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...s})}],986530)},833959,e=>{"use strict";var t=e.i(843476),s=e.i(437750),i=e.i(856539),n=e.i(24071),l=e.i(867927),r=e.i(829600),a=e.i(226091),o=e.i(726067),d=e.i(456420);let c={name:"frame",size:24,node:[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]};c.node;let u=(0,d.default)(c);var m=e.i(91511),x=e.i(77071),f=e.i(566595);let h={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};h.node;let p=(0,d.default)(h);var g=e.i(759659);let v={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};v.node;let b=(0,d.default)(v);var k=e.i(271645),j=e.i(798120),y=e.i(167881),w=e.i(986530),N=e.i(23750),S=e.i(683408),z=e.i(917162),C=e.i(671428),L=e.i(319036),F=e.i(127341),M=e.i(184762),R=e.i(41533),T=e.i(895836),$=e.i(95187);let D=(0,$.createServerReference)("7f713f3f9da1b4c12d01c01af85ff92a631f20aaea",$.callServer,void 0,$.findSourceMapURL,"createSkillAction"),A=(0,$.createServerReference)("7f2b5a2f6ca913bee0bd69084279ffadf31abf601d",$.callServer,void 0,$.findSourceMapURL,"deleteSkillAction"),B=(0,$.createServerReference)("7fc60a0e134ab56c08dfb7fd65ecef0b34c5701a6f",$.callServer,void 0,$.findSourceMapURL,"setSkillDisabledAction"),q=(0,$.createServerReference)("7f1de3baef5627e68ea692f0ed9b847d5812e29d0a",$.callServer,void 0,$.findSourceMapURL,"uploadSkillAction"),I=(0,$.createServerReference)("7ff78c9560983ead182b7c210b8e6e88d26ff5e043",$.callServer,void 0,$.findSourceMapURL,"writeSkillFileAction");var K=e.i(681307);K.z.union([K.z.enum(["custom","default"]),K.z.templateLiteral(["kit:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)]),K.z.templateLiteral(["own:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)])]);let E=e=>"custom"===e||e.startsWith("own:"),U=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long").regex(/^[a-z0-9][a-z0-9_-]*$/i,"Use letters, numbers, dashes and underscores only"),O=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long");K.z.object({name:O,description:K.z.string().trim().min(1,"Description is required"),metadata:K.z.record(K.z.string(),K.z.unknown()).optional(),disabled:K.z.boolean().optional(),platforms:K.z.array(K.z.string()).optional()}).extend({name:U,content:K.z.string().trim().min(1,"Content is required")});var P=e.i(609856),W=e.i(283653),_=e.i(647163);let H={artifact:u,browser:m.Globe,computer:s.AppWindow,"find-skills":f.Search,"skill-creator":p};function V({skill:e}){let[s,n]=(0,P.useServerAction)(A,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),[r]=(0,P.useServerAction)(B,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),a=async()=>{await z.notify.confirm({title:`Delete ${e.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&s(e.source,e.dir)},o="default"===e.source&&H[e.dir]||i.BookMarked;return(0,t.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var s;return s=e,z.notify.component({className:"sm:max-w-4xl",renderer:({guard:e})=>(0,t.jsx)(G,{skill:s,guard:e})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:(0,_.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",e.disabled&&"opacity-45"),children:(0,t.jsx)(o,{className:"size-4"})}),(0,t.jsxs)("span",{className:(0,_.cn)("min-w-0 flex-1 space-y-0.5",e.disabled&&"opacity-45"),children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description.trim().split(/(?<=[.。])\s|\n/)[0].trim()})]}),(0,t.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,t.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,t.jsx)(L.Switch,{checked:!e.disabled,onCheckedChange:t=>r(e.source,e.dir,!t),"aria-label":`${e.name} on or off`,className:"shrink-0"}),E(e.source)?(0,t.jsx)(y.Button,{size:"icon-sm",variant:"ghost",loading:n,onClick:a,"aria-label":`Delete ${e.name}`,className:"shrink-0 text-muted-foreground",children:(0,t.jsx)(g.Trash2,{})}):(0,t.jsx)("span",{className:"size-7 shrink-0"})]})]})}function G({skill:e,guard:s}){let[i,l]=(0,k.useState)(""),[r,a]=(0,k.useState)("SKILL.md"),o=(0,k.useRef)(!1);(0,k.useEffect)(()=>s(()=>o.current),[s]);let d=async e=>{let t=i?`${i}/${e.name}`:e.name;"dir"===e.kind?l(t):t===r||(!o.current||await z.notify.confirm({title:"Discard your changes?",description:`What you wrote in ${r?.split("/").pop()} is not saved.`,okText:"Discard",destructive:!0}))&&(o.current=!1,a(t))};return(0,t.jsx)(T.SettingDialogContent,{title:e.name,description:(0,t.jsx)(Y,{skill:e,path:r??i}),children:(0,t.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,t.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[i&&(0,t.jsxs)("button",{type:"button",onClick:()=>l(i.split("/").slice(0,-1).join("/")),className:"mx-1 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i.split("/").pop()})]}),(0,t.jsx)(J,{source:e.source,dir:e.dir,path:i,current:r,onPick:d})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r?(0,t.jsx)(X,{source:e.source,dir:e.dir,path:r,editable:E(e.source),onUnsaved:e=>{o.current=e}},r):(0,t.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function Y({skill:e,path:s}){if(!e)return(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let i=[e.name,...s.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:i.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,_.cn)("truncate",s===i.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}function Z({icon:e,label:s,active:i,hasChildren:n,onClick:r}){return(0,t.jsxs)("button",{type:"button",onClick:r,className:(0,_.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",i?T.PICKED_ROW:"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:e}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),n&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function J({source:e,dir:s,path:i,current:n,onPick:l}){let{data:d,isLoading:c,error:u}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i));return u?(0,t.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:u.message}):c||!d?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==d.kind?null:(0,t.jsxs)(t.Fragment,{children:[d.entries.map(e=>(0,t.jsx)(Z,{icon:"dir"===e.kind?(0,t.jsx)(o.Folder,{}):e.name.endsWith(".md")?(0,t.jsx)(a.FileText,{}):(0,t.jsx)(r.File,{}),label:e.name,hasChildren:"dir"===e.kind,active:(i?`${i}/${e.name}`:e.name)===n,onClick:()=>l(e)},e.name)),0===d.entries.length&&(0,t.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function Q({content:e,description:s}){let i=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e),n=s?.trim(),l=i?e.slice(i[0].length):e;return(0,t.jsxs)("div",{className:"min-w-0",children:[n&&(0,t.jsx)("p",{className:"border-b border-border/60 px-5 py-3 text-[13px] leading-relaxed text-muted-foreground",children:n}),(0,t.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,t.jsx)(S.Markdown,{children:l})})]})}function X({source:e,dir:s,path:i,editable:n,onUnsaved:l}){let[r,a]=(0,k.useState)(null),{data:o,isLoading:d,error:c}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i)),u=null!==r&&(o?.kind!=="file"||r!==o.content);(0,k.useEffect)(()=>l?.(u),[u,l]);let[m,x]=(0,P.useServerAction)(I,{okMessage:"Saved",onOk:()=>{a(null),(0,W.revalidate)(j.queryKey.skills)}});if(c)return(0,t.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:c.message});if(d||!o)return(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==o.kind)return null;let f=i.split("/").pop()??"";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,t.jsx)("span",{className:"truncate",children:f}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("span",{children:(0,_.formatBytes)(o.size)}),n&&null!==o.content&&null===r&&(0,t.jsxs)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(o.content??""),children:[(0,t.jsx)(p,{}),"Edit"]}),null!==r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(null),children:"Cancel"}),(0,t.jsx)(y.Button,{size:"xs",className:"font-mono",loading:x,disabled:r===o.content,onClick:()=>m(e,s,i,r),children:"Save"})]})]})]}),null!==r?(0,t.jsx)(M.Textarea,{value:r,onChange:e=>a(e.target.value),spellCheck:!1,"aria-label":`${f} contents`,className:"min-h-120 resize-none rounded-none border-0 font-mono text-[13px] leading-relaxed shadow-none focus-visible:ring-0"}):null===o.content?(0,t.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:o.size>R.SKILL_FILES.inlineBytes?"Too long to show here — a bot still reads it from disk.":"Not a text file — a bot can still read it from disk."}):f.toLowerCase().endsWith(".md")?(0,t.jsx)(Q,{content:o.content,description:o.description}):(0,t.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:o.content})]})}function ee(){return z.notify.component({className:"sm:max-w-lg",renderer:({close:e,guard:s})=>(0,t.jsx)(et,{onDone:e,guard:s})})}function et({onDone:e,guard:s}){let[i,n]=(0,k.useState)("write"),[l,r]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),[d,c]=(0,k.useState)(""),[u,m]=(0,k.useState)(null),[f,h]=(0,k.useState)(!1),p=(0,k.useRef)(null),g=(0,k.useRef)(!1);g.current=!!(l.trim()||a.trim()||d.trim()||u),(0,k.useEffect)(()=>s(()=>g.current),[s]);let v={errorMessage:!1,onOk:()=>{(0,W.revalidate)(j.queryKey.skills),e()}},[S,z,,C]=(0,P.useServerAction)(D,v),[L,$,,A]=(0,P.useServerAction)(q,v),B=z||$,I="write"===i?C:A,K=null!==u&&u.size>R.SKILL_FILES.uploadBytes,E=Math.round(R.SKILL_FILES.uploadBytes/1024/1024),U=!B&&("write"===i?l.trim()&&a.trim()&&d.trim():null!==u&&!K),O=async()=>{if(!U)return;if("write"===i)return void S({name:l.trim(),description:a.trim(),content:d});if(!u)return;let e=new FormData;e.append("file",u),L(e)},H=e=>{let t=e?.[0]??null;t&&m(t)};return(0,t.jsxs)(T.SettingDialogContent,{title:"New skill",description:"Instructions a bot reads when a job calls for them.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(y.Button,{disabled:!U,loading:B,onClick:O,children:[!B&&("write"===i?(0,t.jsx)(x.Plus,{}):(0,t.jsx)(b,{})),"write"===i?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:i,onValueChange:e=>n(e),children:[(0,t.jsxs)(F.TabsList,{className:"w-full",children:[(0,t.jsx)(F.TabsTrigger,{value:"write",children:"Write"}),(0,t.jsx)(F.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,t.jsxs)(F.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,t.jsxs)(w.FieldContent,{children:[(0,t.jsx)(N.Input,{id:"skill-name",value:l,onChange:e=>r(e.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[R.PATHS.skills.custom,"/",l.trim()||"…","/SKILL.md"]})]})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,t.jsx)(w.FieldContent,{children:(0,t.jsx)(N.Input,{id:"skill-description",value:a,onChange:e=>o(e.target.value),placeholder:"What it does, then when to use it — a bot reads this to decide"})})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,t.jsx)(M.Textarea,{id:"skill-content",value:d,onChange:e=>c(e.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,t.jsxs)(F.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:e=>{e.preventDefault(),h(!1),H(e.dataTransfer.files)},className:(0,_.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",f?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,t.jsx)(b,{className:"size-5 text-muted-foreground"}),u?(0,t.jsxs)("span",{className:"text-sm",children:[u.name,(0,t.jsxs)("span",{className:(0,_.cn)("ml-2 font-mono text-[11px]",K?"text-destructive":"text-muted-foreground"),children:[(0,_.formatBytes)(u.size),K&&` \xb7 over ${E} MB`]})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,t.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>H(e.target.files)}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,t.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]}),(0,t.jsxs)("p",{children:["Up to ",E," MB."]})]})]})]}),I&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:I})]})}e.s(["SkillsSetting",0,function(){let[e,s]=(0,k.useState)(""),{data:i,isLoading:n,error:l}=(0,W.useServerRoute)(j.queryKey.skills),r=i??[];if(n)return(0,t.jsx)(T.SettingSkeleton,{rows:4});if(l)return(0,t.jsx)(T.SettingError,{message:l.message});let a=e.trim().toLowerCase(),o=r.filter(e=>!a||`${e.name} ${e.description}`.toLowerCase().includes(a)),d=r.filter(e=>!e.disabled).length,c=r.filter(e=>!e.disabled&&("default"===e.source||"custom"===e.source)).length,u=new Map;for(let e of o)e.bot&&u.set(e.bot,[...u.get(e.bot)??[],e]);return(0,t.jsxs)(T.SettingScreen,{footer:(0,t.jsxs)(T.SettingRailNote,{children:[r.filter(e=>!E(e.source)).length," ","shipped ·"," ",r.filter(e=>E(e.source)).length," ","installed"]}),children:[(0,t.jsx)(T.SettingToolbar,{count:`${d} on \xb7 ${r.length-d} off`,children:(0,t.jsx)(T.SettingFilter,{value:e,onChange:s,placeholder:"Filter skills"})}),(0,t.jsx)(T.SettingGroup,{label:"Custom",hint:"yours — added here · a Default skill of the same name wins",children:(0,t.jsx)(T.SettingItems,{addRow:{label:"Add skill",onClick:ee},children:o.filter(e=>"custom"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`custom/${e.dir}`))})}),[...u].map(([e,s])=>(0,t.jsx)(T.SettingGroup,{label:`${e}'s own`,hint:`only ${e} reads these \xb7 what it found or wrote can be edited or deleted`,children:(0,t.jsx)(T.SettingItems,{children:s.map(e=>(0,t.jsx)(V,{skill:e},`${e.source}/${e.dir}`))})},e)),(0,t.jsx)(T.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,t.jsx)(T.SettingItems,{children:o.filter(e=>"default"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`default/${e.dir}`))})}),c>R.PROMPT_CROWDED.skills&&(0,t.jsxs)(T.SettingNote,{children:[c," skills are on for every bot. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})}],833959)},437750,e=>{"use strict";var t=e.i(456420);let s={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};s.node;let i=(0,t.default)(s);e.s(["AppWindow",0,i],437750)},726067,e=>{"use strict";var t=e.i(456420);let s={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};s.node;let i=(0,t.default)(s);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let s={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"]};s.node;let i=(0,t.default)(s);e.s(["Trash2",0,i],759659)}]);