thursday-agent 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) 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/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +2 -2
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  16. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  17. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
  22. package/.next/server/app/api/config/route.js.nft.json +1 -1
  23. package/.next/server/app/api/events/route.js.nft.json +1 -1
  24. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  25. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  26. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  27. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  28. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  29. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  31. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  32. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  33. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  34. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  35. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  36. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  37. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  38. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  39. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  40. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  41. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  42. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  43. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/page/server-reference-manifest.json +40 -40
  45. package/.next/server/app/page.js +2 -2
  46. package/.next/server/app/page.js.nft.json +1 -1
  47. package/.next/server/app/page_client-reference-manifest.js +1 -1
  48. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +1 -1
  49. package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +4 -4
  50. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
  51. package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +2 -2
  52. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
  53. package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +1 -1
  54. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +3 -3
  55. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +4 -3
  56. package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +3 -3
  57. package/.next/server/chunks/_0-fjql4._.js +5 -5
  58. package/.next/server/chunks/_00xh_q0._.js +3 -5
  59. package/.next/server/chunks/_05h2cii._.js +1 -1
  60. package/.next/server/chunks/_0fzqt2y._.js +48 -44
  61. package/.next/server/chunks/_0mecv0f._.js +5 -5
  62. package/.next/server/chunks/_0mh8j4m._.js +1 -1
  63. package/.next/server/chunks/_0wp4le3._.js +1 -1
  64. package/.next/server/chunks/_0y5fg-x._.js +1 -1
  65. package/.next/server/chunks/_1230wbx._.js +3 -3
  66. package/.next/server/chunks/_15hq89o._.js +1 -1
  67. package/.next/server/chunks/{_03kp0jp._.js → _1c78vw5._.js} +58 -56
  68. package/.next/server/chunks/_1j8k_j5._.js +1 -1
  69. package/.next/server/chunks/_1krd9rf._.js +1 -1
  70. package/.next/server/chunks/_1php4eq._.js +1 -1
  71. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  72. package/.next/server/chunks/features_1qf3cei._.js +1 -1
  73. package/.next/server/chunks/features_memory_1uqvksn._.js +2 -2
  74. package/.next/server/chunks/ssr/[root-of-the-server]__092knlj._.js +3 -0
  75. package/.next/server/chunks/ssr/{[root-of-the-server]__1eh7hid._.js → [root-of-the-server]__0s9dq5u._.js} +1 -1
  76. package/.next/server/chunks/ssr/{[root-of-the-server]__1cyjywu._.js → [root-of-the-server]__0s9l2sv._.js} +1 -1
  77. package/.next/server/chunks/ssr/{[root-of-the-server]__0zkv7z_._.js → [root-of-the-server]__0xsog8n._.js} +2 -2
  78. package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +13 -9
  79. package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +2 -2
  80. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  81. package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +1 -1
  82. package/.next/server/chunks/ssr/{[root-of-the-server]__0_69wqr._.js → [root-of-the-server]__202p40z._.js} +1 -1
  83. package/.next/server/chunks/ssr/_001_ms1._.js +1 -1
  84. package/.next/server/chunks/ssr/{_0c-ql2m._.js → _0fz4mf_._.js} +2 -2
  85. package/.next/server/chunks/ssr/{_07uchnc._.js → _0gb4gmf._.js} +2 -2
  86. package/.next/server/chunks/ssr/_0i_6q1w._.js +2 -2
  87. package/.next/server/chunks/ssr/{_20kd_n0._.js → _0ilna52._.js} +3 -3
  88. package/.next/server/chunks/ssr/{_0mo2w06._.js → _0n3toaw._.js} +2 -2
  89. package/.next/server/chunks/ssr/{_0mb8zc8._.js → _0s99bgb._.js} +2 -2
  90. package/.next/server/chunks/ssr/_0zcjrbg._.js +3 -0
  91. package/.next/server/chunks/ssr/{_13z3f85._.js → _1-_etts._.js} +2 -2
  92. package/.next/server/chunks/ssr/_13fke0x._.js +1 -1
  93. package/.next/server/chunks/ssr/{_01_6m32._.js → _1b2mjwr._.js} +2 -2
  94. package/.next/server/chunks/ssr/{_1eoqg_g._.js → _1f-dg-6._.js} +2 -2
  95. package/.next/server/chunks/ssr/{_0y0tiht._.js → _1fojd41._.js} +3 -3
  96. package/.next/server/chunks/ssr/_1gd8q8l._.js +3 -0
  97. package/.next/server/chunks/ssr/{_1xvgn77._.js → _1h0rw11._.js} +2 -2
  98. package/.next/server/chunks/ssr/_1jhd09t._.js +3 -0
  99. package/.next/server/chunks/ssr/{_0u2jv_x._.js → _1lz_cq2._.js} +46 -44
  100. package/.next/server/chunks/ssr/{_0kbkmar._.js → _1nnsk7z._.js} +2 -2
  101. package/.next/server/chunks/ssr/_1sji22n._.js +1 -1
  102. package/.next/server/chunks/ssr/_1vyd1ji._.js +1 -1
  103. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  104. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  105. package/.next/server/chunks/ssr/{node_modules_0z5tsu8._.js → node_modules_00etblx._.js} +1 -1
  106. package/.next/server/chunks/ssr/{node_modules_1h4a4pp._.js → node_modules_04jf_m8._.js} +1 -1
  107. package/.next/server/chunks/ssr/{node_modules_0h5hnr1._.js → node_modules_08dhkiq._.js} +1 -1
  108. package/.next/server/chunks/ssr/{node_modules_1vqb6po._.js → node_modules_0940ns5._.js} +1 -1
  109. package/.next/server/chunks/ssr/{node_modules_1i7u1ia._.js → node_modules_09q35v_._.js} +1 -1
  110. package/.next/server/chunks/ssr/{node_modules_124bue5._.js → node_modules_0_-_a--._.js} +1 -1
  111. package/.next/server/chunks/ssr/{node_modules_0h7u60n._.js → node_modules_0arus10._.js} +1 -1
  112. package/.next/server/chunks/ssr/{node_modules_0rjg6t1._.js → node_modules_0b__sgl._.js} +1 -1
  113. package/.next/server/chunks/ssr/{node_modules_113tz0l._.js → node_modules_0cxaxk9._.js} +1 -1
  114. package/.next/server/chunks/ssr/{node_modules_0lm7_vm._.js → node_modules_0g7fzk3._.js} +1 -1
  115. package/.next/server/chunks/ssr/{node_modules_0h50b8n._.js → node_modules_0had7xd._.js} +1 -1
  116. package/.next/server/chunks/ssr/{node_modules_1-hc6uv._.js → node_modules_0pvd7q-._.js} +1 -1
  117. package/.next/server/chunks/ssr/{node_modules_1bc7gu8._.js → node_modules_0yugy6m._.js} +1 -1
  118. package/.next/server/chunks/ssr/{node_modules_0y_cded._.js → node_modules_14om4ar._.js} +1 -1
  119. package/.next/server/chunks/ssr/{node_modules_0zp9r92._.js → node_modules_14q6g4n._.js} +1 -1
  120. package/.next/server/chunks/ssr/{node_modules_0eu1va6._.js → node_modules_198nmll._.js} +1 -1
  121. package/.next/server/chunks/ssr/{node_modules_1t9cyee._.js → node_modules_1_pc9kq._.js} +1 -1
  122. package/.next/server/chunks/ssr/{node_modules_063xwpp._.js → node_modules_1aaxuef._.js} +1 -1
  123. package/.next/server/chunks/ssr/{node_modules_0bvraul._.js → node_modules_1cx_ql6._.js} +1 -1
  124. package/.next/server/chunks/ssr/{node_modules_1xx28h1._.js → node_modules_1cz2hle._.js} +1 -1
  125. package/.next/server/chunks/ssr/{node_modules_1l0qtdu._.js → node_modules_1efrqxi._.js} +1 -1
  126. package/.next/server/chunks/ssr/{node_modules_1juq3hs._.js → node_modules_1eg7m6c._.js} +1 -1
  127. package/.next/server/chunks/ssr/{node_modules_1_n3ztw._.js → node_modules_1gdh31p._.js} +1 -1
  128. package/.next/server/chunks/ssr/{node_modules_0mwym0g._.js → node_modules_1hpopmo._.js} +1 -1
  129. package/.next/server/chunks/ssr/{node_modules_1bgb6-f._.js → node_modules_1qpjvy5._.js} +1 -1
  130. package/.next/server/chunks/ssr/{node_modules_1uuj9x1._.js → node_modules_1vh5ntv._.js} +1 -1
  131. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0d3skpl._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b748ic._.js} +1 -1
  132. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0i44kk5._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1z4hm5e._.js} +1 -1
  133. package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_0qe30a_._.js → node_modules_@vercel_oidc_dist_06mk8id._.js} +1 -1
  134. package/.next/server/middleware-build-manifest.js +3 -3
  135. package/.next/server/pages/404.html +1 -1
  136. package/.next/server/pages/500.html +1 -1
  137. package/.next/server/server-reference-manifest.js +1 -1
  138. package/.next/server/server-reference-manifest.json +41 -41
  139. package/.next/static/chunks/00rd4-v8r7axp.js +1 -0
  140. package/.next/static/chunks/{0tmgrnlje14-s.js → 08qe4as2q428z.js} +2 -2
  141. package/.next/static/chunks/{3ok9_x74rip3v.js → 0fl3gwe4-l6tz.js} +1 -1
  142. package/.next/static/chunks/{2a0k6jlq0_v1u.js → 0gnqdjn2lvdad.js} +2 -2
  143. package/.next/static/chunks/{1okqiww3pnwka.js → 0hwap1-p0m5sa.js} +1 -1
  144. package/.next/static/chunks/{1ekc7ul556kbl.js → 0w52rrrmuj9r9.js} +1 -1
  145. package/.next/static/chunks/{3agpgkwaa321p.js → 0wcprt5ot5she.js} +1 -1
  146. package/.next/static/chunks/{3xpbkl66ssib5.js → 15m575979un5f.js} +6 -6
  147. package/.next/static/chunks/{2fzs9fm8yarvq.js → 17p6tk6k88dq6.js} +1 -1
  148. package/.next/static/chunks/{26-pr2c9ro222.js → 1jd09sxcjddu1.js} +1 -1
  149. package/.next/static/chunks/{280t0_e99i276.js → 1w73ece_6bheu.js} +1 -1
  150. package/.next/static/chunks/{1grhjo7a5a0_-.js → 214ya3n5gxeih.js} +1 -1
  151. package/.next/static/chunks/22_zkas21rpna.js +1 -0
  152. package/.next/static/chunks/{0x79tx04dxbpp.js → 2u7xt6mxg44lf.js} +1 -1
  153. package/.next/static/chunks/{17donp69y4do7.js → 39j0fvpybzabl.js} +8 -8
  154. package/.next/static/chunks/{28cizcdaabd4h.js → 3akmqm77muj4-.js} +1 -1
  155. package/.next/static/chunks/3cq5g494yuke8.css +1 -0
  156. package/.next/static/chunks/3woj-xd7ki5_i.js +1 -0
  157. package/.next/static/chunks/{3cfi_q6d_wtci.js → 3zmcsnuo25zvq.js} +1 -1
  158. package/README.md +46 -23
  159. package/app/api/events/app-event.ts +0 -2
  160. package/bin/port.mjs +65 -0
  161. package/bin/thursday.mjs +2 -33
  162. package/docs/how-it-works.md +11 -7
  163. package/docs/images/face-dark.png +0 -0
  164. package/docs/images/face-light.png +0 -0
  165. package/docs/images/keeps-going.png +0 -0
  166. package/features/ai/chatgpt.ts +42 -20
  167. package/features/ai/load-tools.ts +20 -14
  168. package/features/ai/prompts/bot.prompt.ts +90 -88
  169. package/features/ai/prompts/thursday.prompt.ts +48 -41
  170. package/features/ai/tools/memory.tool.ts +65 -62
  171. package/features/ai/tools/tool-name.ts +0 -1
  172. package/features/ai/tools/workspace.tool.ts +3 -0
  173. package/features/bot/bot.action.ts +6 -1
  174. package/features/bot/bot.run.ts +11 -7
  175. package/features/bot/bot.runner.ts +34 -16
  176. package/features/bot/bot.schema.ts +25 -0
  177. package/features/bot/components/bot-room.tsx +57 -4
  178. package/features/bot/components/bot-tool.tsx +0 -1
  179. package/features/bot/task.query.ts +25 -6
  180. package/features/bot/task.store.ts +23 -4
  181. package/features/memory/components/memory-edit.tsx +7 -5
  182. package/features/thursday/components/thursday.tsx +0 -3
  183. package/features/thursday/tool-line.ts +0 -1
  184. package/features/thursday/use-thursday.ts +1 -1
  185. package/package.json +1 -1
  186. package/.next/server/chunks/ssr/[root-of-the-server]__1pduf5n._.js +0 -3
  187. package/.next/server/chunks/ssr/_14_lw10._.js +0 -3
  188. package/.next/server/chunks/ssr/_1spzm8z._.js +0 -3
  189. package/.next/server/chunks/ssr/lib_date-like_ts_02is0pw._.js +0 -3
  190. package/.next/static/chunks/0xzgvc0fkdb6t.js +0 -1
  191. package/.next/static/chunks/14hgtsjg-kael.css +0 -1
  192. package/.next/static/chunks/2hw2f6zmt7fmt.js +0 -1
  193. package/.next/static/chunks/3111pj5wnjgos.js +0 -1
  194. package/features/memory/components/memory-view.tsx +0 -84
  195. /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_buildManifest.js +0 -0
  196. /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_clientMiddlewareManifest.js +0 -0
  197. /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_ssgManifest.js +0 -0
@@ -217,7 +217,7 @@ function describe(
217
217
  ): Change {
218
218
  const args = (input ?? {}) as {
219
219
  path?: string;
220
- factId?: number;
220
+ factIds?: (number | null | undefined)[] | null;
221
221
  description?: string | null;
222
222
  aliases?: (string | undefined)[] | null;
223
223
  facts?:
@@ -234,12 +234,14 @@ function describe(
234
234
  }
235
235
 
236
236
  if (name === TOOL_NAMES.memory_forget) {
237
- const fact = args.factId != null ? known.get(args.factId) : undefined;
238
- const fallback = args.factId != null ? `Fact #${args.factId}` : "";
237
+ const ids = (args.factIds ?? []).filter((id) => id != null);
238
+ const facts = ids.map((id) => known.get(id));
239
239
  return {
240
240
  kind: "Forget",
241
- path: fact?.path ?? "",
242
- lines: [{ before: fact?.text ?? fallback }],
241
+ path: facts.find((fact) => fact)?.path ?? "",
242
+ lines: ids.map((id, index) => ({
243
+ before: facts[index]?.text ?? `Fact #${id}`,
244
+ })),
243
245
  carried: false,
244
246
  };
245
247
  }
@@ -29,7 +29,6 @@ import { toolIcon } from "@/features/bot/components/bot-tool";
29
29
  import { installSeedBots } from "@/features/bot/seed-bots";
30
30
  import { VoiceKeys } from "@/features/config/components/voice-key";
31
31
  import { type ConfigStatus, isConfigSet } from "@/features/config/config.const";
32
- import { MemoryView } from "@/features/memory/components/memory-view";
33
32
  import { SECTIONS, Settings } from "@/features/settings/components/settings";
34
33
  import {
35
34
  type SectionAlert,
@@ -214,8 +213,6 @@ export function CallScreen({
214
213
  </div>
215
214
  </div>
216
215
 
217
- {/* Memory the model opens for reading (memory_show) */}
218
- <MemoryView />
219
216
  {/* Documents a finished task produced; opens itself on the artifact event */}
220
217
  <ArtifactView />
221
218
 
@@ -6,7 +6,6 @@ const LINES: Record<string, string> = {
6
6
  [TOOL_NAMES.memory_recall]: "Checking your notes",
7
7
  [TOOL_NAMES.memory_remember]: "Noting that down",
8
8
  [TOOL_NAMES.memory_forget]: "Forgetting that",
9
- [TOOL_NAMES.memory_show]: "Putting your notes on screen",
10
9
  [TOOL_NAMES.bash]: "Doing it on this computer",
11
10
  [TOOL_NAMES.web_search]: "Searching the web",
12
11
  [TOOL_NAMES.load_skill]: "Reading how to do this",
@@ -654,7 +654,7 @@ export function useThursday() {
654
654
  // line open: flush held lines first
655
655
  outbox.open((one) => flush([one]));
656
656
 
657
- // First call: the opening system entry makes the model speak first, on the same path as a relay
657
+ // An opening — a first call, or memory to tidy — makes the model speak first, on the same path as a relay
658
658
  if (handshake.opening) {
659
659
  readAloud();
660
660
  live.say(handshake.opening);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thursday-agent",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A voice agent that runs on your own machine — talk to her, she hands the slow work to bots with a shell, a browser and skills.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -1,3 +0,0 @@
1
- module.exports=[750227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},59639,(a,b,c)=>{b.exports=a.x("node:process",()=>require("node:process"))},545097,a=>{"use strict";var b=a.i(187924),c=a.i(497895);let d={muted:{rest:"text-muted-foreground",band:"via-foreground"},waiting:{rest:c.WAITING_INK,band:"via-amber-950 dark:via-amber-100"}};a.s(["ShinyText",0,function({text:a,tone:e="muted",speed:f=2.4,className:g}){let{rest:h,band:i}=d[e];return(0,b.jsxs)("span",{"data-slot":"shiny-text",className:(0,c.cn)("relative inline-block max-w-full",h,g),children:[a,(0,b.jsx)("span",{"aria-hidden":!0,style:{animationDuration:`${f}s`},className:(0,c.cn)("pointer-events-none absolute inset-0 animate-shine overflow-hidden bg-linear-120 from-transparent from-35% via-50% to-transparent to-65% bg-size-[200%_auto] bg-clip-text text-transparent p-[inherit] select-none [text-overflow:inherit] motion-reduce:hidden",i),children:a})]})}])},287702,a=>{"use strict";process.env.THURSDAY_APP_DIR?.trim()||process.cwd(),process.env.THURSDAY_HOME?.trim()||process.cwd(),process.env.THURSDAY_URL?.trim()||process.env.PORT?.trim();let b=".ai-workspace",c={workspace:b,artifacts:"artifacts",projects:"projects",scratch:"scratch",bots:"bots",output:".output",skills:{default:"skills",custom:`${b}/.agents/skills`}};a.s(["APP_NAME",0,"Thursday","ARTIFACT_VIEW",0,{rows:200,setFiles:120},"ASCII_FACE",0,{charset:"emojiOnly",fontSize:{default:8,min:4,max:16},density:{default:1.4,min:.6,max:2}},"BOT_RUN",0,{steps:100,compactAt:5e5,compactHeadroom:.8,summaryWords:{min:600,max:3e3,perTokens:200},depth:2,askBack:3,silenceMs:3e5,autoResumes:3,retryAfterMs:[3e4,12e4,3e5],overflowShrink:.6,compactFiles:40},"BROWSER_SKILL",0,"browser","CALL_HISTORY_PAGE",0,10,"IS_DEV",0,!1,"PAGE_SIZE",0,50,"PATHS",0,c,"PROMPT_CROWDED",0,{bots:10,skills:20},"STUDIO_SERVER",0,"studio","WORKSPACE_VIEW",0,{rows:200,textMax:524288,elementMax:0x3200000}])},421042,a=>{"use strict";a.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_remember:"memory_remember",memory_forget:"memory_forget",memory_show:"memory_show",memory_conversation:"memory_conversation",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",delegate:"delegate",task:"task",ask_bot:"ask_bot",ask_thursday:"ask_thursday",ask_back:"ask_back",answer:"answer",end_call:"end_call"}])},139329,a=>{"use strict";var b=a.i(156757),c=a.i(199169);let d=b.z.enum(["user","call","bot"]),e=b.z.object({id:b.z.number(),text:b.z.string(),alwaysLoad:b.z.boolean(),source:d.nullish(),createdAt:c.DateLikeSchema});b.z.object({id:b.z.number(),path:b.z.string(),description:b.z.string(),aliases:b.z.string().array().nullish(),ownedByUser:b.z.boolean(),hits:b.z.number(),lastReadAt:c.DateLikeSchema.nullable(),createdAt:c.DateLikeSchema,updatedAt:c.DateLikeSchema,factCount:b.z.number(),facts:e.array()});let f=[{path:"profile",of:"The user themselves — their name, age, what they do, where they live, and whatever else says who they are"},{path:"preferences",of:"How they want things done, and said"},{path:"people/",of:"Someone in their life, and what matters about them"},{path:"projects/",of:"Something with an end — a trip, a purchase, a deadline, a thing being built"},{path:"topics/",of:"Something ongoing that keeps coming back"},{path:"inbox",of:"Nowhere obvious yet"}],g=f.filter(a=>!a.path.endsWith("/")).map(a=>a.path),h=f.filter(a=>a.path.endsWith("/")).map(a=>a.path.slice(0,-1));RegExp(`^(?:${g.join("|")}|(?:${h.join("|")})/.+)$`);let i=["profile","preferences"];[...i],a.s(["isFading",0,function(a){let b,d,e;return b=a.path,!i.includes(b)&&.15>(d=(0,c.toDate)(a.lastReadAt??a.createdAt),e=Math.max(0,(Date.now()-d.getTime())/864e5),(a.hits+1)/(1+e))},"memorySourceLabel",0,a=>"user"===a?"you":"call"===a?"on a call":"bot"===a?"a bot":"","noteTitle",0,function(a){let b=a.indexOf("/");return -1===b?a:a.slice(b+1)},"sectionOf",0,function(a){if("profile"===a||"preferences"===a)return"you";let b=a.slice(0,a.indexOf("/"));return h.includes(b)?b:"inbox"}])},16966,a=>{"use strict";var b=a.i(572131),c=a.i(801811),d=a.i(559539),e=a.i(492403);a.s(["useCompositeItem",0,function(a={}){let{highlightItemOnHover:f,highlightedIndex:g,onHighlightedIndexChange:h}=(0,d.useCompositeRootContext)(),{ref:i,index:j}=(0,e.useCompositeListItem)(a),k=g===j,l=b.useRef(null),m=(0,c.useMergedRefs)(i,l);return{compositeProps:{tabIndex:k?0:-1,onFocus(){h(j)},onMouseMove(){let a=l.current;if(!f||!a)return;let b=a.hasAttribute("disabled")||"true"===a.ariaDisabled;k||b||a.focus()}},compositeRef:m,index:j}}])},579923,a=>{"use strict";var b=a.i(572131),c=a.i(779549),d=a.i(854401),e=a.i(357738),f=a.i(909392),g=a.i(187924);function h(){return new Map}function i(){return new Set}function j(a,b){return a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}a.s(["CompositeList",0,function(a){let{children:k,elementsRef:l,labelsRef:m,onMapChange:n}=a,o=(0,d.useStableCallback)(n),[,p]=b.useState(!1),q=(0,c.useRefWithInit)(i).current,r=(0,c.useRefWithInit)(h).current,s=b.useRef(0),t=b.useRef(!0),u=b.useRef(null),v=b.useRef(null),w=(0,d.useStableCallback)(()=>{t.current||(t.current=!0,p(a=>!a))}),x=(0,d.useStableCallback)((a,b)=>{r.set(a,b),w()}),y=(0,d.useStableCallback)(a=>{r.delete(a),w()}),z=(0,d.useStableCallback)(a=>{let b=new Map;return l.current.length=0,m&&(m.current.length=0),a.forEach(a=>{b.set(a.element,{...a.registration.metadata??{},index:a.index}),l.current[a.index]=a.element,m&&(m.current[a.index]=void 0!==a.registration.label?a.registration.label:a.registration.textRef?.current?.textContent??a.element.textContent)}),s.current=l.current.length,b}),A=(0,d.useStableCallback)(()=>{var a;let b,c,d,e,[f,g]=(a=r,b=new Set,c=[],d=[],a.forEach((a,e)=>{if(!e.isConnected)return;let f=a.index,g={index:f??-1,element:e,registration:a};null===f?d.push(g):f>=0&&(b.add(f),c.push(g))}),e=0,d.sort((a,b)=>j(a.element,b.element)),d.forEach(a=>{for(;b.has(e);)e+=1;a.index=e,c.push(a),e+=1}),b.size>0&&c.sort((a,b)=>a.index-b.index),[c,d.map(a=>a.element)]),h=z(f),i=u.current,k=!i||i.length!==f.length||f.some((a,b)=>{let c=i[b];return a.index!==c.index||a.element!==c.element||a.registration.index!==c.registration.index||a.registration.metadata!==c.registration.metadata});!function(a){if(v.current?.disconnect(),v.current=null,"function"!=typeof MutationObserver||a.length<2)return;let b=new MutationObserver(c=>{if(!function(a){for(let b of a)for(let a=0;a<b.removedNodes.length;a+=1)if(b.removedNodes[a].isConnected)return!0;return!1}(c))return;let d=null;for(let c of a)if(c.isConnected){if(d&&j(d,c)>0){b.disconnect(),w();return}d=c}});v.current=b;let c=new Set;for(let b=1;b<a.length;b+=1){let d=function(a,b){let c=a.parentElement;for(;c&&!c.contains(b);)c=c.parentElement;return c}(a[b-1],a[b]);d&&c.add(d)}c.forEach(a=>b.observe(a,{childList:!0}))}(g),u.current=f,t.current=!1,k&&(q.forEach(a=>a(h)),o(h))});(0,e.useIsoLayoutEffect)(()=>(!t.current&&u.current&&z(u.current),()=>{l.current=[],m&&(m.current=[])}),[l,m,z]),(0,e.useIsoLayoutEffect)(()=>{t.current&&A()}),(0,e.useIsoLayoutEffect)(()=>()=>{v.current?.disconnect(),t.current=!0},[]);let B=(0,d.useStableCallback)(a=>(q.add(a),()=>{q.delete(a)})),C=b.useMemo(()=>({register:x,unregister:y,subscribeMapChange:B,nextIndexRef:s}),[x,y,B,s]);return(0,g.jsx)(f.CompositeListContext.Provider,{value:C,children:k})}])},909392,a=>{"use strict";var b=a.i(572131);let c=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});a.s(["CompositeListContext",0,c,"useCompositeListContext",0,function(){return b.useContext(c)}])},492403,a=>{"use strict";var b=a.i(572131),c=a.i(357738),d=a.i(909392);a.s(["useCompositeListItem",0,function(a={}){let{guess:e,label:f,metadata:g,textRef:h,index:i}=a,{register:j,unregister:k,subscribeMapChange:l,nextIndexRef:m}=(0,d.useCompositeListContext)(),n=b.useRef(-1),[o,p]=b.useState(null==i&&e?()=>{if(-1===n.current){let a=m.current;m.current+=1,n.current=a}return n.current}:-1),q=i??o,r=b.useRef(null),s=b.useCallback(a=>{let b=r.current;b&&k(b),r.current=a,a&&j(a,{metadata:g??null,index:i??null,label:f,textRef:h})},[i,j,k,g,f,h]);return(0,c.useIsoLayoutEffect)(()=>{if(null==i)return l(a=>{let b=r.current?a.get(r.current)?.index:null;null!=b&&p(b)})},[i,l]),{ref:s,index:q}}])},118816,a=>{"use strict";var b=a.i(572131),c=a.i(926184);let d=b.forwardRef(function(a,b){let{className:d,render:e,orientation:f="horizontal",style:g,...h}=a;return(0,c.useRenderElement)("div",a,{state:{orientation:f},ref:b,props:[{role:"separator","aria-orientation":f},h]})});a.s(["Separator",0,d])},144501,a=>{"use strict";var b=a.i(20265),c=a.i(426476);a.s(["getCssDimensions",0,function(a){let d=(0,c.getComputedStyle)(a),e=parseFloat(d.width)||0,f=parseFloat(d.height)||0,g=(0,c.isHTMLElement)(a),h=g?a.offsetWidth:e,i=g?a.offsetHeight:f;return((0,b.round)(e)!==h||(0,b.round)(f)!==i)&&(e=h,f=i),{width:e,height:f}}])},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)},689594,a=>{"use strict";var b=a.i(164831);let c={name:"book-marked",size:24,node:[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]};c.node;let d=(0,b.default)(c);a.s(["BookMarked",0,d],689594)},589027,a=>{"use strict";var b=a.i(164831);let c={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronDown",0,d],589027)},707963,a=>{"use strict";var b=a.i(164831);let c={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronLeft",0,d],707963)},199968,a=>{"use strict";var b=a.i(164831);let c={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};c.node;let d=(0,b.default)(c);a.s(["default",0,d])},141146,a=>{"use strict";var b=a.i(199968);a.s(["ChevronRight",()=>b.default])},168370,a=>{"use strict";var b=a.i(164831);let c={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};c.node;let d=(0,b.default)(c);a.s(["ExternalLink",0,d],168370)},707938,a=>{"use strict";var b=a.i(164831);let c={name:"file-braces",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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],aliases:["file-json"]};c.node;let d=(0,b.default)(c);a.s(["FileJson",0,d],707938)},483138,a=>{"use strict";var b=a.i(164831);let c={name:"file-text",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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};c.node;let d=(0,b.default)(c);a.s(["FileText",0,d],483138)},998697,a=>{"use strict";var b=a.i(164831);let c={name:"file",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"}]]};c.node;let d=(0,b.default)(c);a.s(["File",0,d],998697)},844561,a=>{"use strict";var b=a.i(164831);let c={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};c.node;let d=(0,b.default)(c);a.s(["FolderOpen",0,d],844561)},696732,a=>{"use strict";var b=a.i(164831);let c={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};c.node;let d=(0,b.default)(c);a.s(["Globe",0,d],696732)},71215,a=>{"use strict";var b=a.i(164831);let c={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};c.node;let d=(0,b.default)(c);a.s(["Image",0,d],71215)},875160,a=>{"use strict";var b=a.i(702918);a.s(["Loader2",()=>b.default])},474215,a=>{"use strict";var b=a.i(176965);a.s(["X",()=>b.default])},53467,a=>{"use strict";var b=a.i(261234),c=a.i(539110);a.i(975930);var d=a.i(671731),e=(0,c.__name)(a=>{let{securityLevel:c}=(0,b.getConfig2)(),e=(0,d.select)("body");if("sandbox"===c){let b=(0,d.select)(`#i${a}`),c=b.node()?.contentDocument??document;e=(0,d.select)(c.body)}return e.select(`#${a}`)},"selectSvgElement");a.s(["selectSvgElement",0,e])},882458,a=>{"use strict";var b=a.i(416635),c=a.i(43429),d=a.i(428212),e=a.i(916573),f=a.i(887370),g=a.i(261234),h=a.i(875117),i=a.i(539110),j={common:g.common_default,getConfig:g.getConfig,insertCluster:b.insertCluster,insertEdge:c.insertEdge,insertEdgeLabel:c.insertEdgeLabel,insertMarkers:c.markers_default,insertNode:d.insertNode,interpolateToCurve:f.interpolateToCurve,labelHelper:e.labelHelper,log:h.log,positionEdgeLabel:c.positionEdgeLabel},k={},l=(0,i.__name)(a=>{for(let b of a)k[b.name]=b},"registerLayoutLoaders");(0,i.__name)(()=>{l([{name:"dagre",loader:(0,i.__name)(async()=>await a.A(390118),"loader")},{name:"swimlane",loader:(0,i.__name)(async()=>await a.A(860094),"loader")},{name:"cose-bilkent",loader:(0,i.__name)(async()=>await a.A(989520),"loader")}])},"registerDefaultLayoutLoaders")();var m=(0,i.__name)(async(a,b)=>{if(!(a.layoutAlgorithm in k))throw Error(`Unknown layout algorithm: ${a.layoutAlgorithm}`);if(a.diagramId)for(let b of a.nodes){let c=b.domId||b.id;b.domId=`${a.diagramId}-${c}`}let c=k[a.layoutAlgorithm],d=await c.loader(),{theme:e,themeVariables:f}=a.config,{useGradient:g,gradientStart:h,gradientStop:i}=f,l=b.attr("id");if(b.append("defs").append("filter").attr("id",`${l}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${e?.includes("dark")?"#FFFFFF":"#000000"}`),b.append("defs").append("filter").attr("id",`${l}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${e?.includes("dark")?"#FFFFFF":"#000000"}`),g){let a=b.append("linearGradient").attr("id",b.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");a.append("svg:stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),a.append("svg:stop").attr("offset","100%").attr("stop-color",i).attr("stop-opacity",1)}return d.render(a,b,j,{algorithm:c.algorithm})},"render"),n=(0,i.__name)((a="",{fallback:b="dagre"}={})=>{if(a in k)return a;if(b in k)return h.log.warn(`Layout algorithm ${a} is not registered. Using ${b} as fallback.`),b;throw Error(`Both layout algorithms ${a} and ${b} are not registered.`)},"getRegisteredLayoutAlgorithm");a.s(["getRegisteredLayoutAlgorithm",0,n,"registerLayoutLoaders",0,l,"render",0,m])},869789,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(120635),g=a.r(556704),h=a.r(832319);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1pduf5n._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[608902,852307,a=>{"use strict";var b=a.i(187924),c=a.i(752562),d=a.i(589027),e=a.i(126766),f=a.i(572131),g=a.i(767561),h=a.i(340695),i=a.i(825715),j=a.i(676504),k=a.i(205522),l=a.i(86776),m=a.i(313237),n=a.i(759497),o=a.i(61876),p=a.i(864037),q=a.i(405050);let r=(0,q.createServerReference)("7fafe9889bfe63d1e391f146da7740d5e4f0039cbc",q.callServer,void 0,q.findSourceMapURL,"startChatGptSignInAction");function s({variant:a}){let[c,d]=(0,f.useState)(!1),e=(0,f.useRef)(null),g=()=>{e.current&&clearInterval(e.current),e.current=null};(0,f.useEffect)(()=>g,[]);let[i,j]=(0,m.useServerAction)(r,{onOk:a=>{let b=window.open(a,"thursday-chatgpt","popup,width=520,height=720");if(!b)return void p.toast.add({type:"error",title:"The sign-in window was blocked",description:"Allow pop-ups for this page, then try again"});d(!0),g();let c=Date.now()+6e5;e.current=setInterval(()=>{!b.closed&&Date.now()<c||(g(),d(!1))},700)}});return(0,b.jsx)(h.Button,{variant:a,loading:j||c,onClick:()=>i(),children:"Sign in with ChatGPT"})}a.s(["ChatGptSignIn",0,s],852307);var t=a.i(158983),u=a.i(233540),v=a.i(270390),w=a.i(965733),x=a.i(777794),y=a.i(497895),z=a.i(379630);let A={anthropic:"anthropic",openai:"openai",google:"google",spacexai:"xai"},B={alibaba:[{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}],amazon:[{d:"M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"}],"arcee-ai":[{d:"M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z"}],bfl:[{d:"M0 20.683L12.01 2.5 24 20.683h-2.233L12.009 5.878 3.471 18.806h12.122l1.239 1.877H0z"},{d:"M8.069 16.724l2.073-3.115 2.074 3.115H8.069zM18.24 20.683l-5.668-8.707h2.177l5.686 8.707h-2.196zM19.74 11.676l2.13-3.19 2.13 3.19h-4.26z"}],bytedance:[{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"},{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"},{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"},{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"}],cohere:[{d:"M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"},{d:"M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"},{d:"M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"}],deepseek:[{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"}],"fish-audio":[{d:"M23.12 12.13v.62c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.62c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.37v1.74c0 .24.2.44.44.44.25 0 .44-.2.44-.44V12.5c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76.43v1.99q0 .09.03.17.04.08.1.14.07.07.15.1t.17.03c.24 0 .44-.19.44-.44v-1.99c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17m-1.76.35v1.97c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-1.97c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.32v1.65c0 .25.2.45.44.45s.44-.2.44-.45V13.6c0-.25-.2-.45-.44-.45s-.44.2-.44.45m-1.76 1.26v.3q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-.3q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M0 9.38v.19c0 .24.2.44.44.44.25 0 .44-.2.44-.44v-.19c0-.25-.19-.44-.44-.44-.24 0-.44.19-.44.44m1.82.15v.81c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.81q0-.18-.13-.31t-.31-.13-.31.13-.13.31m1.81-.24v3.39q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V9.29q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3m1.83-.35v.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.22q0-.18-.13-.31T5.9 8.5t-.31.13-.13.31m0 2.94v2.34c0 .25.19.44.44.44.24 0 .44-.19.44-.44v-2.34c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m15.89-3.32V11c0 .25.2.44.44.44.25 0 .44-.19.44-.44V8.56c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76-.39v3.28q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.17c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17M17.83 8v3.9c0 .24.19.44.44.44.24 0 .44-.2.44-.44V8c0-.25-.2-.44-.44-.44-.25 0-.44.19-.44.44m-1.77.11v3.96c0 .25.2.44.44.44s.44-.19.44-.44V8.11c0-.25-.2-.44-.44-.44s-.44.19-.44.44m-1.76.27v5.03q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.38c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.8.46v5.75q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.84c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.76.76v5.52c0 .24.2.44.44.44.25 0 .44-.2.44-.44V9.6c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.77 1.01v4.77q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-4.77q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M23.12 9.6v1.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44V9.6c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44M7.21 11.32V16c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-4.68q0-.18-.13-.31t-.31-.13-.31.13-.13.31"}],inception:[{d:"M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"}],klingai:[{d:"M5.493 21.234c-1.112-1.451-1.109-4.263-.081-7.459l-4.557-2.63a1.683 1.683 0 01-.85-1.304 1.505 1.505 0 01.08-.622 13.18 13.18 0 011.037-2.255c3.476-6.02 10.916-8.23 16.619-4.938.46.266.82.67 1.081 1.184.785 1.545.685 4.096-.234 6.954l4.557 2.631c.339.196.596.492.736.832a1.53 1.53 0 01.034 1.093 13.146 13.146 0 01-1.037 2.255c-3.476 6.02-10.916 8.23-16.619 4.938a2.6 2.6 0 01-.766-.68zm11.096-6.615c-2.073 3.591-5.808 5.316-8.343 3.852-1.267-.731-1.994-2.122-2.145-3.778-.095-1.035.036-2.173.4-3.32.217-.684.517-1.37.902-2.039l.008-.014c2.073-3.59 5.808-5.315 8.343-3.852.633.366 1.13.895 1.49 1.54.986 1.772.922 4.415-.285 6.914-.111.23-.232.457-.362.683l-.008.014z"}],kwaipilot:[{d:"M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z"}],meta:[{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"}],minimax:[{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"}],mistral:[{d:"M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z"}],moonshotai:[{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}],morph:[{d:"M7.941 2c.23 0 .452.073.638.21.186.136.325.328.397.55l.593 1.814c.073.221.212.413.397.55.186.136.409.21.638.21h2.791c.23 0 .452-.074.638-.21a1.11 1.11 0 00.397-.55l.594-1.815a1.11 1.11 0 01.397-.55c.185-.136.408-.209.637-.209h1.7c.23 0 .453.073.639.21.185.136.324.328.397.55l.652 1.994c.118.361.41.635.77.728l2.957.752c.236.06.446.199.596.394.15.195.23.436.231.684v9.376c0 .248-.081.488-.231.684a1.09 1.09 0 01-.595.394l-2.957.752a1.086 1.086 0 00-.477.263 1.114 1.114 0 00-.293.465l-.653 1.994a1.11 1.11 0 01-.396.55c-.186.136-.41.21-.638.21h-1.702c-.229 0-.452-.073-.637-.21a1.11 1.11 0 01-.397-.55l-.364-1.11a1.131 1.131 0 01.15-1.002 1.074 1.074 0 01.885-.462h2.85c.29 0 .567-.116.772-.325.204-.208.32-.49.32-.785V6.444c0-.294-.116-.577-.32-.785a1.08 1.08 0 00-.771-.326h-3.273c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v7.778c0 .295-.114.578-.319.786a1.08 1.08 0 01-.771.325h-2.182a1.08 1.08 0 01-.771-.325 1.122 1.122 0 01-.32-.786V6.444c0-.294-.115-.577-.32-.785a1.081 1.081 0 00-.77-.326H5.454c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v11.112c0 .294.116.577.32.785.205.209.482.326.772.326h2.85a1.075 1.075 0 01.885.461 1.122 1.122 0 01.15 1.001l-.364 1.112a1.11 1.11 0 01-.397.55c-.185.136-.408.209-.637.209H6.24c-.229 0-.452-.073-.638-.21a1.11 1.11 0 01-.397-.55l-.652-1.994a1.114 1.114 0 00-.294-.465 1.086 1.086 0 00-.477-.263l-2.956-.752a1.09 1.09 0 01-.595-.394A1.124 1.124 0 010 16.688V7.312c0-.248.081-.489.231-.684.15-.195.36-.334.595-.394l2.957-.753c.178-.045.342-.136.477-.263.134-.127.235-.287.293-.464l.653-1.995a1.11 1.11 0 01.397-.55C5.788 2.075 6.01 2 6.24 2h1.701z"}],nvidia:[{d:"M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"}],perplexity:[{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"}],recraft:[{d:"M19.667 8.275c0-4.57-4.15-8.275-9.27-8.275-1.774 0-3.213 3.705-3.213 8.275 0 1.143.09 2.233.253 3.224H4.29L1 23h9.4v-6.447c5.117 0 9.266-3.707 9.266-8.275l.001-.002zm-9.27-6.76c.93 0 1.682 3.028 1.682 6.76 0 3.733-.752 6.76-1.681 6.76-.93 0-1.681-3.027-1.681-6.76 0-3.732.752-6.76 1.68-6.76z"},{d:"M19.848 16.552h-9.44L14.028 23h9.438l-3.618-6.448z"}],stepfun:[{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"}],tencent:[{d:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"}],voyage:[{d:"M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"}],xiaomi:[{d:"M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z"}],zai:[{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"}]};function C({owner:a,className:c}){let d=A[a];if(d)return(0,b.jsx)(z.ProviderIcon,{provider:d,className:c});let e=B[a];return e?(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,"aria-hidden":"true",children:e.map(a=>(0,b.jsx)("path",{d:a.d,opacity:a.opacity},a.d))}):null}function D({models:a,kind:c,value:d,loading:e,onPick:g}){let[i,j]=(0,f.useState)(!1),[l,m]=(0,f.useState)(""),[n,p]=(0,f.useState)("cheap"),[q,r]=(0,f.useState)(d),s=a.filter(a=>a.type===(c??o.GATEWAY_TEXT)),z=c?s:s.filter(a=>a.tags.includes(o.GATEWAY_TOOL_USE)),A=l.trim().toLowerCase(),B=(A?z.filter(a=>`${a.id} ${a.label}`.toLowerCase().includes(A)):z).slice().sort(F[n].compare);return(0,b.jsxs)(w.Dialog,{open:i,onOpenChange:a=>{j(a),a?r(d):m("")},children:[(0,b.jsxs)(w.DialogTrigger,{render:(0,b.jsx)("button",{type:"button","aria-label":"Model",className:(0,y.cn)(k.inputClassName,"relative flex items-center pr-8 text-left font-mono text-sm")}),children:[(0,b.jsx)("span",{className:(0,y.cn)("min-w-0 flex-1 truncate",!d&&"font-sans text-muted-foreground"),children:d||"Pick a model"}),(0,b.jsx)("span",{className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center text-muted-foreground",children:e&&0===z.length?(0,b.jsx)(t.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,b.jsx)(u.Search,{className:"size-3.5"})})]}),(0,b.jsx)(w.DialogContent,{className:"h-[min(40rem,calc(100vh-3rem))] gap-0 overflow-hidden p-0 sm:max-w-2xl",children:(0,b.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,b.jsxs)("div",{className:"shrink-0 space-y-1 px-6 pt-5 pb-4",children:[(0,b.jsxs)(w.DialogTitle,{className:"flex items-center gap-2.5 text-xl font-semibold",children:[(0,b.jsx)(v.VercelIcon,{className:"size-3.5"}),c?E[c]:"Text"," models"]}),(0,b.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:A?`${B.length} matching “${l.trim()}”`:c?`${z.length} on the gateway`:`${z.length} of ${s.length} on the gateway can call tools`})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-6 py-3",children:[(0,b.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,b.jsx)(u.Search,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(k.Input,{autoFocus:!0,"aria-label":"Search models",placeholder:"name, id or provider",spellCheck:!1,value:l,onChange:a=>m(a.target.value),className:"h-8 pl-8 font-mono text-xs"})]}),(0,b.jsx)(x.Segmented,{"aria-label":"Sort",options:G,value:n,onChange:p})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-4 px-6 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground/60",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1",children:"model"}),(0,b.jsx)("span",{className:"w-28 text-right",children:"per 1M in / out"})]}),(0,b.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border/60",children:[B.map(a=>(0,b.jsx)(I,{model:a,picked:a.id===q,onPick:()=>r(a.id)},a.id)),0===B.length&&(0,b.jsxs)("div",{className:"flex flex-col items-start gap-2.5 p-10",children:[(0,b.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:A?`Nothing matches “${l.trim()}”.`:"Nothing on the shelf — search for an id."}),A&&(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(h.Button,{size:"sm",onClick:()=>r(l.trim()),children:["Use “",l.trim(),"” as the id"]}),(0,b.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>m(""),children:"Clear search"})]})]})]}),(0,b.jsxs)("div",{className:"flex h-14 shrink-0 items-center gap-3 border-t border-border/60 px-6",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:q||"Nothing picked — the field keeps what it has"}),(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),(0,b.jsx)(h.Button,{disabled:!q,onClick:()=>{g(q),j(!1)},children:"Use this model"})]})]})})]})}let E={image:"Image",video:"Video",speech:"Speech",transcription:"Transcription"},F={cheap:{label:"$↑",title:"Cheapest first",compare:(a,b)=>(a.price.in??1/0)-(b.price.in??1/0)},dear:{label:"$↓",title:"Dearest first",compare:(a,b)=>(b.price.in??-1)-(a.price.in??-1)},name:{label:"a–z",title:"By name",compare:(a,b)=>a.label.localeCompare(b.label)}},G=Object.keys(F).map(a=>({value:a,label:F[a].label,title:F[a].title})),H=a=>a>=1?a.toFixed(2):String(Number(a.toFixed(4)));function I({model:a,picked:d,onPick:e}){let{price:f}=a,g=null!==f.in||null!==f.out;return(0,b.jsxs)("button",{type:"button",onClick:e,className:(0,y.cn)("flex w-full items-center gap-4 border-b border-border/60 px-6 py-2.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",d?"bg-muted/40":"hover:bg-muted/50"),children:[(0,b.jsx)("span",{className:"grid size-[18px] shrink-0 place-items-center",children:(0,b.jsx)(C,{owner:a.owner,className:"size-[15px]"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:(0,y.cn)("truncate text-[13px]",d&&"font-medium"),children:a.label}),d&&(0,b.jsx)(c.Check,{className:"size-3.5 shrink-0"}),a.retiring&&(0,b.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:"retiring"})]}),(0,b.jsx)("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:a.id})]}),(0,b.jsxs)("span",{className:"flex w-28 shrink-0 flex-col items-end",children:[(0,b.jsx)("span",{className:(0,y.cn)("font-mono text-xs",g||f.free?"text-foreground":"text-muted-foreground"),children:f.free?"free":null===f.in&&null===f.out?f.note??"—":`${null===f.in?"—":H(f.in)} / ${null===f.out?"—":H(f.out)}`}),g&&f.note&&(0,b.jsx)("span",{className:"font-mono text-[9px] text-muted-foreground/70",children:f.note})]})]})}function J({provider:a,onSaved:c}){let[d,e]=(0,f.useState)(""),[i,j]=(0,m.useServerAction)(l.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{(0,n.revalidate)(g.queryKey.llmModel),(0,n.revalidate)(g.queryKey.config),c()}});return a.signIn?(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("p",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:"Runs on your plan once you sign in"}),(0,b.jsx)(s,{variant:"outline"})]}):(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(k.Input,{value:d,onChange:a=>e(a.target.value),placeholder:a.apiKeyName,spellCheck:!1,type:"password"}),(0,b.jsx)(h.Button,{variant:"outline",loading:j,disabled:d.trim().length<8,onClick:()=>i(a.apiKeyName,d),children:"Save key"})]})}a.s(["ModelPicker",0,function({provider:a,model:f,kind:k,unset:l,onChange:m}){let{data:p=[],mutate:q}=(0,n.useServerRoute)(g.queryKey.llmModel),r=k?p.filter(a=>(0,o.canMakeKind)(a.id,k)):p,s=r.find(b=>b.id===a),t="vercel-ai-gateway"===a,u=(0,n.useServerRoute)(t&&g.queryKey.modelCatalog),v=(k&&s?o.MEDIA_MODEL_PROVIDERS[s.id]?.models[k]??[]:s?.suggestModels??[]).map(a=>({value:a.id,label:a.label,badge:a.tier,hint:a.id}));return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(j.DropdownMenu,{children:[(0,b.jsxs)(j.DropdownMenuTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",className:"shrink-0"}),children:[s?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.ProviderIcon,{provider:s.id,className:"size-4"}),s.label]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:l??(k?"Not picked":"App default")}),(0,b.jsx)(d.ChevronDown,{className:"size-3.5 text-muted-foreground"})]}),(0,b.jsx)(j.DropdownMenuContent,{align:"start",children:r.map(d=>(0,b.jsxs)(j.DropdownMenuItem,{onClick:()=>m({provider:d.id,model:""}),children:[(0,b.jsx)(z.ProviderIcon,{provider:d.id,className:"size-4"}),d.label,d.hasKey?d.id===a&&(0,b.jsx)(c.Check,{className:"ml-auto size-3.5"}):(0,b.jsx)(e.KeyRound,{className:"ml-auto size-3 text-muted-foreground"})]},d.id))})]}),t&&s&&!u.error?(0,b.jsx)(D,{models:u.data??[],kind:k,value:f,loading:u.isLoading,onPick:a=>m({provider:s.id,model:a})}):(0,b.jsx)(i.Combobox,{value:f,onChange:a=>s&&m({provider:s.id,model:a}),options:v,disabled:!s?.hasKey,"aria-label":"Model",placeholder:s?"Type a model id":"Pick a provider",empty:u.error?"Could not read the catalog — type an id":"Not on the list — it still runs",className:"flex-1"})]}),s&&!s.hasKey&&(0,b.jsx)(J,{provider:s,onSaved:()=>q()}),t&&u.error&&(0,b.jsx)("p",{className:"px-1 font-mono text-[11px] text-destructive",children:u.error.message})]})}],608902)},86776,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f37945ceb686a8a33e09428221c3e9cd25fdcbbe6",b.callServer,void 0,b.findSourceMapURL,"setConfigAction");a.s(["setConfigAction",0,c])},126766,a=>{"use strict";var b=a.i(164831);let c={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};c.node;let d=(0,b.default)(c);a.s(["KeyRound",0,d],126766)}];
2
-
3
- //# sourceMappingURL=_14_lw10._.js.map
@@ -1,3 +0,0 @@
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(760881),y=a.i(411509),z=a.i(913834),A=a.i(42380),B=a.i(16716),C=a.i(394440),D=a.i(28996),E=a.i(346075),F=a.i(369768),G=a.i(199169),H=a.i(313237),I=a.i(759497),J=a.i(497895),K=a.i(324835),L=a.i(777279),M=a.i(8468),N=b([t,B,F,M]);[t,B,F,M]=N.then?(await N)():N;let ap=(0,o.memo)(function(){let a=(0,L.useBotTasks)(),{data:b}=(0,I.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)(new Map),c=(0,o.useRef)(new Map);(0,o.useEffect)(()=>()=>{for(let a of c.current.values())clearTimeout(a)},[]);let d=(0,o.useCallback)(a=>{b(b=>new Map(b).set(a.at,a));let d=c.current.get(a.at);d&&clearTimeout(d),c.current.set(a.at,setTimeout(()=>{c.current.delete(a.at),b(b=>{let c=new Map(b);return c.delete(a.at),c})},3400))},[]);return[a,d]}(),{crew:n,more:q}=(0,o.useMemo)(()=>O(b,a),[b,a]),r=(0,o.useRef)(null),s=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{if(!L.botTasks.primed())return;let b=new Map(j.map(a=>[a.id,a.status])),c=r.current;r.current=b;let d=new Set;for(let b of a)for(let a of b.lines)"ask"===a.kind&&a.to&&d.add(a.id);let e=s.current;if(s.current=d,!c)return;let f=new Map;for(let b of a)for(let a of b.lines){if("ask"!==a.kind||!a.to||e.has(a.id))continue;let b=f.get(a.bot.name)??[];b.push({from:a.bot,to:a.to,text:a.text}),f.set(a.bot.name,b)}for(let[a,b]of f){if(1===b.length){m({at:b[0].to.name,from:b[0].from,text:ar(b[0].text)});continue}m({at:a,from:b[0].from,text:`sent ${b.length} parts out`})}for(let a of j)c.get(a.id)!==a.status&&"working"===a.status&&m(c.has(a.id)?{at:a.bot.name,from:null,text:"picked it back up"}:{at:a.bot.name,from:ay,text:`took on \u201c${ar(a.label)}\u201d`})},[a,m]),(0,L.useSeenOnDetail)(c?k:null);let t=a.filter(a=>"working"===a.status).length,u=j.filter(as),v=u.length,w=j.filter(at),x=w.filter(a=>"failed"===a.status).length,y=(0,o.useCallback)(()=>i(!1),[]);return(0,d.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-[min(80vw,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-132 max-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)(ae,{task:k,className:"min-h-0 flex-1"}),(0,d.jsx)(C.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,L.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:v,composing:h,onCompose:()=>i(!0),onClose:()=>h?i(!1):e(!1)}),h?(0,d.jsx)(S,{bots:b,onDone:y}):j.length?(0,d.jsx)(ac,{tasks:j,onPick:g}):(0,d.jsx)(aa,{bots:b}),!h&&(0,d.jsx)(ab,{})]})}):(0,d.jsx)(P,{crew:n,more:q,bubbles:l,bots:b,rows:u,count:a.length,busy:t,pending:v,unread:w.length,failed:x,composing:h,onCompose:()=>i(!0),onCloseCompose:y,onPick:a=>{g(a),e(!0)},onOpen:()=>{let a=u.length?u:w;f||1!==a.length||g(a[0].id),e(!0)}})})}),aq=new Map,ar=a=>{let b=(0,J.plainText)(a).replace(/\s+/g," ").trim();return b.length>28?`${b.slice(0,27)}…`:b};function O(a,b){let c=new Map;for(let a of(0,L.latestPerBot)(b)){let{task:b,bot:d,line:e}=a;if("waiting"===b.status&&b.bot.name===d.name){c.set(d.name,{waiting:!0,word:null});continue}!("working"!==b.status||c.get(d.name)?.waiting)&&c.set(d.name,{waiting:!1,word:e?"tool"===e.kind&&e.tool?ar(e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`):"say"===e.kind?ar(e.text):null:null})}let d=new Map;for(let b of a??[])d.set(b.name,{name:b.name,icon:b.icon,awake:c.has(b.name),waiting:c.get(b.name)?.waiting??!1,word:c.get(b.name)?.word??null});for(let[a,b]of c)d.has(a)||d.set(a,{name:a,icon:null,awake:!0,waiting:b.waiting,word:b.word});let e=[...d.values()];if(!e.length)return{crew:au.slice(0,av),more:0};for(let a of au){if(e.length>=av)break;d.has(a.name)||e.push(a)}let f=a=>a.waiting?0:a.awake?1:a.standIn?3:2,g=e.map((a,b)=>({face:a,at:b})).sort((a,b)=>f(a.face)-f(b.face)||a.at-b.at).map(a=>a.face);return{crew:g.slice(0,10),more:Math.max(0,g.length-10)}}let as=a=>"waiting"===a.status,at=a=>("done"===a.status||"failed"===a.status)&&!a.seen;function P({crew:a,more:b,bubbles:c,bots:e,rows:g,count:h,busy:i,pending:j,unread:k,failed:m,composing:o,onCompose:p,onCloseCompose:q,onPick:r,onOpen:s}){let t=function({count:a,busy:b,pending:c,unread:d,failed:e}){return c>0?{text:1===c?"waiting on you":`${c} waiting on you`,tone:J.WAITING_INK,shine:"waiting"}:e>0?{text:1===e?"1 failed":`${e} failed`,tone:"text-destructive",shine:null}:d>0?{text:1===d?"1 new answer":`${d} new answers`,tone:J.WAITING_INK,shine:null}:b>0?{text:1===b?"working":`${b} running`,tone:"text-muted-foreground",shine:"muted"}:a>0?{text:"all done",tone:"text-muted-foreground",shine:null}:{text:"no jobs yet",tone:"text-muted-foreground",shine:null}}({count:h,busy:i,pending:j,unread:k,failed:m}),v=o||j>0;return(0,d.jsxs)("div",{className:(0,J.cn)("pointer-events-auto w-fit max-w-full bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",v?"max-w-[min(33rem,100%)] min-w-96 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,d.jsx)("div",{className:(0,J.cn)("grid overflow-hidden transition-[grid-template-rows] duration-300 ease-out",v?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,d.jsx)("div",{className:"min-h-0 overflow-hidden",inert:!v,children:o?(0,d.jsx)(S,{bots:e,onDone:q}):(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 · ",j]}),(0,d.jsx)(Q,{onClick:p})]}),(0,d.jsx)("div",{className:"px-1.5 pb-2",children:g.map(a=>(0,d.jsx)(ad,{task:a,onPick:()=>r(a.id)},a.id))}),(0,d.jsx)("span",{className:"block h-1.5"})]})})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:s,"aria-label":h?`Tasks (${h})`:"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)(T,{crew:a,more:b,bubbles:c}),(0,d.jsxs)("span",{className:"ml-auto flex h-7 shrink-0 items-center gap-1.5",children:[t.shine?(0,d.jsx)(u.ShinyText,{text:t.text,tone:t.shine,speed:2.6,className:"block truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,d.jsx)("span",{className:(0,J.cn)("block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] fade-in duration-300",t.tone),children:t.text},t.text),(0,d.jsxs)("span",{className:"grid size-4 shrink-0 place-items-center",children:[0===j&&0===k&&i>0&&(0,d.jsx)(l.Loader2,{className:"size-4 animate-spin text-muted-foreground/70"}),0===j&&0===m&&(k>0||0===i&&h>0)&&(0,d.jsx)(f.Check,{className:"size-4 text-muted-foreground/60"})]})]})]}),o&&(0,d.jsx)(R,{onClick:q,label:"Cancel the message",children:(0,d.jsx)(n.X,{className:"size-3.5"})})]})]})}function Q({onClick:a}){return(0,d.jsx)(R,{onClick:a,label:"Message a bot",children:(0,d.jsx)(m.Plus,{className:"size-4"})})}function R({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 S({bots:a,onDone:b}){let[c,f]=(0,o.useState)(null),[i,j]=(0,o.useState)(""),[k,m]=(0,H.useServerAction)(x.startTaskAction,{onOk:()=>{(0,I.revalidate)(p.queryKey.tasks),b()}}),n=a?.length?a.filter(a=>!a.disabled).map(a=>({name:a.name,icon:a.icon})):[{name:y.DEFAULT_BOT.name,icon:y.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)(z.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)(z.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 au=["alto","brio","cinder","delta"].map((a,b)=>({name:a,icon:{color:K.MARK_PALETTE[Math.floor(b*K.MARK_PALETTE.length/4)],shape:K.MARK_SHAPES[b%K.MARK_SHAPES.length]},awake:!1,waiting:!1,word:null,standIn:!0})),av=3;function T({crew:a,more:b,bubbles:c}){return(0,d.jsxs)("span",{className:"flex min-w-0 shrink items-center",children:[a.map((b,e)=>{let f=c.get(b.name)??null;return(0,d.jsxs)(o.Fragment,{children:[(0,d.jsxs)("span",{className:(0,J.cn)("relative shrink-0 transition-[margin,transform] duration-500 ease-out",e>0&&!a[e-1].word&&"-ml-2",b.standIn&&"opacity-35",b.awake&&"-translate-y-0.5 scale-110"),style:{zIndex:a.length-e},children:[(0,d.jsx)(U,{face:b}),f&&(0,d.jsx)(V,{handoff:f})]}),b.word&&(0,d.jsx)("span",{className:"mx-2.5 min-w-0 shrink truncate",children:(0,d.jsx)(u.ShinyText,{text:b.word,speed:2.6,className:"truncate text-[13px] leading-5 tracking-[-0.1px]"})})]},b.name)}),b>0&&(0,d.jsxs)("span",{className:(0,J.cn)("grid size-7 shrink-0 place-items-center rounded-[9px] bg-muted font-mono text-[10px] text-muted-foreground ring-1 ring-border/50",!a.at(-1)?.word&&"-ml-2"),title:`${b} more`,children:["+",b]})]})}function U({face:a}){let b=(0,o.useMemo)(()=>a.awake?{glow:20}:void 0,[a.awake]);return(0,d.jsx)(z.BotMark,{size:28,seed:a.name,vary:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:a.waiting,options:b})}function V({handoff:a}){return(0,d.jsxs)("span",{className:"pointer-events-none absolute bottom-[calc(100%+9px)] left-1/2 flex -translate-x-1/2 animate-in flex-col items-center whitespace-nowrap fade-in zoom-in-95 duration-200",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5 rounded-full bg-background px-2.5 py-1 text-[12.5px] leading-4 tracking-[-0.1px] shadow-lg shadow-black/10 ring-1 ring-border",children:[a.from?.name===ay.name?(0,d.jsx)(E.ThursdayMark,{size:14,className:"shrink-0 opacity-75"}):a.from&&(0,d.jsx)(z.BotMark,{size:14,seed:a.from.name,vary:a.from.name,color:a.from.icon?.color,shape:a.from.icon?.shape,outline:a.from.icon?.outline,className:"shrink-0 opacity-75"}),a.text]}),(0,d.jsx)("span",{className:"-mt-px size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-border"}),(0,d.jsx)("span",{className:"-mt-[6.5px] size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-background"})]})}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)(Q,{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)(z.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,J.formatCount)(a.input)} \xb7 out ${(0,J.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,J.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,J.formatCount)(b)} of ${(0,J.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,J.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 aw={working:"text-muted-foreground",waiting:J.WAITING_INK,done:"text-foreground",failed:"text-destructive"};function _({task:a}){let b="done"===a.status&&a.seen?"text-muted-foreground":aw[a.status];return"working"===a.status?(0,d.jsx)(u.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,J.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:a.status})}function aa({bots:a}){let{crew:b,more:c}=O(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)(T,{crew:b,more:c,bubbles:aq}),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 ",y.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,D.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 ax=[{id:"you",label:"needs you",holds:as},{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=ax.find(a=>a.holds(b))??ax[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:ax.map((a,e)=>{let f=c.get(a.id)??[];return f.length?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsxs)("p",{className:(0,J.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=as(a),e=a.lines.at(-1),f=(0,o.useMemo)(()=>(function(a){if("waiting"===a.status&&a.ask)return{text:(0,y.isAppStop)(a.ask)?(0,J.plainText)(a.outcome??a.ask.question):a.ask.question,tone:J.WAITING_INK};let b=a.seen;if("failed"===a.status)return{text:(0,J.plainText)(a.outcome??"Failed"),tone:b?"text-destructive/70":"text-destructive"};if("done"===a.status)return{text:(0,J.plainText)(a.outcome??"Done"),tone:b?"text-muted-foreground":"text-foreground"};let c=(0,L.lastSaid)(a);return c?{text:"tool"===c.kind&&c.tool?c.tool.note??`${c.tool.name} \xb7 ${c.tool.input}`:c.text,tone:"text-muted-foreground"}:{text:`${a.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}})(a),[a.status,a.outcome,a.seen,a.ask,e?.id]),[g,h]=(0,C.useAnswerTask)(),[j,k]=(0,o.useState)(null),m="waiting"===a.status?a.ask?.options??[]:[];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)(z.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,J.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",c?"text-foreground":"text-foreground/80"),children:a.label}),(0,d.jsx)(A.BotRoster,{bots:(0,L.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,G.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.ShinyText,{text:f.text,speed:2.2,className:(0,J.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone)}):(0,d.jsx)("span",{className:(0,J.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:"h-7 gap-1.5 rounded-full border-amber-500/35 bg-background px-3 text-[12px]",children:[b===y.TASK_CONTINUE&&(0,d.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),b]},b))})]})}function ae({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)(F.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,J.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,L.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,d.jsx)(af,{task:a})]})})}function af({task:a}){if(a.lines.some(a=>a.tool&&void 0===a.tool.results))return null;let b=a.lines.at(-1),c=b?.kind==="ask"&&b.to?b.to:b?.bot;return(0,d.jsx)(u.ShinyText,{text:c?`${c.name} is on the next step…`:`${a.bot.name} is taking it on…`,speed:2.2,className:"block px-1 font-mono text-[10px]"})}function ag({task:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ah,{from:ay,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 ay={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)(z.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)(z.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,J.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,J.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)(z.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)(M.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,L.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,J.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)(B.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 answer",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 answer",description:(0,J.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)(M.BotTool,{tool:a.tool,taskId:b,collapsed:!0},a.id):null)]})}a.s(["BotRoom",0,ap,"Conversation",0,ae]),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(405050);let r=(0,q.createServerReference)("7f5bc96ea47ad8a575bfdee5fedc10d3a60faa0387",q.callServer,void 0,q.findSourceMapURL,"answerTaskAction");var s=a.i(445009),t=a.i(411509),u=a.i(777279),v=a.i(313237),w=a.i(759497),x=a.i(497895);function y(){let[a,b]=(0,v.useServerAction)(r,{onOk:()=>(0,w.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 u.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:q}){let[r,z]=(0,k.useState)(()=>u.taskDrafts.get(a.id));(0,k.useEffect)(()=>z(u.taskDrafts.get(a.id)),[a.id]);let A=b=>{z(b),u.taskDrafts.set(a.id,b)},[B,C]=y(),[D,E]=(0,v.useServerAction)(s.cancelTaskAction,{onOk:a=>{(0,w.revalidate)(l.queryKey.tasks),u.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),F=C||E,[G,H]=(0,k.useState)(!1),[I,J]=(0,k.useState)(null);(0,k.useEffect)(()=>{H(!1),J(null)},[a.id]),(0,k.useEffect)(()=>{"running"!==e&&J(null)},[e]),(0,k.useEffect)(()=>{I&&f.some(a=>"user"===a.kind&&a.text===I)&&J(null)},[f,I]);let K=async b=>{!F&&await B(a,b)&&(A(""),"running"===e&&(J(b.trim()),H(!1)))},L="waiting"===e?a.ask:null,M=(0,t.isAppStop)(L),N=L?L.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",O=(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),K(r)},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:r,rows:1,disabled:F,autoFocus:"running"===e,onChange:a=>A(a.target.value),onKeyDown:a=>{"Escape"===a.key&&"running"===e?H(!1):"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),K(r))},placeholder:N,"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:F,onClick:()=>H(!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:r.trim()?"default":"ghost",disabled:!r.trim()||F,"aria-label":"Send",className:"rounded-full",children:C?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(c.ArrowUp,{})})]});return"running"!==e||G?L?(0,b.jsxs)("div",{className:(0,x.cn)("space-y-2.5 rounded-2xl bg-amber-500/8 px-3.5 py-3 ring-1 ring-amber-500/25",q),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})]}),L.question&&(0,b.jsx)(n.FoldedText,{text:L.question,subject:"message",clamp:"line-clamp-6",tall:"max-h-56"}),L.options.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:L.options.map(a=>(0,b.jsxs)(m.Button,{size:"sm",variant:"outline",disabled:F,onClick:()=>K(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",children:[M&&a===t.TASK_CONTINUE&&(0,b.jsx)(d.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a]},a))}),O,"waiting"===e&&(0,b.jsx)("button",{type:"button",disabled:F,onClick:()=>D(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:q,children:O}):(0,b.jsxs)("div",{className:(0,x.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",q),children:[I?(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.ShinyText,{text:I,speed:2.2,className:"min-w-0 truncate"})]}):(0,b.jsx)(o.ShinyText,{text:`${a.bot} is on it — Thursday steers it by voice.`,speed:2.4,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:F,onClick:()=>H(!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:F,onClick:()=>D(a.id),"aria-label":"Stop this task",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:E?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(i.Square,{className:"size-3"})})]})},"useAnswerTask",0,y],394440)},445009,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f02f750f851a61ed3c2676040dea1e1ded9819205",b.callServer,void 0,b.findSourceMapURL,"cancelTaskAction");a.s(["cancelTaskAction",0,c])},760881,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f3ab92bbd495ee087cfb7b701c5f8af0d813bcf67",b.callServer,void 0,b.findSourceMapURL,"startTaskAction");a.s(["startTaskAction",0,c])},777279,a=>{"use strict";var b=a.i(572131),c=a.i(767561),d=a.i(864037),e=a.i(405050);let f=(0,e.createServerReference)("7f15442d74ed44708143e5eb45805be0e17c010418",e.callServer,void 0,e.findSourceMapURL,"markSeenAction");var g=a.i(199169),h=a.i(576271),i=a.i(759497),j=a.i(497895);let k=[],l=!1,m=new Set;function n(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,seen:a.seen,tokens:a.tokens,contextTokens:a.contextTokens,contextBudget:a.contextBudget,updatedAt:a.updatedAt}}let o=new Map,p=new Set,q=[];a.s(["botTasks",0,{sync(a,b){for(let c of(l=!0,k=[...a].reverse().map(a=>n(a,b)).slice(-30),m))c()},primed:()=>l},"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 p)b(a)},subscribe:a=>(p.add(a),()=>{p.delete(a)})},"taskDrafts",0,{get:a=>o.get(a)??"",set(a,b){b?o.set(a,b):o.delete(a)},typing:a=>(o.get(a)?.trim().length??0)>0},"taskFromRow",0,n,"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=>(m.add(a),()=>m.delete(a)),()=>k,()=>q)},"useSeenOnDetail",0,function(a){let e=(0,b.useRef)(new Set),k=a?.id??null,l=a?`${a.id}@${(0,g.toDate)(a.updatedAt).getTime()}`:null,m=!!a&&("done"===a.status||"failed"===a.status)&&!a.seen;(0,b.useEffect)(()=>{!k||!l||!m||e.current.has(l)||(e.current.add(l),f([k]).then(h.unwrapResult).then(()=>(0,i.revalidate)(c.queryKey.tasks)).catch(a=>{e.current.delete(l),d.toast.add({type:"error",title:"Could not mark the task as read",description:(0,j.errorToString)(a)})}))},[k,l,m])}],777279)},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
-
3
- //# sourceMappingURL=_1spzm8z._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[199169,256711,a=>{"use strict";var b=a.i(244513),c=a.i(852587),d=a.i(23464),e=a.i(57270),f=a.i(959296),g=a.i(774016);function h(a,b){let c=(0,g.toDate)(a,b?.in);return c.setHours(0,0,0,0),c}function i(a,b){let d=(0,c.getDefaultOptions)(),e=b?.weekStartsOn??b?.locale?.options?.weekStartsOn??d.weekStartsOn??d.locale?.options?.weekStartsOn??0,f=(0,g.toDate)(a,b?.in),h=f.getDay();return f.setDate(f.getDate()-(7*(h<e)+h-e)),f.setHours(0,0,0,0),f}function j(a,b){return i(a,{...b,weekStartsOn:1})}var k=a.i(42724);function l(a,b){let c=(0,g.toDate)(a,b?.in),d=c.getFullYear(),e=(0,k.constructFrom)(c,0);e.setFullYear(d+1,0,4),e.setHours(0,0,0,0);let f=j(e),h=(0,k.constructFrom)(c,0);h.setFullYear(d,0,4),h.setHours(0,0,0,0);let i=j(h);return c.getTime()>=f.getTime()?d+1:c.getTime()>=i.getTime()?d:d-1}function m(a,b){let d=(0,g.toDate)(a,b?.in),e=d.getFullYear(),f=(0,c.getDefaultOptions)(),h=b?.firstWeekContainsDate??b?.locale?.options?.firstWeekContainsDate??f.firstWeekContainsDate??f.locale?.options?.firstWeekContainsDate??1,j=(0,k.constructFrom)(b?.in||a,0);j.setFullYear(e+1,0,h),j.setHours(0,0,0,0);let l=i(j,b),m=(0,k.constructFrom)(b?.in||a,0);m.setFullYear(e,0,h),m.setHours(0,0,0,0);let n=i(m,b);return+d>=+l?e+1:+d>=+n?e:e-1}function n(a,b){let c=Math.abs(a).toString().padStart(b,"0");return(a<0?"-":"")+c}let o={y(a,b){let c=a.getFullYear(),d=c>0?c:1-c;return n("yy"===b?d%100:d,b.length)},M(a,b){let c=a.getMonth();return"M"===b?String(c+1):n(c+1,2)},d:(a,b)=>n(a.getDate(),b.length),a(a,b){let c=a.getHours()/12>=1?"pm":"am";switch(b){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];default:return"am"===c?"a.m.":"p.m."}},h:(a,b)=>n(a.getHours()%12||12,b.length),H:(a,b)=>n(a.getHours(),b.length),m:(a,b)=>n(a.getMinutes(),b.length),s:(a,b)=>n(a.getSeconds(),b.length),S(a,b){let c=b.length;return n(Math.trunc(a.getMilliseconds()*Math.pow(10,c-3)),b.length)}},p={G:function(a,b,c){let d=+(a.getFullYear()>0);switch(b){case"G":case"GG":case"GGG":return c.era(d,{width:"abbreviated"});case"GGGGG":return c.era(d,{width:"narrow"});default:return c.era(d,{width:"wide"})}},y:function(a,b,c){if("yo"===b){let b=a.getFullYear();return c.ordinalNumber(b>0?b:1-b,{unit:"year"})}return o.y(a,b)},Y:function(a,b,c,d){let e=m(a,d),f=e>0?e:1-e;return"YY"===b?n(f%100,2):"Yo"===b?c.ordinalNumber(f,{unit:"year"}):n(f,b.length)},R:function(a,b){return n(l(a),b.length)},u:function(a,b){return n(a.getFullYear(),b.length)},Q:function(a,b,c){let d=Math.ceil((a.getMonth()+1)/3);switch(b){case"Q":return String(d);case"QQ":return n(d,2);case"Qo":return c.ordinalNumber(d,{unit:"quarter"});case"QQQ":return c.quarter(d,{width:"abbreviated",context:"formatting"});case"QQQQQ":return c.quarter(d,{width:"narrow",context:"formatting"});default:return c.quarter(d,{width:"wide",context:"formatting"})}},q:function(a,b,c){let d=Math.ceil((a.getMonth()+1)/3);switch(b){case"q":return String(d);case"qq":return n(d,2);case"qo":return c.ordinalNumber(d,{unit:"quarter"});case"qqq":return c.quarter(d,{width:"abbreviated",context:"standalone"});case"qqqqq":return c.quarter(d,{width:"narrow",context:"standalone"});default:return c.quarter(d,{width:"wide",context:"standalone"})}},M:function(a,b,c){let d=a.getMonth();switch(b){case"M":case"MM":return o.M(a,b);case"Mo":return c.ordinalNumber(d+1,{unit:"month"});case"MMM":return c.month(d,{width:"abbreviated",context:"formatting"});case"MMMMM":return c.month(d,{width:"narrow",context:"formatting"});default:return c.month(d,{width:"wide",context:"formatting"})}},L:function(a,b,c){let d=a.getMonth();switch(b){case"L":return String(d+1);case"LL":return n(d+1,2);case"Lo":return c.ordinalNumber(d+1,{unit:"month"});case"LLL":return c.month(d,{width:"abbreviated",context:"standalone"});case"LLLLL":return c.month(d,{width:"narrow",context:"standalone"});default:return c.month(d,{width:"wide",context:"standalone"})}},w:function(a,b,d,e){let h,j,l,o,p,q=Math.round((i(h=(0,g.toDate)(a,e?.in),e)-(j=(0,c.getDefaultOptions)(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??j.firstWeekContainsDate??j.locale?.options?.firstWeekContainsDate??1,o=m(h,e),(p=(0,k.constructFrom)(e?.in||h,0)).setFullYear(o,0,l),p.setHours(0,0,0,0),i(p,e)))/f.millisecondsInWeek)+1;return"wo"===b?d.ordinalNumber(q,{unit:"week"}):n(q,b.length)},I:function(a,b,c){let d,e,h,i=Math.round((j(d=(0,g.toDate)(a,void 0))-(e=l(d,void 0),(h=(0,k.constructFrom)(d,0)).setFullYear(e,0,4),h.setHours(0,0,0,0),j(h)))/f.millisecondsInWeek)+1;return"Io"===b?c.ordinalNumber(i,{unit:"week"}):n(i,b.length)},d:function(a,b,c){return"do"===b?c.ordinalNumber(a.getDate(),{unit:"date"}):o.d(a,b)},D:function(a,b,c){let i,j,k=function(a,b){let[c,g]=(0,e.normalizeDates)(void 0,a,b),i=h(c),j=h(g);return Math.round((i-(0,d.getTimezoneOffsetInMilliseconds)(i)-(j-(0,d.getTimezoneOffsetInMilliseconds)(j)))/f.millisecondsInDay)}(i=(0,g.toDate)(a,void 0),((j=(0,g.toDate)(i,void 0)).setFullYear(j.getFullYear(),0,1),j.setHours(0,0,0,0),j))+1;return"Do"===b?c.ordinalNumber(k,{unit:"dayOfYear"}):n(k,b.length)},E:function(a,b,c){let d=a.getDay();switch(b){case"E":case"EE":case"EEE":return c.day(d,{width:"abbreviated",context:"formatting"});case"EEEEE":return c.day(d,{width:"narrow",context:"formatting"});case"EEEEEE":return c.day(d,{width:"short",context:"formatting"});default:return c.day(d,{width:"wide",context:"formatting"})}},e:function(a,b,c,d){let e=a.getDay(),f=(e-d.weekStartsOn+8)%7||7;switch(b){case"e":return String(f);case"ee":return n(f,2);case"eo":return c.ordinalNumber(f,{unit:"day"});case"eee":return c.day(e,{width:"abbreviated",context:"formatting"});case"eeeee":return c.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return c.day(e,{width:"short",context:"formatting"});default:return c.day(e,{width:"wide",context:"formatting"})}},c:function(a,b,c,d){let e=a.getDay(),f=(e-d.weekStartsOn+8)%7||7;switch(b){case"c":return String(f);case"cc":return n(f,b.length);case"co":return c.ordinalNumber(f,{unit:"day"});case"ccc":return c.day(e,{width:"abbreviated",context:"standalone"});case"ccccc":return c.day(e,{width:"narrow",context:"standalone"});case"cccccc":return c.day(e,{width:"short",context:"standalone"});default:return c.day(e,{width:"wide",context:"standalone"})}},i:function(a,b,c){let d=a.getDay(),e=0===d?7:d;switch(b){case"i":return String(e);case"ii":return n(e,b.length);case"io":return c.ordinalNumber(e,{unit:"day"});case"iii":return c.day(d,{width:"abbreviated",context:"formatting"});case"iiiii":return c.day(d,{width:"narrow",context:"formatting"});case"iiiiii":return c.day(d,{width:"short",context:"formatting"});default:return c.day(d,{width:"wide",context:"formatting"})}},a:function(a,b,c){let d=a.getHours()/12>=1?"pm":"am";switch(b){case"a":case"aa":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"});case"aaa":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return c.dayPeriod(d,{width:"narrow",context:"formatting"});default:return c.dayPeriod(d,{width:"wide",context:"formatting"})}},b:function(a,b,c){let d,e=a.getHours();switch(d=12===e?"noon":0===e?"midnight":e/12>=1?"pm":"am",b){case"b":case"bb":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"});case"bbb":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return c.dayPeriod(d,{width:"narrow",context:"formatting"});default:return c.dayPeriod(d,{width:"wide",context:"formatting"})}},B:function(a,b,c){let d,e=a.getHours();switch(d=e>=17?"evening":e>=12?"afternoon":e>=4?"morning":"night",b){case"B":case"BB":case"BBB":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"});case"BBBBB":return c.dayPeriod(d,{width:"narrow",context:"formatting"});default:return c.dayPeriod(d,{width:"wide",context:"formatting"})}},h:function(a,b,c){if("ho"===b){let b=a.getHours()%12;return 0===b&&(b=12),c.ordinalNumber(b,{unit:"hour"})}return o.h(a,b)},H:function(a,b,c){return"Ho"===b?c.ordinalNumber(a.getHours(),{unit:"hour"}):o.H(a,b)},K:function(a,b,c){let d=a.getHours()%12;return"Ko"===b?c.ordinalNumber(d,{unit:"hour"}):n(d,b.length)},k:function(a,b,c){let d=a.getHours();return(0===d&&(d=24),"ko"===b)?c.ordinalNumber(d,{unit:"hour"}):n(d,b.length)},m:function(a,b,c){return"mo"===b?c.ordinalNumber(a.getMinutes(),{unit:"minute"}):o.m(a,b)},s:function(a,b,c){return"so"===b?c.ordinalNumber(a.getSeconds(),{unit:"second"}):o.s(a,b)},S:function(a,b){return o.S(a,b)},X:function(a,b,c){let d=a.getTimezoneOffset();if(0===d)return"Z";switch(b){case"X":return r(d);case"XXXX":case"XX":return s(d);default:return s(d,":")}},x:function(a,b,c){let d=a.getTimezoneOffset();switch(b){case"x":return r(d);case"xxxx":case"xx":return s(d);default:return s(d,":")}},O:function(a,b,c){let d=a.getTimezoneOffset();switch(b){case"O":case"OO":case"OOO":return"GMT"+q(d,":");default:return"GMT"+s(d,":")}},z:function(a,b,c){let d=a.getTimezoneOffset();switch(b){case"z":case"zz":case"zzz":return"GMT"+q(d,":");default:return"GMT"+s(d,":")}},t:function(a,b,c){return n(Math.trunc(a/1e3),b.length)},T:function(a,b,c){return n(+a,b.length)}};function q(a,b=""){let c=a>0?"-":"+",d=Math.abs(a),e=Math.trunc(d/60),f=d%60;return 0===f?c+String(e):c+String(e)+b+n(f,2)}function r(a,b){return a%60==0?(a>0?"-":"+")+n(Math.abs(a)/60,2):s(a,b)}function s(a,b=""){let c=Math.abs(a);return(a>0?"-":"+")+n(Math.trunc(c/60),2)+b+n(c%60,2)}let t=(a,b)=>{switch(a){case"P":return b.date({width:"short"});case"PP":return b.date({width:"medium"});case"PPP":return b.date({width:"long"});default:return b.date({width:"full"})}},u=(a,b)=>{switch(a){case"p":return b.time({width:"short"});case"pp":return b.time({width:"medium"});case"ppp":return b.time({width:"long"});default:return b.time({width:"full"})}},v={p:u,P:(a,b)=>{let c,d=a.match(/(P+)(p+)?/)||[],e=d[1],f=d[2];if(!f)return t(a,b);switch(e){case"P":c=b.dateTime({width:"short"});break;case"PP":c=b.dateTime({width:"medium"});break;case"PPP":c=b.dateTime({width:"long"});break;default:c=b.dateTime({width:"full"})}return c.replace("{{date}}",t(e,b)).replace("{{time}}",u(f,b))}},w=/^D+$/,x=/^Y+$/,y=["D","DD","YY","YYYY"],z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B=/^'([^]*?)'?$/,C=/''/g,D=/[a-zA-Z]/;function E(a,d,e){let f=(0,c.getDefaultOptions)(),h=e?.locale??f.locale??b.defaultLocale,i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??f.firstWeekContainsDate??f.locale?.options?.firstWeekContainsDate??1,j=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??f.weekStartsOn??f.locale?.options?.weekStartsOn??0,k=(0,g.toDate)(a,e?.in);if(!(k instanceof Date||"object"==typeof k&&"[object Date]"===Object.prototype.toString.call(k))&&"number"!=typeof k||isNaN(+(0,g.toDate)(k)))throw RangeError("Invalid time value");let l=d.match(A).map(a=>{let b=a[0];return"p"===b||"P"===b?(0,v[b])(a,h.formatLong):a}).join("").match(z).map(a=>{if("''"===a)return{isToken:!1,value:"'"};let b=a[0];if("'"===b){var c;let b;return{isToken:!1,value:(b=(c=a).match(B))?b[1].replace(C,"'"):c}}if(p[b])return{isToken:!0,value:a};if(b.match(D))throw RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:a}});h.localize.preprocessor&&(l=h.localize.preprocessor(k,l));let m={firstWeekContainsDate:i,weekStartsOn:j,locale:h};return l.map(b=>{if(!b.isToken)return b.value;let c=b.value;return(!e?.useAdditionalWeekYearTokens&&x.test(c)||!e?.useAdditionalDayOfYearTokens&&w.test(c))&&function(a,b,c){var d,e,f;let g,h=(d=a,e=b,f=c,g="Y"===d[0]?"years":"days of the month",`Use \`${d.toLowerCase()}\` instead of \`${d}\` (in \`${e}\`) for formatting ${g} to the input \`${f}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(h),y.includes(a))throw RangeError(h)}(c,d,String(a)),(0,p[c[0]])(k,c,h.localize,m)}).join("")}a.s(["format",0,E],256711);var F=a.i(934754);function G(a,b,c){let[d,f]=(0,e.normalizeDates)(c?.in,a,b);return+h(d)==+h(f)}var H=a.i(156757);let I=H.z.union([H.z.date(),H.z.iso.datetime()]),J=a=>new Date(a);a.s(["DateLikeSchema",0,I,"shortAgo",0,function(a,b=Date.now()){let c=Math.max(0,Math.round((b-J(a).getTime())/1e3));if(c<60)return"now";let d=Math.round(c/60);if(d<60)return`${d}m`;let e=Math.round(d/60);return e<24?`${e}h`:`${Math.round(e/24)}d`},"toDate",0,J,"whenOf",0,function(a){let b=J(a),c=E(b,"HH:mm");return G((0,k.constructFrom)(b,b),(0,F.constructNow)(b))?c:!function(a){var b,c;let d;return G((0,k.constructFrom)(a,a),(b=(0,F.constructNow)(a),c=void 0,d=(0,g.toDate)(b,c?.in),isNaN(-1)?(0,k.constructFrom)(c?.in||b,NaN):(d.setDate(d.getDate()+-1),d)))}(b)?`${E(b,"MMM d")} \xb7 ${c}`:`Yesterday ${c}`}],199169)}];
2
-
3
- //# sourceMappingURL=lib_date-like_ts_02is0pw._.js.map
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,279265,240829,206721,e=>{"use strict";var t=e.i(843476),n=e.i(96892),s=e.i(689664),a=e.i(24071),o=e.i(867927),r=e.i(931619),i=e.i(508734),l=e.i(779266),d=e.i(632781),u=e.i(77071),c=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(815731),f=e.i(167881),h=e.i(496336),b=e.i(683408),g=e.i(660302),k=e.i(184762),v=e.i(6799),j=e.i(313689),w=e.i(451888),y=e.i(635963),N=e.i(835878),T=e.i(764224),C=e.i(919191),z=e.i(929272),S=e.i(686013),M=e.i(761086),A=e.i(95187);let B=(0,A.createServerReference)("7f15442d74ed44708143e5eb45805be0e17c010418",A.callServer,void 0,A.findSourceMapURL,"markSeenAction");var _=e.i(245629),R=e.i(393080),$=e.i(283653),I=e.i(647163);let E=[],F=!1,q=new Set,K={sync(e,t){for(let n of(F=!0,E=[...e].reverse().map(e=>L(e,t)).slice(-30),q))n()},primed:()=>F};function L(e,t){let n=e=>({name:e,icon:t?.find(t=>t.name===e)?.icon??null}),s=n(e.bot),a=[],o=new Map,r=new Map;for(let t of e.lines){let e=t.bot?n(t.bot):s,i=t.parent&&r.get(t.parent)?.name?s:null;switch(t.kind){case"user":a.push({id:t.id,bot:s,to:null,text:t.text,kind:"user"});break;case"text":a.push({id:t.id,bot:e,to:i,text:t.text,kind:"say"});break;case"note":a.push({id:t.id,bot:e,to:i,text:t.text,kind:"note"});break;case"tool":o.set(t.callId,a.length),a.push({id:t.id,bot:e,to:i,text:t.note??t.input,kind:"tool",tool:{name:t.name,input:t.input,note:t.note,path:t.path,callId:t.callId}});break;case"tool-result":{let e=o.get(t.callId),n=void 0===e?void 0:a[e];n?.tool&&void 0!==e&&(a[e]={...n,tool:{...n.tool,results:t.results,more:t.more}});break}case"ask":{let s=n(t.to);r.set(t.callId,s),a.push({id:t.id,bot:e,to:s,text:t.text,kind:"ask"});break}case"ask-result":{let n=r.get(t.callId);n&&t.text&&a.push({id:t.id,bot:n,to:e,text:t.text,kind:"ask"});break}case"waiting":a.push({id:t.id,bot:e,to:null,text:t.question,kind:"result",options:t.options})}}if("failed"===e.status&&e.outcome)a.push({id:`${e.id}-end`,bot:s,to:null,text:e.outcome,kind:"error"});else if("done"===e.status||"waiting"===e.status){let t=a.at(-1);t&&"say"===t.kind&&t.text===e.outcome&&(a[a.length-1]={...t,kind:"result"})}return{id:e.id,request:e.request,label:e.label,bot:s,lines:a,status:"running"===e.status?"working":e.status,outcome:e.outcome,ask:e.ask,seen:e.seen,tokens:e.tokens,contextTokens:e.contextTokens,contextBudget:e.contextBudget,updatedAt:e.updatedAt}}function D(e){for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("user"!==n.kind&&"note"!==n.kind)return n}return null}let O=new Map,P={get:e=>O.get(e)??"",set(e,t){t?O.set(e,t):O.delete(e)},typing:e=>(O.get(e)?.trim().length??0)>0},U=new Set,H={announce(e){for(let t of U)t(e)},subscribe:e=>(U.add(e),()=>{U.delete(e)})},V=[];function W(){return(0,m.useSyncExternalStore)(e=>(q.add(e),()=>q.delete(e)),()=>E,()=>V)}let G=e=>"result"===e.kind||"error"===e.kind;function X(e){let t=[e.bot];for(let n of e.lines)t.some(e=>e.name===n.bot.name)||t.push(n.bot);return t}function J(e){let t=new Set([e.bot.name]),n=[];for(let s of function(e){let t=[];for(let n of e){let e=t.at(-1);if(e&&e.bot.name===n.bot.name&&e.to?.name===n.to?.name&&"user"===e.lines[0].kind==("user"===n.kind)){e.lines.push(n);continue}t.push({key:n.id,bot:n.bot,to:n.to,lines:[n]})}return t}(e.lines))s.to&&!t.has(s.to.name)&&(t.add(s.to.name),n.push({kind:"invite",key:`${s.key}-joins`,from:s.bot,to:s.to})),t.add(s.bot.name),n.push({kind:"group",key:s.key,group:s});return n}function Y(e){let t=new Map;for(let n of e)for(let e of(t.has(n.bot.name)||t.set(n.bot.name,{bot:n.bot,task:n,line:null,open:0}),n.lines))"user"!==e.kind&&"note"!==e.kind&&t.set(e.bot.name,{bot:e.bot,task:n,line:e,open:t.get(e.bot.name)?.open??0});for(let n of e){if("working"!==n.status)continue;let e=t.get(n.bot.name);e&&(e.open+=1)}return[...t.values()]}function Q(e){let t=(0,m.useRef)(new Set),n=e?.id??null,s=e?`${e.id}@${(0,_.toDate)(e.updatedAt).getTime()}`:null,a=!!e&&("done"===e.status||"failed"===e.status)&&!e.seen;(0,m.useEffect)(()=>{!n||!s||!a||t.current.has(s)||(t.current.add(s),B([n]).then(R.unwrapResult).then(()=>(0,$.revalidate)(x.queryKey.tasks)).catch(e=>{t.current.delete(s),v.toast.add({type:"error",title:"Could not mark the task as read",description:(0,I.errorToString)(e)})}))},[n,s,a])}e.s(["botTasks",0,K,"isOutcome",0,G,"lastSaid",0,D,"latestPerBot",0,Y,"rosterOf",0,X,"screenActs",0,H,"taskDrafts",0,P,"taskFromRow",0,L,"threadItems",0,J,"useBotTasks",0,W,"useSeenOnDetail",0,Q],240829);var Z=e.i(609856);function ee({task:e,status:s,lines:a=[],className:o}){let[i,l]=(0,m.useState)(()=>P.get(e.id));(0,m.useEffect)(()=>l(P.get(e.id)),[e.id]);let u=t=>{l(t),P.set(e.id,t)},[p,b]=et(),[v,j]=(0,Z.useServerAction)(M.cancelTaskAction,{onOk:e=>{(0,$.revalidate)(x.queryKey.tasks),H.announce({kind:"stopped",id:e.id,label:e.label})}}),y=b||j,[N,T]=(0,m.useState)(!1),[S,A]=(0,m.useState)(null);(0,m.useEffect)(()=>{T(!1),A(null)},[e.id]),(0,m.useEffect)(()=>{"running"!==s&&A(null)},[s]),(0,m.useEffect)(()=>{S&&a.some(e=>"user"===e.kind&&e.text===S)&&A(null)},[a,S]);let B=async t=>{!y&&await p(e,t)&&(u(""),"running"===s&&(A(t.trim()),T(!1)))},_="waiting"===s?e.ask:null,R=(0,w.isAppStop)(_),E=_?_.options.length?"Or put it another way…":"Your answer":"running"===s?`What's off? ${e.bot} reads this before its next step`:"Anything more? It picks up where it left off",F=(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),B(i)},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,t.jsx)(k.Textarea,{value:i,rows:1,disabled:y,autoFocus:"running"===s,onChange:e=>u(e.target.value),onKeyDown:e=>{"Escape"===e.key&&"running"===s?T(!1):"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.keyCode||(e.preventDefault(),B(i))},placeholder:E,"aria-label":`Message for ${e.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"===s&&(0,t.jsx)(f.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:y,onClick:()=>T(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(c.X,{})}),(0,t.jsx)(f.Button,{type:"submit",size:"icon-sm",variant:i.trim()?"default":"ghost",disabled:!i.trim()||y,"aria-label":"Send",className:"rounded-full",children:b?(0,t.jsx)(d.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]});return"running"!==s||N?_?(0,t.jsxs)("div",{className:(0,I.cn)("space-y-2.5 rounded-2xl bg-amber-500/8 px-3.5 py-3 ring-1 ring-amber-500/25",o),children:[(0,t.jsxs)("p",{className:"flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{className:"shrink-0",children:"To"}),(0,t.jsx)("span",{className:"truncate text-foreground",children:e.bot}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)("span",{className:"truncate",children:e.label})]}),_.question&&(0,t.jsx)(h.FoldedText,{text:_.question,subject:"message",clamp:"line-clamp-6",tall:"max-h-56"}),_.options.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:_.options.map(e=>(0,t.jsxs)(f.Button,{size:"sm",variant:"outline",disabled:y,onClick:()=>B(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",children:[R&&e===w.TASK_CONTINUE&&(0,t.jsx)(r.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))}),F,"waiting"===s&&(0,t.jsx)("button",{type:"button",disabled:y,onClick:()=>v(e.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,t.jsx)("div",{className:o,children:F}):(0,t.jsxs)("div",{className:(0,I.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",o),children:[S?(0,t.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-[12.5px] leading-5 text-muted-foreground",children:[(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsx)("span",{className:"shrink-0",children:"Before its next step:"}),(0,t.jsx)(g.ShinyText,{text:S,speed:2.2,className:"min-w-0 truncate"})]}):(0,t.jsx)(g.ShinyText,{text:`${e.bot} is on it — Thursday steers it by voice.`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(f.Button,{type:"button",size:"sm",variant:"ghost",disabled:y,onClick:()=>T(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(C.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),(0,t.jsx)(f.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:y,onClick:()=>v(e.id),"aria-label":"Stop this task",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:j?(0,t.jsx)(d.Loader2,{className:"animate-spin"}):(0,t.jsx)(z.Square,{className:"size-3"})})]})}function et(){let[e,t]=(0,Z.useServerAction)(S.answerTaskAction,{onOk:()=>(0,$.revalidate)(x.queryKey.tasks)});return[async(t,n)=>{let s=n.trim();if(!s)return!1;try{let n=await e(t.id,s);return H.announce({kind:"answered",id:n.id,label:n.label,answer:s}),!0}catch{return!1}},t]}e.s(["TaskReply",0,ee,"useAnswerTask",0,et],206721);var en=e.i(989409),es=e.i(256604),ea=e.i(621285),eo=e.i(864723),er=e.i(222055);let ei=(0,m.memo)(function(){let e=W(),{data:n}=(0,$.useServerRoute)(x.queryKey.bot),[s,a]=(0,m.useState)(!1),[o,r]=(0,m.useState)(null),[i,l]=(0,m.useState)(!1),d=[...e].reverse(),u=o?d.find(e=>e.id===o)??null:null,[c,p]=function(){let[e,t]=(0,m.useState)(new Map),n=(0,m.useRef)(new Map);return(0,m.useEffect)(()=>()=>{for(let e of n.current.values())clearTimeout(e)},[]),[e,(0,m.useCallback)(e=>{t(t=>new Map(t).set(e.at,e));let s=n.current.get(e.at);s&&clearTimeout(s),n.current.set(e.at,setTimeout(()=>{n.current.delete(e.at),t(t=>{let n=new Map(t);return n.delete(e.at),n})},3400))},[])]}(),{crew:f,more:h}=(0,m.useMemo)(()=>eu(n,e),[n,e]),b=(0,m.useRef)(null),g=(0,m.useRef)(new Set);(0,m.useEffect)(()=>{if(!K.primed())return;let t=new Map(d.map(e=>[e.id,e.status])),n=b.current;b.current=t;let s=new Set;for(let t of e)for(let e of t.lines)"ask"===e.kind&&e.to&&s.add(e.id);let a=g.current;if(g.current=s,!n)return;let o=new Map;for(let t of e)for(let e of t.lines){if("ask"!==e.kind||!e.to||a.has(e.id))continue;let t=o.get(e.bot.name)??[];t.push({from:e.bot,to:e.to,text:e.text}),o.set(e.bot.name,t)}for(let[e,t]of o){if(1===t.length){p({at:t[0].to.name,from:t[0].from,text:ed(t[0].text)});continue}p({at:e,from:t[0].from,text:`sent ${t.length} parts out`})}for(let e of d)n.get(e.id)!==e.status&&"working"===e.status&&p(n.has(e.id)?{at:e.bot.name,from:null,text:"picked it back up"}:{at:e.bot.name,from:eF,text:`took on \u201c${ed(e.label)}\u201d`})},[e,p]),Q(s?u:null);let k=e.filter(e=>"working"===e.status).length,v=d.filter(ec),j=v.length,w=d.filter(em),y=w.filter(e=>"failed"===e.status).length,N=(0,m.useCallback)(()=>l(!1),[]);return(0,t.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-[min(80vw,calc(100vw-2.5rem))] flex-col items-end gap-2",children:s?(0,t.jsx)("div",{className:"pointer-events-auto flex max-h-[min(44rem,78vh)] w-132 max-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:u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eN,{task:u,onBack:()=>r(null),onClose:()=>a(!1)}),(0,t.jsx)(e$,{task:u,className:"min-h-0 flex-1"}),(0,t.jsx)(ee,{task:{id:u.id,label:u.label,bot:u.bot.name,ask:function(e){if(!e.ask?.question)return e.ask;let t=e.lines.at(-1);return t&&G(t)&&t.text===e.ask.question?{...e.ask,question:""}:e.ask}(u)},status:"working"===u.status?"running":u.status,lines:u.lines,className:"mx-3 mb-2 shrink-0"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ey,{count:e.length,pending:j,composing:i,onCompose:()=>l(!0),onClose:()=>i?l(!1):a(!1)}),i?(0,t.jsx)(eh,{bots:n,onDone:N}):d.length?(0,t.jsx)(e_,{tasks:d,onPick:r}):(0,t.jsx)(eM,{bots:n}),!i&&(0,t.jsx)(eA,{})]})}):(0,t.jsx)(ex,{crew:f,more:h,bubbles:c,bots:n,rows:v,count:e.length,busy:k,pending:j,unread:w.length,failed:y,composing:i,onCompose:()=>l(!0),onCloseCompose:N,onPick:e=>{r(e),a(!0)},onOpen:()=>{let e=v.length?v:w;o||1!==e.length||r(e[0].id),a(!0)}})})}),el=new Map,ed=e=>{let t=(0,I.plainText)(e).replace(/\s+/g," ").trim();return t.length>28?`${t.slice(0,27)}…`:t};function eu(e,t){let n=new Map;for(let e of Y(t)){let{task:t,bot:s,line:a}=e;if("waiting"===t.status&&t.bot.name===s.name){n.set(s.name,{waiting:!0,word:null});continue}!("working"!==t.status||n.get(s.name)?.waiting)&&n.set(s.name,{waiting:!1,word:a?"tool"===a.kind&&a.tool?ed(a.tool.note??`${a.tool.name} \xb7 ${a.tool.input}`):"say"===a.kind?ed(a.text):null:null})}let s=new Map;for(let t of e??[])s.set(t.name,{name:t.name,icon:t.icon,awake:n.has(t.name),waiting:n.get(t.name)?.waiting??!1,word:n.get(t.name)?.word??null});for(let[e,t]of n)s.has(e)||s.set(e,{name:e,icon:null,awake:!0,waiting:t.waiting,word:t.word});let a=[...s.values()];if(!a.length)return{crew:eb.slice(0,eg),more:0};for(let e of eb){if(a.length>=eg)break;s.has(e.name)||a.push(e)}let o=e=>e.waiting?0:e.awake?1:e.standIn?3:2,r=a.map((e,t)=>({face:e,at:t})).sort((e,t)=>o(e.face)-o(t.face)||e.at-t.at).map(e=>e.face);return{crew:r.slice(0,10),more:Math.max(0,r.length-10)}}let ec=e=>"waiting"===e.status,em=e=>("done"===e.status||"failed"===e.status)&&!e.seen;function ex({crew:e,more:n,bubbles:a,bots:o,rows:r,count:i,busy:l,pending:u,unread:m,failed:x,composing:p,onCompose:f,onCloseCompose:h,onPick:b,onOpen:k}){let v=function({count:e,busy:t,pending:n,unread:s,failed:a}){return n>0?{text:1===n?"waiting on you":`${n} waiting on you`,tone:I.WAITING_INK,shine:"waiting"}:a>0?{text:1===a?"1 failed":`${a} failed`,tone:"text-destructive",shine:null}:s>0?{text:1===s?"1 new answer":`${s} new answers`,tone:I.WAITING_INK,shine:null}:t>0?{text:1===t?"working":`${t} running`,tone:"text-muted-foreground",shine:"muted"}:e>0?{text:"all done",tone:"text-muted-foreground",shine:null}:{text:"no jobs yet",tone:"text-muted-foreground",shine:null}}({count:i,busy:l,pending:u,unread:m,failed:x}),j=p||u>0;return(0,t.jsxs)("div",{className:(0,I.cn)("pointer-events-auto w-fit max-w-full bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",j?"max-w-[min(33rem,100%)] min-w-96 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,t.jsx)("div",{className:(0,I.cn)("grid overflow-hidden transition-[grid-template-rows] duration-300 ease-out",j?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,t.jsx)("div",{className:"min-h-0 overflow-hidden",inert:!j,children:p?(0,t.jsx)(eh,{bots:o,onDone:h}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex-1",children:["needs you · ",u]}),(0,t.jsx)(ep,{onClick:f})]}),(0,t.jsx)("div",{className:"px-1.5 pb-2",children:r.map(e=>(0,t.jsx)(eR,{task:e,onPick:()=>b(e.id)},e.id))}),(0,t.jsx)("span",{className:"block h-1.5"})]})})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,t.jsxs)("button",{type:"button",onClick:k,"aria-label":i?`Tasks (${i})`:"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,t.jsx)(ek,{crew:e,more:n,bubbles:a}),(0,t.jsxs)("span",{className:"ml-auto flex h-7 shrink-0 items-center gap-1.5",children:[v.shine?(0,t.jsx)(g.ShinyText,{text:v.text,tone:v.shine,speed:2.6,className:"block truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,t.jsx)("span",{className:(0,I.cn)("block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] fade-in duration-300",v.tone),children:v.text},v.text),(0,t.jsxs)("span",{className:"grid size-4 shrink-0 place-items-center",children:[0===u&&0===m&&l>0&&(0,t.jsx)(d.Loader2,{className:"size-4 animate-spin text-muted-foreground/70"}),0===u&&0===x&&(m>0||0===l&&i>0)&&(0,t.jsx)(s.Check,{className:"size-4 text-muted-foreground/60"})]})]})]}),p&&(0,t.jsx)(ef,{onClick:h,label:"Cancel the message",children:(0,t.jsx)(c.X,{className:"size-3.5"})})]})]})}function ep({onClick:e}){return(0,t.jsx)(ef,{onClick:e,label:"Message a bot",children:(0,t.jsx)(u.Plus,{className:"size-4"})})}function ef({onClick:e,label:n,children:s}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":n,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:s})}function eh({bots:e,onDone:s}){let[r,i]=(0,m.useState)(null),[l,u]=(0,m.useState)(""),[c,p]=(0,Z.useServerAction)(j.startTaskAction,{onOk:()=>{(0,$.revalidate)(x.queryKey.tasks),s()}}),h=e?.length?e.filter(e=>!e.disabled).map(e=>({name:e.name,icon:e.icon})):[{name:w.DEFAULT_BOT.name,icon:w.DEFAULT_BOT.icon}],b=()=>{r&&l.trim()&&!p&&c(r.name,l.trim())};return r?(0,t.jsxs)("div",{className:"flex min-h-32 flex-col pb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>i(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,t.jsx)(a.ChevronLeft,{className:"size-3.5"})}),(0,t.jsx)(y.BotMark,{size:22,seed:r.name,vary:r.name,color:r.icon?.color,shape:r.icon?.shape,outline:r.icon?.outline,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium",children:["To ",r.name]})]}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),b()},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,t.jsx)(k.Textarea,{value:l,rows:1,autoFocus:!0,disabled:p,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.keyCode||(e.preventDefault(),b())},placeholder:`What should ${r.name} do? It cannot hear the call, so say the whole job.`,"aria-label":`Message for ${r.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,t.jsx)(f.Button,{type:"submit",size:"icon-sm",variant:l.trim()?"default":"ghost",disabled:!l.trim()||p,"aria-label":"Send",className:"rounded-full",children:p?(0,t.jsx)(d.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})]}):(0,t.jsxs)("div",{className:"min-h-32 pb-3",children:[(0,t.jsx)("p",{className:"px-3 pt-3 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground",children:"message a bot"}),(0,t.jsx)("div",{className:"px-1",children:h.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>i(e),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,t.jsx)(y.BotMark,{size:22,seed:e.name,vary:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,className:"shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:e.name}),(0,t.jsx)(o.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},e.name))})]})}let eb=["alto","brio","cinder","delta"].map((e,t)=>({name:e,icon:{color:eo.MARK_PALETTE[Math.floor(t*eo.MARK_PALETTE.length/4)],shape:eo.MARK_SHAPES[t%eo.MARK_SHAPES.length]},awake:!1,waiting:!1,word:null,standIn:!0})),eg=3;function ek({crew:e,more:n,bubbles:s}){return(0,t.jsxs)("span",{className:"flex min-w-0 shrink items-center",children:[e.map((n,a)=>{let o=s.get(n.name)??null;return(0,t.jsxs)(m.Fragment,{children:[(0,t.jsxs)("span",{className:(0,I.cn)("relative shrink-0 transition-[margin,transform] duration-500 ease-out",a>0&&!e[a-1].word&&"-ml-2",n.standIn&&"opacity-35",n.awake&&"-translate-y-0.5 scale-110"),style:{zIndex:e.length-a},children:[(0,t.jsx)(ev,{face:n}),o&&(0,t.jsx)(ej,{handoff:o})]}),n.word&&(0,t.jsx)("span",{className:"mx-2.5 min-w-0 shrink truncate",children:(0,t.jsx)(g.ShinyText,{text:n.word,speed:2.6,className:"truncate text-[13px] leading-5 tracking-[-0.1px]"})})]},n.name)}),n>0&&(0,t.jsxs)("span",{className:(0,I.cn)("grid size-7 shrink-0 place-items-center rounded-[9px] bg-muted font-mono text-[10px] text-muted-foreground ring-1 ring-border/50",!e.at(-1)?.word&&"-ml-2"),title:`${n} more`,children:["+",n]})]})}function ev({face:e}){let n=(0,m.useMemo)(()=>e.awake?{glow:20}:void 0,[e.awake]);return(0,t.jsx)(y.BotMark,{size:28,seed:e.name,vary:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,notify:e.waiting,options:n})}function ej({handoff:e}){return(0,t.jsxs)("span",{className:"pointer-events-none absolute bottom-[calc(100%+9px)] left-1/2 flex -translate-x-1/2 animate-in flex-col items-center whitespace-nowrap fade-in zoom-in-95 duration-200",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 rounded-full bg-background px-2.5 py-1 text-[12.5px] leading-4 tracking-[-0.1px] shadow-lg shadow-black/10 ring-1 ring-border",children:[e.from?.name===eF.name?(0,t.jsx)(es.ThursdayMark,{size:14,className:"shrink-0 opacity-75"}):e.from&&(0,t.jsx)(y.BotMark,{size:14,seed:e.from.name,vary:e.from.name,color:e.from.icon?.color,shape:e.from.icon?.shape,outline:e.from.icon?.outline,className:"shrink-0 opacity-75"}),e.text]}),(0,t.jsx)("span",{className:"-mt-px size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-border"}),(0,t.jsx)("span",{className:"-mt-[6.5px] size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-background"})]})}function ew({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(c.X,{className:"size-3.5"})})}function ey({count:e,pending:n,composing:s,onCompose:a,onClose:o}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium",children:"Tasks"}),e>0&&!s&&(0,t.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:n>0?`${n} for you \xb7 ${e}`:e}),(0,t.jsx)("span",{className:"flex-1"}),!s&&(0,t.jsx)(ep,{onClick:a}),(0,t.jsx)(ew,{onClick:o})]})}function eN({task:e,onBack:n,onClose:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(a.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(y.BotMark,{size:22,seed:e.bot.name,vary:e.id,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,notify:!1}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[e.label,(0,t.jsx)("span",{title:e.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:e.id.slice(0,8)})]}),(0,t.jsx)(eT,{usage:e.tokens}),(0,t.jsx)(eC,{task:e}),(0,t.jsx)(eS,{task:e}),(0,t.jsx)(ew,{onClick:s})]})}function eT({usage:e}){let n=e.input+e.output;return n?(0,t.jsx)("span",{title:`in ${(0,I.formatCount)(e.input)} \xb7 out ${(0,I.formatCount)(e.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,I.formatCount)(n)}):null}function eC({task:e}){let{contextTokens:n,contextBudget:s}=e;if(!n||!s)return null;let a=Math.min(1,n/s);return(0,t.jsx)("span",{title:`Context ${(0,I.formatCount)(n)} of ${(0,I.formatCount)(s)} — it summarizes itself here`,className:"block h-[3px] w-9 shrink-0 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,I.cn)("block h-full rounded-full",a>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*a))}%`}})})}let ez={working:"text-muted-foreground",waiting:I.WAITING_INK,done:"text-foreground",failed:"text-destructive"};function eS({task:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":ez[e.status];return"working"===e.status?(0,t.jsx)(g.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,I.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:e.status})}function eM({bots:e}){let{crew:n,more:s}=eu(e,[]);return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 px-6 pt-3 pb-4 text-center",children:[(0,t.jsx)(ek,{crew:n,more:s,bubbles:el}),e?.length?(0,t.jsx)("p",{className:"text-[12px] text-muted-foreground",children:"Nothing handed over yet — ask for something that takes a while."}):(0,t.jsxs)("p",{className:"text-[12px] text-muted-foreground",children:["Thursday hands work to ",w.DEFAULT_BOT.name," until you make bots of your own in Settings › Bots."]})]})}function eA(){return(0,t.jsx)("div",{className:"flex shrink-0 justify-end px-3 pb-2.5",children:(0,t.jsxs)("button",{type:"button",onClick:()=>(0,en.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,t.jsx)(l.History,{className:"size-3"}),"History"]})})}let eB=[{id:"you",label:"needs you",holds:ec},{id:"working",label:"working",holds:e=>"working"===e.status},{id:"done",label:"done",holds:()=>!0}];function e_({tasks:e,onPick:n}){let s=new Map;for(let t of e){let e=eB.find(e=>e.holds(t))??eB[2],n=s.get(e.id);n?n.push(t):s.set(e.id,[t])}return(0,t.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:eB.map((e,a)=>{let o=s.get(e.id)??[];return o.length?(0,t.jsxs)(m.Fragment,{children:[(0,t.jsxs)("p",{className:(0,I.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===a?"pt-1":"pt-3"),children:[e.label," · ",o.length]}),o.map(e=>(0,t.jsx)(eR,{task:e,onPick:()=>n(e.id)},e.id))]},e.id):null})})}function eR({task:e,onPick:n}){let s=ec(e),a=e.lines.at(-1),o=(0,m.useMemo)(()=>(function(e){if("waiting"===e.status&&e.ask)return{text:(0,w.isAppStop)(e.ask)?(0,I.plainText)(e.outcome??e.ask.question):e.ask.question,tone:I.WAITING_INK};let t=e.seen;if("failed"===e.status)return{text:(0,I.plainText)(e.outcome??"Failed"),tone:t?"text-destructive/70":"text-destructive"};if("done"===e.status)return{text:(0,I.plainText)(e.outcome??"Done"),tone:t?"text-muted-foreground":"text-foreground"};let n=D(e);return n?{text:"tool"===n.kind&&n.tool?n.tool.note??`${n.tool.name} \xb7 ${n.tool.input}`:n.text,tone:"text-muted-foreground"}:{text:`${e.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}})(e),[e.status,e.outcome,e.seen,e.ask,a?.id]),[i,l]=et(),[u,c]=(0,m.useState)(null),x="waiting"===e.status?e.ask?.options??[]:[];return(0,t.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,t.jsxs)("button",{type:"button",onClick:n,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,t.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:e.bot.name,children:(0,t.jsx)(y.BotMark,{size:32,seed:e.bot.name,vary:e.id,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,state:"working"===e.status?"thinking":"idle",notify:s})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",s?"text-foreground":"text-foreground/80"),children:e.label}),(0,t.jsx)(N.BotRoster,{bots:X(e),taskId:e.id}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,_.shortAgo)(e.updatedAt)})]}),(0,t.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===e.status&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"===e.status?(0,t.jsx)(g.ShinyText,{text:o.text,speed:2.2,className:(0,I.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",o.tone)}):(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",o.tone),children:o.text})]})]})]}),x.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:x.map(n=>(0,t.jsxs)(f.Button,{size:"sm",variant:"outline",loading:u===n,disabled:l,onClick:async()=>{c(n),await i(e,n),c(null)},className:"h-7 gap-1.5 rounded-full border-amber-500/35 bg-background px-3 text-[12px]",children:[n===w.TASK_CONTINUE&&(0,t.jsx)(r.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),n]},n))})]})}function e$({task:e,className:n}){let s=(0,m.useRef)(null),a=(0,m.useRef)(!0);return(0,m.useEffect)(()=>{a.current=!0},[e.id]),(0,m.useEffect)(()=>{let e=s.current;e&&a.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status]),(0,t.jsx)(ea.FileViewer,{children:(0,t.jsxs)("div",{ref:s,onScroll:e=>{let t=e.currentTarget;a.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,I.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",n),children:[(0,t.jsx)(eE,{task:e}),J(e).map(n=>"invite"===n.kind?(0,t.jsx)(eq,{from:n.from,to:n.to},n.key):(0,t.jsx)(eO,{group:n.group,task:e},n.key)),"working"===e.status&&(0,t.jsx)(eI,{task:e})]})})}function eI({task:e}){if(e.lines.some(e=>e.tool&&void 0===e.tool.results))return null;let n=e.lines.at(-1),s=n?.kind==="ask"&&n.to?n.to:n?.bot;return(0,t.jsx)(g.ShinyText,{text:s?`${s.name} is on the next step…`:`${e.bot.name} is taking it on…`,speed:2.2,className:"block px-1 font-mono text-[10px]"})}function eE({task:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eq,{from:eF,to:e.bot}),(0,t.jsx)(eL,{children:(0,t.jsx)(p.Bubble,{align:"end",className:"max-w-full",children:(0,t.jsx)(p.BubbleContent,{className:"rounded-tr-md py-2 pr-2 pl-3.5",children:(0,t.jsx)(h.FoldedText,{text:e.request,subject:"request"})})})})]})}let eF={name:"Thursday"};function eq({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(eK,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(eK,{bot:n})]})})}function eK({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)(y.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function eL({children:e}){return(0,t.jsx)(eD,{side:"end",name:"Thursday",mark:(0,t.jsx)(y.BotMark,{size:26,seed:"thursday",notify:!1,className:"mt-1 shrink-0"}),children:e})}function eD({side:e,mark:n,name:s,children:a}){return(0,t.jsxs)("div",{className:(0,I.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,I.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:s}),a]})]})}function eO({group:e,task:n}){return e.lines[0]?.kind==="user"?(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(eL,{children:e.lines.map(e=>(0,t.jsx)(p.Bubble,{align:"end",className:"max-w-full",children:(0,t.jsx)(p.BubbleContent,{className:"rounded-tr-md px-3.5 text-[13px] leading-snug break-keep",children:e.text})},e.id))})}):(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(eD,{side:e.bot.name===n.bot.name?"start":"end",name:e.bot.name,mark:(0,t.jsx)(y.BotMark,{size:26,seed:e.bot.name,vary:n.id,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,notify:!1,className:"mt-1 shrink-0"}),children:(function(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"said",s=t.at(-1);s&&s.kind===e?s.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t})(e.lines).map(e=>"tools"===e.kind?(0,t.jsx)(eH,{lines:e.lines,taskId:n.id},e.key):e.lines.map(e=>(0,t.jsx)(eP,{line:e,taskId:n.id},e.id)))})})}function eP({line:e,taskId:n}){if("tool"===e.kind&&e.tool)return(0,t.jsx)(er.BotTool,{tool:e.tool,taskId:n});if("note"===e.kind)return(0,t.jsxs)("details",{className:"w-full py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)("p",{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px] leading-relaxed whitespace-pre-wrap break-keep",children:e.text})]});if(!G(e))return(0,t.jsx)("p",{className:"px-1 text-[12.5px] leading-relaxed break-keep text-muted-foreground",children:e.text});if(e.options)return(0,t.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,t.jsx)("p",{className:"text-[13px] leading-snug break-keep",children:e.text}),e.options.length>0&&(0,t.jsx)("p",{className:"flex flex-wrap gap-1",children:e.options.map(e=>(0,t.jsx)("span",{className:"rounded-full bg-background/70 px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})]});let s="error"===e.kind;return(0,t.jsxs)("div",{className:"min-w-0 px-1",children:[s&&(0,t.jsxs)("p",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] text-destructive",children:[(0,t.jsx)(c.X,{className:"size-3 shrink-0"}),"Could not finish"]}),(0,t.jsx)(b.Markdown,{className:(0,I.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",s&&"text-destructive"),children:e.text}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(T.PathChips,{text:e.text,className:"min-w-0"}),!s&&(0,t.jsx)("span",{className:"ml-auto shrink-0",children:(0,t.jsx)(eU,{text:e.text})})]})]})}function eU({text:e}){let[n,a]=(0,m.useState)(!1),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),a(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>a(!1),1400)}catch(e){v.toast.add({type:"error",title:"Could not copy the answer",description:(0,I.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(s.Check,{className:"size-3"}):(0,t.jsx)(i.Copy,{className:"size-3"})})}function eH({lines:e,taskId:n}){return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:[e.length>1&&(0,t.jsxs)("p",{className:"px-2 py-1 font-mono text-[10px] text-muted-foreground",children:[e.length," steps"]}),e.map(e=>e.tool?(0,t.jsx)(er.BotTool,{tool:e.tool,taskId:n,collapsed:!0},e.id):null)]})}e.s(["BotRoom",0,ei,"Conversation",0,e$],279265)},761086,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f02f750f851a61ed3c2676040dea1e1ded9819205",t.callServer,void 0,t.findSourceMapURL,"cancelTaskAction");e.s(["cancelTaskAction",0,n])},686013,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f5bc96ea47ad8a575bfdee5fedc10d3a60faa0387",t.callServer,void 0,t.findSourceMapURL,"answerTaskAction");e.s(["answerTaskAction",0,n])},931619,508734,815731,496336,313689,835878,764224,919191,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let s=(0,t.default)(n);e.s(["ChevronsRight",0,s],931619);let a={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};a.node;let o=(0,t.default)(a);e.s(["Copy",0,o],508734);var r=e.i(843476),i=e.i(176782),l=e.i(552245),d=e.i(225913),u=e.i(647163);let c=(0,d.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,d.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...s}){return(0,r.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,u.cn)(c({variant:e}),n),...s})},"BubbleContent",0,function({className:e,render:t,...n}){var s;return s={defaultTagName:"div",props:(0,i.mergeProps)({className:(0,u.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,l.useRenderElement)(s.defaultTagName??"div",s,s)}],815731);var m=e.i(716327),x=e.i(271645);e.s(["FoldedText",0,function({text:e,subject:t,clamp:n="line-clamp-3",tall:s="max-h-40",className:a}){let[o,i]=(0,x.useState)(!1),[l,d]=(0,x.useState)(!1),c=(0,x.useRef)(null);return(0,x.useEffect)(()=>i(!1),[e]),(0,x.useEffect)(()=>{let e=c.current;e&&!o&&d(e.scrollHeight>e.clientHeight+1)},[o,e]),(0,r.jsxs)("div",{className:(0,u.cn)("flex items-start gap-1",a),children:[(0,r.jsx)("p",{ref:c,className:(0,u.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",o?(0,u.cn)(s,"overflow-y-auto scrollbar-none"):n),children:e}),(l||o)&&(0,r.jsx)("button",{type:"button",onClick:()=>i(e=>!e),"aria-label":o?`Fold the ${t}`:`Read the whole ${t}`,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,r.jsx)(m.ChevronDown,{className:(0,u.cn)("size-3.5",o&&"rotate-180")})})]})}],496336);var p=e.i(95187);let f=(0,p.createServerReference)("7f3ab92bbd495ee087cfb7b701c5f8af0d813bcf67",p.callServer,void 0,p.findSourceMapURL,"startTaskAction");e.s(["startTaskAction",0,f],313689);var h=e.i(635963);e.s(["BotRoster",0,function({bots:e,taskId:t}){return e.length<2?null:(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,r.jsx)("span",{className:"flex items-center",children:e.slice(0,3).map(e=>(0,r.jsx)(h.BotMark,{size:18,seed:e.name,vary:t,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,notify:!1,className:"-ml-[3px] rounded-[7px] ring-2 ring-background first:ml-0"},e.name))}),(0,r.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}],835878);var b=e.i(829600);let g={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"}]]};g.node;let k=(0,t.default)(g),v={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"}]]};v.node;let j=(0,t.default)(v);var w=e.i(905015);let y={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"}]]};y.node;let N=(0,t.default)(y);var T=e.i(226091);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 z=(0,t.default)(C);var S=e.i(621285),M=e.i(616172);let A={markdown:T.FileText,csv:N,json:w.FileJson,text:z,image:j};e.s(["PathChips",0,function({text:e,className:t}){let n=(0,x.useMemo)(()=>(0,M.pathsIn)(e),[e]);return n.length?(0,r.jsx)("div",{className:(0,u.cn)("flex flex-wrap gap-1.5",t),children:n.map(e=>{let t,n=e.split("/").pop()??e,s="frame"===(t=(0,M.viewKindOf)(e))?e.toLowerCase().endsWith(".pdf")?T.FileText:k:A[t]??b.File;return(0,r.jsxs)(S.FileLink,{path:e,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,r.jsx)(s,{className:"size-3 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"truncate",children:n})]},e)})}):null}],764224);let B={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"}]]};B.node;let _=(0,t.default)(B);e.s(["CornerDownLeft",0,_],919191)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let s=(0,t.default)(n);e.s(["Square",0,s],929272)}]);