thursday-agent 0.1.0 → 0.1.1

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 (204) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +1 -1
  11. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  15. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  16. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/page/server-reference-manifest.json +41 -41
  18. package/.next/server/app/page.js.nft.json +1 -1
  19. package/.next/server/app/page_client-reference-manifest.js +1 -1
  20. package/.next/server/chunks/ssr/[root-of-the-server]__0dfwvr4._.js +1 -1
  21. package/.next/server/chunks/ssr/[root-of-the-server]__1-mnhyd._.js +1 -1
  22. package/.next/server/chunks/ssr/[root-of-the-server]__1e-f3gy._.js +3 -0
  23. package/.next/server/chunks/ssr/{[root-of-the-server]__0ng1y5l._.js → [root-of-the-server]__1ncajna._.js} +2 -2
  24. package/.next/server/chunks/ssr/_077-g6s._.js +1 -1
  25. package/.next/server/chunks/ssr/_0ay6b01._.js +1 -1
  26. package/.next/server/chunks/ssr/_0sf1isi._.js +1 -1
  27. package/.next/server/chunks/ssr/{_0c2y8ks._.js → _124q1la._.js} +2 -2
  28. package/.next/server/chunks/ssr/_19eoufz._.js +3 -0
  29. package/.next/server/chunks/ssr/{_1lz4t71._.js → _1aca4j8._.js} +2 -2
  30. package/.next/server/chunks/ssr/{_06l25rd._.js → _1b3yex3._.js} +2 -2
  31. package/.next/server/chunks/ssr/{_0n0wwfo._.js → _1cb_5sv._.js} +2 -2
  32. package/.next/server/chunks/ssr/{_0vbcev4._.js → _1dnxp2k._.js} +2 -2
  33. package/.next/server/chunks/ssr/_1e-dgz0._.js +1 -1
  34. package/.next/server/chunks/ssr/{_1wlc_pv._.js → _1hkvsg0._.js} +2 -2
  35. package/.next/server/chunks/ssr/{_061oc5l._.js → _1m5popy._.js} +2 -2
  36. package/.next/server/chunks/ssr/{_0-pwe74._.js → _1r2_qk-._.js} +2 -2
  37. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +1 -1
  38. package/.next/server/chunks/ssr/features_config_components_14jqgy4._.js +1 -1
  39. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  40. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  41. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  42. package/.next/server/chunks/ssr/{node_modules_1i1aztk._.js → node_modules_00riwzq._.js} +1 -1
  43. package/.next/server/chunks/ssr/{node_modules_13r64hh._.js → node_modules_012m-mo._.js} +1 -1
  44. package/.next/server/chunks/ssr/{node_modules_01-lnjv._.js → node_modules_01jj5oy._.js} +1 -1
  45. package/.next/server/chunks/ssr/{node_modules_0cagd-a._.js → node_modules_03f-6up._.js} +1 -1
  46. package/.next/server/chunks/ssr/{node_modules_0o9cu2m._.js → node_modules_07_oxjr._.js} +1 -1
  47. package/.next/server/chunks/ssr/{node_modules_06gkc-1._.js → node_modules_0egn4iq._.js} +1 -1
  48. package/.next/server/chunks/ssr/{node_modules_0510bcb._.js → node_modules_0eqdzva._.js} +1 -1
  49. package/.next/server/chunks/ssr/{node_modules_12ilj3x._.js → node_modules_0ewynyi._.js} +1 -1
  50. package/.next/server/chunks/ssr/{node_modules_18h15oi._.js → node_modules_0i37h34._.js} +1 -1
  51. package/.next/server/chunks/ssr/{node_modules_14qjnj6._.js → node_modules_0nh2m35._.js} +1 -1
  52. package/.next/server/chunks/ssr/{node_modules_04m323e._.js → node_modules_0nq_p-o._.js} +1 -1
  53. package/.next/server/chunks/ssr/{node_modules_1hfkkak._.js → node_modules_0sbobpz._.js} +1 -1
  54. package/.next/server/chunks/ssr/{node_modules_20oe6vi._.js → node_modules_0xe_k12._.js} +1 -1
  55. package/.next/server/chunks/ssr/{node_modules_1ekezwy._.js → node_modules_14uxpfb._.js} +1 -1
  56. package/.next/server/chunks/ssr/{node_modules_1ci9xpq._.js → node_modules_17c71fz._.js} +1 -1
  57. package/.next/server/chunks/ssr/{node_modules_1czzodm._.js → node_modules_17ls31t._.js} +1 -1
  58. package/.next/server/chunks/ssr/{node_modules_0n9m8ww._.js → node_modules_1854ebs._.js} +1 -1
  59. package/.next/server/chunks/ssr/{node_modules_0okab9u._.js → node_modules_1_w_b81._.js} +1 -1
  60. package/.next/server/chunks/ssr/{node_modules_0eq4z64._.js → node_modules_1bjm3ch._.js} +1 -1
  61. package/.next/server/chunks/ssr/{node_modules_1bog3e3._.js → node_modules_1euv75v._.js} +1 -1
  62. package/.next/server/chunks/ssr/{node_modules_0a7_hec._.js → node_modules_1fsvm8f._.js} +1 -1
  63. package/.next/server/chunks/ssr/{node_modules_0egyezs._.js → node_modules_1kj6swe._.js} +1 -1
  64. package/.next/server/chunks/ssr/{node_modules_0kc8lu9._.js → node_modules_1mnmhse._.js} +1 -1
  65. package/.next/server/chunks/ssr/{node_modules_1wya71n._.js → node_modules_1wsx1pg._.js} +1 -1
  66. package/.next/server/chunks/ssr/{node_modules_0snv8wz._.js → node_modules_1y1m-q4._.js} +1 -1
  67. package/.next/server/chunks/ssr/{node_modules_126jgz-._.js → node_modules_1yxkq1s._.js} +1 -1
  68. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0babb8b._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1f5re6n._.js} +1 -1
  69. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0jiglry._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_216aa7f._.js} +1 -1
  70. package/.next/server/middleware-build-manifest.js +3 -3
  71. package/.next/server/pages/404.html +1 -1
  72. package/.next/server/pages/500.html +1 -1
  73. package/.next/server/server-reference-manifest.js +1 -1
  74. package/.next/server/server-reference-manifest.json +42 -42
  75. package/.next/static/chunks/{1n0rxcrn8v33a.js → 0_6qjj4f3t3j-.js} +1 -1
  76. package/.next/static/chunks/{16jdhpex5davi.js → 0g2n0xskvyk04.js} +1 -1
  77. package/.next/static/chunks/{2tab0u1fay-lo.js → 0h7pjyewk7ky-.js} +1 -1
  78. package/.next/static/chunks/{1ti6qqe8rxjc9.js → 0yn2yol46cj77.js} +1 -1
  79. package/.next/static/chunks/{3ktulatcmvs36.js → 14s7e14xltx47.js} +1 -1
  80. package/.next/static/chunks/{1n1_b0m4z2r2l.js → 1lpdcqos7mkek.js} +1 -1
  81. package/.next/static/chunks/{225bcu0dkzwh9.js → 1rja48de93vvx.js} +1 -1
  82. package/.next/static/chunks/{3v_k5wbdx5z1e.js → 1u5d-pvhwir9g.js} +1 -1
  83. package/.next/static/chunks/{3imn63hmy-dvm.js → 261871a8ot1pi.js} +1 -1
  84. package/.next/static/chunks/{2bd12_uvbr996.js → 2cgzsjzheo2m2.js} +1 -1
  85. package/.next/static/chunks/{26jl58p1cmfyz.js → 2ka9uwo_evj7a.js} +1 -1
  86. package/.next/static/chunks/{3a8ieqoovwtgg.js → 2kl3n2d-4-7i5.js} +1 -1
  87. package/.next/static/chunks/{17yxvpmlyxotg.js → 2qci2z603es_m.js} +1 -1
  88. package/.next/static/chunks/{07hfxlyqq92v-.js → 2v_vqhmdl8de_.js} +1 -1
  89. package/.next/static/chunks/{0m28u02ktcwrt.js → 34eu8t79ko6lm.js} +1 -1
  90. package/.next/static/chunks/{0qwvymwynno3x.js → 35uo6rtl_otbd.js} +1 -1
  91. package/.next/static/chunks/{0t7ve-t64i24a.js → 3w7-y53xzl2ir.js} +1 -1
  92. package/.next/static/chunks/{1ma7gsnw16oor.js → 3yan6-5cvpk2o.js} +1 -1
  93. package/package.json +3 -17
  94. package/.next/server/chunks/ssr/[root-of-the-server]__1d9rffu._.js +0 -3
  95. package/.next/server/chunks/ssr/_0g7xsms._.js +0 -3
  96. package/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
  97. package/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -219
  98. package/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
  99. package/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.18.6 +0 -0
  100. package/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -43
  101. package/node_modules/@img/sharp-libvips-linux-x64/versions.json +0 -30
  102. package/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  103. package/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -219
  104. package/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  105. package/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.18.6 +0 -0
  106. package/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -43
  107. package/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  108. package/node_modules/@img/sharp-linux-x64/index.cjs +0 -2
  109. package/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64-0.35.4.node +0 -0
  110. package/node_modules/@img/sharp-linux-x64/package.json +0 -47
  111. package/node_modules/@img/sharp-linuxmusl-x64/index.cjs +0 -2
  112. package/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64-0.35.4.node +0 -0
  113. package/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -47
  114. package/node_modules/@libsql/linux-x64-gnu/index.node +0 -0
  115. package/node_modules/@libsql/linux-x64-gnu/package.json +0 -36
  116. package/node_modules/@libsql/linux-x64-musl/index.node +0 -0
  117. package/node_modules/@libsql/linux-x64-musl/package.json +0 -36
  118. package/node_modules/libsql/auth.js +0 -22
  119. package/node_modules/libsql/index.js +0 -441
  120. package/node_modules/libsql/node_modules/detect-libc/lib/detect-libc.js +0 -279
  121. package/node_modules/libsql/node_modules/detect-libc/lib/filesystem.js +0 -41
  122. package/node_modules/libsql/node_modules/detect-libc/lib/process.js +0 -19
  123. package/node_modules/libsql/node_modules/detect-libc/package.json +0 -40
  124. package/node_modules/libsql/package.json +0 -90
  125. package/node_modules/libsql/sqlite-error.js +0 -21
  126. package/node_modules/sharp/dist/channel.cjs +0 -177
  127. package/node_modules/sharp/dist/channel.mjs +0 -177
  128. package/node_modules/sharp/dist/colour.cjs +0 -199
  129. package/node_modules/sharp/dist/colour.mjs +0 -199
  130. package/node_modules/sharp/dist/composite.cjs +0 -213
  131. package/node_modules/sharp/dist/composite.mjs +0 -213
  132. package/node_modules/sharp/dist/constructor.cjs +0 -511
  133. package/node_modules/sharp/dist/constructor.mjs +0 -511
  134. package/node_modules/sharp/dist/index.cjs +0 -25
  135. package/node_modules/sharp/dist/index.d.cts +0 -1999
  136. package/node_modules/sharp/dist/index.d.mts +0 -2046
  137. package/node_modules/sharp/dist/index.mjs +0 -25
  138. package/node_modules/sharp/dist/input.cjs +0 -819
  139. package/node_modules/sharp/dist/input.mjs +0 -819
  140. package/node_modules/sharp/dist/is.cjs +0 -143
  141. package/node_modules/sharp/dist/is.mjs +0 -143
  142. package/node_modules/sharp/dist/libvips.cjs +0 -212
  143. package/node_modules/sharp/dist/libvips.mjs +0 -212
  144. package/node_modules/sharp/dist/operation.cjs +0 -1002
  145. package/node_modules/sharp/dist/operation.mjs +0 -1002
  146. package/node_modules/sharp/dist/output.cjs +0 -1785
  147. package/node_modules/sharp/dist/output.mjs +0 -1785
  148. package/node_modules/sharp/dist/resize.cjs +0 -617
  149. package/node_modules/sharp/dist/resize.mjs +0 -617
  150. package/node_modules/sharp/dist/sharp.cjs +0 -174
  151. package/node_modules/sharp/dist/sharp.mjs +0 -174
  152. package/node_modules/sharp/dist/utility.cjs +0 -301
  153. package/node_modules/sharp/dist/utility.mjs +0 -301
  154. package/node_modules/sharp/node_modules/semver/classes/comparator.js +0 -143
  155. package/node_modules/sharp/node_modules/semver/classes/range.js +0 -577
  156. package/node_modules/sharp/node_modules/semver/classes/semver.js +0 -350
  157. package/node_modules/sharp/node_modules/semver/functions/clean.js +0 -8
  158. package/node_modules/sharp/node_modules/semver/functions/cmp.js +0 -54
  159. package/node_modules/sharp/node_modules/semver/functions/coerce.js +0 -62
  160. package/node_modules/sharp/node_modules/semver/functions/compare-build.js +0 -9
  161. package/node_modules/sharp/node_modules/semver/functions/compare-loose.js +0 -5
  162. package/node_modules/sharp/node_modules/semver/functions/compare.js +0 -7
  163. package/node_modules/sharp/node_modules/semver/functions/diff.js +0 -60
  164. package/node_modules/sharp/node_modules/semver/functions/eq.js +0 -5
  165. package/node_modules/sharp/node_modules/semver/functions/gt.js +0 -5
  166. package/node_modules/sharp/node_modules/semver/functions/gte.js +0 -5
  167. package/node_modules/sharp/node_modules/semver/functions/inc.js +0 -21
  168. package/node_modules/sharp/node_modules/semver/functions/lt.js +0 -5
  169. package/node_modules/sharp/node_modules/semver/functions/lte.js +0 -5
  170. package/node_modules/sharp/node_modules/semver/functions/major.js +0 -5
  171. package/node_modules/sharp/node_modules/semver/functions/minor.js +0 -5
  172. package/node_modules/sharp/node_modules/semver/functions/neq.js +0 -5
  173. package/node_modules/sharp/node_modules/semver/functions/parse.js +0 -18
  174. package/node_modules/sharp/node_modules/semver/functions/patch.js +0 -5
  175. package/node_modules/sharp/node_modules/semver/functions/prerelease.js +0 -8
  176. package/node_modules/sharp/node_modules/semver/functions/rcompare.js +0 -5
  177. package/node_modules/sharp/node_modules/semver/functions/rsort.js +0 -5
  178. package/node_modules/sharp/node_modules/semver/functions/satisfies.js +0 -12
  179. package/node_modules/sharp/node_modules/semver/functions/sort.js +0 -5
  180. package/node_modules/sharp/node_modules/semver/functions/truncate.js +0 -48
  181. package/node_modules/sharp/node_modules/semver/functions/valid.js +0 -8
  182. package/node_modules/sharp/node_modules/semver/index.js +0 -93
  183. package/node_modules/sharp/node_modules/semver/internal/constants.js +0 -37
  184. package/node_modules/sharp/node_modules/semver/internal/debug.js +0 -11
  185. package/node_modules/sharp/node_modules/semver/internal/identifiers.js +0 -29
  186. package/node_modules/sharp/node_modules/semver/internal/lrucache.js +0 -42
  187. package/node_modules/sharp/node_modules/semver/internal/parse-options.js +0 -17
  188. package/node_modules/sharp/node_modules/semver/internal/re.js +0 -223
  189. package/node_modules/sharp/node_modules/semver/package.json +0 -78
  190. package/node_modules/sharp/node_modules/semver/ranges/gtr.js +0 -6
  191. package/node_modules/sharp/node_modules/semver/ranges/intersects.js +0 -9
  192. package/node_modules/sharp/node_modules/semver/ranges/ltr.js +0 -6
  193. package/node_modules/sharp/node_modules/semver/ranges/max-satisfying.js +0 -27
  194. package/node_modules/sharp/node_modules/semver/ranges/min-satisfying.js +0 -26
  195. package/node_modules/sharp/node_modules/semver/ranges/min-version.js +0 -63
  196. package/node_modules/sharp/node_modules/semver/ranges/outside.js +0 -82
  197. package/node_modules/sharp/node_modules/semver/ranges/simplify.js +0 -49
  198. package/node_modules/sharp/node_modules/semver/ranges/subset.js +0 -249
  199. package/node_modules/sharp/node_modules/semver/ranges/to-comparators.js +0 -10
  200. package/node_modules/sharp/node_modules/semver/ranges/valid.js +0 -13
  201. package/node_modules/sharp/package.json +0 -227
  202. /package/.next/static/{M8Zkbqz2M4SLzLsE8DC6V → G-9_HnysmzY_Bx9GpDYAO}/_buildManifest.js +0 -0
  203. /package/.next/static/{M8Zkbqz2M4SLzLsE8DC6V → G-9_HnysmzY_Bx9GpDYAO}/_clientMiddlewareManifest.js +0 -0
  204. /package/.next/static/{M8Zkbqz2M4SLzLsE8DC6V → G-9_HnysmzY_Bx9GpDYAO}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[673701,a=>{"use strict";var b=a.i(187924),c=a.i(676459),d=a.i(926184),e=a.i(400187),f=a.i(497895);let g=(0,e.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,e.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),a.s(["Bubble",0,function({variant:a="default",align:c="start",className:d,...e}){return(0,b.jsx)("div",{"data-slot":"bubble","data-variant":a,"data-align":c,className:(0,f.cn)(g({variant:a}),d),...e})},"BubbleContent",0,function({className:a,render:b,...e}){var g;return g={defaultTagName:"div",props:(0,c.mergeProps)({className:(0,f.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",a)},e),render:b,state:{slot:"bubble-content"}},(0,d.useRenderElement)(g.defaultTagName??"div",g,g)}],673701)},613350,a=>{"use strict";var b=a.i(187924),c=a.i(589027),d=a.i(572131),e=a.i(497895);a.s(["FoldedText",0,function({text:a,subject:f,clamp:g="line-clamp-3",tall:h="max-h-40",className:i}){let[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(null);return(0,d.useEffect)(()=>k(!1),[a]),(0,d.useEffect)(()=>{let a=n.current;a&&!j&&m(a.scrollHeight>a.clientHeight+1)},[j,a]),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-start gap-1",i),children:[(0,b.jsx)("p",{ref:n,className:(0,e.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",j?(0,e.cn)(h,"overflow-y-auto scrollbar-none"):g),children:a}),(l||j)&&(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),"aria-label":j?`Fold the ${f}`:`Read the whole ${f}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(c.ChevronDown,{className:(0,e.cn)("size-3.5",j&&"rotate-180")})})]})}])},467268,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(327598),f=a.i(752562),g=a.i(707963),h=a.i(141146),i=a.i(231500),j=a.i(585650),k=a.i(425256),l=a.i(875160),m=a.i(403512),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(673701),r=a.i(340695),s=a.i(613350),t=a.i(846991),u=a.i(545097),v=a.i(546893),w=a.i(864037),x=a.i(287702),y=a.i(626940),z=a.i(550070),A=a.i(411509),B=a.i(913834),C=a.i(42380),D=a.i(16716),E=a.i(394440),F=a.i(28996),G=a.i(369768),H=a.i(199169),I=a.i(576271),J=a.i(313237),K=a.i(759497),L=a.i(497895),M=a.i(324835),N=a.i(777279),O=a.i(8468),P=b([t,D,G,O]);[t,D,G,O]=P.then?(await P)():P;let ap=(0,o.memo)(function(){let a=(0,N.useBotTasks)(),{data:b}=(0,K.useServerRoute)(p.queryKey.bot),[c,e]=(0,o.useState)(!1),[f,g]=(0,o.useState)(null),[h,i]=(0,o.useState)(!1),j=[...a].reverse(),k=f?j.find(a=>a.id===f)??null:null,[l,m]=function(){let[a,b]=(0,o.useState)(null),c=(0,o.useRef)([]),d=(0,o.useRef)(!1),e=(0,o.useRef)([]);(0,o.useEffect)(()=>()=>{for(let a of e.current)clearTimeout(a)},[]);let f=(0,o.useRef)(()=>{});f.current=()=>{if(d.current)return;let a=c.current.shift();a&&(d.current=!0,b(a),e.current.push(setTimeout(()=>{b(null),e.current.push(setTimeout(()=>{d.current=!1,f.current()},260))},3e3)))};let g=(0,o.useCallback)(a=>{let b=c.current.findIndex(b=>b.bot===a.bot);b>=0?c.current[b]=a:c.current.push(a),f.current()},[]);return[a,g]}(),n=(0,o.useRef)(null),q=(0,o.useRef)(new Map);(0,o.useEffect)(()=>{if(!N.botTasks.primed())return;let b=new Map(j.map(a=>[a.id,a.status])),c=n.current;n.current=b;let d=new Map;for(let b of(0,N.latestPerBot)(a))b.line&&d.set(b.bot.name,b.line.id);let e=q.current;if(q.current=d,c){for(let b of(0,N.latestPerBot)(a)){if("working"!==b.task.status)continue;let a=b.line?.id;a&&e.get(b.bot.name)!==a&&m({bot:b.bot.name,label:b.task.label,what:ae(b.task).text,live:!0})}for(let a of j){let b=c.get(a.id);b!==a.status&&(void 0===b&&"working"!==a.status&&a.relayed||m({bot:a.bot.name,label:a.label,...function(a,b){let c=a.bot.name;return"working"===a.status?{what:b?`${c} took this on`:`${c} picked it back up`,live:!0}:"waiting"===a.status?(0,A.isBudgetAsk)(a.ask)?{what:`${c} is out of steps`}:{what:`${c} is asking`,tone:L.WAITING_INK}:"failed"===a.status?{what:`${c} could not finish`,tone:"text-destructive"}:{what:`${c} finished`}}(a,void 0===b)}))}}},[a,m]);let r=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{if(!k||k.relayed||"done"!==k.status&&"failed"!==k.status)return;let a=`${k.id}@${(0,H.toDate)(k.updatedAt).getTime()}`;r.current.has(a)||(r.current.add(a),(0,y.markReportedAction)([k.id]).then(I.unwrapResult).then(()=>(0,K.revalidate)(p.queryKey.tasks)).catch(b=>{r.current.delete(a),w.toast.add({type:"error",title:"Could not mark the task as read",description:(0,L.errorToString)(b)})}))},[k]);let s=a.filter(a=>"working"===a.status).length,t=j.filter(aq),u=t.length,v=t.map(a=>a.bot).filter((a,b,c)=>c.findIndex(b=>b.name===a.name)===b),x=(0,o.useCallback)(()=>i(!1),[]);return(0,d.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-132 max-w-[calc(100vw-2.5rem)] flex-col items-end gap-2",children:c?(0,d.jsx)("div",{className:"pointer-events-auto flex max-h-[min(44rem,78vh)] w-full animate-in flex-col overflow-hidden rounded-3xl bg-background/75 shadow-2xl shadow-black/6 ring-1 ring-border/50 backdrop-blur-xl fade-in slide-in-from-bottom-1 duration-200",children:k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Y,{task:k,onBack:()=>g(null),onClose:()=>e(!1)}),(0,d.jsx)(af,{task:k,className:"min-h-0 flex-1"}),(0,d.jsx)(E.TaskReply,{task:{id:k.id,label:k.label,bot:k.bot.name,ask:function(a){if(!a.ask?.question)return a.ask;let b=a.lines.at(-1);return b&&(0,N.isOutcome)(b)&&b.text===a.ask.question?{...a.ask,question:""}:a.ask}(k)},status:"working"===k.status?"running":k.status,lines:k.lines,className:"mx-3 mb-2 shrink-0"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(X,{count:a.length,pending:u,composing:h,onCompose:()=>i(!0),onClose:()=>h?i(!1):e(!1)}),h?(0,d.jsx)(U,{bots:b,onDone:x}):j.length?(0,d.jsx)(ac,{tasks:j,onPick:g}):(0,d.jsx)(aa,{bots:b}),!h&&(0,d.jsx)(ab,{})]})}):(0,d.jsx)(Q,{bots:b,rows:t,waiting:v,count:a.length,busy:s,pending:u,beat:l,composing:h,onCompose:()=>i(!0),onCloseCompose:x,onPick:a=>{g(a),e(!0)},onOpen:()=>{f||1!==t.length||g(t[0].id),e(!0)}})})}),aq=a=>"waiting"===a.status;function Q({bots:a,rows:b,waiting:c,count:e,busy:g,pending:h,beat:i,composing:j,onCompose:k,onCloseCompose:m,onPick:o,onOpen:p}){let q=function({count:a,busy:b,pending:c}){return c>0?{text:1===c?"waiting on you":`${c} waiting on you`,tone:L.WAITING_INK,shine:"amber"}:b>0?{text:1===b?"working":`${b} running`,tone:"text-muted-foreground",shine:"muted"}:a>0?{text:"all done",tone:"text-muted-foreground"}:{text:"no jobs yet",tone:"text-muted-foreground"}}({count:e,busy:g,pending:h}),r=j||h>0;return(0,d.jsxs)("div",{className:(0,L.cn)("pointer-events-auto w-fit max-w-full overflow-hidden bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",r?"min-w-96 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,d.jsx)("div",{className:(0,L.cn)("grid transition-[grid-template-rows] duration-300 ease-out",r?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,d.jsx)("div",{className:"min-h-0 overflow-hidden",inert:!r,children:j?(0,d.jsx)(U,{bots:a,onDone:m}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"flex items-center gap-2 px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex-1",children:["needs you · ",h]}),(0,d.jsx)(S,{onClick:k})]}),(0,d.jsx)("div",{className:"px-1.5 pb-2",children:b.map(a=>(0,d.jsx)(ad,{task:a,onPick:()=>o(a.id)},a.id))}),(0,d.jsx)("span",{className:"block h-1.5"})]})})}),(0,d.jsxs)("div",{className:(0,L.cn)("flex items-center gap-2 px-3 py-1.5"),children:[(0,d.jsxs)("button",{type:"button",onClick:p,"aria-label":e?`Tasks (${e})`:"Bots",className:"flex min-w-0 flex-1 items-center gap-2 rounded-full text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(V,{bots:a,waiting:c,only:i?.bot}),(0,d.jsxs)("span",{className:"flex h-7 min-w-0 flex-1 items-center",children:[(0,d.jsx)(R,{on:!!i,children:(0,d.jsxs)("span",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:i?.label}),i?.live?(0,d.jsx)(u.default,{text:i.what,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,d.jsx)("span",{className:(0,L.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",i?.tone??"text-foreground"),children:i?.what})]})}),(0,d.jsx)(R,{on:!i,children:q.shine?(0,d.jsx)("span",{className:(0,L.cn)("block","amber"===q.shine?"[--rest:var(--color-amber-700)] [--shine:var(--color-amber-400)] dark:[--rest:var(--color-amber-400)] dark:[--shine:var(--color-amber-100)]":"[--rest:var(--muted-foreground)] [--shine:var(--foreground)]"),children:(0,d.jsx)(u.default,{text:q.text,speed:2.6,color:"var(--rest)",shineColor:"var(--shine)",className:"truncate text-[14px] leading-5 tracking-[-0.15px]"})}):(0,d.jsx)("span",{className:(0,L.cn)("block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] fade-in duration-300",q.tone),children:q.text},q.text)})]})]}),j&&(0,d.jsx)(T,{onClick:m,label:"Cancel the message",children:(0,d.jsx)(n.X,{className:"size-3.5"})}),!j&&0===h&&g>0&&(0,d.jsx)(l.Loader2,{className:"size-4 shrink-0 animate-spin text-muted-foreground/70"}),!j&&0===h&&0===g&&e>0&&(0,d.jsx)(f.Check,{className:"size-4 shrink-0 text-muted-foreground/60"})]})]})}function R({on:a,children:b}){return(0,d.jsx)("span",{className:(0,L.cn)("grid min-w-0 transition-[grid-template-columns,opacity] duration-200 ease-out",a?"grid-cols-[1fr] opacity-100":"grid-cols-[0fr] opacity-0"),children:(0,d.jsx)("span",{className:"min-w-0 overflow-hidden",children:b})})}function S({onClick:a}){return(0,d.jsx)(T,{onClick:a,label:"Message a bot",children:(0,d.jsx)(m.Plus,{className:"size-4"})})}function T({onClick:a,label:b,children:c}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":b,className:"grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:c})}function U({bots:a,onDone:b}){let[c,f]=(0,o.useState)(null),[i,j]=(0,o.useState)(""),[k,m]=(0,J.useServerAction)(z.startTaskAction,{onOk:()=>{(0,K.revalidate)(p.queryKey.tasks),b()}}),n=a?.length?a.map(a=>({name:a.name,icon:a.icon})):[{name:A.DEFAULT_BOT.name,icon:A.DEFAULT_BOT.icon}],q=()=>{c&&i.trim()&&!m&&k(c.name,i.trim())};return c?(0,d.jsxs)("div",{className:"flex min-h-32 flex-col pb-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>f(null),"aria-label":"Choose a different bot",className:"grid size-6 shrink-0 place-items-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ChevronLeft,{className:"size-3.5"})}),(0,d.jsx)(B.BotMark,{size:22,seed:c.name,vary:c.name,color:c.icon?.color,shape:c.icon?.shape,outline:c.icon?.outline,className:"shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium",children:["To ",c.name]})]}),(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),q()},className:"mx-3 mt-auto flex items-end gap-1 rounded-2xl bg-background py-2 pr-2 pl-3 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",children:[(0,d.jsx)(v.Textarea,{value:i,rows:1,autoFocus:!0,disabled:m,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),q())},placeholder:`What should ${c.name} do? It cannot hear the call, so say the whole job.`,"aria-label":`Message for ${c.name}`,className:"max-h-32 min-h-15 flex-1 resize-none border-0 bg-transparent px-0 py-0 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,d.jsx)(r.Button,{type:"submit",size:"icon-sm",variant:i.trim()?"default":"ghost",disabled:!i.trim()||m,"aria-label":"Send",className:"rounded-full",children:m?(0,d.jsx)(l.Loader2,{className:"animate-spin"}):(0,d.jsx)(e.ArrowUp,{})})]})]}):(0,d.jsxs)("div",{className:"min-h-32 pb-3",children:[(0,d.jsx)("p",{className:"px-3 pt-3 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground",children:"message a bot"}),(0,d.jsx)("div",{className:"px-1",children:n.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>f(a),className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(B.BotMark,{size:22,seed:a.name,vary:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,className:"shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:a.name}),(0,d.jsx)(h.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},a.name))})]})}let ar=["alto","brio","cinder","delta"].map((a,b)=>({key:a,seed:a,color:M.MARK_PALETTE[Math.floor(b*M.MARK_PALETTE.length/4)],shape:M.MARK_SHAPES[b%M.MARK_SHAPES.length],outline:void 0}));function V({bots:a,waiting:b=[],only:c}){let e=a?.length?a.map(a=>({key:a.name,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1})):ar.map(a=>({...a,notify:!1})),f=b.map(a=>({key:a.name,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!0})),g=[...f,...e.filter(a=>!f.some(b=>b.key===a.key))].map(a=>({...a,standIn:!1})),h=ar.filter(a=>!g.some(b=>b.key===a.key)).slice(0,Math.max(0,3-g.length)).map(a=>({...a,notify:!1,standIn:!0})),i=[...g,...h].slice(0,4);return(0,d.jsx)("span",{className:(0,L.cn)("flex shrink-0 items-center",!a?.length&&!f.length&&"opacity-50"),children:i.map((a,b)=>(0,d.jsx)("span",{className:(0,L.cn)("origin-right transition-[margin,opacity,transform] duration-300 ease-out",b>0&&"-ml-2",a.standIn&&"opacity-35",c&&a.key!==c&&"-ml-[28px] scale-50 opacity-0"),style:{zIndex:i.length-b},children:(0,d.jsx)(B.BotMark,{size:28,seed:a.seed,vary:a.seed,color:a.color,shape:a.shape,outline:a.outline,notify:a.notify})},a.key))})}function W({onClick:a}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(n.X,{className:"size-3.5"})})}function X({count:a,pending:b,composing:c,onCompose:e,onClose:f}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,d.jsx)("span",{className:"text-[13px] font-medium",children:"Tasks"}),a>0&&!c&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:b>0?`${b} for you \xb7 ${a}`:a}),(0,d.jsx)("span",{className:"flex-1"}),!c&&(0,d.jsx)(S,{onClick:e}),(0,d.jsx)(W,{onClick:f})]})}function Y({task:a,onBack:b,onClose:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ChevronLeft,{className:"size-4"})}),(0,d.jsx)(B.BotMark,{size:22,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[a.label,(0,d.jsx)("span",{title:a.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:a.id.slice(0,8)})]}),(0,d.jsx)(Z,{usage:a.tokens}),(0,d.jsx)($,{task:a}),(0,d.jsx)(_,{task:a}),(0,d.jsx)(W,{onClick:c})]})}function Z({usage:a}){let b=a.input+a.output;return b?(0,d.jsx)("span",{title:`in ${(0,L.formatCount)(a.input)} \xb7 out ${(0,L.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,L.formatCount)(b)}):null}function $({task:a}){let{contextTokens:b,contextBudget:c}=a;if(!b||!c)return null;let e=Math.min(1,b/c);return(0,d.jsx)("span",{title:`Context ${(0,L.formatCount)(b)} of ${(0,L.formatCount)(c)} — it summarizes itself here`,className:"block h-[3px] w-9 shrink-0 overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("span",{className:(0,L.cn)("block h-full rounded-full",e>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*e))}%`}})})}let as={working:"text-muted-foreground",waiting:L.WAITING_INK,done:"text-foreground",failed:"text-destructive"};function _({task:a}){let b="done"===a.status&&a.relayed?"text-muted-foreground":as[a.status];return"working"===a.status?(0,d.jsx)(u.default,{text:"working",speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,L.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:a.status})}function aa({bots:a}){return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 px-6 pt-3 pb-4 text-center",children:[(0,d.jsx)(V,{bots:a}),a?.length?(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:"Nothing handed over yet — ask for something that takes a while."}):(0,d.jsxs)("p",{className:"text-[12px] text-muted-foreground",children:["Thursday hands work to ",A.DEFAULT_BOT.name," until you make bots of your own in Settings › Bots."]})]})}function ab(){return(0,d.jsx)("div",{className:"flex shrink-0 justify-end px-3 pb-2.5",children:(0,d.jsxs)("button",{type:"button",onClick:()=>(0,F.openSettings)("tasks"),className:"flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(k.History,{className:"size-3"}),"History"]})})}let at=[{id:"you",label:"needs you",holds:aq},{id:"working",label:"working",holds:a=>"working"===a.status},{id:"done",label:"done",holds:()=>!0}];function ac({tasks:a,onPick:b}){let c=new Map;for(let b of a){let a=at.find(a=>a.holds(b))??at[2],d=c.get(a.id);d?d.push(b):c.set(a.id,[b])}return(0,d.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-1 scrollbar-none",children:at.map((a,e)=>{let f=c.get(a.id)??[];return f.length?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsxs)("p",{className:(0,L.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===e?"pt-1":"pt-3"),children:[a.label," · ",f.length]}),f.map(a=>(0,d.jsx)(ad,{task:a,onPick:()=>b(a.id)},a.id))]},a.id):null})})}function ad({task:a,onPick:b}){let c=aq(a),e=a.lines.at(-1),f=(0,o.useMemo)(()=>ae(a),[a.status,a.outcome,a.relayed,a.ask,e?.id]),[g,h]=(0,E.useAnswerTask)(),[j,k]=(0,o.useState)(null),m="waiting"===a.status?a.ask?.options??[]:[],n=(0,A.isBudgetAsk)(a.ask);return(0,d.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,d.jsxs)("button",{type:"button",onClick:b,className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:a.bot.name,children:(0,d.jsx)(B.BotMark,{size:32,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,state:"working"===a.status?"thinking":"idle",notify:c})}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:(0,L.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",c?"text-foreground":"text-foreground/80"),children:a.label}),(0,d.jsx)(C.BotRoster,{bots:(0,N.rosterOf)(a),taskId:a.id}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,H.shortAgo)(a.updatedAt)})]}),(0,d.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===a.status&&(0,d.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"===a.status?(0,d.jsx)(u.default,{text:f.text,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:(0,L.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone)}):(0,d.jsx)("span",{className:(0,L.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone),children:f.text})]})]})]}),m.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:m.map(b=>(0,d.jsxs)(r.Button,{size:"sm",variant:"outline",loading:j===b,disabled:h,onClick:async()=>{k(b),await g(a,b),k(null)},className:(0,L.cn)("h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",!n&&"border-amber-500/35"),children:[n&&b===A.TASK_CONTINUE&&(0,d.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),b,n&&b===A.TASK_CONTINUE&&(0,d.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",x.BOT_RUN.steps," steps"]})]},b))})]})}function ae(a){if("waiting"===a.status&&a.ask)return(0,A.isBudgetAsk)(a.ask)?{text:(0,L.plainText)(a.outcome??a.ask.question),tone:"text-muted-foreground"}:{text:a.ask.question,tone:L.WAITING_INK};if("failed"===a.status)return{text:(0,L.plainText)(a.outcome??"Failed"),tone:"text-destructive"};if("done"===a.status)return{text:(0,L.plainText)(a.outcome??"Done"),tone:a.relayed?"text-muted-foreground":"text-foreground"};let b=(0,N.lastSaid)(a);return b?{text:"tool"===b.kind&&b.tool?b.tool.note??`${b.tool.name} \xb7 ${b.tool.input}`:b.text,tone:"text-muted-foreground"}:{text:`${a.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}}function af({task:a,className:b}){let c=(0,o.useRef)(null),e=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{e.current=!0},[a.id]),(0,o.useEffect)(()=>{let a=c.current;a&&e.current&&(a.scrollTop=a.scrollHeight)},[a.lines,a.status]),(0,d.jsx)(G.FileViewer,{children:(0,d.jsxs)("div",{ref:c,onScroll:a=>{let b=a.currentTarget;e.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:(0,L.cn)("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",b),children:[(0,d.jsx)(ag,{task:a}),(0,N.threadItems)(a).map(b=>"invite"===b.kind?(0,d.jsx)(ah,{from:b.from,to:b.to},b.key):(0,d.jsx)(al,{group:b.group,task:a},b.key)),"working"===a.status&&0===a.lines.length&&(0,d.jsx)(u.default,{text:`${a.bot.name} is taking it on…`,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"block px-1 font-mono text-[10px]"})]})})}function ag({task:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ah,{from:au,to:a.bot}),(0,d.jsx)(aj,{children:(0,d.jsx)(q.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(q.BubbleContent,{className:"rounded-tr-md py-2 pr-2 pl-3.5",children:(0,d.jsx)(s.FoldedText,{text:a.request,subject:"request"})})})})]})}let au={name:"Thursday"};function ah({from:a,to:b}){return(0,d.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,d.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(ai,{bot:a}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,d.jsx)(ai,{bot:b})]})})}function ai({bot:a}){return(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)(B.BotMark,{size:15,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function aj({children:a}){return(0,d.jsx)(ak,{side:"end",name:"Thursday",mark:(0,d.jsx)(B.BotMark,{size:26,seed:"thursday",notify:!1,className:"mt-1 shrink-0"}),children:a})}function ak({side:a,mark:b,name:c,children:e}){return(0,d.jsxs)("div",{className:(0,L.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,L.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===a&&"items-end"),children:[(0,d.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:c}),e]})]})}function al({group:a,task:b}){return a.lines[0]?.kind==="user"?(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(aj,{children:a.lines.map(a=>(0,d.jsx)(q.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(q.BubbleContent,{className:"rounded-tr-md px-3.5 text-[13px] leading-snug break-keep",children:a.text})},a.id))})}):(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(ak,{side:a.bot.name===b.bot.name?"start":"end",name:a.bot.name,mark:(0,d.jsx)(B.BotMark,{size:26,seed:a.bot.name,vary:b.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1,className:"mt-1 shrink-0"}),children:(function(a){let b=[];for(let c of a){let a="tool"===c.kind&&c.tool?"tools":"said",d=b.at(-1);d&&d.kind===a?d.lines.push(c):b.push({kind:a,key:c.id,lines:[c]})}return b})(a.lines).map(a=>"tools"===a.kind?(0,d.jsx)(ao,{lines:a.lines,taskId:b.id},a.key):a.lines.map(a=>(0,d.jsx)(am,{line:a,taskId:b.id},a.id)))})})}function am({line:a,taskId:b}){if("tool"===a.kind&&a.tool)return(0,d.jsx)(O.BotTool,{tool:a.tool,taskId:b});if("note"===a.kind)return(0,d.jsxs)("details",{className:"w-full py-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,d.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,d.jsx)("p",{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px] leading-relaxed whitespace-pre-wrap break-keep",children:a.text})]});if(!(0,N.isOutcome)(a))return(0,d.jsx)("p",{className:"px-1 text-[12.5px] leading-relaxed break-keep text-muted-foreground",children:a.text});if(a.options)return(0,d.jsxs)("div",{className:"w-fit max-w-full space-y-1.5 rounded-2xl bg-amber-500/8 px-3 py-2 ring-1 ring-amber-500/25",children:[(0,d.jsx)("p",{className:"text-[13px] leading-snug break-keep",children:a.text}),a.options.length>0&&(0,d.jsx)("p",{className:"flex flex-wrap gap-1",children:a.options.map(a=>(0,d.jsx)("span",{className:"rounded-full bg-background/70 px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:a},a))})]});let c="error"===a.kind;return(0,d.jsxs)("div",{className:"min-w-0 px-1",children:[c&&(0,d.jsxs)("p",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] text-destructive",children:[(0,d.jsx)(n.X,{className:"size-3 shrink-0"}),"Could not finish"]}),(0,d.jsx)(t.Markdown,{className:(0,L.cn)("overflow-x-auto text-[13px] leading-relaxed break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",c&&"text-destructive"),children:a.text}),(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)(D.PathChips,{text:a.text,className:"min-w-0"}),!c&&(0,d.jsx)("span",{className:"ml-auto shrink-0",children:(0,d.jsx)(an,{text:a.text})})]})]})}function an({text:a}){let[b,c]=(0,o.useState)(!1),e=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,d.jsx)("button",{type:"button","aria-label":"Copy the report",onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1400)}catch(a){w.toast.add({type:"error",title:"Could not copy the report",description:(0,L.errorToString)(a)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:b?(0,d.jsx)(f.Check,{className:"size-3"}):(0,d.jsx)(j.Copy,{className:"size-3"})})}function ao({lines:a,taskId:b}){return(0,d.jsxs)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:[a.length>1&&(0,d.jsxs)("p",{className:"px-2 py-1 font-mono text-[10px] text-muted-foreground",children:[a.length," steps"]}),a.map(a=>a.tool?(0,d.jsx)(O.BotTool,{tool:a.tool,taskId:b,collapsed:!0},a.id):null)]})}a.s(["BotRoom",0,ap,"Conversation",0,af]),c()}catch(a){c(a)}},!1),42380,a=>{"use strict";var b=a.i(187924),c=a.i(913834);a.s(["BotRoster",0,function({bots:a,taskId:d}){return a.length<2?null:(0,b.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:a.map(a=>a.name).join(", "),children:[(0,b.jsx)("span",{className:"flex items-center",children:a.slice(0,3).map(a=>(0,b.jsx)(c.BotMark,{size:18,seed:a.name,vary:d,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"-ml-[3px] rounded-[7px] ring-2 ring-background first:ml-0"},a.name))}),(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[a.length," bots"]})]})}])},16716,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(998697),f=a.i(840260),g=a.i(930345),h=a.i(707938),i=a.i(576509),j=a.i(483138),k=a.i(904340),l=a.i(572131),m=a.i(369768),n=a.i(559553),o=a.i(497895),p=b([m]);[m]=p.then?(await p)():p;let q={markdown:j.FileText,csv:i.FileSpreadsheet,json:h.FileJson,text:k.FileType,image:g.FileImage};a.s(["PathChips",0,function({text:a,className:b}){let c=(0,l.useMemo)(()=>(0,n.pathsIn)(a),[a]);return c.length?(0,d.jsx)("div",{className:(0,o.cn)("flex flex-wrap gap-1.5",b),children:c.map(a=>{let b,c=a.split("/").pop()??a,g=(b=(0,n.viewKindOf)(a),"frame"===b?a.toLowerCase().endsWith(".pdf")?j.FileText:f.FileCode:q[b]??e.File);return(0,d.jsxs)(m.FileLink,{path:a,className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted/70 py-1 pr-2.5 pl-2 font-mono text-[11px] text-foreground/80 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(g,{className:"size-3 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"truncate",children:c})]},a)})}):null}]),c()}catch(a){c(a)}},!1),394440,a=>{"use strict";var b=a.i(187924),c=a.i(327598),d=a.i(231500),e=a.i(164831);let f={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"}]]};f.node;let g=(0,e.default)(f);var h=a.i(875160),i=a.i(19895),j=a.i(474215),k=a.i(572131),l=a.i(767561),m=a.i(340695),n=a.i(613350),o=a.i(545097),p=a.i(546893),q=a.i(287702),r=a.i(405050);let s=(0,r.createServerReference)("7f0a213c1b1df126ce7efadde94d8dd2c42077c902",r.callServer,void 0,r.findSourceMapURL,"answerTaskAction");var t=a.i(229948),u=a.i(411509),v=a.i(777279),w=a.i(313237),x=a.i(759497),y=a.i(497895);function z(){let[a,b]=(0,w.useServerAction)(s,{onOk:()=>(0,x.revalidate)(l.queryKey.tasks)});return[async(b,c)=>{let d=c.trim();if(!d)return!1;try{let c=await a(b.id,d);return v.screenActs.announce({kind:"answered",id:c.id,label:c.label,answer:d}),!0}catch{return!1}},b]}a.s(["TaskReply",0,function({task:a,status:e,lines:f=[],className:r}){let[s,A]=(0,k.useState)(()=>v.taskDrafts.get(a.id));(0,k.useEffect)(()=>A(v.taskDrafts.get(a.id)),[a.id]);let B=b=>{A(b),v.taskDrafts.set(a.id,b)},[C,D]=z(),[E,F]=(0,w.useServerAction)(t.cancelTaskAction,{onOk:a=>{(0,x.revalidate)(l.queryKey.tasks),v.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),G=D||F,[H,I]=(0,k.useState)(!1),[J,K]=(0,k.useState)(null);(0,k.useEffect)(()=>{I(!1),K(null)},[a.id]),(0,k.useEffect)(()=>{"running"!==e&&K(null)},[e]),(0,k.useEffect)(()=>{J&&f.some(a=>"user"===a.kind&&a.text===J)&&K(null)},[f,J]);let L=async b=>{!G&&await C(a,b)&&(B(""),"running"===e&&(K(b.trim()),I(!1)))},M="waiting"===e?a.ask:null,N=(0,u.isBudgetAsk)(M),O=M?M.options.length?"Or put it another way…":"Your answer":"running"===e?`What's off? ${a.bot} reads this before its next step`:"Anything more? It picks up where it left off",P=(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),L(s)},className:"flex items-end gap-1 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",children:[(0,b.jsx)(p.Textarea,{value:s,rows:1,disabled:G,autoFocus:"running"===e,onChange:a=>B(a.target.value),onKeyDown:a=>{"Escape"===a.key&&"running"===e?I(!1):"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),L(s))},placeholder:O,"aria-label":`Message for ${a.label}`,className:"max-h-32 min-h-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"}),"running"===e&&(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:G,onClick:()=>I(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,b.jsx)(j.X,{})}),(0,b.jsx)(m.Button,{type:"submit",size:"icon-sm",variant:s.trim()?"default":"ghost",disabled:!s.trim()||G,"aria-label":"Send",className:"rounded-full",children:D?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(c.ArrowUp,{})})]});return"running"!==e||H?M?(0,b.jsxs)("div",{className:(0,y.cn)("space-y-2.5 rounded-2xl px-3.5 py-3 ring-1",N?"bg-muted/40 ring-border/50":"bg-amber-500/8 ring-amber-500/25",r),children:[(0,b.jsxs)("p",{className:"flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{className:"shrink-0",children:"To"}),(0,b.jsx)("span",{className:"truncate text-foreground",children:a.bot}),(0,b.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,b.jsx)("span",{className:"truncate",children:a.label})]}),M.question&&(0,b.jsx)(n.FoldedText,{text:M.question,subject:"message",clamp:"line-clamp-6",tall:"max-h-56"}),M.options.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:M.options.map(a=>(0,b.jsxs)(m.Button,{size:"sm",variant:"outline",disabled:G,onClick:()=>L(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",children:[N&&a===u.TASK_CONTINUE&&(0,b.jsx)(d.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a,N&&a===u.TASK_CONTINUE&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",q.BOT_RUN.steps," steps"]})]},a))}),P,(0,b.jsx)("button",{type:"button",disabled:G,onClick:()=>E(a.id),className:"font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",children:"Stop this task instead"})]}):(0,b.jsx)("div",{className:r,children:P}):(0,b.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 rounded-2xl bg-muted/40 py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/50",r),children:[J?(0,b.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-[12.5px] leading-5 text-muted-foreground",children:[(0,b.jsx)(h.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,b.jsx)("span",{className:"shrink-0",children:"Before its next step:"}),(0,b.jsx)(o.default,{text:J,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate"})]}):(0,b.jsx)(o.default,{text:`${a.bot} is on it — Thursday steers it by voice.`,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,b.jsxs)(m.Button,{type:"button",size:"sm",variant:"ghost",disabled:G,onClick:()=>I(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,b.jsx)(g,{className:"size-3.5"}),"Step in"]}),(0,b.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:G,onClick:()=>E(a.id),"aria-label":"Stop this task",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:F?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(i.Square,{className:"size-3"})})]})},"useAnswerTask",0,z],394440)},229948,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7ffb45d8c0884d0210b7f16e9f566b178e012e300f",b.callServer,void 0,b.findSourceMapURL,"cancelTaskAction");a.s(["cancelTaskAction",0,c])},626940,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fcdd78cde9f4b497d1d9e27b8a650758554e70862",b.callServer,void 0,b.findSourceMapURL,"markReportedAction");a.s(["markReportedAction",0,c])},550070,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f58530eb100621af8b59a8b2792c01a9f756413cc",b.callServer,void 0,b.findSourceMapURL,"startTaskAction");a.s(["startTaskAction",0,c])},777279,a=>{"use strict";var b=a.i(572131);let c=[],d=!1,e=new Set;function f(a,b){let c=a=>({name:a,icon:b?.find(b=>b.name===a)?.icon??null}),d=c(a.bot),e=[],f=new Map,g=new Map;for(let b of a.lines){let a=b.bot?c(b.bot):d,h=b.parent&&g.get(b.parent)?.name?d:null;switch(b.kind){case"user":e.push({id:b.id,bot:d,to:null,text:b.text,kind:"user"});break;case"text":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"say"});break;case"note":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"note"});break;case"tool":f.set(b.callId,e.length),e.push({id:b.id,bot:a,to:h,text:b.note??b.input,kind:"tool",tool:{name:b.name,input:b.input,note:b.note,path:b.path,callId:b.callId}});break;case"tool-result":{let a=f.get(b.callId),c=void 0===a?void 0:e[a];c?.tool&&void 0!==a&&(e[a]={...c,tool:{...c.tool,results:b.results,more:b.more}});break}case"ask":{let d=c(b.to);g.set(b.callId,d),e.push({id:b.id,bot:a,to:d,text:b.text,kind:"ask"});break}case"ask-result":{let c=g.get(b.callId);c&&b.text&&e.push({id:b.id,bot:c,to:a,text:b.text,kind:"ask"});break}case"waiting":e.push({id:b.id,bot:a,to:null,text:b.question,kind:"result",options:b.options})}}if("failed"===a.status&&a.outcome)e.push({id:`${a.id}-end`,bot:d,to:null,text:a.outcome,kind:"error"});else if("done"===a.status||"waiting"===a.status){let b=e.at(-1);b&&"say"===b.kind&&b.text===a.outcome&&(e[e.length-1]={...b,kind:"result"})}return{id:a.id,request:a.request,label:a.label,bot:d,lines:e,status:"running"===a.status?"working":a.status,outcome:a.outcome,ask:a.ask,relayed:a.reported,tokens:a.tokens,contextTokens:a.contextTokens,contextBudget:a.contextBudget,updatedAt:a.updatedAt}}let g=new Map,h=new Set,i=[];a.s(["botTasks",0,{sync(a,b){for(let g of(d=!0,c=[...a].reverse().map(a=>f(a,b)).slice(-30),e))g()},primed:()=>d},"isOutcome",0,a=>"result"===a.kind||"error"===a.kind,"lastSaid",0,function(a){for(let b=a.lines.length-1;b>=0;b--){let c=a.lines[b];if("user"!==c.kind&&"note"!==c.kind)return c}return null},"latestPerBot",0,function(a){let b=new Map;for(let c of a)for(let a of(b.has(c.bot.name)||b.set(c.bot.name,{bot:c.bot,task:c,line:null,open:0}),c.lines))"user"!==a.kind&&"note"!==a.kind&&b.set(a.bot.name,{bot:a.bot,task:c,line:a,open:b.get(a.bot.name)?.open??0});for(let c of a){if("working"!==c.status)continue;let a=b.get(c.bot.name);a&&(a.open+=1)}return[...b.values()]},"rosterOf",0,function(a){let b=[a.bot];for(let c of a.lines)b.some(a=>a.name===c.bot.name)||b.push(c.bot);return b},"screenActs",0,{announce(a){for(let b of h)b(a)},subscribe:a=>(h.add(a),()=>{h.delete(a)})},"taskDrafts",0,{get:a=>g.get(a)??"",set(a,b){b?g.set(a,b):g.delete(a)},typing:a=>(g.get(a)?.trim().length??0)>0},"taskFromRow",0,f,"threadItems",0,function(a){let b=new Set([a.bot.name]),c=[];for(let d of function(a){let b=[];for(let c of a){let a=b.at(-1);if(a&&a.bot.name===c.bot.name&&a.to?.name===c.to?.name&&"user"===a.lines[0].kind==("user"===c.kind)){a.lines.push(c);continue}b.push({key:c.id,bot:c.bot,to:c.to,lines:[c]})}return b}(a.lines))d.to&&!b.has(d.to.name)&&(b.add(d.to.name),c.push({kind:"invite",key:`${d.key}-joins`,from:d.bot,to:d.to})),b.add(d.bot.name),c.push({kind:"group",key:d.key,group:d});return c},"useBotTasks",0,function(){return(0,b.useSyncExternalStore)(a=>(e.add(a),()=>e.delete(a)),()=>c,()=>i)}])},327598,a=>{"use strict";var b=a.i(164831);let c={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};c.node;let d=(0,b.default)(c);a.s(["ArrowUp",0,d],327598)},231500,a=>{"use strict";var b=a.i(164831);let c={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronsRight",0,d],231500)},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.default)(c);a.s(["Copy",0,d],585650)},840260,a=>{"use strict";var b=a.i(164831);let c={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};c.node;let d=(0,b.default)(c);a.s(["FileCode",0,d],840260)},930345,a=>{"use strict";var b=a.i(164831);let c={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};c.node;let d=(0,b.default)(c);a.s(["FileImage",0,d],930345)},576509,a=>{"use strict";var b=a.i(164831);let c={name:"file-spreadsheet",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]};c.node;let d=(0,b.default)(c);a.s(["FileSpreadsheet",0,d],576509)},904340,a=>{"use strict";var b=a.i(164831);let c={name:"file-type",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]};c.node;let d=(0,b.default)(c);a.s(["FileType",0,d],904340)},19895,a=>{"use strict";var b=a.i(164831);let c={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};c.node;let d=(0,b.default)(c);a.s(["Square",0,d],19895)}];
1
+ module.exports=[673701,a=>{"use strict";var b=a.i(187924),c=a.i(676459),d=a.i(926184),e=a.i(400187),f=a.i(497895);let g=(0,e.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,e.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),a.s(["Bubble",0,function({variant:a="default",align:c="start",className:d,...e}){return(0,b.jsx)("div",{"data-slot":"bubble","data-variant":a,"data-align":c,className:(0,f.cn)(g({variant:a}),d),...e})},"BubbleContent",0,function({className:a,render:b,...e}){var g;return g={defaultTagName:"div",props:(0,c.mergeProps)({className:(0,f.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",a)},e),render:b,state:{slot:"bubble-content"}},(0,d.useRenderElement)(g.defaultTagName??"div",g,g)}],673701)},613350,a=>{"use strict";var b=a.i(187924),c=a.i(589027),d=a.i(572131),e=a.i(497895);a.s(["FoldedText",0,function({text:a,subject:f,clamp:g="line-clamp-3",tall:h="max-h-40",className:i}){let[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(null);return(0,d.useEffect)(()=>k(!1),[a]),(0,d.useEffect)(()=>{let a=n.current;a&&!j&&m(a.scrollHeight>a.clientHeight+1)},[j,a]),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-start gap-1",i),children:[(0,b.jsx)("p",{ref:n,className:(0,e.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",j?(0,e.cn)(h,"overflow-y-auto scrollbar-none"):g),children:a}),(l||j)&&(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),"aria-label":j?`Fold the ${f}`:`Read the whole ${f}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(c.ChevronDown,{className:(0,e.cn)("size-3.5",j&&"rotate-180")})})]})}])},467268,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(327598),f=a.i(752562),g=a.i(707963),h=a.i(141146),i=a.i(231500),j=a.i(585650),k=a.i(425256),l=a.i(875160),m=a.i(403512),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(673701),r=a.i(340695),s=a.i(613350),t=a.i(846991),u=a.i(545097),v=a.i(546893),w=a.i(864037),x=a.i(287702),y=a.i(371181),z=a.i(944567),A=a.i(411509),B=a.i(913834),C=a.i(42380),D=a.i(16716),E=a.i(394440),F=a.i(28996),G=a.i(369768),H=a.i(199169),I=a.i(576271),J=a.i(313237),K=a.i(759497),L=a.i(497895),M=a.i(324835),N=a.i(777279),O=a.i(8468),P=b([t,D,G,O]);[t,D,G,O]=P.then?(await P)():P;let ap=(0,o.memo)(function(){let a=(0,N.useBotTasks)(),{data:b}=(0,K.useServerRoute)(p.queryKey.bot),[c,e]=(0,o.useState)(!1),[f,g]=(0,o.useState)(null),[h,i]=(0,o.useState)(!1),j=[...a].reverse(),k=f?j.find(a=>a.id===f)??null:null,[l,m]=function(){let[a,b]=(0,o.useState)(null),c=(0,o.useRef)([]),d=(0,o.useRef)(!1),e=(0,o.useRef)([]);(0,o.useEffect)(()=>()=>{for(let a of e.current)clearTimeout(a)},[]);let f=(0,o.useRef)(()=>{});f.current=()=>{if(d.current)return;let a=c.current.shift();a&&(d.current=!0,b(a),e.current.push(setTimeout(()=>{b(null),e.current.push(setTimeout(()=>{d.current=!1,f.current()},260))},3e3)))};let g=(0,o.useCallback)(a=>{let b=c.current.findIndex(b=>b.bot===a.bot);b>=0?c.current[b]=a:c.current.push(a),f.current()},[]);return[a,g]}(),n=(0,o.useRef)(null),q=(0,o.useRef)(new Map);(0,o.useEffect)(()=>{if(!N.botTasks.primed())return;let b=new Map(j.map(a=>[a.id,a.status])),c=n.current;n.current=b;let d=new Map;for(let b of(0,N.latestPerBot)(a))b.line&&d.set(b.bot.name,b.line.id);let e=q.current;if(q.current=d,c){for(let b of(0,N.latestPerBot)(a)){if("working"!==b.task.status)continue;let a=b.line?.id;a&&e.get(b.bot.name)!==a&&m({bot:b.bot.name,label:b.task.label,what:ae(b.task).text,live:!0})}for(let a of j){let b=c.get(a.id);b!==a.status&&(void 0===b&&"working"!==a.status&&a.relayed||m({bot:a.bot.name,label:a.label,...function(a,b){let c=a.bot.name;return"working"===a.status?{what:b?`${c} took this on`:`${c} picked it back up`,live:!0}:"waiting"===a.status?(0,A.isBudgetAsk)(a.ask)?{what:`${c} is out of steps`}:{what:`${c} is asking`,tone:L.WAITING_INK}:"failed"===a.status?{what:`${c} could not finish`,tone:"text-destructive"}:{what:`${c} finished`}}(a,void 0===b)}))}}},[a,m]);let r=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{if(!k||k.relayed||"done"!==k.status&&"failed"!==k.status)return;let a=`${k.id}@${(0,H.toDate)(k.updatedAt).getTime()}`;r.current.has(a)||(r.current.add(a),(0,y.markReportedAction)([k.id]).then(I.unwrapResult).then(()=>(0,K.revalidate)(p.queryKey.tasks)).catch(b=>{r.current.delete(a),w.toast.add({type:"error",title:"Could not mark the task as read",description:(0,L.errorToString)(b)})}))},[k]);let s=a.filter(a=>"working"===a.status).length,t=j.filter(aq),u=t.length,v=t.map(a=>a.bot).filter((a,b,c)=>c.findIndex(b=>b.name===a.name)===b),x=(0,o.useCallback)(()=>i(!1),[]);return(0,d.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-132 max-w-[calc(100vw-2.5rem)] flex-col items-end gap-2",children:c?(0,d.jsx)("div",{className:"pointer-events-auto flex max-h-[min(44rem,78vh)] w-full animate-in flex-col overflow-hidden rounded-3xl bg-background/75 shadow-2xl shadow-black/6 ring-1 ring-border/50 backdrop-blur-xl fade-in slide-in-from-bottom-1 duration-200",children:k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Y,{task:k,onBack:()=>g(null),onClose:()=>e(!1)}),(0,d.jsx)(af,{task:k,className:"min-h-0 flex-1"}),(0,d.jsx)(E.TaskReply,{task:{id:k.id,label:k.label,bot:k.bot.name,ask:function(a){if(!a.ask?.question)return a.ask;let b=a.lines.at(-1);return b&&(0,N.isOutcome)(b)&&b.text===a.ask.question?{...a.ask,question:""}:a.ask}(k)},status:"working"===k.status?"running":k.status,lines:k.lines,className:"mx-3 mb-2 shrink-0"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(X,{count:a.length,pending:u,composing:h,onCompose:()=>i(!0),onClose:()=>h?i(!1):e(!1)}),h?(0,d.jsx)(U,{bots:b,onDone:x}):j.length?(0,d.jsx)(ac,{tasks:j,onPick:g}):(0,d.jsx)(aa,{bots:b}),!h&&(0,d.jsx)(ab,{})]})}):(0,d.jsx)(Q,{bots:b,rows:t,waiting:v,count:a.length,busy:s,pending:u,beat:l,composing:h,onCompose:()=>i(!0),onCloseCompose:x,onPick:a=>{g(a),e(!0)},onOpen:()=>{f||1!==t.length||g(t[0].id),e(!0)}})})}),aq=a=>"waiting"===a.status;function Q({bots:a,rows:b,waiting:c,count:e,busy:g,pending:h,beat:i,composing:j,onCompose:k,onCloseCompose:m,onPick:o,onOpen:p}){let q=function({count:a,busy:b,pending:c}){return c>0?{text:1===c?"waiting on you":`${c} waiting on you`,tone:L.WAITING_INK,shine:"amber"}:b>0?{text:1===b?"working":`${b} running`,tone:"text-muted-foreground",shine:"muted"}:a>0?{text:"all done",tone:"text-muted-foreground"}:{text:"no jobs yet",tone:"text-muted-foreground"}}({count:e,busy:g,pending:h}),r=j||h>0;return(0,d.jsxs)("div",{className:(0,L.cn)("pointer-events-auto w-fit max-w-full overflow-hidden bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",r?"min-w-96 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,d.jsx)("div",{className:(0,L.cn)("grid transition-[grid-template-rows] duration-300 ease-out",r?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,d.jsx)("div",{className:"min-h-0 overflow-hidden",inert:!r,children:j?(0,d.jsx)(U,{bots:a,onDone:m}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"flex items-center gap-2 px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex-1",children:["needs you · ",h]}),(0,d.jsx)(S,{onClick:k})]}),(0,d.jsx)("div",{className:"px-1.5 pb-2",children:b.map(a=>(0,d.jsx)(ad,{task:a,onPick:()=>o(a.id)},a.id))}),(0,d.jsx)("span",{className:"block h-1.5"})]})})}),(0,d.jsxs)("div",{className:(0,L.cn)("flex items-center gap-2 px-3 py-1.5"),children:[(0,d.jsxs)("button",{type:"button",onClick:p,"aria-label":e?`Tasks (${e})`:"Bots",className:"flex min-w-0 flex-1 items-center gap-2 rounded-full text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(V,{bots:a,waiting:c,only:i?.bot}),(0,d.jsxs)("span",{className:"flex h-7 min-w-0 flex-1 items-center",children:[(0,d.jsx)(R,{on:!!i,children:(0,d.jsxs)("span",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:i?.label}),i?.live?(0,d.jsx)(u.default,{text:i.what,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,d.jsx)("span",{className:(0,L.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",i?.tone??"text-foreground"),children:i?.what})]})}),(0,d.jsx)(R,{on:!i,children:q.shine?(0,d.jsx)("span",{className:(0,L.cn)("block","amber"===q.shine?"[--rest:var(--color-amber-700)] [--shine:var(--color-amber-400)] dark:[--rest:var(--color-amber-400)] dark:[--shine:var(--color-amber-100)]":"[--rest:var(--muted-foreground)] [--shine:var(--foreground)]"),children:(0,d.jsx)(u.default,{text:q.text,speed:2.6,color:"var(--rest)",shineColor:"var(--shine)",className:"truncate text-[14px] leading-5 tracking-[-0.15px]"})}):(0,d.jsx)("span",{className:(0,L.cn)("block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] fade-in duration-300",q.tone),children:q.text},q.text)})]})]}),j&&(0,d.jsx)(T,{onClick:m,label:"Cancel the message",children:(0,d.jsx)(n.X,{className:"size-3.5"})}),!j&&0===h&&g>0&&(0,d.jsx)(l.Loader2,{className:"size-4 shrink-0 animate-spin text-muted-foreground/70"}),!j&&0===h&&0===g&&e>0&&(0,d.jsx)(f.Check,{className:"size-4 shrink-0 text-muted-foreground/60"})]})]})}function R({on:a,children:b}){return(0,d.jsx)("span",{className:(0,L.cn)("grid min-w-0 transition-[grid-template-columns,opacity] duration-200 ease-out",a?"grid-cols-[1fr] opacity-100":"grid-cols-[0fr] opacity-0"),children:(0,d.jsx)("span",{className:"min-w-0 overflow-hidden",children:b})})}function S({onClick:a}){return(0,d.jsx)(T,{onClick:a,label:"Message a bot",children:(0,d.jsx)(m.Plus,{className:"size-4"})})}function T({onClick:a,label:b,children:c}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":b,className:"grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:c})}function U({bots:a,onDone:b}){let[c,f]=(0,o.useState)(null),[i,j]=(0,o.useState)(""),[k,m]=(0,J.useServerAction)(z.startTaskAction,{onOk:()=>{(0,K.revalidate)(p.queryKey.tasks),b()}}),n=a?.length?a.map(a=>({name:a.name,icon:a.icon})):[{name:A.DEFAULT_BOT.name,icon:A.DEFAULT_BOT.icon}],q=()=>{c&&i.trim()&&!m&&k(c.name,i.trim())};return c?(0,d.jsxs)("div",{className:"flex min-h-32 flex-col pb-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>f(null),"aria-label":"Choose a different bot",className:"grid size-6 shrink-0 place-items-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ChevronLeft,{className:"size-3.5"})}),(0,d.jsx)(B.BotMark,{size:22,seed:c.name,vary:c.name,color:c.icon?.color,shape:c.icon?.shape,outline:c.icon?.outline,className:"shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium",children:["To ",c.name]})]}),(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),q()},className:"mx-3 mt-auto flex items-end gap-1 rounded-2xl bg-background py-2 pr-2 pl-3 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",children:[(0,d.jsx)(v.Textarea,{value:i,rows:1,autoFocus:!0,disabled:m,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),q())},placeholder:`What should ${c.name} do? It cannot hear the call, so say the whole job.`,"aria-label":`Message for ${c.name}`,className:"max-h-32 min-h-15 flex-1 resize-none border-0 bg-transparent px-0 py-0 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,d.jsx)(r.Button,{type:"submit",size:"icon-sm",variant:i.trim()?"default":"ghost",disabled:!i.trim()||m,"aria-label":"Send",className:"rounded-full",children:m?(0,d.jsx)(l.Loader2,{className:"animate-spin"}):(0,d.jsx)(e.ArrowUp,{})})]})]}):(0,d.jsxs)("div",{className:"min-h-32 pb-3",children:[(0,d.jsx)("p",{className:"px-3 pt-3 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground",children:"message a bot"}),(0,d.jsx)("div",{className:"px-1",children:n.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>f(a),className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(B.BotMark,{size:22,seed:a.name,vary:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,className:"shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:a.name}),(0,d.jsx)(h.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},a.name))})]})}let ar=["alto","brio","cinder","delta"].map((a,b)=>({key:a,seed:a,color:M.MARK_PALETTE[Math.floor(b*M.MARK_PALETTE.length/4)],shape:M.MARK_SHAPES[b%M.MARK_SHAPES.length],outline:void 0}));function V({bots:a,waiting:b=[],only:c}){let e=a?.length?a.map(a=>({key:a.name,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1})):ar.map(a=>({...a,notify:!1})),f=b.map(a=>({key:a.name,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!0})),g=[...f,...e.filter(a=>!f.some(b=>b.key===a.key))].map(a=>({...a,standIn:!1})),h=ar.filter(a=>!g.some(b=>b.key===a.key)).slice(0,Math.max(0,3-g.length)).map(a=>({...a,notify:!1,standIn:!0})),i=[...g,...h].slice(0,4);return(0,d.jsx)("span",{className:(0,L.cn)("flex shrink-0 items-center",!a?.length&&!f.length&&"opacity-50"),children:i.map((a,b)=>(0,d.jsx)("span",{className:(0,L.cn)("origin-right transition-[margin,opacity,transform] duration-300 ease-out",b>0&&"-ml-2",a.standIn&&"opacity-35",c&&a.key!==c&&"-ml-[28px] scale-50 opacity-0"),style:{zIndex:i.length-b},children:(0,d.jsx)(B.BotMark,{size:28,seed:a.seed,vary:a.seed,color:a.color,shape:a.shape,outline:a.outline,notify:a.notify})},a.key))})}function W({onClick:a}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(n.X,{className:"size-3.5"})})}function X({count:a,pending:b,composing:c,onCompose:e,onClose:f}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,d.jsx)("span",{className:"text-[13px] font-medium",children:"Tasks"}),a>0&&!c&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:b>0?`${b} for you \xb7 ${a}`:a}),(0,d.jsx)("span",{className:"flex-1"}),!c&&(0,d.jsx)(S,{onClick:e}),(0,d.jsx)(W,{onClick:f})]})}function Y({task:a,onBack:b,onClose:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ChevronLeft,{className:"size-4"})}),(0,d.jsx)(B.BotMark,{size:22,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[a.label,(0,d.jsx)("span",{title:a.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:a.id.slice(0,8)})]}),(0,d.jsx)(Z,{usage:a.tokens}),(0,d.jsx)($,{task:a}),(0,d.jsx)(_,{task:a}),(0,d.jsx)(W,{onClick:c})]})}function Z({usage:a}){let b=a.input+a.output;return b?(0,d.jsx)("span",{title:`in ${(0,L.formatCount)(a.input)} \xb7 out ${(0,L.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,L.formatCount)(b)}):null}function $({task:a}){let{contextTokens:b,contextBudget:c}=a;if(!b||!c)return null;let e=Math.min(1,b/c);return(0,d.jsx)("span",{title:`Context ${(0,L.formatCount)(b)} of ${(0,L.formatCount)(c)} — it summarizes itself here`,className:"block h-[3px] w-9 shrink-0 overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("span",{className:(0,L.cn)("block h-full rounded-full",e>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*e))}%`}})})}let as={working:"text-muted-foreground",waiting:L.WAITING_INK,done:"text-foreground",failed:"text-destructive"};function _({task:a}){let b="done"===a.status&&a.relayed?"text-muted-foreground":as[a.status];return"working"===a.status?(0,d.jsx)(u.default,{text:"working",speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,L.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:a.status})}function aa({bots:a}){return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 px-6 pt-3 pb-4 text-center",children:[(0,d.jsx)(V,{bots:a}),a?.length?(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:"Nothing handed over yet — ask for something that takes a while."}):(0,d.jsxs)("p",{className:"text-[12px] text-muted-foreground",children:["Thursday hands work to ",A.DEFAULT_BOT.name," until you make bots of your own in Settings › Bots."]})]})}function ab(){return(0,d.jsx)("div",{className:"flex shrink-0 justify-end px-3 pb-2.5",children:(0,d.jsxs)("button",{type:"button",onClick:()=>(0,F.openSettings)("tasks"),className:"flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(k.History,{className:"size-3"}),"History"]})})}let at=[{id:"you",label:"needs you",holds:aq},{id:"working",label:"working",holds:a=>"working"===a.status},{id:"done",label:"done",holds:()=>!0}];function ac({tasks:a,onPick:b}){let c=new Map;for(let b of a){let a=at.find(a=>a.holds(b))??at[2],d=c.get(a.id);d?d.push(b):c.set(a.id,[b])}return(0,d.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-1 scrollbar-none",children:at.map((a,e)=>{let f=c.get(a.id)??[];return f.length?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsxs)("p",{className:(0,L.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===e?"pt-1":"pt-3"),children:[a.label," · ",f.length]}),f.map(a=>(0,d.jsx)(ad,{task:a,onPick:()=>b(a.id)},a.id))]},a.id):null})})}function ad({task:a,onPick:b}){let c=aq(a),e=a.lines.at(-1),f=(0,o.useMemo)(()=>ae(a),[a.status,a.outcome,a.relayed,a.ask,e?.id]),[g,h]=(0,E.useAnswerTask)(),[j,k]=(0,o.useState)(null),m="waiting"===a.status?a.ask?.options??[]:[],n=(0,A.isBudgetAsk)(a.ask);return(0,d.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,d.jsxs)("button",{type:"button",onClick:b,className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:a.bot.name,children:(0,d.jsx)(B.BotMark,{size:32,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,state:"working"===a.status?"thinking":"idle",notify:c})}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:(0,L.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",c?"text-foreground":"text-foreground/80"),children:a.label}),(0,d.jsx)(C.BotRoster,{bots:(0,N.rosterOf)(a),taskId:a.id}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,H.shortAgo)(a.updatedAt)})]}),(0,d.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===a.status&&(0,d.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"===a.status?(0,d.jsx)(u.default,{text:f.text,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:(0,L.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone)}):(0,d.jsx)("span",{className:(0,L.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone),children:f.text})]})]})]}),m.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:m.map(b=>(0,d.jsxs)(r.Button,{size:"sm",variant:"outline",loading:j===b,disabled:h,onClick:async()=>{k(b),await g(a,b),k(null)},className:(0,L.cn)("h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",!n&&"border-amber-500/35"),children:[n&&b===A.TASK_CONTINUE&&(0,d.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),b,n&&b===A.TASK_CONTINUE&&(0,d.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",x.BOT_RUN.steps," steps"]})]},b))})]})}function ae(a){if("waiting"===a.status&&a.ask)return(0,A.isBudgetAsk)(a.ask)?{text:(0,L.plainText)(a.outcome??a.ask.question),tone:"text-muted-foreground"}:{text:a.ask.question,tone:L.WAITING_INK};if("failed"===a.status)return{text:(0,L.plainText)(a.outcome??"Failed"),tone:"text-destructive"};if("done"===a.status)return{text:(0,L.plainText)(a.outcome??"Done"),tone:a.relayed?"text-muted-foreground":"text-foreground"};let b=(0,N.lastSaid)(a);return b?{text:"tool"===b.kind&&b.tool?b.tool.note??`${b.tool.name} \xb7 ${b.tool.input}`:b.text,tone:"text-muted-foreground"}:{text:`${a.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}}function af({task:a,className:b}){let c=(0,o.useRef)(null),e=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{e.current=!0},[a.id]),(0,o.useEffect)(()=>{let a=c.current;a&&e.current&&(a.scrollTop=a.scrollHeight)},[a.lines,a.status]),(0,d.jsx)(G.FileViewer,{children:(0,d.jsxs)("div",{ref:c,onScroll:a=>{let b=a.currentTarget;e.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:(0,L.cn)("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",b),children:[(0,d.jsx)(ag,{task:a}),(0,N.threadItems)(a).map(b=>"invite"===b.kind?(0,d.jsx)(ah,{from:b.from,to:b.to},b.key):(0,d.jsx)(al,{group:b.group,task:a},b.key)),"working"===a.status&&0===a.lines.length&&(0,d.jsx)(u.default,{text:`${a.bot.name} is taking it on…`,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"block px-1 font-mono text-[10px]"})]})})}function ag({task:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ah,{from:au,to:a.bot}),(0,d.jsx)(aj,{children:(0,d.jsx)(q.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(q.BubbleContent,{className:"rounded-tr-md py-2 pr-2 pl-3.5",children:(0,d.jsx)(s.FoldedText,{text:a.request,subject:"request"})})})})]})}let au={name:"Thursday"};function ah({from:a,to:b}){return(0,d.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,d.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(ai,{bot:a}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,d.jsx)(ai,{bot:b})]})})}function ai({bot:a}){return(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)(B.BotMark,{size:15,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function aj({children:a}){return(0,d.jsx)(ak,{side:"end",name:"Thursday",mark:(0,d.jsx)(B.BotMark,{size:26,seed:"thursday",notify:!1,className:"mt-1 shrink-0"}),children:a})}function ak({side:a,mark:b,name:c,children:e}){return(0,d.jsxs)("div",{className:(0,L.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,L.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===a&&"items-end"),children:[(0,d.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:c}),e]})]})}function al({group:a,task:b}){return a.lines[0]?.kind==="user"?(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(aj,{children:a.lines.map(a=>(0,d.jsx)(q.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(q.BubbleContent,{className:"rounded-tr-md px-3.5 text-[13px] leading-snug break-keep",children:a.text})},a.id))})}):(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(ak,{side:a.bot.name===b.bot.name?"start":"end",name:a.bot.name,mark:(0,d.jsx)(B.BotMark,{size:26,seed:a.bot.name,vary:b.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1,className:"mt-1 shrink-0"}),children:(function(a){let b=[];for(let c of a){let a="tool"===c.kind&&c.tool?"tools":"said",d=b.at(-1);d&&d.kind===a?d.lines.push(c):b.push({kind:a,key:c.id,lines:[c]})}return b})(a.lines).map(a=>"tools"===a.kind?(0,d.jsx)(ao,{lines:a.lines,taskId:b.id},a.key):a.lines.map(a=>(0,d.jsx)(am,{line:a,taskId:b.id},a.id)))})})}function am({line:a,taskId:b}){if("tool"===a.kind&&a.tool)return(0,d.jsx)(O.BotTool,{tool:a.tool,taskId:b});if("note"===a.kind)return(0,d.jsxs)("details",{className:"w-full py-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,d.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,d.jsx)("p",{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px] leading-relaxed whitespace-pre-wrap break-keep",children:a.text})]});if(!(0,N.isOutcome)(a))return(0,d.jsx)("p",{className:"px-1 text-[12.5px] leading-relaxed break-keep text-muted-foreground",children:a.text});if(a.options)return(0,d.jsxs)("div",{className:"w-fit max-w-full space-y-1.5 rounded-2xl bg-amber-500/8 px-3 py-2 ring-1 ring-amber-500/25",children:[(0,d.jsx)("p",{className:"text-[13px] leading-snug break-keep",children:a.text}),a.options.length>0&&(0,d.jsx)("p",{className:"flex flex-wrap gap-1",children:a.options.map(a=>(0,d.jsx)("span",{className:"rounded-full bg-background/70 px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:a},a))})]});let c="error"===a.kind;return(0,d.jsxs)("div",{className:"min-w-0 px-1",children:[c&&(0,d.jsxs)("p",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] text-destructive",children:[(0,d.jsx)(n.X,{className:"size-3 shrink-0"}),"Could not finish"]}),(0,d.jsx)(t.Markdown,{className:(0,L.cn)("overflow-x-auto text-[13px] leading-relaxed break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",c&&"text-destructive"),children:a.text}),(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)(D.PathChips,{text:a.text,className:"min-w-0"}),!c&&(0,d.jsx)("span",{className:"ml-auto shrink-0",children:(0,d.jsx)(an,{text:a.text})})]})]})}function an({text:a}){let[b,c]=(0,o.useState)(!1),e=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,d.jsx)("button",{type:"button","aria-label":"Copy the report",onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1400)}catch(a){w.toast.add({type:"error",title:"Could not copy the report",description:(0,L.errorToString)(a)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:b?(0,d.jsx)(f.Check,{className:"size-3"}):(0,d.jsx)(j.Copy,{className:"size-3"})})}function ao({lines:a,taskId:b}){return(0,d.jsxs)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:[a.length>1&&(0,d.jsxs)("p",{className:"px-2 py-1 font-mono text-[10px] text-muted-foreground",children:[a.length," steps"]}),a.map(a=>a.tool?(0,d.jsx)(O.BotTool,{tool:a.tool,taskId:b,collapsed:!0},a.id):null)]})}a.s(["BotRoom",0,ap,"Conversation",0,af]),c()}catch(a){c(a)}},!1),42380,a=>{"use strict";var b=a.i(187924),c=a.i(913834);a.s(["BotRoster",0,function({bots:a,taskId:d}){return a.length<2?null:(0,b.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:a.map(a=>a.name).join(", "),children:[(0,b.jsx)("span",{className:"flex items-center",children:a.slice(0,3).map(a=>(0,b.jsx)(c.BotMark,{size:18,seed:a.name,vary:d,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"-ml-[3px] rounded-[7px] ring-2 ring-background first:ml-0"},a.name))}),(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[a.length," bots"]})]})}])},16716,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(998697),f=a.i(840260),g=a.i(930345),h=a.i(707938),i=a.i(576509),j=a.i(483138),k=a.i(904340),l=a.i(572131),m=a.i(369768),n=a.i(559553),o=a.i(497895),p=b([m]);[m]=p.then?(await p)():p;let q={markdown:j.FileText,csv:i.FileSpreadsheet,json:h.FileJson,text:k.FileType,image:g.FileImage};a.s(["PathChips",0,function({text:a,className:b}){let c=(0,l.useMemo)(()=>(0,n.pathsIn)(a),[a]);return c.length?(0,d.jsx)("div",{className:(0,o.cn)("flex flex-wrap gap-1.5",b),children:c.map(a=>{let b,c=a.split("/").pop()??a,g=(b=(0,n.viewKindOf)(a),"frame"===b?a.toLowerCase().endsWith(".pdf")?j.FileText:f.FileCode:q[b]??e.File);return(0,d.jsxs)(m.FileLink,{path:a,className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted/70 py-1 pr-2.5 pl-2 font-mono text-[11px] text-foreground/80 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(g,{className:"size-3 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"truncate",children:c})]},a)})}):null}]),c()}catch(a){c(a)}},!1),394440,a=>{"use strict";var b=a.i(187924),c=a.i(327598),d=a.i(231500),e=a.i(164831);let f={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"}]]};f.node;let g=(0,e.default)(f);var h=a.i(875160),i=a.i(19895),j=a.i(474215),k=a.i(572131),l=a.i(767561),m=a.i(340695),n=a.i(613350),o=a.i(545097),p=a.i(546893),q=a.i(287702),r=a.i(405050);let s=(0,r.createServerReference)("7fbc7081db6a5f8821ff485f87b3fd5a4a2f223663",r.callServer,void 0,r.findSourceMapURL,"answerTaskAction");var t=a.i(939774),u=a.i(411509),v=a.i(777279),w=a.i(313237),x=a.i(759497),y=a.i(497895);function z(){let[a,b]=(0,w.useServerAction)(s,{onOk:()=>(0,x.revalidate)(l.queryKey.tasks)});return[async(b,c)=>{let d=c.trim();if(!d)return!1;try{let c=await a(b.id,d);return v.screenActs.announce({kind:"answered",id:c.id,label:c.label,answer:d}),!0}catch{return!1}},b]}a.s(["TaskReply",0,function({task:a,status:e,lines:f=[],className:r}){let[s,A]=(0,k.useState)(()=>v.taskDrafts.get(a.id));(0,k.useEffect)(()=>A(v.taskDrafts.get(a.id)),[a.id]);let B=b=>{A(b),v.taskDrafts.set(a.id,b)},[C,D]=z(),[E,F]=(0,w.useServerAction)(t.cancelTaskAction,{onOk:a=>{(0,x.revalidate)(l.queryKey.tasks),v.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),G=D||F,[H,I]=(0,k.useState)(!1),[J,K]=(0,k.useState)(null);(0,k.useEffect)(()=>{I(!1),K(null)},[a.id]),(0,k.useEffect)(()=>{"running"!==e&&K(null)},[e]),(0,k.useEffect)(()=>{J&&f.some(a=>"user"===a.kind&&a.text===J)&&K(null)},[f,J]);let L=async b=>{!G&&await C(a,b)&&(B(""),"running"===e&&(K(b.trim()),I(!1)))},M="waiting"===e?a.ask:null,N=(0,u.isBudgetAsk)(M),O=M?M.options.length?"Or put it another way…":"Your answer":"running"===e?`What's off? ${a.bot} reads this before its next step`:"Anything more? It picks up where it left off",P=(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),L(s)},className:"flex items-end gap-1 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",children:[(0,b.jsx)(p.Textarea,{value:s,rows:1,disabled:G,autoFocus:"running"===e,onChange:a=>B(a.target.value),onKeyDown:a=>{"Escape"===a.key&&"running"===e?I(!1):"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),L(s))},placeholder:O,"aria-label":`Message for ${a.label}`,className:"max-h-32 min-h-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"}),"running"===e&&(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:G,onClick:()=>I(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,b.jsx)(j.X,{})}),(0,b.jsx)(m.Button,{type:"submit",size:"icon-sm",variant:s.trim()?"default":"ghost",disabled:!s.trim()||G,"aria-label":"Send",className:"rounded-full",children:D?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(c.ArrowUp,{})})]});return"running"!==e||H?M?(0,b.jsxs)("div",{className:(0,y.cn)("space-y-2.5 rounded-2xl px-3.5 py-3 ring-1",N?"bg-muted/40 ring-border/50":"bg-amber-500/8 ring-amber-500/25",r),children:[(0,b.jsxs)("p",{className:"flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{className:"shrink-0",children:"To"}),(0,b.jsx)("span",{className:"truncate text-foreground",children:a.bot}),(0,b.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,b.jsx)("span",{className:"truncate",children:a.label})]}),M.question&&(0,b.jsx)(n.FoldedText,{text:M.question,subject:"message",clamp:"line-clamp-6",tall:"max-h-56"}),M.options.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:M.options.map(a=>(0,b.jsxs)(m.Button,{size:"sm",variant:"outline",disabled:G,onClick:()=>L(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",children:[N&&a===u.TASK_CONTINUE&&(0,b.jsx)(d.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a,N&&a===u.TASK_CONTINUE&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",q.BOT_RUN.steps," steps"]})]},a))}),P,(0,b.jsx)("button",{type:"button",disabled:G,onClick:()=>E(a.id),className:"font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",children:"Stop this task instead"})]}):(0,b.jsx)("div",{className:r,children:P}):(0,b.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 rounded-2xl bg-muted/40 py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/50",r),children:[J?(0,b.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-[12.5px] leading-5 text-muted-foreground",children:[(0,b.jsx)(h.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,b.jsx)("span",{className:"shrink-0",children:"Before its next step:"}),(0,b.jsx)(o.default,{text:J,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate"})]}):(0,b.jsx)(o.default,{text:`${a.bot} is on it — Thursday steers it by voice.`,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,b.jsxs)(m.Button,{type:"button",size:"sm",variant:"ghost",disabled:G,onClick:()=>I(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,b.jsx)(g,{className:"size-3.5"}),"Step in"]}),(0,b.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:G,onClick:()=>E(a.id),"aria-label":"Stop this task",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:F?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(i.Square,{className:"size-3"})})]})},"useAnswerTask",0,z],394440)},371181,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fbb988f415acfb6ae0ecf4b9da4d6510c4331ed8f",b.callServer,void 0,b.findSourceMapURL,"markReportedAction");a.s(["markReportedAction",0,c])},939774,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fe21e4e229cffa414a4ef02ed9591309ce5d04398",b.callServer,void 0,b.findSourceMapURL,"cancelTaskAction");a.s(["cancelTaskAction",0,c])},944567,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f2b62a0347bf9a35aa766fc41149b696cbf7af676",b.callServer,void 0,b.findSourceMapURL,"startTaskAction");a.s(["startTaskAction",0,c])},777279,a=>{"use strict";var b=a.i(572131);let c=[],d=!1,e=new Set;function f(a,b){let c=a=>({name:a,icon:b?.find(b=>b.name===a)?.icon??null}),d=c(a.bot),e=[],f=new Map,g=new Map;for(let b of a.lines){let a=b.bot?c(b.bot):d,h=b.parent&&g.get(b.parent)?.name?d:null;switch(b.kind){case"user":e.push({id:b.id,bot:d,to:null,text:b.text,kind:"user"});break;case"text":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"say"});break;case"note":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"note"});break;case"tool":f.set(b.callId,e.length),e.push({id:b.id,bot:a,to:h,text:b.note??b.input,kind:"tool",tool:{name:b.name,input:b.input,note:b.note,path:b.path,callId:b.callId}});break;case"tool-result":{let a=f.get(b.callId),c=void 0===a?void 0:e[a];c?.tool&&void 0!==a&&(e[a]={...c,tool:{...c.tool,results:b.results,more:b.more}});break}case"ask":{let d=c(b.to);g.set(b.callId,d),e.push({id:b.id,bot:a,to:d,text:b.text,kind:"ask"});break}case"ask-result":{let c=g.get(b.callId);c&&b.text&&e.push({id:b.id,bot:c,to:a,text:b.text,kind:"ask"});break}case"waiting":e.push({id:b.id,bot:a,to:null,text:b.question,kind:"result",options:b.options})}}if("failed"===a.status&&a.outcome)e.push({id:`${a.id}-end`,bot:d,to:null,text:a.outcome,kind:"error"});else if("done"===a.status||"waiting"===a.status){let b=e.at(-1);b&&"say"===b.kind&&b.text===a.outcome&&(e[e.length-1]={...b,kind:"result"})}return{id:a.id,request:a.request,label:a.label,bot:d,lines:e,status:"running"===a.status?"working":a.status,outcome:a.outcome,ask:a.ask,relayed:a.reported,tokens:a.tokens,contextTokens:a.contextTokens,contextBudget:a.contextBudget,updatedAt:a.updatedAt}}let g=new Map,h=new Set,i=[];a.s(["botTasks",0,{sync(a,b){for(let g of(d=!0,c=[...a].reverse().map(a=>f(a,b)).slice(-30),e))g()},primed:()=>d},"isOutcome",0,a=>"result"===a.kind||"error"===a.kind,"lastSaid",0,function(a){for(let b=a.lines.length-1;b>=0;b--){let c=a.lines[b];if("user"!==c.kind&&"note"!==c.kind)return c}return null},"latestPerBot",0,function(a){let b=new Map;for(let c of a)for(let a of(b.has(c.bot.name)||b.set(c.bot.name,{bot:c.bot,task:c,line:null,open:0}),c.lines))"user"!==a.kind&&"note"!==a.kind&&b.set(a.bot.name,{bot:a.bot,task:c,line:a,open:b.get(a.bot.name)?.open??0});for(let c of a){if("working"!==c.status)continue;let a=b.get(c.bot.name);a&&(a.open+=1)}return[...b.values()]},"rosterOf",0,function(a){let b=[a.bot];for(let c of a.lines)b.some(a=>a.name===c.bot.name)||b.push(c.bot);return b},"screenActs",0,{announce(a){for(let b of h)b(a)},subscribe:a=>(h.add(a),()=>{h.delete(a)})},"taskDrafts",0,{get:a=>g.get(a)??"",set(a,b){b?g.set(a,b):g.delete(a)},typing:a=>(g.get(a)?.trim().length??0)>0},"taskFromRow",0,f,"threadItems",0,function(a){let b=new Set([a.bot.name]),c=[];for(let d of function(a){let b=[];for(let c of a){let a=b.at(-1);if(a&&a.bot.name===c.bot.name&&a.to?.name===c.to?.name&&"user"===a.lines[0].kind==("user"===c.kind)){a.lines.push(c);continue}b.push({key:c.id,bot:c.bot,to:c.to,lines:[c]})}return b}(a.lines))d.to&&!b.has(d.to.name)&&(b.add(d.to.name),c.push({kind:"invite",key:`${d.key}-joins`,from:d.bot,to:d.to})),b.add(d.bot.name),c.push({kind:"group",key:d.key,group:d});return c},"useBotTasks",0,function(){return(0,b.useSyncExternalStore)(a=>(e.add(a),()=>e.delete(a)),()=>c,()=>i)}])},327598,a=>{"use strict";var b=a.i(164831);let c={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};c.node;let d=(0,b.default)(c);a.s(["ArrowUp",0,d],327598)},231500,a=>{"use strict";var b=a.i(164831);let c={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronsRight",0,d],231500)},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.default)(c);a.s(["Copy",0,d],585650)},840260,a=>{"use strict";var b=a.i(164831);let c={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};c.node;let d=(0,b.default)(c);a.s(["FileCode",0,d],840260)},930345,a=>{"use strict";var b=a.i(164831);let c={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};c.node;let d=(0,b.default)(c);a.s(["FileImage",0,d],930345)},576509,a=>{"use strict";var b=a.i(164831);let c={name:"file-spreadsheet",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]};c.node;let d=(0,b.default)(c);a.s(["FileSpreadsheet",0,d],576509)},904340,a=>{"use strict";var b=a.i(164831);let c={name:"file-type",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]};c.node;let d=(0,b.default)(c);a.s(["FileType",0,d],904340)},19895,a=>{"use strict";var b=a.i(164831);let c={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};c.node;let d=(0,b.default)(c);a.s(["Square",0,d],19895)}];
2
2
 
3
- //# sourceMappingURL=_061oc5l._.js.map
3
+ //# sourceMappingURL=_1m5popy._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[964665,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(707963),f=a.i(168370),g=a.i(998697),h=a.i(572327),i=a.i(707938),j=a.i(483138),k=a.i(844561),l=a.i(71215),m=a.i(595775),n=a.i(649268),o=a.i(239025),p=a.i(951675),q=a.i(586446),r=a.i(572131),s=a.i(767561),t=a.i(340695),u=a.i(446181),v=a.i(950463),w=a.i(287702),x=a.i(603034),y=a.i(619477),z=a.i(369768),A=a.i(775552),B=a.i(199169),C=a.i(313237),D=a.i(759497),E=a.i(497895),F=b([z]);[z]=F.then?(await F)():F;let L={markdown:j.FileText,csv:o.Sheet,json:i.FileJson,text:j.FileText,frame:h.FileCode2,image:l.Image,audio:n.Music,video:q.Video,none:g.File};function G({entry:a,active:b,onPick:c}){let e="set"===a.kind?m.Images:L[a.view];return(0,d.jsxs)("button",{type:"button",onClick:c,title:`${a.name} \xb7 ${(0,B.shortAgo)(a.at)}`,className:(0,E.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",b?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,d.jsx)(e,{className:"size-3.5 shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:"set"===a.kind?a.count:(0,E.formatBytes)(a.bytes)})]})}function H({row:a,file:b,onOpen:c,onBack:g,onGone:h}){let[i]=(0,C.useServerAction)(A.openFileAction),[j,l]=(0,C.useServerAction)(x.deleteArtifactAction,{okMessage:"Deleted",onOk:()=>{(0,D.revalidate)(s.queryKey.artifacts),b?g():h()}}),m=b?{path:b.path,bytes:b.bytes,at:b.at}:"file"===a.kind?{path:a.path,bytes:a.bytes,at:a.at}:null,n=async a=>{await u.notify.confirm({title:`Delete ${a.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&j(a)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-3 border-b border-border/60 px-6",children:[b&&(0,d.jsxs)("button",{type:"button",onClick:g,className:"-ml-1 flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(e.ChevronLeft,{className:"size-3"}),a.name]}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:m?m.path.split("/").pop()??a.name:a.name}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:m?`${(0,E.formatBytes)(m.bytes)} \xb7 ${(0,B.shortAgo)(m.at)}`:`${a.count} ${1===a.count?"file":"files"} \xb7 ${(0,B.shortAgo)(a.at)}`}),m&&(0,d.jsx)("a",{href:s.queryKey.fileView(m.path),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(f.ExternalLink,{className:"size-4"})}),(0,d.jsx)(t.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>i(m?.path??a.path),children:(0,d.jsx)(k.FolderOpen,{})}),m&&(0,d.jsx)(t.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:l,className:"text-muted-foreground",onClick:()=>n(m.path),children:(0,d.jsx)(p.Trash2,{})})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:m?(0,d.jsx)(z.FilePreview,{path:m.path,bytes:m.bytes}):(0,d.jsx)(I,{name:a.name,onOpen:c})})]})}function I({name:a,onOpen:b}){let{data:c,isLoading:e,error:f}=(0,D.useServerRoute)(s.queryKey.artifactSet(a,w.ARTIFACT_VIEW.setFiles));if(e)return(0,d.jsx)("div",{className:"grid grid-cols-4 gap-3 p-5",children:Array.from({length:8},(a,b)=>(0,d.jsx)(v.Skeleton,{className:"aspect-4/3 w-full rounded-xl"},b))});if(f)return(0,d.jsx)(y.SettingError,{message:f.message});let g=c?.files??[];return 0===g.length?(0,d.jsx)("p",{className:"p-5 text-xs text-muted-foreground/60",children:"Nothing in here the app can open."}):(0,d.jsxs)("div",{className:"p-5",children:[(0,d.jsx)("div",{className:"grid grid-cols-4 gap-3",children:g.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>b(a),title:`${a.name} \xb7 ${(0,E.formatBytes)(a.bytes)}`,className:"flex flex-col gap-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-2",children:[(0,d.jsx)(J,{file:a}),(0,d.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:a.name})]},a.path))}),c&&c.total>g.length&&(0,d.jsx)("p",{className:"pt-4 font-mono text-[11px] text-muted-foreground/60",children:`${g.length} of ${c.total.toLocaleString("en")} — the rest are in the folder`})]})}function J({file:a}){if("image"===a.view&&a.bytes<=w.WORKSPACE_VIEW.elementMax)return(0,d.jsx)("img",{src:s.queryKey.file(a.path),alt:a.name,loading:"lazy",decoding:"async",className:"aspect-4/3 w-full rounded-xl object-cover"});let b=L[a.view];return(0,d.jsx)("span",{className:"grid aspect-4/3 w-full place-items-center rounded-xl bg-muted/40 text-muted-foreground",children:(0,d.jsx)(b,{className:"size-5"})})}function K({empty:a,onReveal:b}){return(0,d.jsxs)("div",{className:"space-y-4 p-8",children:[(0,d.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:a?"Nothing finished yet. When a bot ends a job with something to hand over — a page, a report, a set of pictures — it lands here.":"Pick something on the left. A folder a bot filled is one row, and opens as a sheet."}),(0,d.jsxs)(t.Button,{variant:"outline",onClick:b,children:[(0,d.jsx)(k.FolderOpen,{}),"Reveal folder"]})]})}a.s(["ArtifactSetting",0,function(){let[a,b]=(0,r.useState)(null),[c,e]=(0,r.useState)(""),[f,g]=(0,r.useState)(w.ARTIFACT_VIEW.rows),{data:h,isLoading:i,error:j}=(0,D.useServerRoute)(s.queryKey.artifactShelf(f),{keepPreviousData:!0}),[l]=(0,C.useServerAction)(A.openFileAction);if(i)return(0,d.jsx)(y.SettingPanesSkeleton,{});if(j)return(0,d.jsx)(y.SettingError,{message:j.message});let m=h?.entries??[],n=h?.total??0,o=c.trim().toLowerCase(),p=o?m.filter(a=>a.name.toLowerCase().includes(o)):m,q=m.find(b=>b.path===a?.row.path)??a?.row;return(0,d.jsx)(y.SettingPanes,{footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(y.SettingRailNote,{children:(0,d.jsxs)("span",{className:"font-mono",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:"artifacts"}),` \xb7 ${function(a,b,c){if(0===b)return"empty";let d=b>a.length?`${a.length} of ${b.toLocaleString("en")} artifacts`:`${b} ${1===b?"artifact":"artifacts"}`;return c>b?`${d} \xb7 ${c.toLocaleString("en")} files`:d}(m,n,h?.files??0)}`]})}),(0,d.jsxs)(t.Button,{variant:"outline",size:"sm",onClick:()=>l("artifacts"),children:[(0,d.jsx)(k.FolderOpen,{}),"Reveal folder"]})]}),left:(0,d.jsxs)("div",{className:"flex flex-col py-2",children:[(0,d.jsx)(y.SettingFilter,{value:c,onChange:e,placeholder:"Filter artifacts",className:"mx-2 mb-1.5 w-auto"}),0===p.length?(0,d.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:o?"Nothing matches":"Nothing here yet"}):p.map(a=>(0,d.jsx)(G,{entry:a,active:a.path===q?.path,onPick:()=>b({row:a,file:null})},a.path)),n>m.length&&(0,d.jsx)("button",{type:"button",onClick:()=>g(f+w.ARTIFACT_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(w.ARTIFACT_VIEW.rows,n-m.length)} more of ${n.toLocaleString("en")}`})]}),right:q?(0,d.jsx)(H,{row:q,file:a?.file??null,onOpen:a=>b({row:q,file:a}),onBack:()=>b({row:q,file:null}),onGone:()=>b(null)},q.path):(0,d.jsx)(K,{empty:0===n,onReveal:()=>l("artifacts")})})}]),c()}catch(a){c(a)}},!1),603034,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fdad44e62ddf8a72f8c27c74a9673daded0d24847",b.callServer,void 0,b.findSourceMapURL,"deleteArtifactAction");a.s(["deleteArtifactAction",0,c])},572327,a=>{"use strict";var b=a.i(164831);let c={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};c.node;let d=(0,b.default)(c);a.s(["FileCode2",0,d],572327)},595775,a=>{"use strict";var b=a.i(164831);let c={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};c.node;let d=(0,b.default)(c);a.s(["Images",0,d],595775)},649268,a=>{"use strict";var b=a.i(164831);let c={name:"music",size:24,node:[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]};c.node;let d=(0,b.default)(c);a.s(["Music",0,d],649268)},239025,a=>{"use strict";var b=a.i(164831);let c={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};c.node;let d=(0,b.default)(c);a.s(["Sheet",0,d],239025)},951675,a=>{"use strict";var b=a.i(164831);let c={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"]};c.node;let d=(0,b.default)(c);a.s(["Trash2",0,d],951675)},586446,a=>{"use strict";var b=a.i(164831);let c={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};c.node;let d=(0,b.default)(c);a.s(["Video",0,d],586446)}];
1
+ module.exports=[964665,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(707963),f=a.i(168370),g=a.i(998697),h=a.i(572327),i=a.i(707938),j=a.i(483138),k=a.i(844561),l=a.i(71215),m=a.i(595775),n=a.i(649268),o=a.i(239025),p=a.i(951675),q=a.i(586446),r=a.i(572131),s=a.i(767561),t=a.i(340695),u=a.i(446181),v=a.i(950463),w=a.i(287702),x=a.i(473613),y=a.i(619477),z=a.i(369768),A=a.i(247017),B=a.i(199169),C=a.i(313237),D=a.i(759497),E=a.i(497895),F=b([z]);[z]=F.then?(await F)():F;let L={markdown:j.FileText,csv:o.Sheet,json:i.FileJson,text:j.FileText,frame:h.FileCode2,image:l.Image,audio:n.Music,video:q.Video,none:g.File};function G({entry:a,active:b,onPick:c}){let e="set"===a.kind?m.Images:L[a.view];return(0,d.jsxs)("button",{type:"button",onClick:c,title:`${a.name} \xb7 ${(0,B.shortAgo)(a.at)}`,className:(0,E.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",b?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,d.jsx)(e,{className:"size-3.5 shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:"set"===a.kind?a.count:(0,E.formatBytes)(a.bytes)})]})}function H({row:a,file:b,onOpen:c,onBack:g,onGone:h}){let[i]=(0,C.useServerAction)(A.openFileAction),[j,l]=(0,C.useServerAction)(x.deleteArtifactAction,{okMessage:"Deleted",onOk:()=>{(0,D.revalidate)(s.queryKey.artifacts),b?g():h()}}),m=b?{path:b.path,bytes:b.bytes,at:b.at}:"file"===a.kind?{path:a.path,bytes:a.bytes,at:a.at}:null,n=async a=>{await u.notify.confirm({title:`Delete ${a.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&j(a)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-3 border-b border-border/60 px-6",children:[b&&(0,d.jsxs)("button",{type:"button",onClick:g,className:"-ml-1 flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(e.ChevronLeft,{className:"size-3"}),a.name]}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:m?m.path.split("/").pop()??a.name:a.name}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:m?`${(0,E.formatBytes)(m.bytes)} \xb7 ${(0,B.shortAgo)(m.at)}`:`${a.count} ${1===a.count?"file":"files"} \xb7 ${(0,B.shortAgo)(a.at)}`}),m&&(0,d.jsx)("a",{href:s.queryKey.fileView(m.path),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(f.ExternalLink,{className:"size-4"})}),(0,d.jsx)(t.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>i(m?.path??a.path),children:(0,d.jsx)(k.FolderOpen,{})}),m&&(0,d.jsx)(t.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:l,className:"text-muted-foreground",onClick:()=>n(m.path),children:(0,d.jsx)(p.Trash2,{})})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:m?(0,d.jsx)(z.FilePreview,{path:m.path,bytes:m.bytes}):(0,d.jsx)(I,{name:a.name,onOpen:c})})]})}function I({name:a,onOpen:b}){let{data:c,isLoading:e,error:f}=(0,D.useServerRoute)(s.queryKey.artifactSet(a,w.ARTIFACT_VIEW.setFiles));if(e)return(0,d.jsx)("div",{className:"grid grid-cols-4 gap-3 p-5",children:Array.from({length:8},(a,b)=>(0,d.jsx)(v.Skeleton,{className:"aspect-4/3 w-full rounded-xl"},b))});if(f)return(0,d.jsx)(y.SettingError,{message:f.message});let g=c?.files??[];return 0===g.length?(0,d.jsx)("p",{className:"p-5 text-xs text-muted-foreground/60",children:"Nothing in here the app can open."}):(0,d.jsxs)("div",{className:"p-5",children:[(0,d.jsx)("div",{className:"grid grid-cols-4 gap-3",children:g.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>b(a),title:`${a.name} \xb7 ${(0,E.formatBytes)(a.bytes)}`,className:"flex flex-col gap-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-2",children:[(0,d.jsx)(J,{file:a}),(0,d.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:a.name})]},a.path))}),c&&c.total>g.length&&(0,d.jsx)("p",{className:"pt-4 font-mono text-[11px] text-muted-foreground/60",children:`${g.length} of ${c.total.toLocaleString("en")} — the rest are in the folder`})]})}function J({file:a}){if("image"===a.view&&a.bytes<=w.WORKSPACE_VIEW.elementMax)return(0,d.jsx)("img",{src:s.queryKey.file(a.path),alt:a.name,loading:"lazy",decoding:"async",className:"aspect-4/3 w-full rounded-xl object-cover"});let b=L[a.view];return(0,d.jsx)("span",{className:"grid aspect-4/3 w-full place-items-center rounded-xl bg-muted/40 text-muted-foreground",children:(0,d.jsx)(b,{className:"size-5"})})}function K({empty:a,onReveal:b}){return(0,d.jsxs)("div",{className:"space-y-4 p-8",children:[(0,d.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:a?"Nothing finished yet. When a bot ends a job with something to hand over — a page, a report, a set of pictures — it lands here.":"Pick something on the left. A folder a bot filled is one row, and opens as a sheet."}),(0,d.jsxs)(t.Button,{variant:"outline",onClick:b,children:[(0,d.jsx)(k.FolderOpen,{}),"Reveal folder"]})]})}a.s(["ArtifactSetting",0,function(){let[a,b]=(0,r.useState)(null),[c,e]=(0,r.useState)(""),[f,g]=(0,r.useState)(w.ARTIFACT_VIEW.rows),{data:h,isLoading:i,error:j}=(0,D.useServerRoute)(s.queryKey.artifactShelf(f),{keepPreviousData:!0}),[l]=(0,C.useServerAction)(A.openFileAction);if(i)return(0,d.jsx)(y.SettingPanesSkeleton,{});if(j)return(0,d.jsx)(y.SettingError,{message:j.message});let m=h?.entries??[],n=h?.total??0,o=c.trim().toLowerCase(),p=o?m.filter(a=>a.name.toLowerCase().includes(o)):m,q=m.find(b=>b.path===a?.row.path)??a?.row;return(0,d.jsx)(y.SettingPanes,{footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(y.SettingRailNote,{children:(0,d.jsxs)("span",{className:"font-mono",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:"artifacts"}),` \xb7 ${function(a,b,c){if(0===b)return"empty";let d=b>a.length?`${a.length} of ${b.toLocaleString("en")} artifacts`:`${b} ${1===b?"artifact":"artifacts"}`;return c>b?`${d} \xb7 ${c.toLocaleString("en")} files`:d}(m,n,h?.files??0)}`]})}),(0,d.jsxs)(t.Button,{variant:"outline",size:"sm",onClick:()=>l("artifacts"),children:[(0,d.jsx)(k.FolderOpen,{}),"Reveal folder"]})]}),left:(0,d.jsxs)("div",{className:"flex flex-col py-2",children:[(0,d.jsx)(y.SettingFilter,{value:c,onChange:e,placeholder:"Filter artifacts",className:"mx-2 mb-1.5 w-auto"}),0===p.length?(0,d.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:o?"Nothing matches":"Nothing here yet"}):p.map(a=>(0,d.jsx)(G,{entry:a,active:a.path===q?.path,onPick:()=>b({row:a,file:null})},a.path)),n>m.length&&(0,d.jsx)("button",{type:"button",onClick:()=>g(f+w.ARTIFACT_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(w.ARTIFACT_VIEW.rows,n-m.length)} more of ${n.toLocaleString("en")}`})]}),right:q?(0,d.jsx)(H,{row:q,file:a?.file??null,onOpen:a=>b({row:q,file:a}),onBack:()=>b({row:q,file:null}),onGone:()=>b(null)},q.path):(0,d.jsx)(K,{empty:0===n,onReveal:()=>l("artifacts")})})}]),c()}catch(a){c(a)}},!1),473613,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fb8137c16531f0b30d68e5fb1b81da2e890990b96",b.callServer,void 0,b.findSourceMapURL,"deleteArtifactAction");a.s(["deleteArtifactAction",0,c])},572327,a=>{"use strict";var b=a.i(164831);let c={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};c.node;let d=(0,b.default)(c);a.s(["FileCode2",0,d],572327)},595775,a=>{"use strict";var b=a.i(164831);let c={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};c.node;let d=(0,b.default)(c);a.s(["Images",0,d],595775)},649268,a=>{"use strict";var b=a.i(164831);let c={name:"music",size:24,node:[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]};c.node;let d=(0,b.default)(c);a.s(["Music",0,d],649268)},239025,a=>{"use strict";var b=a.i(164831);let c={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};c.node;let d=(0,b.default)(c);a.s(["Sheet",0,d],239025)},951675,a=>{"use strict";var b=a.i(164831);let c={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"]};c.node;let d=(0,b.default)(c);a.s(["Trash2",0,d],951675)},586446,a=>{"use strict";var b=a.i(164831);let c={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};c.node;let d=(0,b.default)(c);a.s(["Video",0,d],586446)}];
2
2
 
3
- //# sourceMappingURL=_0-pwe74._.js.map
3
+ //# sourceMappingURL=_1r2_qk-._.js.map