thursday-agent 0.10.0 → 0.12.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 (308) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +0 -1
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +0 -6
  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 +2 -2
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/keep-working/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  24. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  26. package/.next/server/app/api/config/route.js.nft.json +1 -1
  27. package/.next/server/app/api/events/route.js.nft.json +1 -1
  28. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  29. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  31. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  32. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  33. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  34. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  36. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  37. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  38. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  39. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  40. package/.next/server/app/api/reach/route.js +13 -13
  41. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  42. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  43. package/.next/server/app/api/signins/route.js +1 -1
  44. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  45. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  46. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  47. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  48. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  49. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  50. package/.next/server/app/api/thursday/tool-call/route.js +14 -15
  51. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  52. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  53. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  54. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  55. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  56. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  58. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  59. package/.next/server/app/page/server-reference-manifest.json +56 -56
  60. package/.next/server/app/page.js +4 -4
  61. package/.next/server/app/page.js.nft.json +1 -1
  62. package/.next/server/app/page_client-reference-manifest.js +1 -1
  63. package/.next/server/app-paths-manifest.json +0 -1
  64. package/.next/server/chunks/[root-of-the-server]__014ydvq._.js +2 -2
  65. package/.next/server/chunks/[root-of-the-server]__0209ah4._.js +7 -5
  66. package/.next/server/chunks/[root-of-the-server]__04r4h-2._.js +4 -2
  67. package/.next/server/chunks/[root-of-the-server]__04wldw9._.js +1 -1
  68. package/.next/server/chunks/[root-of-the-server]__0542v_d._.js +3 -0
  69. package/.next/server/chunks/[root-of-the-server]__0cfszwn._.js +1 -1
  70. package/.next/server/chunks/[root-of-the-server]__0gewdg9._.js +2 -2
  71. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  72. package/.next/server/chunks/[root-of-the-server]__0npn_pn._.js +1 -1
  73. package/.next/server/chunks/[root-of-the-server]__0nr-v8s._.js +1 -1
  74. package/.next/server/chunks/[root-of-the-server]__0rqgb17._.js +1 -1
  75. package/.next/server/chunks/[root-of-the-server]__1-swlkw._.js +2 -2
  76. package/.next/server/chunks/[root-of-the-server]__12iddfq._.js +1 -1
  77. package/.next/server/chunks/[root-of-the-server]__1ai5lme._.js +3 -3
  78. package/.next/server/chunks/[root-of-the-server]__1cjxw0-._.js +2 -2
  79. package/.next/server/chunks/{[root-of-the-server]__1fy2g82._.js → [root-of-the-server]__1k3j52n._.js} +1 -1
  80. package/.next/server/chunks/[root-of-the-server]__1kyjt5m._.js +3 -3
  81. package/.next/server/chunks/[root-of-the-server]__1tg5got._.js +1 -1
  82. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  83. package/.next/server/chunks/_05v8k21._.js +3 -1
  84. package/.next/server/chunks/_0awtznl._.js +1 -1
  85. package/.next/server/chunks/_0f6ts7z._.js +1 -1
  86. package/.next/server/chunks/_0na2fj1._.js +1 -1
  87. package/.next/server/chunks/_0x-ej3f._.js +17 -17
  88. package/.next/server/chunks/_10tkr26._.js +1 -1
  89. package/.next/server/chunks/_12-amdu._.js +2 -2
  90. package/.next/server/chunks/_15740dw._.js +60 -0
  91. package/.next/server/chunks/_1dc_d1q._.js +3 -3
  92. package/.next/server/chunks/_1i350l5._.js +3 -1
  93. package/.next/server/chunks/_1jc5g4p._.js +2 -2
  94. package/.next/server/chunks/_1jn-aep._.js +4 -4
  95. package/.next/server/chunks/_1m88lkh._.js +11 -11
  96. package/.next/server/chunks/_1ogqovh._.js +4 -4
  97. package/.next/server/chunks/_1taa4bs._.js +1 -1
  98. package/.next/server/chunks/_1tpr507._.js +1 -1
  99. package/.next/server/chunks/_1uuucy-._.js +1 -1
  100. package/.next/server/chunks/_1zxp-p6._.js +1 -1
  101. package/.next/server/chunks/features_0rfvely._.js +5 -3
  102. package/.next/server/chunks/ssr/[root-of-the-server]__0a967km._.js +3 -0
  103. package/.next/server/chunks/ssr/{[root-of-the-server]__1se25x0._.js → [root-of-the-server]__0hpp3nw._.js} +29 -13
  104. package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +24 -60
  105. package/.next/server/chunks/ssr/{[root-of-the-server]__0tvavy9._.js → [root-of-the-server]__1iwyp1e._.js} +1 -1
  106. package/.next/server/chunks/ssr/[root-of-the-server]__1r77-88._.js +3 -0
  107. package/.next/server/chunks/ssr/[root-of-the-server]__1w9hqq8._.js +1 -1
  108. package/.next/server/chunks/ssr/_026qnc9._.js +1 -1
  109. package/.next/server/chunks/ssr/{_173siic._.js → _02c7o30._.js} +2 -2
  110. package/.next/server/chunks/ssr/_097-ljd._.js +1 -1
  111. package/.next/server/chunks/ssr/_0euzzf8._.js +3 -0
  112. package/.next/server/chunks/ssr/{_1u2jw0i._.js → _0fbi6om._.js} +3 -3
  113. package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
  114. package/.next/server/chunks/ssr/_0igfcax._.js +20 -0
  115. package/.next/server/chunks/ssr/_0ld9_qq._.js +1 -1
  116. package/.next/server/chunks/ssr/_0nvh1h9._.js +3 -0
  117. package/.next/server/chunks/ssr/_0qmpw35._.js +3 -0
  118. package/.next/server/chunks/ssr/{_1yk6yak._.js → _0rmaf32._.js} +2 -2
  119. package/.next/server/chunks/ssr/_0uv-qs4._.js +3 -0
  120. package/.next/server/chunks/ssr/{_1doidrw._.js → _10f-jib._.js} +2 -2
  121. package/.next/server/chunks/ssr/{_05rxyf9._.js → _10mo72m._.js} +2 -2
  122. package/.next/server/chunks/ssr/_12mijol._.js +11 -11
  123. package/.next/server/chunks/ssr/_132qkfz._.js +1 -1
  124. package/.next/server/chunks/ssr/_15zqt-t._.js +1 -1
  125. package/.next/server/chunks/ssr/_16gfxpn._.js +3 -0
  126. package/.next/server/chunks/ssr/_184327j._.js +1 -1
  127. package/.next/server/chunks/ssr/{_1ng831c._.js → _18ujhhq._.js} +2 -2
  128. package/.next/server/chunks/ssr/_1d423aj._.js +7 -5
  129. package/.next/server/chunks/ssr/_1lx6w_o._.js +67 -0
  130. package/.next/server/chunks/ssr/_1mqn9mc._.js +1 -1
  131. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  132. package/.next/server/chunks/ssr/{_19n08g5._.js → _1ntpny5._.js} +2 -2
  133. package/.next/server/chunks/ssr/{_0bp-_fi._.js → _1o1g4uk._.js} +3 -3
  134. package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
  135. package/.next/server/chunks/ssr/_1yh5bj5._.js +1 -1
  136. package/.next/server/chunks/ssr/{_0tg0vf8._.js → _2008vmi._.js} +8 -8
  137. package/.next/server/chunks/ssr/{features_bot_1yr-_pm._.js → features_bot_1n1s7bh._.js} +2 -2
  138. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  139. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  140. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  141. package/.next/server/chunks/ssr/features_workspace_00jz2hu._.js +1 -1
  142. package/.next/server/chunks/ssr/{node_modules_1n0h9sf._.js → node_modules_0-x0zxm._.js} +1 -1
  143. package/.next/server/chunks/ssr/{node_modules_1xzo2wn._.js → node_modules_00nrzz_._.js} +1 -1
  144. package/.next/server/chunks/ssr/{node_modules_0511ha-._.js → node_modules_01ed0yi._.js} +1 -1
  145. package/.next/server/chunks/ssr/{node_modules_18woe20._.js → node_modules_01u4ea3._.js} +1 -1
  146. package/.next/server/chunks/ssr/{node_modules_1expacw._.js → node_modules_05b6e99._.js} +1 -1
  147. package/.next/server/chunks/ssr/{node_modules_0eb4rx7._.js → node_modules_07jp6tj._.js} +1 -1
  148. package/.next/server/chunks/ssr/{node_modules_0piws2a._.js → node_modules_0azd56x._.js} +1 -1
  149. package/.next/server/chunks/ssr/{node_modules_0f2k5l0._.js → node_modules_0b0iy01._.js} +1 -1
  150. package/.next/server/chunks/ssr/{node_modules_0wq4-ts._.js → node_modules_0fpnetd._.js} +1 -1
  151. package/.next/server/chunks/ssr/{node_modules_11hbkuj._.js → node_modules_0ky76fz._.js} +1 -1
  152. package/.next/server/chunks/ssr/{node_modules_048wmmj._.js → node_modules_0lautv3._.js} +1 -1
  153. package/.next/server/chunks/ssr/{node_modules_1dcbvfw._.js → node_modules_0m3_5ge._.js} +1 -1
  154. package/.next/server/chunks/ssr/{node_modules_0pk6i-e._.js → node_modules_0operbz._.js} +1 -1
  155. package/.next/server/chunks/ssr/{node_modules_1zkpek5._.js → node_modules_0ou0all._.js} +1 -1
  156. package/.next/server/chunks/ssr/{node_modules_04t200t._.js → node_modules_0ucridu._.js} +1 -1
  157. package/.next/server/chunks/ssr/{node_modules_08g12f-._.js → node_modules_0v_-uht._.js} +1 -1
  158. package/.next/server/chunks/ssr/{node_modules_1m2ho33._.js → node_modules_0yzmxfq._.js} +1 -1
  159. package/.next/server/chunks/ssr/{node_modules_1ksh9gy._.js → node_modules_19b0bir._.js} +1 -1
  160. package/.next/server/chunks/ssr/{node_modules_1qehmwm._.js → node_modules_1c2ikr9._.js} +1 -1
  161. package/.next/server/chunks/ssr/{node_modules_1_afpz7._.js → node_modules_1hv-j1l._.js} +1 -1
  162. package/.next/server/chunks/ssr/{node_modules_0cdu6jq._.js → node_modules_1iau_ea._.js} +1 -1
  163. package/.next/server/chunks/ssr/{node_modules_1zf46lp._.js → node_modules_1ma_y68._.js} +1 -1
  164. package/.next/server/chunks/ssr/{node_modules_0s1lwc9._.js → node_modules_1omg9xr._.js} +1 -1
  165. package/.next/server/chunks/ssr/{node_modules_1cxc8kn._.js → node_modules_1wgnj8q._.js} +1 -1
  166. package/.next/server/chunks/ssr/{node_modules_0zjqwz7._.js → node_modules_1wvf3oo._.js} +1 -1
  167. package/.next/server/chunks/ssr/{node_modules_1_ban4u._.js → node_modules_1z3sh11._.js} +1 -1
  168. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0avl8-1._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0tmjn9w._.js} +1 -1
  169. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_14oslro._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1_e8c3o._.js} +1 -1
  170. package/.next/server/middleware-build-manifest.js +3 -3
  171. package/.next/server/pages/404.html +1 -1
  172. package/.next/server/pages/500.html +1 -1
  173. package/.next/server/server-reference-manifest.js +1 -1
  174. package/.next/server/server-reference-manifest.json +57 -57
  175. package/.next/static/chunks/09pkygbht7ki8.js +18 -0
  176. package/.next/static/chunks/0bm-nhblcmmj4.js +17 -0
  177. package/.next/static/chunks/{22shnca_6zfzs.js → 0hhza87hkbqaz.js} +1 -1
  178. package/.next/static/chunks/{19ojn4lomsk0r.js → 0mscosx0eh3ee.js} +1 -1
  179. package/.next/static/chunks/{3vynnr71ghvom.js → 0p50d-au6-3hx.js} +2 -2
  180. package/.next/static/chunks/{42890jqk049q1.js → 0p9jcyqkpq71f.js} +1 -1
  181. package/.next/static/chunks/{35kwn237o4wdn.js → 0qgn3u86jkbm7.js} +1 -1
  182. package/.next/static/chunks/{2d4z3er53ng8r.js → 0samf80yu2b17.js} +1 -1
  183. package/.next/static/chunks/{1pjygp7hqib6j.js → 1czfknd4luo6t.js} +1 -1
  184. package/.next/static/chunks/{09120tms63y21.js → 1jz8n0mhtdzr8.js} +1 -1
  185. package/.next/static/chunks/206laxm6maiz2.js +1 -0
  186. package/.next/static/chunks/{24dst4mgurbsh.js → 2_c7mu6x1lu49.js} +1 -1
  187. package/.next/static/chunks/{2ky81z-jgvasc.js → 2h-tlhb2ffhkk.js} +1 -1
  188. package/.next/static/chunks/{0oz3rs47yy3p8.js → 2i5_w8olnrvo0.js} +2 -2
  189. package/.next/static/chunks/{1mwee7xvitlp9.js → 2m8iqwc6sykln.js} +1 -1
  190. package/.next/static/chunks/{0o980477kfqez.js → 2r6xnyg7ezyxr.js} +1 -1
  191. package/.next/static/chunks/33fyp-byw48ju.js +65 -0
  192. package/.next/static/chunks/{2ndw4w4u2x51r.js → 35yd_27d9ylra.js} +1 -1
  193. package/.next/static/chunks/{3exjsi8pfdvzj.js → 3ag1i3__yl94f.js} +1 -1
  194. package/.next/static/chunks/{3obf9n3cxj99k.js → 3jvldk2wvwbge.js} +1 -1
  195. package/.next/static/chunks/3m_ejzg-xn21r.css +1 -0
  196. package/.next/static/chunks/{0w20wnnfrscq7.js → 3s-jpd3ky49-n.js} +1 -1
  197. package/.next/static/chunks/40ij3wsn3vt7h.js +1 -0
  198. package/README.md +1 -1
  199. package/app/api/thursday/tool-call/route.ts +1 -15
  200. package/docs/images/demo-still.jpg +0 -0
  201. package/docs/live-calls.md +19 -11
  202. package/features/ai/components/model-picker.tsx +8 -2
  203. package/features/ai/model.schema.ts +26 -0
  204. package/features/ai/prompts/live.prompt.ts +51 -26
  205. package/features/ai/prompts/prompt-helper.ts +1 -9
  206. package/features/ai/prompts/thursday.prompt.ts +8 -2
  207. package/features/bot/bot.run.ts +9 -3
  208. package/features/bot/bot.seed.ts +35 -91
  209. package/features/bot/components/bot-room.tsx +3 -12
  210. package/features/bot/components/room-list.tsx +1 -1
  211. package/features/bot/components/room-pill.tsx +44 -55
  212. package/features/bot/seed-bots.ts +2 -2
  213. package/features/config/components/config-badge.tsx +6 -0
  214. package/features/config/components/config-setting.tsx +20 -1
  215. package/features/config/components/models-badge.tsx +5 -7
  216. package/features/config/components/voice-key.tsx +24 -1
  217. package/features/config/config.const.ts +7 -0
  218. package/features/intro/components/intro.tsx +4 -19
  219. package/features/reach/reach.ts +2 -2
  220. package/features/settings/components/setting-ui.tsx +14 -5
  221. package/features/settings/components/settings.tsx +3 -1
  222. package/features/settings/settings.alert.ts +12 -11
  223. package/features/signins/signins.query.ts +66 -1
  224. package/features/thursday/components/side-captions.tsx +31 -8
  225. package/features/thursday/components/tab-state.tsx +5 -2
  226. package/features/thursday/components/thursday.tsx +158 -68
  227. package/features/thursday/components/write-line.tsx +37 -17
  228. package/features/thursday/thursday.action.ts +4 -20
  229. package/features/thursday/thursday.schema.ts +0 -9
  230. package/features/thursday/thursday.store.ts +11 -15
  231. package/features/thursday/thursday.text.ts +10 -8
  232. package/features/thursday/tool-line.ts +17 -6
  233. package/features/thursday/use-call-ring.ts +1 -5
  234. package/features/thursday/use-text-call.ts +37 -21
  235. package/features/thursday/use-thursday.ts +14 -44
  236. package/features/workspace/workspace.ts +4 -2
  237. package/guide/bots.md +12 -2
  238. package/guide/calls.md +9 -6
  239. package/guide/setup.md +4 -1
  240. package/lib/live/live.session.ts +0 -39
  241. package/package.json +1 -1
  242. package/scripts/live-session.test.mts +19 -26
  243. package/seed-skills/analyst/README.md +3 -4
  244. package/seed-skills/analyst/data-report/SKILL.md +5 -4
  245. package/seed-skills/insta/instagram/SKILL.md +5 -2
  246. package/seed-skills/insta/instagram/references/post.md +2 -2
  247. package/seed-skills/insta/instagram/scripts/compose.mjs +5 -1
  248. package/seed-skills/insta/instagram/scripts/inbox.mjs +5 -1
  249. package/seed-skills/insta/instagram/scripts/lib.mjs +12 -70
  250. package/seed-skills/insta/instagram/scripts/media.mjs +1 -1
  251. package/seed-skills/insta/instagram/scripts/profile.mjs +6 -2
  252. package/seed-skills/insta/instagram/scripts/read.mjs +5 -1
  253. package/seed-skills/insta/instagram/scripts/search.mjs +6 -2
  254. package/seed-skills/insta/instagram/scripts/sheet.mjs +31 -88
  255. package/seed-skills/insta/instagram/templates/carousel.html +1 -1
  256. package/seed-skills/tutor/picture-book/SKILL.md +16 -0
  257. package/seed-skills/tutor/picture-book/book/book.css +181 -0
  258. package/seed-skills/tutor/picture-book/book/book.html +33 -0
  259. package/seed-skills/tutor/picture-book/book/book.js +60 -0
  260. package/seed-skills/tutor/picture-book/references/picture-book.md +104 -0
  261. package/seed-skills/tutor/picture-book/scripts/book-video.mjs +177 -0
  262. package/seed-skills/tutor/picture-book/scripts/book.mjs +98 -0
  263. package/skills/browser/SKILL.md +13 -4
  264. package/skills/browser/references/scripts.md +55 -0
  265. package/{seed-skills/insta/instagram → skills/browser}/scripts/render.mjs +1 -1
  266. package/skills/browser/scripts/session.mjs +105 -0
  267. package/skills/browser/scripts/sheet.mjs +97 -0
  268. package/{seed-skills/insta/instagram → skills/browser}/scripts/webimage.mjs +1 -1
  269. package/skills/interactive-page/SKILL.md +4 -3
  270. package/{seed-skills/analyst/data-report → skills/interactive-page}/scripts/chart.mjs +3 -3
  271. package/skills/interactive-page/scripts/page.mjs +1 -0
  272. package/.next/server/app/api/probe/route/app-paths-manifest.json +0 -3
  273. package/.next/server/app/api/probe/route/build-manifest.json +0 -12
  274. package/.next/server/app/api/probe/route/server-reference-manifest.json +0 -4
  275. package/.next/server/app/api/probe/route.js +0 -10
  276. package/.next/server/app/api/probe/route.js.map +0 -5
  277. package/.next/server/app/api/probe/route.js.nft.json +0 -1
  278. package/.next/server/app/api/probe/route_client-reference-manifest.js +0 -3
  279. package/.next/server/chunks/[root-of-the-server]__012s2o8._.js +0 -3
  280. package/.next/server/chunks/[root-of-the-server]__0z0hc1f._.js +0 -4
  281. package/.next/server/chunks/[root-of-the-server]__1v7-zke._.js +0 -5
  282. package/.next/server/chunks/_0whlpyi._.js +0 -4
  283. package/.next/server/chunks/_next-internal_server_app_api_probe_route_actions_0cqd30j.js +0 -3
  284. package/.next/server/chunks/ssr/[root-of-the-server]__0cxqzfc._.js +0 -103
  285. package/.next/server/chunks/ssr/[root-of-the-server]__1-d2tgh._.js +0 -3
  286. package/.next/server/chunks/ssr/_070nv1_._.js +0 -3
  287. package/.next/server/chunks/ssr/_0hlxij-._.js +0 -3
  288. package/.next/server/chunks/ssr/_0p9pmxe._.js +0 -3
  289. package/.next/server/chunks/ssr/_0s41irp._.js +0 -3
  290. package/.next/server/chunks/ssr/_157yfrk._.js +0 -3
  291. package/.next/server/chunks/ssr/_17v-33v._.js +0 -20
  292. package/.next/server/chunks/ssr/_1flsjeo._.js +0 -3
  293. package/.next/static/chunks/03kgfyrli_0gz.js +0 -1
  294. package/.next/static/chunks/1p764d75_0lhv.js +0 -18
  295. package/.next/static/chunks/25zq8gzhbdsr7.js +0 -1
  296. package/.next/static/chunks/2qod5tqlpz8b7.js +0 -17
  297. package/.next/static/chunks/30skcjexa57zn.js +0 -101
  298. package/.next/static/chunks/3qq4o8w2rv_e9.css +0 -1
  299. package/lib/probe.server.ts +0 -17
  300. package/lib/probe.ts +0 -55
  301. package/seed-skills/mail/mail/SKILL.md +0 -37
  302. package/seed-skills/mail/mail/recipes/gmail.mjs +0 -448
  303. package/seed-skills/mail/mail/references/recipes.md +0 -55
  304. package/seed-skills/mail/mail/scripts/mail.mjs +0 -202
  305. /package/.next/static/{Ar5V4kMdL4CE1trx8anrH → QSe0rTdXU5kh5BBzr2XBB}/_buildManifest.js +0 -0
  306. /package/.next/static/{Ar5V4kMdL4CE1trx8anrH → QSe0rTdXU5kh5BBzr2XBB}/_clientMiddlewareManifest.js +0 -0
  307. /package/.next/static/{Ar5V4kMdL4CE1trx8anrH → QSe0rTdXU5kh5BBzr2XBB}/_ssgManifest.js +0 -0
  308. /package/{seed-skills/insta/instagram → skills/browser}/scripts/image-size.mjs +0 -0
@@ -1,3 +1,3 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null);return(0,a.useEffect)(()=>c(!1),[e]),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),f=e.i(660302),h=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7fa79f2b94e5e145ca0dbb9f3ef82067e0f2b003fa",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),C=e.i(647163),T=e.i(553429),_=e.i(978411),M=e.i(222055);function B({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})}function $({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{thread:e}),(0,t.jsx)(R,{thread:e}),(0,t.jsx)(I,{thread:e})]})}function A({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,C.formatCount)(n)} tokens \xb7 in total in ${(0,C.formatCount)(a.input)} \xb7 out ${(0,C.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,C.formatCount)(n)}):null}function R({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)});if((0,m.useEffect)(()=>r(!1),[n]),!n||!a)return null;let l=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name).catch(()=>{}),title:s?"It summarizes itself at its next step":`Context ${(0,C.formatCount)(n)} of ${(0,C.formatCount)(a)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,C.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":l>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*l))}%`}})})})}let D={working:"text-muted-foreground",waiting:C.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"};function I({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(f.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,C.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:e.status})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(h.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,C.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(h.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:n.map(n=>{let a=q(e,n.name);return(0,t.jsxs)(h.TabsTrigger,{value:n.name,className:(0,C.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function q(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===Q.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(Z,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(Y,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(O,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==Q.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(ee,{line:o.line,surface:r,mention:d},o.key)})})})}function O({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?q(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),h=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",h?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":h,onClick:()=>{o(e=>!e),c(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(f.ShinyText,{text:"asking"===u?"waiting on you":b?G(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:"min-w-0 truncate text-[12px] leading-4"}):(0,t.jsx)(U,{words:b?G(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · ")}),e.length>0&&(0,t.jsx)(H,{open:h})]}),!h&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),h&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ed(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(eo,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e,inset:!0},e.id)))})]})}function K({lines:e,trailing:n,bot:a,thread:s}){let r=n?q(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ed(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(eo,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e},e.id))),r&&!i&&(0,t.jsx)(f.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,C.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function H({open:e}){return(0,t.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,t.jsx)(s.ChevronDown,{className:(0,C.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function G(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,C.plainText)(e.text).replace(/\s+/g," ").trim()}function V({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{from:Q,to:e.bot}),(0,t.jsx)(Z,{side:"end",name:Q.name,mark:(0,t.jsx)(Y,{bot:Q}),children:(0,t.jsx)(J,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let Q={name:T.ROOM_THURSDAY};function W({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(X,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(X,{bot:n})]})})}function X({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function Y({bot:e}){return e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function J({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,C.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,C.cn)("min-w-0",e&&"inverse"),children:n})})})}function Z({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,C.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function ee({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(es,{}),a?(0,t.jsx)(ea,{bot:a,bubble:i,children:o}):(0,t.jsx)(et,{bubble:i,className:(0,C.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(J,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(ei,{text:e.text})})]})}function et({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,C.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",n&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",a),children:e})}function en({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,C.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function ea({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(en,{bot:e,bubble:n}),(0,t.jsx)(et,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function es(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function er({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(et,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(et,{className:(0,C.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function ei({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,C.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function eo({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:el(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let el=e=>e.split(" (")[0].replace(/\.$/,"");function ed(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||el(a.lines[0].text)===el(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=(0,_.rosterOf)(e),c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&q(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>`${e.bot}
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null);return(0,a.useEffect)(()=>c(!1),[e]),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),h=e.i(660302),f=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7fe8d6537be4e8290d1b81e8b1b55de06421001601",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),C=e.i(647163),T=e.i(553429),_=e.i(978411),M=e.i(222055);function B({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})}function $({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{thread:e}),(0,t.jsx)(R,{thread:e}),(0,t.jsx)(I,{thread:e})]})}function A({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,C.formatCount)(n)} tokens \xb7 in total in ${(0,C.formatCount)(a.input)} \xb7 out ${(0,C.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,C.formatCount)(n)}):null}function R({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)});if((0,m.useEffect)(()=>r(!1),[n]),!n||!a)return null;let l=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name).catch(()=>{}),title:s?"It summarizes itself at its next step":`Context ${(0,C.formatCount)(n)} of ${(0,C.formatCount)(a)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,C.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":l>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*l))}%`}})})})}let D={working:"text-muted-foreground",waiting:C.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"};function I({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(h.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,C.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:e.status})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(f.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,C.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(f.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:n.map(n=>{let a=q(e,n.name);return(0,t.jsxs)(f.TabsTrigger,{value:n.name,className:(0,C.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function q(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===Q.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(Z,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(Y,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(O,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==Q.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(ee,{line:o.line,surface:r,mention:d},o.key)})})})}function O({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?q(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),f=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",f?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":f,onClick:()=>{o(e=>!e),c(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(h.ShinyText,{text:"asking"===u?"waiting on you":b?G(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:"min-w-0 truncate text-[12px] leading-4"}):(0,t.jsx)(U,{words:b?G(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · ")}),e.length>0&&(0,t.jsx)(H,{open:f})]}),!f&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),f&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ed(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(eo,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e,inset:!0},e.id)))})]})}function K({lines:e,trailing:n,bot:a,thread:s}){let r=n?q(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ed(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(eo,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e},e.id))),r&&!i&&(0,t.jsx)(h.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,C.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function H({open:e}){return(0,t.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,t.jsx)(s.ChevronDown,{className:(0,C.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function G(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,C.plainText)(e.text).replace(/\s+/g," ").trim()}function V({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{from:Q,to:e.bot}),(0,t.jsx)(Z,{side:"end",name:Q.name,mark:(0,t.jsx)(Y,{bot:Q}),children:(0,t.jsx)(J,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let Q={name:T.ROOM_THURSDAY};function W({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(X,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(X,{bot:n})]})})}function X({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function Y({bot:e}){return e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function J({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,C.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,C.cn)("min-w-0",e&&"inverse"),children:n})})})}function Z({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,C.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function ee({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(es,{}),a?(0,t.jsx)(ea,{bot:a,bubble:i,children:o}):(0,t.jsx)(et,{bubble:i,className:(0,C.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(J,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(ei,{text:e.text})})]})}function et({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,C.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",n&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",a),children:e})}function en({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,C.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function ea({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(en,{bot:e,bubble:n}),(0,t.jsx)(et,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function es(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function er({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(et,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(et,{className:(0,C.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function ei({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,C.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function eo({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:el(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let el=e=>e.split(" (")[0].replace(/\.$/,"");function ed(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||el(a.lines[0].text)===el(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=(0,_.rosterOf)(e),c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&q(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>`${e.bot}
2
2
  ${e.text.trim()}`))).size?{...e,lines:e.lines.filter(e=>!("ask"===e.kind&&e.question&&e.to?.name===Q.name&&i.has(`${e.bot.name}
3
- ${e.text.trim()}`)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,C.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",s),children:[!c&&(0,t.jsx)(V,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(W,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,B,"TAB",0,L,"THURSDAY",0,Q,"ThreadFacts",0,$,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[e.label,(0,t.jsx)("span",{title:e.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:e.id.slice(0,8)})]}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(B,{onClick:a})]})},"leadOf",0,el,"stepOf",0,G],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),f=e.i(496336),h=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(633840),v=e.i(248473),w=e.i(95187);let y=(0,w.createServerReference)("7f846c3a9b71e5f3c1e3d53451fc7114df90e1437e",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),C=e.i(609856),T=e.i(283653),_=e.i(696801);function M({bot:e,onAllowed:n}){let{data:a}=(0,T.useServerRoute)(x.queryKey.signIns),[s,r]=(0,C.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,T.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var B=e.i(6799),$=e.i(41533),A=e.i(83928);let R=(0,w.createServerReference)("7f1c15fbadd646f804b60c10d0fe95367e29335f86",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,C.useServerAction)(R),r=(0,m.useCallback)(async e=>{let r=$.GIVEN_FILES.perMessage-n.length;e.length>r&&B.toast.add({type:"error",title:`At most ${$.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function F({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[e.path?(0,t.jsx)(A.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[E(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let L=null,q={claim:e=>(L=e,()=>{L===e&&(L=null)}),offer:(e,t)=>!!L&&!!e?.closest?.("[data-room]")&&(L(t),!0)},E=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function O({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function K({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(G,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:f,className:h}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:C}=N;(0,m.useEffect)(()=>q.claim(e=>void C(e)),[C]);let T=!!g.trim()&&!i&&!N.arriving,_=async()=>{T&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",h),children:[N.files.length>0&&(0,t.jsx)(F,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),C(t))},onKeyDown:e=>{"Escape"===e.key&&x?x():"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.keyCode||(e.preventDefault(),_())},placeholder:o,"aria-label":c,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{C([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),f,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:T?"default":"ghost",disabled:!T,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function H({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,t.jsx)(G,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(G,{bot:e,size:16}),e.name]},e.name))})})]})}function G({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function V(){let[e,t]=(0,C.useServerAction)(j.answerThreadAction,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["GivenFiles",0,F,"roomDrop",0,q,"useGivenFiles",0,I],709190),e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[B,$]=(0,m.useState)(null);(0,m.useEffect)(()=>{w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)},[e.id,e.bot]),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let A=e.room.participants,R=e.room.questions,I=Math.max(0,R.findIndex(e=>e.id===b)),F=R[I],L="waiting"===n?e.ask:null,q=(0,N.isAppStop)(L),E=F?.bot??(A.some(e=>e.bot===j)?j:e.bot),G=F?.id,[Q,W]=V(),[X,Y]=(0,C.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,T.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),J=W||Y,Z=e.room.deliveries.filter(e=>!e.delivered),[ee,et]=(0,C.useServerAction)(y,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)}),en=Z.map(e=>`${e.bot}: ${e.text}`).join(" · "),ea=A.filter(e=>"running"===e.state).map(e=>e.bot).join(", ")||e.bot,es=e=>a.find(t=>t.name===e)??{name:e},er=async t=>{if(J)return!1;let a=await Q(e,t,E,G);return a&&"running"===n&&_(!1),a},ei=async e=>{$(e),await er(e),$(null)},eo="running"===n||"waiting"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>X(e.id),"aria-label":"Stop this thread",title:"Stop this thread",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:Y?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(c.Square,{className:"size-3"})}):null;if(F){let n=F.options??[],a=F.text;return(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(E),word:"Question",children:R.length>1&&(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:J||0===I,onClick:()=>k(R[I-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[I+1," / ",R.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:J||I===R.length-1,onClick:()=>k(R[I+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(h.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:B,busy:J,onChoose:ei}),(0,t.jsx)(M,{bot:E,onAllowed:er}),(0,t.jsx)(U,{threadId:e.id,recipient:E,draftKey:F.id,send:er,busy:J,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${E}`,trailing:eo},JSON.stringify([e.id,E,F.id]))]})}return q?(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(e.bot),word:"Paused"}),L?.question&&(0,t.jsx)(f.FoldedText,{text:L.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:L?.options.length?L.options:[N.THREAD_CONTINUE],picked:B,busy:J,onChoose:ei}),(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,placeholder:"Or put it another way…",label:`Message for ${E}`,trailing:eo},JSON.stringify([e.id,E,"paused"]))]}):"running"!==n||S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,autoFocus:"running"===n,onEscape:"running"===n?()=>_(!1):void 0,placeholder:"running"===n?`What's off? ${E} reads this before its next step`:"Anything more? It picks up where it left off",label:`Message for ${E}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:A.length>1?(0,t.jsx)(H,{current:es(E),bots:A.map(e=>es(e.bot)),disabled:J,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:"running"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,E])),!!en&&"running"!==n&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",en]})]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[Z.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:et,onClick:()=>ee(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ea} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:J,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),eo]})]})},"useAnswerThread",0,V],399512)},248473,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f777b3dcd6fac42c0201ea9a338fdaaec72e25d22",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},633840,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7ff2a34f34dc1c633b94ee70431cc84efc247ec2b3",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,o.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);
3
+ ${e.text.trim()}`)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,C.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",s),children:[!c&&(0,t.jsx)(V,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(W,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,B,"TAB",0,L,"THURSDAY",0,Q,"ThreadFacts",0,$,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[e.label,(0,t.jsx)("span",{title:e.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:e.id.slice(0,8)})]}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(B,{onClick:a})]})},"leadOf",0,el,"stepOf",0,G],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),h=e.i(496336),f=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(834146),v=e.i(711800),w=e.i(95187);let y=(0,w.createServerReference)("7f247e5a629e7a1560dadef89c2c44310462a2be80",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),C=e.i(609856),T=e.i(283653),_=e.i(950953);function M({bot:e,onAllowed:n}){let{data:a}=(0,T.useServerRoute)(x.queryKey.signIns),[s,r]=(0,C.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,T.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var B=e.i(6799),$=e.i(41533),A=e.i(83928);let R=(0,w.createServerReference)("7f63936457a5f34275fc2c3ae6ee5ff47817e28c32",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,C.useServerAction)(R),r=(0,m.useCallback)(async e=>{let r=$.GIVEN_FILES.perMessage-n.length;e.length>r&&B.toast.add({type:"error",title:`At most ${$.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function F({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[e.path?(0,t.jsx)(A.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[E(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let L=null,q={claim:e=>(L=e,()=>{L===e&&(L=null)}),offer:(e,t)=>!!L&&!!e?.closest?.("[data-room]")&&(L(t),!0)},E=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function O({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function K({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(G,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:h,className:f}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:C}=N;(0,m.useEffect)(()=>q.claim(e=>void C(e)),[C]);let T=!!g.trim()&&!i&&!N.arriving,_=async()=>{T&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",f),children:[N.files.length>0&&(0,t.jsx)(F,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),C(t))},onKeyDown:e=>{"Escape"===e.key&&x?x():"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.keyCode||(e.preventDefault(),_())},placeholder:o,"aria-label":c,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{C([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),h,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:T?"default":"ghost",disabled:!T,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function H({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,t.jsx)(G,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(G,{bot:e,size:16}),e.name]},e.name))})})]})}function G({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function V(){let[e,t]=(0,C.useServerAction)(j.answerThreadAction,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["GivenFiles",0,F,"roomDrop",0,q,"useGivenFiles",0,I],709190),e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[B,$]=(0,m.useState)(null);(0,m.useEffect)(()=>{w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)},[e.id,e.bot]),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let A=e.room.participants,R=e.room.questions,I=Math.max(0,R.findIndex(e=>e.id===b)),F=R[I],L="waiting"===n?e.ask:null,q=(0,N.isAppStop)(L),E=F?.bot??(A.some(e=>e.bot===j)?j:e.bot),G=F?.id,[Q,W]=V(),[X,Y]=(0,C.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,T.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),J=W||Y,Z=e.room.deliveries.filter(e=>!e.delivered),[ee,et]=(0,C.useServerAction)(y,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)}),en=Z.map(e=>`${e.bot}: ${e.text}`).join(" · "),ea=A.filter(e=>"running"===e.state).map(e=>e.bot).join(", ")||e.bot,es=e=>a.find(t=>t.name===e)??{name:e},er=async t=>{if(J)return!1;let a=await Q(e,t,E,G);return a&&"running"===n&&_(!1),a},ei=async e=>{$(e),await er(e),$(null)},eo="running"===n||"waiting"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>X(e.id),"aria-label":"Stop this thread",title:"Stop this thread",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:Y?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(c.Square,{className:"size-3"})}):null;if(F){let n=F.options??[],a=F.text;return(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(E),word:"Question",children:R.length>1&&(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:J||0===I,onClick:()=>k(R[I-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[I+1," / ",R.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:J||I===R.length-1,onClick:()=>k(R[I+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(f.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:B,busy:J,onChoose:ei}),(0,t.jsx)(M,{bot:E,onAllowed:er}),(0,t.jsx)(U,{threadId:e.id,recipient:E,draftKey:F.id,send:er,busy:J,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${E}`,trailing:eo},JSON.stringify([e.id,E,F.id]))]})}return q?(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(e.bot),word:"Paused"}),L?.question&&(0,t.jsx)(h.FoldedText,{text:L.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:L?.options.length?L.options:[N.THREAD_CONTINUE],picked:B,busy:J,onChoose:ei}),(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,placeholder:"Or put it another way…",label:`Message for ${E}`,trailing:eo},JSON.stringify([e.id,E,"paused"]))]}):"running"!==n||S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,autoFocus:"running"===n,onEscape:"running"===n?()=>_(!1):void 0,placeholder:"running"===n?`What's off? ${E} reads this before its next step`:"Anything more? It picks up where it left off",label:`Message for ${E}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:A.length>1?(0,t.jsx)(H,{current:es(E),bots:A.map(e=>es(e.bot)),disabled:J,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:"running"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,E])),!!en&&"running"!==n&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",en]})]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[Z.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:et,onClick:()=>ee(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ea} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:J,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),eo]})]})},"useAnswerThread",0,V],399512)},711800,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7fbd83ed7976d5911cf4c4c9402f67b2de4601a34b",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},834146,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7fa903404f6203f59566ec69113a2bd5ec7de459a2",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,o.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,457343,e=>{"use strict";var t=e.i(843476),n=e.i(867927),s=e.i(632781),a=e.i(648119),i=e.i(929272),r=e.i(759659),o=e.i(263676),l=e.i(271645),d=e.i(798120),c=e.i(167881),u=e.i(630374),x=e.i(463415),h=e.i(917162),m=e.i(660302),p=e.i(671428),f=e.i(41533),g=e.i(248473),j=e.i(95187);let b=(0,j.createServerReference)("7f205d1240f42627a1e6de9116d0ac943d0b4270de",j.callServer,void 0,j.findSourceMapURL,"clearFinishedThreadsAction"),k=(0,j.createServerReference)("7faad9c5d7887872a59722a8a48780695b761500d4",j.callServer,void 0,j.findSourceMapURL,"deleteThreadAction");var N=e.i(451888),v=e.i(635963),w=e.i(835878),y=e.i(222055),S=e.i(351866),T=e.i(978411),D=e.i(431594),M=e.i(895836),C=e.i(245629),z=e.i(609856),A=e.i(661504),R=e.i(283653),I=e.i(647163),O=e.i(399512);let $="w-36";function F({thread:e,bots:a,open:i,onOpen:r,onStop:o,onDelete:d}){let c="running"===e.status,u=(0,l.useMemo)(()=>(0,T.threadFromRow)(e,a),[e,a]),x=function(e){let t=e.room.questions[0];if(t)return{text:(0,I.plainText)(t.text),tone:I.WAITING_INK};if("waiting"===e.status&&e.ask)return{text:(0,N.isAppStop)(e.ask)?(0,I.plainText)(e.outcome??e.ask.question):e.ask.question,tone:I.WAITING_INK};let n=e.seen;if("cancelled"===e.status)return{text:"Stopped",tone:"text-muted-foreground"};if("done"===e.status)return{text:(0,I.plainText)(e.outcome??"Done"),tone:n?"text-muted-foreground":"text-foreground/80"};for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("tool"===n.kind)return{text:n.note??n.input,tone:"text-muted-foreground",tool:n.name,shine:!0};if("text"===n.kind)return{text:n.text,tone:"text-muted-foreground",shine:!0};if("user"===n.kind)break}return{text:`${e.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(e),h=e.tokens.input+e.tokens.output;return(0,t.jsxs)("div",{className:(0,I.cn)("group/row relative transition-colors",i?"bg-muted/80":"hover:bg-muted/50"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsxs)("button",{type:"button",onClick:r,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(v.BotMark,{size:40,seed:e.bot,...B(e.bot,a),state:c?"thinking":"idle",notify:(0,N.needsThreadReply)(e),crossed:"cancelled"===e.status,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),e.routineId&&(0,t.jsx)("span",{title:"Started by a routine",className:"shrink-0",children:(0,t.jsx)(D.RoutineMark,{className:"size-3 text-muted-foreground/80"})}),(0,t.jsx)(w.BotRoster,{bots:(0,T.rosterOf)(u)}),c&&(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),x&&(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[x.tool&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:x.tool}),x.shine?(0,t.jsx)(m.ShinyText,{text:x.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 truncate",x.tone),children:x.text})]})]}),(0,t.jsxs)("span",{className:(0,I.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",$),children:[(0,t.jsx)("span",{children:(0,C.whenOf)(e.updatedAt)}),(0,t.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:h>0?`${e.id} \xb7 in ${(0,I.formatCount)(e.tokens.input)} \xb7 out ${(0,I.formatCount)(e.tokens.output)}`:e.id,children:[e.bot,h>0&&` \xb7 ${(0,I.formatCount)(h)}`]})]}),(0,t.jsx)(n.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(K,{thread:e,onStop:o,onDelete:d})]}),c&&(0,t.jsx)(P,{thread:e})]})}function K({thread:e,onStop:n,onDelete:s,className:o}){let l="running"===e.status||"waiting"===e.status;return(0,t.jsxs)(x.DropdownMenu,{children:[(0,t.jsx)(x.DropdownMenuTrigger,{render:(0,t.jsx)(c.Button,{size:"icon-sm",variant:"ghost",className:o}),children:(0,t.jsx)(a.MoreHorizontal,{})}),(0,t.jsxs)(x.DropdownMenuContent,{align:"end",children:[l&&(0,t.jsxs)(x.DropdownMenuItem,{onClick:n,children:[(0,t.jsx)(i.Square,{}),"Stop"]}),(0,t.jsxs)(x.DropdownMenuItem,{variant:"destructive",onClick:s,children:[(0,t.jsx)(r.Trash2,{}),"Delete"]})]})]})}function q({thread:e,bots:n,onClose:s,onStop:a,onDelete:i}){let[r,d]=(0,l.useState)(null),x=(0,l.useCallback)(e=>{d(e?.closest("[data-slot=dialog-content]")??null)},[]),[h,m]=(0,l.useState)({}),p=(0,l.useMemo)(()=>e?(0,T.threadFromRow)(e,n):null,[e,n]),f=e?h[e.id]??null:null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:x,hidden:!0}),(0,t.jsx)(u.Dialog,{open:!!(e&&r),onOpenChange:e=>!e&&s(),modal:!1,disablePointerDismissal:!0,children:(0,t.jsx)(u.DialogPortal,{container:r,children:(0,t.jsx)(u.DialogPopup,{className:"absolute inset-y-0 right-0 z-10 flex w-[min(35rem,calc(100%-13rem))] flex-col border-l border-border/60 bg-popover text-popover-foreground shadow-2xl shadow-black/10 duration-150 data-open:animate-in data-open:fade-in-0 data-open:slide-in-from-right-4 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-right-4",children:e&&p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[(0,t.jsx)(v.BotMark,{size:28,seed:e.bot,...B(e.bot,n),state:"running"===e.status?"thinking":"idle",notify:(0,N.needsThreadReply)(e),crossed:"cancelled"===e.status,className:"shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(u.DialogTitle,{className:"sr-only",children:e.label}),(0,t.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:e.label}),(0,t.jsxs)("div",{className:"mt-0.5 flex min-w-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{title:e.id,className:"min-w-0 truncate",children:[e.bot," · ",(0,C.whenOf)(e.updatedAt)]}),(0,t.jsx)(S.ThreadFacts,{thread:p})]})]}),(0,t.jsx)(K,{thread:e,onStop:()=>a(e),onDelete:()=>i(e),className:"text-muted-foreground"}),(0,t.jsx)(u.DialogClose,{render:(0,t.jsx)(c.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the thread"}),children:(0,t.jsx)(o.X,{})})]}),(0,t.jsx)(S.Conversation,{thread:p,tab:f,onTab:t=>m(n=>({...n,[e.id]:t})),className:"max-h-none min-h-0 flex-1 px-5",tabsClassName:"px-5"}),(0,t.jsx)("div",{className:"shrink-0 px-5 pt-2 pb-4",children:(0,t.jsx)(O.ThreadReply,{thread:{id:e.id,label:e.label,bot:e.bot,ask:e.ask,room:e.room},status:e.status,faces:(0,T.rosterOf)(p),to:f??e.bot})})]})})})})]})}function B(e,t){let n=t?.find(t=>t.name===e)?.icon;return{color:n?.color,shape:n?.shape,outline:n?.outline,paint:n?.paint}}function P({thread:e}){let n=[];if(e.lines.forEach((t,s)=>{if("tool"!==t.kind)return;let a=e.lines[s+1];n.push({step:t,took:a?(0,C.toDate)(a.at).getTime()-(0,C.toDate)(t.at).getTime():null})}),0===n.length)return null;let a=(0,C.toDate)(e.updatedAt).getTime()-(0,C.toDate)(e.createdAt).getTime();return(0,t.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.bot}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsxs)("span",{children:[n.length," ",1===n.length?"step":"steps"]}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsx)("span",{children:L(a)})]}),n.slice(-6).map(({step:e,took:n})=>{let a=(0,y.toolIcon)(e.name);return(0,t.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===n?(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,t.jsx)(a,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:e.name}),null===n?(0,t.jsx)(m.ShinyText,{text:e.note??e.input,speed:2.2,className:"min-w-0 flex-1 truncate"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.note??e.input}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===n?"":L(n)})]},e.id)})]})}function L(e){let t=Math.max(0,e)/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60);return`${n}m ${Math.round(t-60*n)}s`}function E(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)(p.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,t.jsx)(p.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,t.jsxs)("span",{className:(0,I.cn)("flex shrink-0 flex-col items-end gap-1.5",$),children:[(0,t.jsx)(p.Skeleton,{className:"h-2.5 w-12"}),(0,t.jsx)(p.Skeleton,{className:"h-2.5 w-24"})]}),(0,t.jsx)("span",{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"size-7 shrink-0"})]})}e.s(["ThreadSetting",0,function(){let[e,n]=(0,l.useState)(null),[s,a]=(0,l.useState)(""),{data:i}=(0,R.useServerRoute)(d.queryKey.bot),{items:r,isLoading:o,isLoadingMore:u,error:x,hasMore:m,sentinelRef:p}=(0,A.useServerPages)({key:(e,t)=>{if(0===e)return d.queryKey.threadHistory(null);let n=t?.at(-1);return n?d.queryKey.threadHistory((0,C.toDate)(n.updatedAt).toISOString()):null},size:f.PAGE_SIZE}),j=r.find(t=>t.id===e);(0,T.useSeenOnDetail)(j);let[N]=(0,z.useServerAction)(g.cancelThreadAction,{onOk:e=>{(0,R.revalidate)(d.queryKey.threads),T.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),[v]=(0,z.useServerAction)(k,{onOk:()=>(0,R.revalidate)(d.queryKey.threads)}),[w]=(0,z.useServerAction)(b,{onOk:()=>(0,R.revalidate)(d.queryKey.threads)}),y=s.trim().toLowerCase(),S=y?r.filter(e=>[e.label,e.outcome,e.bot].join(" ").toLowerCase().includes(y)):r,D=async()=>{await h.notify.confirm({title:"Clear finished jobs?",description:"Everything done or stopped goes, messages included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&w()},I=async t=>{if(!await h.notify.confirm({title:`Delete "${t.label}"?`,description:"Its messages go with it — nothing can be picked back up.",okText:"Delete",destructive:!0}))return;let s=S.findIndex(e=>e.id===t.id),a=S[s+1]??S[s-1];try{await v(t.id)}catch{return}t.id===e&&n(a?.id??null)};if(o)return(0,t.jsx)(M.SettingSkeleton,{rows:3});if(x)return(0,t.jsx)(M.SettingError,{message:x.message});let O=r.filter(e=>"waiting"===e.status).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(M.SettingRailNote,{children:[r.length," loaded",O>0&&` \xb7 ${O} waiting on you`]}),(0,t.jsx)(c.Button,{variant:"outline",size:"sm",onClick:D,children:"Clear finished"})]}),children:(0,t.jsx)(M.SettingGroup,{filter:(0,t.jsx)(M.SettingFilter,{value:s,onChange:a,placeholder:"Filter by label, bot or word"}),right:y?`${S.length} of ${r.length}`:void 0,children:(0,t.jsxs)(M.SettingItems,{children:[0===S.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:y?"Nothing loaded matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):S.map(e=>(0,t.jsx)(F,{thread:e,bots:i,open:e.id===j?.id,onOpen:()=>n(e.id),onStop:()=>N(e.id),onDelete:()=>I(e)},e.id)),(0,t.jsx)(M.SettingMore,{hasMore:m,loading:u,sentinelRef:p,ghost:(0,t.jsx)(E,{}),className:"divide-y divide-border/60"})]})})}),(0,t.jsx)(q,{thread:j,bots:i,onClose:()=>n(null),onStop:e=>N(e.id),onDelete:I})]})}],457343)},648119,e=>{"use strict";var t=e.i(560972);e.s(["MoreHorizontal",()=>t.default])},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,457343,e=>{"use strict";var t=e.i(843476),n=e.i(867927),s=e.i(632781),a=e.i(648119),i=e.i(929272),r=e.i(759659),o=e.i(263676),l=e.i(271645),d=e.i(798120),c=e.i(167881),u=e.i(630374),x=e.i(463415),h=e.i(917162),m=e.i(660302),p=e.i(671428),f=e.i(41533),g=e.i(711800),j=e.i(95187);let b=(0,j.createServerReference)("7f0bc715041b3e1b8e0da3a67c31c9d3ff2d973834",j.callServer,void 0,j.findSourceMapURL,"clearFinishedThreadsAction"),k=(0,j.createServerReference)("7fa917f3a1efb2be573c7cb75e7111c1535078fdac",j.callServer,void 0,j.findSourceMapURL,"deleteThreadAction");var N=e.i(451888),v=e.i(635963),w=e.i(835878),y=e.i(222055),S=e.i(351866),T=e.i(978411),D=e.i(431594),M=e.i(895836),C=e.i(245629),z=e.i(609856),A=e.i(661504),R=e.i(283653),I=e.i(647163),O=e.i(399512);let $="w-36";function F({thread:e,bots:a,open:i,onOpen:r,onStop:o,onDelete:d}){let c="running"===e.status,u=(0,l.useMemo)(()=>(0,T.threadFromRow)(e,a),[e,a]),x=function(e){let t=e.room.questions[0];if(t)return{text:(0,I.plainText)(t.text),tone:I.WAITING_INK};if("waiting"===e.status&&e.ask)return{text:(0,N.isAppStop)(e.ask)?(0,I.plainText)(e.outcome??e.ask.question):e.ask.question,tone:I.WAITING_INK};let n=e.seen;if("cancelled"===e.status)return{text:"Stopped",tone:"text-muted-foreground"};if("done"===e.status)return{text:(0,I.plainText)(e.outcome??"Done"),tone:n?"text-muted-foreground":"text-foreground/80"};for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("tool"===n.kind)return{text:n.note??n.input,tone:"text-muted-foreground",tool:n.name,shine:!0};if("text"===n.kind)return{text:n.text,tone:"text-muted-foreground",shine:!0};if("user"===n.kind)break}return{text:`${e.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(e),h=e.tokens.input+e.tokens.output;return(0,t.jsxs)("div",{className:(0,I.cn)("group/row relative transition-colors",i?"bg-muted/80":"hover:bg-muted/50"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsxs)("button",{type:"button",onClick:r,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(v.BotMark,{size:40,seed:e.bot,...B(e.bot,a),state:c?"thinking":"idle",notify:(0,N.needsThreadReply)(e),crossed:"cancelled"===e.status,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),e.routineId&&(0,t.jsx)("span",{title:"Started by a routine",className:"shrink-0",children:(0,t.jsx)(D.RoutineMark,{className:"size-3 text-muted-foreground/80"})}),(0,t.jsx)(w.BotRoster,{bots:(0,T.rosterOf)(u)}),c&&(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),x&&(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[x.tool&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:x.tool}),x.shine?(0,t.jsx)(m.ShinyText,{text:x.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 truncate",x.tone),children:x.text})]})]}),(0,t.jsxs)("span",{className:(0,I.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",$),children:[(0,t.jsx)("span",{children:(0,C.whenOf)(e.updatedAt)}),(0,t.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:h>0?`${e.id} \xb7 in ${(0,I.formatCount)(e.tokens.input)} \xb7 out ${(0,I.formatCount)(e.tokens.output)}`:e.id,children:[e.bot,h>0&&` \xb7 ${(0,I.formatCount)(h)}`]})]}),(0,t.jsx)(n.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(K,{thread:e,onStop:o,onDelete:d})]}),c&&(0,t.jsx)(P,{thread:e})]})}function K({thread:e,onStop:n,onDelete:s,className:o}){let l="running"===e.status||"waiting"===e.status;return(0,t.jsxs)(x.DropdownMenu,{children:[(0,t.jsx)(x.DropdownMenuTrigger,{render:(0,t.jsx)(c.Button,{size:"icon-sm",variant:"ghost",className:o}),children:(0,t.jsx)(a.MoreHorizontal,{})}),(0,t.jsxs)(x.DropdownMenuContent,{align:"end",children:[l&&(0,t.jsxs)(x.DropdownMenuItem,{onClick:n,children:[(0,t.jsx)(i.Square,{}),"Stop"]}),(0,t.jsxs)(x.DropdownMenuItem,{variant:"destructive",onClick:s,children:[(0,t.jsx)(r.Trash2,{}),"Delete"]})]})]})}function q({thread:e,bots:n,onClose:s,onStop:a,onDelete:i}){let[r,d]=(0,l.useState)(null),x=(0,l.useCallback)(e=>{d(e?.closest("[data-slot=dialog-content]")??null)},[]),[h,m]=(0,l.useState)({}),p=(0,l.useMemo)(()=>e?(0,T.threadFromRow)(e,n):null,[e,n]),f=e?h[e.id]??null:null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:x,hidden:!0}),(0,t.jsx)(u.Dialog,{open:!!(e&&r),onOpenChange:e=>!e&&s(),modal:!1,disablePointerDismissal:!0,children:(0,t.jsx)(u.DialogPortal,{container:r,children:(0,t.jsx)(u.DialogPopup,{className:"absolute inset-y-0 right-0 z-10 flex w-[min(35rem,calc(100%-13rem))] flex-col border-l border-border/60 bg-popover text-popover-foreground shadow-2xl shadow-black/10 duration-150 data-open:animate-in data-open:fade-in-0 data-open:slide-in-from-right-4 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-right-4",children:e&&p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[(0,t.jsx)(v.BotMark,{size:28,seed:e.bot,...B(e.bot,n),state:"running"===e.status?"thinking":"idle",notify:(0,N.needsThreadReply)(e),crossed:"cancelled"===e.status,className:"shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(u.DialogTitle,{className:"sr-only",children:e.label}),(0,t.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:e.label}),(0,t.jsxs)("div",{className:"mt-0.5 flex min-w-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{title:e.id,className:"min-w-0 truncate",children:[e.bot," · ",(0,C.whenOf)(e.updatedAt)]}),(0,t.jsx)(S.ThreadFacts,{thread:p})]})]}),(0,t.jsx)(K,{thread:e,onStop:()=>a(e),onDelete:()=>i(e),className:"text-muted-foreground"}),(0,t.jsx)(u.DialogClose,{render:(0,t.jsx)(c.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the thread"}),children:(0,t.jsx)(o.X,{})})]}),(0,t.jsx)(S.Conversation,{thread:p,tab:f,onTab:t=>m(n=>({...n,[e.id]:t})),className:"max-h-none min-h-0 flex-1 px-5",tabsClassName:"px-5"}),(0,t.jsx)("div",{className:"shrink-0 px-5 pt-2 pb-4",children:(0,t.jsx)(O.ThreadReply,{thread:{id:e.id,label:e.label,bot:e.bot,ask:e.ask,room:e.room},status:e.status,faces:(0,T.rosterOf)(p),to:f??e.bot})})]})})})})]})}function B(e,t){let n=t?.find(t=>t.name===e)?.icon;return{color:n?.color,shape:n?.shape,outline:n?.outline,paint:n?.paint}}function P({thread:e}){let n=[];if(e.lines.forEach((t,s)=>{if("tool"!==t.kind)return;let a=e.lines[s+1];n.push({step:t,took:a?(0,C.toDate)(a.at).getTime()-(0,C.toDate)(t.at).getTime():null})}),0===n.length)return null;let a=(0,C.toDate)(e.updatedAt).getTime()-(0,C.toDate)(e.createdAt).getTime();return(0,t.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.bot}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsxs)("span",{children:[n.length," ",1===n.length?"step":"steps"]}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsx)("span",{children:L(a)})]}),n.slice(-6).map(({step:e,took:n})=>{let a=(0,y.toolIcon)(e.name);return(0,t.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===n?(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,t.jsx)(a,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:e.name}),null===n?(0,t.jsx)(m.ShinyText,{text:e.note??e.input,speed:2.2,className:"min-w-0 flex-1 truncate"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.note??e.input}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===n?"":L(n)})]},e.id)})]})}function L(e){let t=Math.max(0,e)/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60);return`${n}m ${Math.round(t-60*n)}s`}function E(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)(p.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,t.jsx)(p.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,t.jsxs)("span",{className:(0,I.cn)("flex shrink-0 flex-col items-end gap-1.5",$),children:[(0,t.jsx)(p.Skeleton,{className:"h-2.5 w-12"}),(0,t.jsx)(p.Skeleton,{className:"h-2.5 w-24"})]}),(0,t.jsx)("span",{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"size-7 shrink-0"})]})}e.s(["ThreadSetting",0,function(){let[e,n]=(0,l.useState)(null),[s,a]=(0,l.useState)(""),{data:i}=(0,R.useServerRoute)(d.queryKey.bot),{items:r,isLoading:o,isLoadingMore:u,error:x,hasMore:m,sentinelRef:p}=(0,A.useServerPages)({key:(e,t)=>{if(0===e)return d.queryKey.threadHistory(null);let n=t?.at(-1);return n?d.queryKey.threadHistory((0,C.toDate)(n.updatedAt).toISOString()):null},size:f.PAGE_SIZE}),j=r.find(t=>t.id===e);(0,T.useSeenOnDetail)(j);let[N]=(0,z.useServerAction)(g.cancelThreadAction,{onOk:e=>{(0,R.revalidate)(d.queryKey.threads),T.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),[v]=(0,z.useServerAction)(k,{onOk:()=>(0,R.revalidate)(d.queryKey.threads)}),[w]=(0,z.useServerAction)(b,{onOk:()=>(0,R.revalidate)(d.queryKey.threads)}),y=s.trim().toLowerCase(),S=y?r.filter(e=>[e.label,e.outcome,e.bot].join(" ").toLowerCase().includes(y)):r,D=async()=>{await h.notify.confirm({title:"Clear finished jobs?",description:"Everything done or stopped goes, messages included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&w()},I=async t=>{if(!await h.notify.confirm({title:`Delete "${t.label}"?`,description:"Its messages go with it — nothing can be picked back up.",okText:"Delete",destructive:!0}))return;let s=S.findIndex(e=>e.id===t.id),a=S[s+1]??S[s-1];try{await v(t.id)}catch{return}t.id===e&&n(a?.id??null)};if(o)return(0,t.jsx)(M.SettingSkeleton,{rows:3});if(x)return(0,t.jsx)(M.SettingError,{message:x.message});let O=r.filter(e=>"waiting"===e.status).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(M.SettingRailNote,{children:[r.length," loaded",O>0&&` \xb7 ${O} waiting on you`]}),(0,t.jsx)(c.Button,{variant:"outline",size:"sm",onClick:D,children:"Clear finished"})]}),children:(0,t.jsx)(M.SettingGroup,{filter:(0,t.jsx)(M.SettingFilter,{value:s,onChange:a,placeholder:"Filter by label, bot or word"}),right:y?`${S.length} of ${r.length}`:void 0,children:(0,t.jsxs)(M.SettingItems,{children:[0===S.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:y?"Nothing loaded matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):S.map(e=>(0,t.jsx)(F,{thread:e,bots:i,open:e.id===j?.id,onOpen:()=>n(e.id),onStop:()=>N(e.id),onDelete:()=>I(e)},e.id)),(0,t.jsx)(M.SettingMore,{hasMore:m,loading:u,sentinelRef:p,ghost:(0,t.jsx)(E,{}),className:"divide-y divide-border/60"})]})})}),(0,t.jsx)(q,{thread:j,bots:i,onClose:()=>n(null),onStop:e=>N(e.id),onDelete:I})]})}],457343)},648119,e=>{"use strict";var t=e.i(560972);e.s(["MoreHorizontal",()=>t.default])},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)}]);
@@ -1,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 n=(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)(n({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),n=e.i(456420);let i={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"}]]};i.node;let l=(0,n.default)(i),o={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};o.node;let d=(0,n.default)(o);var c=e.i(77071),u=e.i(759659),m=e.i(263676),h=e.i(271645),f=e.i(798120),p=e.i(167881),x=e.i(986530),g=e.i(23750),v=e.i(917162),b=e.i(671428),j=e.i(127341),y=e.i(184762),k=e.i(41533),N=e.i(968978),S=e.i(265402),w=e.i(670097),C=e.i(640262),z=e.i(96892);let F={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"}]]};F.node;let A=(0,n.default)(F);var M=e.i(716327),L=e.i(632781);let R={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};R.node;let T=(0,n.default)(R);var O=e.i(660302),B=e.i(146538),$=e.i(213377),E=e.i(647163);let P=new C.DefaultChatTransport({api:f.queryKey.memoryEdit});function D({notes:e}){let[a,r]=(0,h.useState)(""),[s,n]=(0,h.useState)({provider:null,model:""}),[i,l]=(0,h.useState)(!1),{messages:o,sendMessage:d,setMessages:c,status:u,stop:m,error:f,clearError:x}=(0,w.useChat)({transport:P}),g=(0,h.useRef)(m);g.current=m,(0,h.useEffect)(()=>()=>{g.current()},[]);let v=(0,h.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 b="submitted"===u||"streaming"===u,j=!!(s.provider&&s.model.trim()),y=[...o].reverse().find(e=>"assistant"===e.role),k=y?.parts??[],S=k.filter(C.isToolUIPart),F=k.flatMap(e=>"text"===e.type?[e.text]:[]).join(" ").trim(),A=!!f||S.some(e=>"output-error"===e.state),L=S.filter(e=>"output-available"===e.state&&(0,C.getToolName)(e)!==$.TOOL_NAMES.memory_recall).length;(0,h.useEffect)(()=>{if("ready"!==u||A||0===o.length)return;let e=setTimeout(()=>c([]),4e3);return()=>clearTimeout(e)},[u,A,o.length,c]);let R=b?(0,t.jsx)(O.ShinyText,{text:"Working on memory",className:"text-xs"}):f?(0,t.jsx)("span",{className:"text-xs text-destructive",children:f.message}):y?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:F||(0===L?"Nothing to change":1===L?"1 change saved":`${L} 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:[i&&(0,t.jsx)("div",{className:"w-full rounded-xl bg-popover p-2 shadow-lg ring-1 ring-foreground/10",children:(0,t.jsx)(B.ModelPicker,{provider:s.provider,model:s.model,unset:"Provider",onChange:n})}),S.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:S.map(e=>(0,t.jsx)(K,{name:(0,C.getToolName)(e),input:e.input,state:e.state,errorText:"output-error"===e.state?e.errorText:void 0,known:v.current},e.toolCallId))}),R&&(0,t.jsx)("p",{className:"max-w-full truncate px-1",children:R}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=a.trim();t&&j&&!b&&(r(""),l(!1),x(),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:b,"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)(p.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>l(!i),className:(0,E.cn)("max-w-44",!j&&"text-muted-foreground"),children:[j&&s.provider?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.ProviderIcon,{provider:s.provider,className:"size-3"}),(0,t.jsx)("span",{className:"truncate",children:s.model})]}):"Model",(0,t.jsx)(M.ChevronDown,{className:"text-muted-foreground"})]}),(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",loading:b,disabled:!a.trim()||!j||b,"aria-label":"Send",children:!b&&(0,t.jsx)(z.ArrowUp,{})})]})]})})}let I={Remember:c.Plus,Replace:l,Forget:T,Rename:l,Opened:A};function K({name:e,input:a,state:s,errorText:n,known:i}){let l=function(e,t,a){let r=t??{};if(e===$.TOOL_NAMES.memory_recall)return{kind:"Opened",path:r.path??"",lines:[],carried:!1};if(e===$.TOOL_NAMES.memory_forget){let e=(r.factIds??[]).filter(e=>null!=e),t=e.map(e=>a.get(e));return{kind:"Forget",path:t.find(e=>e)?.path??"",lines:e.map((e,a)=>({before:t[a]?.text??`Fact #${e}`})),carried:!1}}let s=(r.facts??[]).filter(e=>null!=e),n=s.map(e=>null!=e.replaces?{before:a.get(e.replaces)?.text??`Fact #${e.replaces}`,after:e.text}:{after:e.text});r.description&&n.push({after:`“${r.description}”`});let i=(r.aliases??[]).filter(Boolean);return i.length&&n.push({after:`Called ${i.map(e=>`“${e}”`).join(", ")}`}),{kind:s.some(e=>null!=e.replaces)?"Replace":s.length?"Remember":"Rename",path:r.path??"",lines:n,carried:s.some(e=>e.alwaysLoad)}}(e,a,i),o=I[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}`,l.carried&&" · carried into every call"]}),d&&n&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:n})]}),(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)(m.X,{className:"size-3.5 text-destructive"}):"output-available"===s?(0,t.jsx)(r.Check,{className:"size-3.5"}):(0,t.jsx)(L.Loader2,{className:"size-3.5 animate-spin"})})]})}var U=e.i(95187);let q=(0,U.createServerReference)("7f0971ae6f804e41d67f1025aa120d5aae7b54122d",U.callServer,void 0,U.findSourceMapURL,"addFactsAction"),_=(0,U.createServerReference)("7f613c3180e5ebe6d59ccfdb49ca64857370285950",U.callServer,void 0,U.findSourceMapURL,"createNoteAction"),V=(0,U.createServerReference)("7f0cae0b4f090c99dc36fb2f27c0fa185ea70396d5",U.callServer,void 0,U.findSourceMapURL,"deleteNoteAction"),H=(0,U.createServerReference)("7fc84c5e9af8ab7c523daaf9bbcacce53b587a4eae",U.callServer,void 0,U.findSourceMapURL,"forgetFactAction"),W=(0,U.createServerReference)("7f53dfd755ddd439971369bb94a70c6eb12e46535a",U.callServer,void 0,U.findSourceMapURL,"reviseFactAction"),X=(0,U.createServerReference)("7f8a5abfc7504ee1eb38c762125d4ee3e7a62002b8",U.callServer,void 0,U.findSourceMapURL,"setFactAlwaysLoadAction"),G=(0,U.createServerReference)("7f3167c5fbd04ab35ebd4b0e96777d21c1fcbe437d",U.callServer,void 0,U.findSourceMapURL,"updateNoteAction");var Y=e.i(681307),Z=e.i(245629);let J=Y.z.enum(["user","call","bot"]),Q=Y.z.object({id:Y.z.number(),text:Y.z.string(),alwaysLoad:Y.z.boolean(),source:J.nullish(),createdAt:Z.DateLikeSchema});Y.z.object({id:Y.z.number(),path:Y.z.string(),description:Y.z.string(),aliases:Y.z.string().array().nullish(),ownedByUser:Y.z.boolean(),hits:Y.z.number(),lastReadAt:Z.DateLikeSchema.nullable(),createdAt:Z.DateLikeSchema,updatedAt:Z.DateLikeSchema,factCount:Y.z.number(),facts:Q.array()});let ee=[{path:"profile",of:"The user themselves — their name, age, what they do, where they live, and whatever else says who they are"},{path:"preferences",of:"How they want things done, and said"},{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"}],et=ee.filter(e=>!e.path.endsWith("/")).map(e=>e.path),ea=ee.filter(e=>e.path.endsWith("/")).map(e=>e.path.slice(0,-1));RegExp(`^(?:${et.join("|")}|(?:${ea.join("|")})/.+)$`);let er=["profile","preferences"];var es=e.i(895836),en=e.i(609856),ei=e.i(661504),el=e.i(283653);let eo=[{key:"you",label:"You"},{key:"people",label:"People"},{key:"projects",label:"Projects"},{key:"topics",label:"Topics"},{key:"other",label:"Other"}],ed={onOk:()=>(0,el.revalidate)(f.queryKey.memory)},ec=S.textModelProviderSchema.options.filter(e=>"chatgpt"!==e);function eu(){return(0,t.jsx)("span",{className:"mr-0.5 flex items-center",children:ec.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)(N.ProviderIcon,{provider:e,className:"size-3"})},e))})}function em(e,t){return a=>{a.nativeEvent.isComposing||229===a.keyCode||("Enter"===a.key&&(a.preventDefault(),e()),"Escape"===a.key&&(a.stopPropagation(),t()))}}function eh({note:e,open:a,onToggle:r}){var n;let i,o,d,c,m,[f,x]=(0,h.useState)(!1),[g,b]=(0,en.useServerAction)(V,ed),j=async()=>{await v.notify.confirm({title:`Forget ${e.path}?`,description:"Every fact in this note is deleted for good.",okText:"Delete",destructive:!0})&&g(e.id)},y=(0,t.jsx)("span",{className:"w-36 shrink-0 truncate text-sm font-medium",children:-1===(i=(n=e.path).indexOf("/"))?n:n.slice(i+1)});return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex h-12 items-center gap-3 pr-2 pl-4",children:f?(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)(ef,{note:e,onDone:()=>x(!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,!er.includes(o)&&.15>(d=(0,Z.toDate)(e.lastReadAt??e.createdAt),c=Math.max(0,(Date.now()-d.getTime())/864e5),(e.hits+1)/(1+c))&&!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,Z.shortAgo)(e.lastReadAt):"—"})]}),(0,t.jsx)("span",{className:"flex w-15 shrink-0 justify-end",children:a&&(0,t.jsxs)(t.Fragment,{children:[(m=e.path,!er.includes(m)&&(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit the note's line",onClick:()=>x(!0),children:(0,t.jsx)(l,{})})),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this note",loading:b,onClick:j,children:!b&&(0,t.jsx)(u.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)(ep,{noteId:e.id}),e.facts.map(a=>(0,t.jsx)(ex,{noteId:e.id,fact:a},a.id))]})]})}function ef({note:e,onDone:a}){let[s,n]=(0,h.useState)(e.description),[i,l]=(0,en.useServerAction)(G,{onOk:()=>{a(),(0,el.revalidate)(f.queryKey.memory)}}),o=()=>{let t=s.trim();if(!t||t===e.description)return a();i(e.id,{description:t})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Input,{autoFocus:!0,value:s,onChange:e=>n(e.target.value),onKeyDown:em(o,a),"aria-label":"The note's line",placeholder:"One line the agent sees in its note list",className:"h-8 min-w-0 flex-1 text-[13px]"}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:l,onClick:o,children:!l&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:a,children:(0,t.jsx)(m.X,{})})]})}function ep({noteId:e}){let[a,r]=(0,h.useState)(""),[s,n]=(0,en.useServerAction)(q,{onOk:()=>{r(""),(0,el.revalidate)(f.queryKey.memory)}}),i=()=>{let t=a.trim();t&&!n&&s(e,[t])};return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pb-1",children:[(0,t.jsx)(g.Input,{value:a,onChange:e=>r(e.target.value),onKeyDown:em(i,()=>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)(p.Button,{size:"sm",variant:"outline",loading:n,disabled:!a.trim(),onClick:i,children:[!n&&(0,t.jsx)(c.Plus,{}),"Add"]})]})}function ex({noteId:e,fact:s}){let n,[i,o]=(0,h.useState)(!1),[c,x]=(0,h.useState)(s.text),[v,b]=(0,en.useServerAction)(W,{onOk:()=>{o(!1),(0,el.revalidate)(f.queryKey.memory)}}),[j,y]=(0,en.useServerAction)(X,ed),[k,N]=(0,en.useServerAction)(H,ed),S=()=>{let t=c.trim();if(!t||t===s.text)return o(!1);v(e,s.id,t)},w="user"===(n=s.source)?"you":"call"===n?"on a call":"bot"===n?"a bot":"";return(0,t.jsxs)("div",{className:"flex min-h-10 items-center gap-1.5",children:[(0,t.jsx)(p.Button,{size:"icon-sm",variant:s.alwaysLoad?"secondary":"ghost","aria-pressed":s.alwaysLoad,"aria-label":s.alwaysLoad?"Stop carrying into calls":"Carry into every call",title:"Carried into every call, without opening this note",loading:y,onClick:()=>j(e,s.id,!s.alwaysLoad),children:!y&&(0,t.jsx)(d,{className:(0,E.cn)(!s.alwaysLoad&&"text-muted-foreground/45")})}),i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Input,{autoFocus:!0,value:c,onChange:e=>x(e.target.value),onKeyDown:em(S,()=>o(!1)),"aria-label":"Fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:b,onClick:S,children:!b&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>o(!1),children:(0,t.jsx)(m.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"),w&&` \xb7 ${w}`]}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit this fact",onClick:()=>{x(s.text),o(!0)},children:(0,t.jsx)(l,{})}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this fact",loading:N,onClick:()=>k(e,s.id),children:!N&&(0,t.jsx)(u.Trash2,{})})]})]})}let eg=[{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 ev(){return v.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(eb,{onDone:e})})}function eb({onDone:e}){let[a,r]=(0,h.useState)("people"),[s,n]=(0,h.useState)(""),[i,l]=(0,h.useState)(""),[o,d]=(0,h.useState)(""),[u,m,,v]=(0,en.useServerAction)(_,{errorMessage:!1,onOk:()=>{(0,el.revalidate)(f.queryKey.memory),e()}}),b=eg.find(e=>e.key===a),k=s.trim()&&i.trim()&&!m,N=()=>{k&&u(`${a}/${s.trim()}`,i.trim(),o.split("\n").map(e=>e.trim()).filter(Boolean))};return(0,t.jsxs)(es.SettingDialogContent,{title:"New note",description:"Where the agent files what it learns about this subject.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(p.Button,{disabled:!k,loading:m,onClick:N,children:[!m&&(0,t.jsx)(c.Plus,{}),"Create"]})]}),children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Kind"}),(0,t.jsx)(j.Tabs,{value:a,onValueChange:e=>r(e),children:(0,t.jsx)(j.TabsList,{className:"w-full",children:eg.map(e=>(0,t.jsx)(j.TabsTrigger,{value:e.key,children:e.label},e.key))})})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{htmlFor:"note-name",children:"Name"}),(0,t.jsxs)(x.FieldContent,{children:[(0,t.jsx)(g.Input,{id:"note-name",value:s,onChange:e=>n(e.target.value),placeholder:b?.placeholder,spellCheck:!1,required:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[a,"/",s.trim()||"…"]})]})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{htmlFor:"note-summary",children:"Summary"}),(0,t.jsx)(x.FieldContent,{children:(0,t.jsx)(g.Input,{id:"note-summary",value:i,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&N(),placeholder:"One line the agent sees in its note list",required:!0})})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{htmlFor:"note-facts",children:"Facts"}),(0,t.jsx)(y.Textarea,{id:"note-facts",value:o,onChange:e=>d(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 n=(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)(n({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),n=e.i(456420);let i={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"}]]};i.node;let l=(0,n.default)(i),o={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};o.node;let d=(0,n.default)(o);var c=e.i(77071),u=e.i(759659),m=e.i(263676),h=e.i(271645),f=e.i(798120),p=e.i(167881),x=e.i(986530),g=e.i(23750),v=e.i(917162),b=e.i(671428),j=e.i(127341),y=e.i(184762),k=e.i(41533),N=e.i(968978),S=e.i(265402),w=e.i(670097),C=e.i(640262),z=e.i(96892);let F={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"}]]};F.node;let A=(0,n.default)(F);var M=e.i(716327),L=e.i(632781);let R={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};R.node;let T=(0,n.default)(R);var O=e.i(660302),B=e.i(146538),$=e.i(213377),E=e.i(647163);let P=new C.DefaultChatTransport({api:f.queryKey.memoryEdit});function D({notes:e}){let[a,r]=(0,h.useState)(""),[s,n]=(0,h.useState)({provider:null,model:""}),[i,l]=(0,h.useState)(!1),{messages:o,sendMessage:d,setMessages:c,status:u,stop:m,error:f,clearError:x}=(0,w.useChat)({transport:P}),g=(0,h.useRef)(m);g.current=m,(0,h.useEffect)(()=>()=>{g.current()},[]);let v=(0,h.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 b="submitted"===u||"streaming"===u,j=!!(s.provider&&s.model.trim()),y=[...o].reverse().find(e=>"assistant"===e.role),k=y?.parts??[],S=k.filter(C.isToolUIPart),F=k.flatMap(e=>"text"===e.type?[e.text]:[]).join(" ").trim(),A=!!f||S.some(e=>"output-error"===e.state),L=S.filter(e=>"output-available"===e.state&&(0,C.getToolName)(e)!==$.TOOL_NAMES.memory_recall).length;(0,h.useEffect)(()=>{if("ready"!==u||A||0===o.length)return;let e=setTimeout(()=>c([]),4e3);return()=>clearTimeout(e)},[u,A,o.length,c]);let R=b?(0,t.jsx)(O.ShinyText,{text:"Working on memory",className:"text-xs"}):f?(0,t.jsx)("span",{className:"text-xs text-destructive",children:f.message}):y?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:F||(0===L?"Nothing to change":1===L?"1 change saved":`${L} 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:[i&&(0,t.jsx)("div",{className:"w-full rounded-xl bg-popover p-2 shadow-lg ring-1 ring-foreground/10",children:(0,t.jsx)(B.ModelPicker,{provider:s.provider,model:s.model,unset:"Provider",onChange:n})}),S.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:S.map(e=>(0,t.jsx)(K,{name:(0,C.getToolName)(e),input:e.input,state:e.state,errorText:"output-error"===e.state?e.errorText:void 0,known:v.current},e.toolCallId))}),R&&(0,t.jsx)("p",{className:"max-w-full truncate px-1",children:R}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=a.trim();t&&j&&!b&&(r(""),l(!1),x(),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:b,"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)(p.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>l(!i),className:(0,E.cn)("max-w-44",!j&&"text-muted-foreground"),children:[j&&s.provider?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.ProviderIcon,{provider:s.provider,className:"size-3"}),(0,t.jsx)("span",{className:"truncate",children:s.model})]}):"Model",(0,t.jsx)(M.ChevronDown,{className:"text-muted-foreground"})]}),(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",loading:b,disabled:!a.trim()||!j||b,"aria-label":"Send",children:!b&&(0,t.jsx)(z.ArrowUp,{})})]})]})})}let I={Remember:c.Plus,Replace:l,Forget:T,Rename:l,Opened:A};function K({name:e,input:a,state:s,errorText:n,known:i}){let l=function(e,t,a){let r=t??{};if(e===$.TOOL_NAMES.memory_recall)return{kind:"Opened",path:r.path??"",lines:[],carried:!1};if(e===$.TOOL_NAMES.memory_forget){let e=(r.factIds??[]).filter(e=>null!=e),t=e.map(e=>a.get(e));return{kind:"Forget",path:t.find(e=>e)?.path??"",lines:e.map((e,a)=>({before:t[a]?.text??`Fact #${e}`})),carried:!1}}let s=(r.facts??[]).filter(e=>null!=e),n=s.map(e=>null!=e.replaces?{before:a.get(e.replaces)?.text??`Fact #${e.replaces}`,after:e.text}:{after:e.text});r.description&&n.push({after:`“${r.description}”`});let i=(r.aliases??[]).filter(Boolean);return i.length&&n.push({after:`Called ${i.map(e=>`“${e}”`).join(", ")}`}),{kind:s.some(e=>null!=e.replaces)?"Replace":s.length?"Remember":"Rename",path:r.path??"",lines:n,carried:s.some(e=>e.alwaysLoad)}}(e,a,i),o=I[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}`,l.carried&&" · carried into every call"]}),d&&n&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:n})]}),(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)(m.X,{className:"size-3.5 text-destructive"}):"output-available"===s?(0,t.jsx)(r.Check,{className:"size-3.5"}):(0,t.jsx)(L.Loader2,{className:"size-3.5 animate-spin"})})]})}var U=e.i(95187);let q=(0,U.createServerReference)("7f3d3958951c383dd4ebb10af86cfbcad19895bf89",U.callServer,void 0,U.findSourceMapURL,"addFactsAction"),_=(0,U.createServerReference)("7fa3b9c4f93dcdd094a2195a28d0991caba0ae50b6",U.callServer,void 0,U.findSourceMapURL,"createNoteAction"),V=(0,U.createServerReference)("7fe828f1b32683a2b99c0ce44ddc59f9d9c58ea70b",U.callServer,void 0,U.findSourceMapURL,"deleteNoteAction"),H=(0,U.createServerReference)("7f8080b114b946c314387e423e89536de9d7b90f4c",U.callServer,void 0,U.findSourceMapURL,"forgetFactAction"),W=(0,U.createServerReference)("7ff1c0e8ec9950d14c31a0342a6a22dfb76f91325a",U.callServer,void 0,U.findSourceMapURL,"reviseFactAction"),X=(0,U.createServerReference)("7f7aef7266b7786b29a663ff595c3d7c74343c24d2",U.callServer,void 0,U.findSourceMapURL,"setFactAlwaysLoadAction"),G=(0,U.createServerReference)("7fb07800634295b9b67d266d6060a4facfb2973e91",U.callServer,void 0,U.findSourceMapURL,"updateNoteAction");var Y=e.i(681307),Z=e.i(245629);let J=Y.z.enum(["user","call","bot"]),Q=Y.z.object({id:Y.z.number(),text:Y.z.string(),alwaysLoad:Y.z.boolean(),source:J.nullish(),createdAt:Z.DateLikeSchema});Y.z.object({id:Y.z.number(),path:Y.z.string(),description:Y.z.string(),aliases:Y.z.string().array().nullish(),ownedByUser:Y.z.boolean(),hits:Y.z.number(),lastReadAt:Z.DateLikeSchema.nullable(),createdAt:Z.DateLikeSchema,updatedAt:Z.DateLikeSchema,factCount:Y.z.number(),facts:Q.array()});let ee=[{path:"profile",of:"The user themselves — their name, age, what they do, where they live, and whatever else says who they are"},{path:"preferences",of:"How they want things done, and said"},{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"}],et=ee.filter(e=>!e.path.endsWith("/")).map(e=>e.path),ea=ee.filter(e=>e.path.endsWith("/")).map(e=>e.path.slice(0,-1));RegExp(`^(?:${et.join("|")}|(?:${ea.join("|")})/.+)$`);let er=["profile","preferences"];var es=e.i(895836),en=e.i(609856),ei=e.i(661504),el=e.i(283653);let eo=[{key:"you",label:"You"},{key:"people",label:"People"},{key:"projects",label:"Projects"},{key:"topics",label:"Topics"},{key:"other",label:"Other"}],ed={onOk:()=>(0,el.revalidate)(f.queryKey.memory)},ec=S.textModelProviderSchema.options.filter(e=>"chatgpt"!==e);function eu(){return(0,t.jsx)("span",{className:"mr-0.5 flex items-center",children:ec.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)(N.ProviderIcon,{provider:e,className:"size-3"})},e))})}function em(e,t){return a=>{a.nativeEvent.isComposing||229===a.keyCode||("Enter"===a.key&&(a.preventDefault(),e()),"Escape"===a.key&&(a.stopPropagation(),t()))}}function eh({note:e,open:a,onToggle:r}){var n;let i,o,d,c,m,[f,x]=(0,h.useState)(!1),[g,b]=(0,en.useServerAction)(V,ed),j=async()=>{await v.notify.confirm({title:`Forget ${e.path}?`,description:"Every fact in this note is deleted for good.",okText:"Delete",destructive:!0})&&g(e.id)},y=(0,t.jsx)("span",{className:"w-36 shrink-0 truncate text-sm font-medium",children:-1===(i=(n=e.path).indexOf("/"))?n:n.slice(i+1)});return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex h-12 items-center gap-3 pr-2 pl-4",children:f?(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)(ef,{note:e,onDone:()=>x(!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,!er.includes(o)&&.15>(d=(0,Z.toDate)(e.lastReadAt??e.createdAt),c=Math.max(0,(Date.now()-d.getTime())/864e5),(e.hits+1)/(1+c))&&!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,Z.shortAgo)(e.lastReadAt):"—"})]}),(0,t.jsx)("span",{className:"flex w-15 shrink-0 justify-end",children:a&&(0,t.jsxs)(t.Fragment,{children:[(m=e.path,!er.includes(m)&&(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit the note's line",onClick:()=>x(!0),children:(0,t.jsx)(l,{})})),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this note",loading:b,onClick:j,children:!b&&(0,t.jsx)(u.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)(ep,{noteId:e.id}),e.facts.map(a=>(0,t.jsx)(ex,{noteId:e.id,fact:a},a.id))]})]})}function ef({note:e,onDone:a}){let[s,n]=(0,h.useState)(e.description),[i,l]=(0,en.useServerAction)(G,{onOk:()=>{a(),(0,el.revalidate)(f.queryKey.memory)}}),o=()=>{let t=s.trim();if(!t||t===e.description)return a();i(e.id,{description:t})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Input,{autoFocus:!0,value:s,onChange:e=>n(e.target.value),onKeyDown:em(o,a),"aria-label":"The note's line",placeholder:"One line the agent sees in its note list",className:"h-8 min-w-0 flex-1 text-[13px]"}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:l,onClick:o,children:!l&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:a,children:(0,t.jsx)(m.X,{})})]})}function ep({noteId:e}){let[a,r]=(0,h.useState)(""),[s,n]=(0,en.useServerAction)(q,{onOk:()=>{r(""),(0,el.revalidate)(f.queryKey.memory)}}),i=()=>{let t=a.trim();t&&!n&&s(e,[t])};return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pb-1",children:[(0,t.jsx)(g.Input,{value:a,onChange:e=>r(e.target.value),onKeyDown:em(i,()=>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)(p.Button,{size:"sm",variant:"outline",loading:n,disabled:!a.trim(),onClick:i,children:[!n&&(0,t.jsx)(c.Plus,{}),"Add"]})]})}function ex({noteId:e,fact:s}){let n,[i,o]=(0,h.useState)(!1),[c,x]=(0,h.useState)(s.text),[v,b]=(0,en.useServerAction)(W,{onOk:()=>{o(!1),(0,el.revalidate)(f.queryKey.memory)}}),[j,y]=(0,en.useServerAction)(X,ed),[k,N]=(0,en.useServerAction)(H,ed),S=()=>{let t=c.trim();if(!t||t===s.text)return o(!1);v(e,s.id,t)},w="user"===(n=s.source)?"you":"call"===n?"on a call":"bot"===n?"a bot":"";return(0,t.jsxs)("div",{className:"flex min-h-10 items-center gap-1.5",children:[(0,t.jsx)(p.Button,{size:"icon-sm",variant:s.alwaysLoad?"secondary":"ghost","aria-pressed":s.alwaysLoad,"aria-label":s.alwaysLoad?"Stop carrying into calls":"Carry into every call",title:"Carried into every call, without opening this note",loading:y,onClick:()=>j(e,s.id,!s.alwaysLoad),children:!y&&(0,t.jsx)(d,{className:(0,E.cn)(!s.alwaysLoad&&"text-muted-foreground/45")})}),i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Input,{autoFocus:!0,value:c,onChange:e=>x(e.target.value),onKeyDown:em(S,()=>o(!1)),"aria-label":"Fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:b,onClick:S,children:!b&&(0,t.jsx)(r.Check,{})}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>o(!1),children:(0,t.jsx)(m.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"),w&&` \xb7 ${w}`]}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit this fact",onClick:()=>{x(s.text),o(!0)},children:(0,t.jsx)(l,{})}),(0,t.jsx)(p.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this fact",loading:N,onClick:()=>k(e,s.id),children:!N&&(0,t.jsx)(u.Trash2,{})})]})]})}let eg=[{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 ev(){return v.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(eb,{onDone:e})})}function eb({onDone:e}){let[a,r]=(0,h.useState)("people"),[s,n]=(0,h.useState)(""),[i,l]=(0,h.useState)(""),[o,d]=(0,h.useState)(""),[u,m,,v]=(0,en.useServerAction)(_,{errorMessage:!1,onOk:()=>{(0,el.revalidate)(f.queryKey.memory),e()}}),b=eg.find(e=>e.key===a),k=s.trim()&&i.trim()&&!m,N=()=>{k&&u(`${a}/${s.trim()}`,i.trim(),o.split("\n").map(e=>e.trim()).filter(Boolean))};return(0,t.jsxs)(es.SettingDialogContent,{title:"New note",description:"Where the agent files what it learns about this subject.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(p.Button,{disabled:!k,loading:m,onClick:N,children:[!m&&(0,t.jsx)(c.Plus,{}),"Create"]})]}),children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Kind"}),(0,t.jsx)(j.Tabs,{value:a,onValueChange:e=>r(e),children:(0,t.jsx)(j.TabsList,{className:"w-full",children:eg.map(e=>(0,t.jsx)(j.TabsTrigger,{value:e.key,children:e.label},e.key))})})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{htmlFor:"note-name",children:"Name"}),(0,t.jsxs)(x.FieldContent,{children:[(0,t.jsx)(g.Input,{id:"note-name",value:s,onChange:e=>n(e.target.value),placeholder:b?.placeholder,spellCheck:!1,required:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[a,"/",s.trim()||"…"]})]})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{htmlFor:"note-summary",children:"Summary"}),(0,t.jsx)(x.FieldContent,{children:(0,t.jsx)(g.Input,{id:"note-summary",value:i,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&N(),placeholder:"One line the agent sees in its note list",required:!0})})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{htmlFor:"note-facts",children:"Facts"}),(0,t.jsx)(y.Textarea,{id:"note-facts",value:o,onChange:e=>d(e.target.value),placeholder:`One per line
2
2
  ${b?.fact??""}`,className:"min-h-24 resize-none text-sm"})]})]}),v&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:v})]})}e.s(["MemorySetting",0,function(){let{items:e,isLoading:a,isLoadingMore:r,error:s,hasMore:n,sentinelRef:i}=(0,ei.useServerPages)({key:e=>f.queryKey.memoryPage(e*k.PAGE_SIZE)}),[l,o]=(0,h.useState)(""),[d,u]=(0,h.useState)(new Set),[m,x]=(0,h.useState)(!1);if(a)return(0,t.jsx)(es.SettingSkeleton,{});if(s)return(0,t.jsx)(es.SettingError,{message:s.message});let g=l.trim().toLowerCase(),v=g?e.filter(e=>[e.path,e.description,...e.aliases??[],...e.facts.map(e=>e.text)].some(e=>e.toLowerCase().includes(g))):e,j=e.reduce((e,t)=>e+t.factCount,0),y=e.reduce((e,t)=>e+t.facts.filter(e=>e.alwaysLoad).length,0),N=n?"+":"";return(0,t.jsxs)("div",{className:"relative h-full min-h-0",children:[(0,t.jsxs)(es.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(es.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[y," of ",k.MEMORY_LIMITS.carried," carried into every call"]})}),(0,t.jsxs)(p.Button,{size:"sm",variant:m?"secondary":"ghost","aria-pressed":m,onClick:()=>x(!m),children:[(0,t.jsx)(eu,{}),"Edit with a model"]})]}),children:[(0,t.jsx)(es.SettingToolbar,{count:(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[`${e.length}${N} notes \xb7 ${j}${N} facts`,(0,t.jsxs)(p.Button,{size:"sm",variant:"outline",className:"font-sans",onClick:ev,children:[(0,t.jsx)(c.Plus,{}),"New note"]})]}),children:(0,t.jsx)(es.SettingFilter,{value:l,onChange:o,placeholder:"Filter memory"})}),g&&0===v.length&&(0,t.jsx)("p",{className:"px-1 text-xs text-muted-foreground/60",children:"Nothing matches"}),eo.map(({key:e,label:a})=>{let r=v.filter(t=>(function(e){if("profile"===e||"preferences"===e)return"you";let t=e.slice(0,e.indexOf("/"));return ea.includes(t)?t:"other"})(t.path)===e);return 0===r.length?null:(0,t.jsx)(es.SettingGroup,{label:a,children:(0,t.jsx)(es.SettingItems,{children:r.map(e=>(0,t.jsx)(eh,{note:e,open:d.has(e.id)!==!!g,onToggle:()=>{let t;return t=e.id,u(e=>{let a=new Set(e);return a.delete(t)||a.add(t),a})}},e.id))})},e)}),(0,t.jsx)(es.SettingMore,{hasMore:n,loading:r,sentinelRef:i,ghost:(0,t.jsxs)("div",{className:"flex h-12 items-center gap-3 px-4",children:[(0,t.jsx)(b.Skeleton,{className:"h-3 w-24"}),(0,t.jsx)(b.Skeleton,{className:"h-3 w-56"})]})})]}),m&&(0,t.jsx)(D,{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)}]);