@alwith/module-chat 0.5.10 → 0.5.12

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 (316) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/approval/choice-elicitation-form.js +1 -1
  3. package/dist/approval/choice-schema.js +1 -1
  4. package/dist/approval/permission-options.js +1 -1
  5. package/dist/approval/permission-view.js +1 -1
  6. package/dist/approval/schema-elicitation-form.js +1 -1
  7. package/dist/approval/url-elicitation-card.js +1 -1
  8. package/dist/{chunk-8tn17nw7.js → chunk-023yzyq8.js} +2 -2
  9. package/dist/{chunk-j8fybkv1.js → chunk-0qm0fy2r.js} +2 -2
  10. package/dist/chunk-1dh0q11h.js +4 -0
  11. package/dist/{chunk-9bjywaze.js → chunk-1drkvxzk.js} +1 -1
  12. package/dist/{chunk-94r5frad.js → chunk-1k03fpcj.js} +2 -2
  13. package/dist/chunk-24b1z856.js +2 -0
  14. package/dist/{chunk-12swy4za.js → chunk-27vftbhf.js} +4 -4
  15. package/dist/{chunk-ybwgmphj.js → chunk-2pha46d9.js} +1 -1
  16. package/dist/{chunk-d8rf7rff.js → chunk-2w576ygb.js} +2 -2
  17. package/dist/chunk-31x6chk8.js +2 -0
  18. package/dist/chunk-36t9x2qc.js +4 -0
  19. package/dist/{chunk-zbnjrtye.js → chunk-3ah1ez70.js} +5 -5
  20. package/dist/{chunk-xv3qen27.js → chunk-3dvx2q8w.js} +2 -2
  21. package/dist/{chunk-b616t3fp.js → chunk-3g66qg03.js} +2 -2
  22. package/dist/chunk-3q6ssrs3.js +2 -0
  23. package/dist/{chunk-vxm45kym.js → chunk-4wkpatzz.js} +2 -2
  24. package/dist/{chunk-ptws0wtt.js → chunk-58bs5f2z.js} +2 -2
  25. package/dist/{chunk-zse2yz8e.js → chunk-62m11b37.js} +3 -3
  26. package/dist/{chunk-rg5vskrr.js → chunk-63zq5nr8.js} +2 -2
  27. package/dist/chunk-6nyba0m4.js +2 -0
  28. package/dist/{chunk-bm4s6n8a.js → chunk-6ss1981q.js} +2 -2
  29. package/dist/{chunk-34a7aha4.js → chunk-753s76b6.js} +2 -2
  30. package/dist/chunk-76w1a72z.js +2 -0
  31. package/dist/{chunk-dzx4rypz.js → chunk-7avpdkmf.js} +2 -2
  32. package/dist/{chunk-gthvary5.js → chunk-8712sy9s.js} +1 -1
  33. package/dist/{chunk-83dkw1mh.js → chunk-8a1j96d1.js} +2 -2
  34. package/dist/{chunk-wp673je0.js → chunk-8jpm8fnf.js} +1 -1
  35. package/dist/chunk-9hvbm4be.js +2 -0
  36. package/dist/{chunk-r55p44ys.js → chunk-9t8ptjct.js} +2 -2
  37. package/dist/chunk-9v94xnhp.js +2 -0
  38. package/dist/{chunk-5f4m4ptz.js → chunk-a1kmc6t8.js} +3 -3
  39. package/dist/{chunk-et0rpfh9.js → chunk-a2hygrpr.js} +1 -1
  40. package/dist/{chunk-tc85dd04.js → chunk-ak0k5vg6.js} +1 -1
  41. package/dist/{chunk-erzjz56d.js → chunk-ana59z25.js} +1 -1
  42. package/dist/{chunk-anshr0mw.js → chunk-anfrrs5x.js} +1 -1
  43. package/dist/chunk-aprxk7c2.js +2 -0
  44. package/dist/chunk-b1vw42he.js +2 -0
  45. package/dist/chunk-b3nt7axf.js +2 -0
  46. package/dist/chunk-b5z75meq.js +2 -0
  47. package/dist/{chunk-rawfwgmw.js → chunk-b65vdzz3.js} +1 -1
  48. package/dist/{chunk-f4e289mj.js → chunk-bbwb4555.js} +2 -2
  49. package/dist/{chunk-90c0tynf.js → chunk-bcrq96dw.js} +2 -2
  50. package/dist/{chunk-gq30yqjk.js → chunk-bftrddmr.js} +2 -2
  51. package/dist/chunk-bna24ggr.js +2 -0
  52. package/dist/chunk-bzk6wn2s.js +3 -0
  53. package/dist/{chunk-vyf9wx2w.js → chunk-c0ac9k7h.js} +2 -2
  54. package/dist/{chunk-6z9r27t2.js → chunk-c7km8xgd.js} +2 -2
  55. package/dist/{chunk-bq05e911.js → chunk-c9k66x5g.js} +2 -2
  56. package/dist/{chunk-rmv0t2ee.js → chunk-chwg3na0.js} +2 -2
  57. package/dist/{chunk-kgkrtc3r.js → chunk-cy6grsx0.js} +1 -1
  58. package/dist/{chunk-9w0w5by0.js → chunk-d6840cvf.js} +2 -2
  59. package/dist/{chunk-nsns7rgs.js → chunk-ddtb692j.js} +2 -2
  60. package/dist/{chunk-y8qmxd0j.js → chunk-dgnk7h62.js} +2 -2
  61. package/dist/{chunk-13y1xqbb.js → chunk-ds6avzj3.js} +2 -2
  62. package/dist/{chunk-bhrnw36x.js → chunk-dxt9j0da.js} +2 -2
  63. package/dist/chunk-e15f3anm.js +3 -0
  64. package/dist/chunk-ee9pzqnq.js +2 -0
  65. package/dist/{chunk-kjtd3wc3.js → chunk-ek06eyp4.js} +1 -1
  66. package/dist/chunk-evx9d147.js +2 -0
  67. package/dist/chunk-f3e3ged2.js +2 -0
  68. package/dist/chunk-f7n8erng.js +2 -0
  69. package/dist/chunk-fa0kzj3j.js +2 -0
  70. package/dist/{chunk-gajhc4bp.js → chunk-fnbs3dq1.js} +2 -2
  71. package/dist/{chunk-5nqhvv28.js → chunk-fpx4ng0t.js} +2 -2
  72. package/dist/{chunk-r828rqdv.js → chunk-fteek5h4.js} +2 -2
  73. package/dist/chunk-gbbpdhg6.js +2 -0
  74. package/dist/chunk-gpz9f9zq.js +2 -0
  75. package/dist/{chunk-951wn2bd.js → chunk-gszy4mhj.js} +2 -2
  76. package/dist/{chunk-115a3p9z.js → chunk-gtqwgjjg.js} +2 -2
  77. package/dist/chunk-hgj33wbd.js +2 -0
  78. package/dist/chunk-hh498geh.js +7 -0
  79. package/dist/chunk-hpyaxv6h.js +2 -0
  80. package/dist/chunk-ht28382s.js +2 -0
  81. package/dist/{chunk-7q07tm0w.js → chunk-hw99hhjf.js} +1 -1
  82. package/dist/{chunk-5c4z345j.js → chunk-hwfwd04r.js} +2 -2
  83. package/dist/{chunk-dnhmnmgf.js → chunk-hz1pgnqp.js} +2 -2
  84. package/dist/chunk-jr591zg2.js +2 -0
  85. package/dist/chunk-jtv179nm.js +2 -0
  86. package/dist/{chunk-1k1e55de.js → chunk-kbwjcnf6.js} +1 -1
  87. package/dist/{chunk-s4tydqhr.js → chunk-kfs19vc5.js} +2 -2
  88. package/dist/{chunk-tjhwk02y.js → chunk-ks05sstp.js} +1 -1
  89. package/dist/{chunk-5d94195x.js → chunk-ksv9pjc2.js} +1 -1
  90. package/dist/{chunk-vdeh7n7d.js → chunk-kw487283.js} +2 -2
  91. package/dist/{chunk-y0ppdmcv.js → chunk-m6h92nq4.js} +2 -2
  92. package/dist/chunk-mk379yt7.js +2 -0
  93. package/dist/{chunk-eg1d1gbc.js → chunk-mkw0twsb.js} +2 -2
  94. package/dist/{chunk-jbz530rv.js → chunk-mvv5xmap.js} +2 -2
  95. package/dist/{chunk-grncrd31.js → chunk-mwd0ed0c.js} +2 -2
  96. package/dist/chunk-nad1erxy.js +3 -0
  97. package/dist/{chunk-xjtqdp82.js → chunk-ncekagm6.js} +1 -1
  98. package/dist/chunk-nwrbpw97.js +2 -0
  99. package/dist/{chunk-k583q9wq.js → chunk-phy911dk.js} +3 -3
  100. package/dist/{chunk-9cbpmdqf.js → chunk-q256c3hn.js} +2 -2
  101. package/dist/{chunk-gc1m6aw5.js → chunk-qg1b5k6m.js} +2 -2
  102. package/dist/{chunk-4t6bd8j7.js → chunk-qnk5jk1b.js} +2 -2
  103. package/dist/chunk-qv4x469a.js +2 -0
  104. package/dist/{chunk-sx4fhs54.js → chunk-qwyvq7bk.js} +2 -2
  105. package/dist/{chunk-b81yxz7f.js → chunk-r0t8zj4g.js} +2 -2
  106. package/dist/chunk-rag9xsg5.js +2 -0
  107. package/dist/{chunk-vpt3vyfc.js → chunk-reaxcamj.js} +2 -2
  108. package/dist/chunk-rrrpp44m.js +2 -0
  109. package/dist/chunk-rtg6xfgr.js +2 -0
  110. package/dist/chunk-s2k5xynq.js +2 -0
  111. package/dist/chunk-sbyn62qx.js +2 -0
  112. package/dist/chunk-shsyer15.js +2 -0
  113. package/dist/{chunk-2ymhbrf9.js → chunk-sn80gr8g.js} +3 -3
  114. package/dist/{chunk-btjqewxj.js → chunk-svt0t387.js} +2 -2
  115. package/dist/{chunk-v2bbgpvw.js → chunk-tjpr0adf.js} +2 -2
  116. package/dist/{chunk-2pj3pcc7.js → chunk-tjykfxrd.js} +2 -2
  117. package/dist/{chunk-r67bkrmr.js → chunk-tm4ee7m3.js} +2 -2
  118. package/dist/chunk-tt40vzdd.js +2 -0
  119. package/dist/{chunk-76xfekar.js → chunk-vc9ts6wp.js} +2 -2
  120. package/dist/{chunk-3wg25354.js → chunk-vcbv30ph.js} +2 -2
  121. package/dist/{chunk-7awdgc0t.js → chunk-vyccmpdn.js} +2 -2
  122. package/dist/{chunk-fjwg3y8h.js → chunk-w45d5th9.js} +2 -2
  123. package/dist/{chunk-pmpeh7e8.js → chunk-wmk2dwpf.js} +2 -2
  124. package/dist/{chunk-0fr24sxr.js → chunk-x2tsybks.js} +3 -3
  125. package/dist/{chunk-vvk1knxf.js → chunk-xa20eex9.js} +1 -1
  126. package/dist/{chunk-t1yd4a57.js → chunk-xd5rqbwp.js} +1 -1
  127. package/dist/{chunk-x66yhg5y.js → chunk-xj0y094j.js} +2 -2
  128. package/dist/{chunk-64hrczd9.js → chunk-xxkdv1zf.js} +1 -1
  129. package/dist/{chunk-2879v3ps.js → chunk-y0psrvcc.js} +2 -2
  130. package/dist/{chunk-ct5wk01a.js → chunk-y1kkt0m2.js} +3 -3
  131. package/dist/{chunk-46gb51y9.js → chunk-y6r6tzfh.js} +2 -2
  132. package/dist/chunk-zg2342s2.js +2 -0
  133. package/dist/chunk-zmpbfbnn.js +2 -0
  134. package/dist/{chunk-0sdhavk8.js → chunk-znyyzs85.js} +2 -2
  135. package/dist/{chunk-akcs13sj.js → chunk-zp5ntx27.js} +2 -2
  136. package/dist/{chunk-wqrn3428.js → chunk-zw3h5xgf.js} +1 -1
  137. package/dist/codex/activity-group.js +1 -1
  138. package/dist/codex/assistant-message.d.ts +2 -1
  139. package/dist/codex/assistant-message.js +1 -1
  140. package/dist/codex/async-question-card.js +1 -1
  141. package/dist/codex/edited-files-card.js +1 -1
  142. package/dist/codex/image-view-activity.js +1 -1
  143. package/dist/codex/markdown-renderer.js +1 -1
  144. package/dist/codex/navigation-audio.js +1 -1
  145. package/dist/codex/navigation-preview.js +1 -1
  146. package/dist/codex/navigation-rail.js +1 -1
  147. package/dist/codex/patch-view.js +1 -1
  148. package/dist/codex/plan.js +1 -1
  149. package/dist/codex/timeline-virtualizer.js +1 -1
  150. package/dist/codex/turn-activity.d.ts +1 -1
  151. package/dist/codex/turn-activity.js +1 -1
  152. package/dist/codex/user-message.js +1 -1
  153. package/dist/codex/virtualized-turn-list.js +1 -1
  154. package/dist/composer/completion-filter.js +1 -1
  155. package/dist/composer/completion-menu.js +1 -1
  156. package/dist/composer/completion-trigger.js +1 -1
  157. package/dist/composer/effort-slider.js +1 -1
  158. package/dist/composer/menu-radio.js +1 -1
  159. package/dist/composer/model-select.js +1 -1
  160. package/dist/composer/permission-mode-select.js +1 -1
  161. package/dist/composer/prompt-input-attachments.js +1 -1
  162. package/dist/composer/prompt-input-clipboard.js +1 -1
  163. package/dist/composer/prompt-input-context.js +1 -1
  164. package/dist/composer/prompt-input-textarea.js +1 -1
  165. package/dist/composer/prompt-input.js +1 -1
  166. package/dist/conversation/action-card.js +1 -1
  167. package/dist/conversation/composer/composer.d.ts +2 -1
  168. package/dist/conversation/composer/composer.js +1 -1
  169. package/dist/conversation/composer/config-options.js +1 -1
  170. package/dist/conversation/composer/context.d.ts +1 -0
  171. package/dist/conversation/composer/context.js +1 -1
  172. package/dist/conversation/composer/drafts.js +1 -1
  173. package/dist/conversation/composer/file-items.js +1 -1
  174. package/dist/conversation/composer/long-text.js +1 -1
  175. package/dist/conversation/composer/mention-chips.js +1 -1
  176. package/dist/conversation/composer/mention-uri.js +1 -1
  177. package/dist/conversation/composer/model-menu.d.ts +1 -1
  178. package/dist/conversation/composer/model-menu.js +1 -1
  179. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  180. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  181. package/dist/conversation/composer/prediction.js +1 -1
  182. package/dist/conversation/composer/slash-command-button.js +1 -1
  183. package/dist/conversation/composer/submit-button.js +1 -1
  184. package/dist/conversation/composer/usage-meter.js +1 -1
  185. package/dist/conversation/context.js +1 -1
  186. package/dist/conversation/conversation-body.js +1 -1
  187. package/dist/conversation/conversation-view.js +1 -1
  188. package/dist/conversation/conversation.js +1 -1
  189. package/dist/conversation/diff-modal.js +1 -1
  190. package/dist/conversation/session-actions.js +1 -1
  191. package/dist/image-lightbox.js +1 -1
  192. package/dist/image-preview-dialog.js +1 -1
  193. package/dist/lib/code-highlighter.js +1 -1
  194. package/dist/lib/fuzzy.js +1 -1
  195. package/dist/lib/group-blocks.js +1 -1
  196. package/dist/lib/image-encode.js +1 -1
  197. package/dist/lib/limits.js +1 -1
  198. package/dist/lib/markdown-parser.js +1 -1
  199. package/dist/lib/markdown-parser.worker.js +43 -39
  200. package/dist/lib/markdown-rules.js +1 -1
  201. package/dist/lib/model-name.js +1 -1
  202. package/dist/lib/pointer-centered-zoom.js +1 -1
  203. package/dist/lib/prepare-prompt-files.js +1 -1
  204. package/dist/lib/stream-style.js +1 -1
  205. package/dist/lib/streaming-markdown.js +1 -1
  206. package/dist/locales.d.ts +13 -0
  207. package/dist/locales.js +1 -1
  208. package/dist/search/chat-search.js +1 -1
  209. package/dist/search/dom-matches.js +1 -1
  210. package/dist/search/find-bar.js +1 -1
  211. package/dist/search/literal-matches.js +1 -1
  212. package/dist/session-list/archived-sessions.js +1 -1
  213. package/dist/session-list/highlight.js +1 -1
  214. package/dist/session-list/host.js +1 -1
  215. package/dist/session-list/hover-info-card.js +1 -1
  216. package/dist/session-list/navigation.js +1 -1
  217. package/dist/session-list/overflow-marquee.js +1 -1
  218. package/dist/session-list/row-stop-button.js +1 -1
  219. package/dist/session-list/session-groups.js +1 -1
  220. package/dist/session-list/session-info-card.js +1 -1
  221. package/dist/session-list/session-list.js +1 -1
  222. package/dist/session-list/session-row.js +1 -1
  223. package/dist/session-list/session-state-dot.js +1 -1
  224. package/dist/session-list/session-state-menu.js +1 -1
  225. package/dist/session-list/sidebar-overlay.js +1 -1
  226. package/dist/session-list/trailing-swap.js +1 -1
  227. package/dist/session-list/use-activity-preview.js +1 -1
  228. package/dist/session-list/use-project-sessions.js +1 -1
  229. package/dist/session-list/virtual-session-rows.js +1 -1
  230. package/dist/session-timeline/activity-group.js +1 -1
  231. package/dist/session-timeline/activity-projection.d.ts +2 -1
  232. package/dist/session-timeline/activity-projection.js +1 -1
  233. package/dist/session-timeline/assistant-content.js +1 -1
  234. package/dist/session-timeline/assistant-turn.js +1 -1
  235. package/dist/session-timeline/async-questions.js +1 -1
  236. package/dist/session-timeline/edited-files-card.js +1 -1
  237. package/dist/session-timeline/history-timeline.js +1 -1
  238. package/dist/session-timeline/host.js +1 -1
  239. package/dist/session-timeline/navigation-rail.js +1 -1
  240. package/dist/session-timeline/plan.js +1 -1
  241. package/dist/session-timeline/question-reply.js +1 -1
  242. package/dist/session-timeline/resource-content.js +1 -1
  243. package/dist/session-timeline/session-timeline.js +1 -1
  244. package/dist/session-timeline/timeline-registry.js +1 -1
  245. package/dist/session-timeline/turn-activity.js +1 -1
  246. package/dist/session-timeline/turn-error.js +1 -1
  247. package/dist/session-timeline/turn-retry.js +1 -1
  248. package/dist/session-timeline/turn-time.js +1 -1
  249. package/dist/session-timeline/turns.js +1 -1
  250. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  251. package/dist/session-timeline/user-message.js +1 -1
  252. package/dist/types.d.ts +1 -0
  253. package/dist/ui/alert.js +1 -1
  254. package/dist/ui/badge.js +1 -1
  255. package/dist/ui/card.js +1 -1
  256. package/dist/ui/checkbox.js +1 -1
  257. package/dist/ui/dialog.js +1 -1
  258. package/dist/ui/dropdown-menu.js +1 -1
  259. package/dist/ui/empty.js +1 -1
  260. package/dist/ui/field.js +1 -1
  261. package/dist/ui/hover-card.js +1 -1
  262. package/dist/ui/input-group-textarea.js +1 -1
  263. package/dist/ui/input-group.js +1 -1
  264. package/dist/ui/kbd.js +1 -1
  265. package/dist/ui/label.js +1 -1
  266. package/dist/ui/radio-group.js +1 -1
  267. package/dist/ui/select.js +1 -1
  268. package/dist/ui/separator.js +1 -1
  269. package/dist/ui/skeleton.js +1 -1
  270. package/dist/ui/spinner.js +1 -1
  271. package/dist/ui/switch.js +1 -1
  272. package/dist/ui/textarea.js +1 -1
  273. package/dist/ui/tooltip.js +1 -1
  274. package/package.json +5 -5
  275. package/dist/chunk-1jzxmw98.js +0 -2
  276. package/dist/chunk-1wxebrbt.js +0 -2
  277. package/dist/chunk-1xg1qw4g.js +0 -4
  278. package/dist/chunk-3g8ck68k.js +0 -2
  279. package/dist/chunk-3xnbypjz.js +0 -2
  280. package/dist/chunk-4ecdn9z1.js +0 -2
  281. package/dist/chunk-60ks28ef.js +0 -2
  282. package/dist/chunk-62x983rq.js +0 -2
  283. package/dist/chunk-6f2h379x.js +0 -2
  284. package/dist/chunk-6xp64b2e.js +0 -2
  285. package/dist/chunk-78x93ef2.js +0 -2
  286. package/dist/chunk-7e1m1d9x.js +0 -2
  287. package/dist/chunk-8dtaq4eh.js +0 -2
  288. package/dist/chunk-9h86hvc3.js +0 -2
  289. package/dist/chunk-9tgtskz4.js +0 -2
  290. package/dist/chunk-a7nqzhxj.js +0 -2
  291. package/dist/chunk-aafg3jqm.js +0 -3
  292. package/dist/chunk-b8ywzj88.js +0 -2
  293. package/dist/chunk-b9ew8dwr.js +0 -2
  294. package/dist/chunk-cc6vp2sg.js +0 -2
  295. package/dist/chunk-fb6vxbmc.js +0 -2
  296. package/dist/chunk-fcyzhbmn.js +0 -2
  297. package/dist/chunk-fw3emcqw.js +0 -2
  298. package/dist/chunk-h7ks1p6h.js +0 -2
  299. package/dist/chunk-j4cm74nv.js +0 -4
  300. package/dist/chunk-jegkf64h.js +0 -2
  301. package/dist/chunk-jjtgsnj0.js +0 -2
  302. package/dist/chunk-jnrcqphc.js +0 -2
  303. package/dist/chunk-jyy20tw1.js +0 -2
  304. package/dist/chunk-k7wta28t.js +0 -2
  305. package/dist/chunk-kathd6f3.js +0 -2
  306. package/dist/chunk-ksmcznp2.js +0 -3
  307. package/dist/chunk-m2ab6p4w.js +0 -2
  308. package/dist/chunk-n89jvr5q.js +0 -2
  309. package/dist/chunk-nvya2g1d.js +0 -2
  310. package/dist/chunk-rqnvygqy.js +0 -7
  311. package/dist/chunk-rw9bsnyp.js +0 -2
  312. package/dist/chunk-s1z1418w.js +0 -2
  313. package/dist/chunk-sgy6b5me.js +0 -2
  314. package/dist/chunk-sk14wfkj.js +0 -2
  315. package/dist/chunk-vmcxp5e2.js +0 -2
  316. package/dist/chunk-wzjq9j6g.js +0 -3
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-6kn920c5.js";import{H,O,N}from"./chunk-wqrn3428.js";import{f}from"./chunk-94r5frad.js";import{useState as w}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function ko({value:r,currentName:o,icon:p,options:i,label:s,header:a,onValueChange:d,showLabel:l=!1,disabled:u=!1,warning:m=!1}){let[c,g]=w(!1);return t(H,{open:c,onOpenChange:g,children:[n(O,{render:t(e,{disabled:u,"data-permission-warning":m?"":void 0,variant:"ghost","aria-label":`${s}: ${o}`,title:o,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[p,n("span",{className:l?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:o})]})}),t(N,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&n("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:n("span",{children:a})}),n(f,{value:r,onValueChange:d,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}
2
- export{ko};
1
+ import{e}from"./chunk-6kn920c5.js";import{H,O,N}from"./chunk-zw3h5xgf.js";import{h}from"./chunk-1k03fpcj.js";import{useState as f}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function zo({value:r,currentName:o,icon:p,options:i,label:s,header:a,onValueChange:d,showLabel:l=!1,disabled:u=!1,warning:m=!1}){let[c,g]=f(!1);return t(H,{open:c,onOpenChange:g,children:[n(O,{render:t(e,{disabled:u,"data-permission-warning":m?"":void 0,variant:"ghost","aria-label":`${s}: ${o}`,title:o,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[p,n("span",{className:l?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:o})]})}),t(N,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&n("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:n("span",{children:a})}),n(h,{value:r,onValueChange:d,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}
2
+ export{zo};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-f3e3ged2.js";import{Ae,Le,De}from"./chunk-b65vdzz3.js";import{n}from"./chunk-9hvbm4be.js";import{x,ne}from"./chunk-3q6ssrs3.js";import{hasAccount as M,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{useEffect as W,useState as T}from"react";import{jsx as r,jsxs as u}from"react/jsx-runtime";var m=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),F=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),z=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function O(a,t){let e=Math.min(100,a/t*100),p=e>=90?"text-destructive":e>=70?"text-foreground":"text-muted-foreground";return{pct:e,className:p}}function A(a){let t=x(a.configOptions,"model");return t===void 0?void 0:ne(t)}function Fo(a,t){let e=a.windowDurationMins;if(e===null)return t("usage.usage");if(e%1440===0)return t("usage.windowDays",{count:e/1440});return t("usage.windowHours",{count:Math.round(e/60)})}function I(a){let{client:t}=n(),e=o((s)=>a&&s.connection==="ready"&&M(s.agent)),[p,l]=T(null);return W(()=>{if(!e){l(null);return}let s=!0;t.readRateLimits().then((d)=>{if(s)l(d)},()=>{return});let c=t.onRateLimits((d)=>{if(s)l(d)});return()=>{s=!1,c()}},[e,t]),e?p:null}function dt({session:a}){let{t}=n().host,e=x(a.configOptions,"model"),p=e!==void 0&&(L(e.options)?e.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===e.currentValue)):!e.currentValue.startsWith("gateway:")&&e.options.some((i)=>i.value===e.currentValue)),l=I(p),{usage:s,lastTurnUsage:c}=a;if(s===null&&c===null)return null;let d=s&&s.size>0?O(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(c?.inputTokens),k=f(c?.outputTokens),g=f(c?.cachedReadTokens),w=f(c?.cachedWriteTokens),S=f(c?.totalTokens)||N+k+g+w,R=N+g,C=R>0?F.format(g/R):t("tokens.notAvailable"),D=[[t("tokens.input"),m.format(N)],[t("tokens.output"),m.format(k)],[t("tokens.cachedRead"),m.format(g)],[t("tokens.cachedWrite"),m.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),m.format(S)]],v=A(a);return u(Ae,{children:[r(Le,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",d?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),d!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-d.pct/100),transform:"rotate(-90 9 9)"})]}),d!==null&&u("span",{children:[Math.round(d.pct),"%"]})]})}),u(De,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[c!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:D.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:m.format(s.used),limit:m.format(s.size),percent:z.format(s.used/s.size*100)})})]}),l!==null&&(l.primary!==null||l.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[l.primary,l.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Fo(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}
2
+ export{Fo,dt};
@@ -1,3 +1,3 @@
1
- import{a}from"./chunk-46gb51y9.js";import{ChevronDownIcon as v,ChevronUpIcon as b,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as n}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
- `).length}function Or(e){let l=new Map;for(let u of e)for(let d of u.content){if(d.type!=="diff")continue;let f=d,r=f._meta?.alwith?.hunks??[],h=r.reduce((o,i)=>o+x(i.newText),0),c=r.reduce((o,i)=>o+x(i.oldText),0);for(let o of f.changes){let i=l.get(o.path);if(i)i.additions+=h,i.deletions+=c;else l.set(o.path,{path:o.path,additions:h,deletions:c})}}return[...l.values()]}function go({blocks:e}){return s(Bt,{files:Or(e)})}function Bt({files:e,onOpen:l,renderPath:u}){let{t:d,openLink:f}=a(),[r,h]=m(!0),[c,o]=m(!1);if(e.length===0)return null;let i=e.reduce((t,p)=>t+p.additions,0),g=e.reduce((t,p)=>t+p.deletions,0);return n("section",{className:"codex-edited-files-card",children:[n("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(C,{})}),n("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),o(!1)},"aria-expanded":r,children:d(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),n("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[n("span",{className:"codex-diff-additions",children:["+",i]}),n("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&n("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((t)=>n("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>l===void 0?f(t.path):l(t),children:u===void 0?t.path:u(t)}),n("span",{className:"codex-edited-file-counts",children:[n("span",{className:"codex-diff-additions",children:["+",t.additions]}),n("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&n("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>o((t)=>!t),children:[d(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?s(b,{size:16,"aria-hidden":"true"}):s(v,{size:16,"aria-hidden":"true"})]})]})]})}
3
- export{Or,go,Bt};
1
+ import{a}from"./chunk-y6r6tzfh.js";import{ChevronDownIcon as v,ChevronUpIcon as b,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as n}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
+ `).length}function Fr(e){let l=new Map;for(let u of e)for(let d of u.content){if(d.type!=="diff")continue;let f=d,r=f._meta?.alwith?.hunks??[],h=r.reduce((o,i)=>o+x(i.newText),0),c=r.reduce((o,i)=>o+x(i.oldText),0);for(let o of f.changes){let i=l.get(o.path);if(i)i.additions+=h,i.deletions+=c;else l.set(o.path,{path:o.path,additions:h,deletions:c})}}return[...l.values()]}function po({blocks:e}){return s($t,{files:Fr(e)})}function $t({files:e,onOpen:l,renderPath:u}){let{t:d,openLink:f}=a(),[r,h]=m(!0),[c,o]=m(!1);if(e.length===0)return null;let i=e.reduce((t,p)=>t+p.additions,0),g=e.reduce((t,p)=>t+p.deletions,0);return n("section",{className:"codex-edited-files-card",children:[n("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(C,{})}),n("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),o(!1)},"aria-expanded":r,children:d(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),n("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[n("span",{className:"codex-diff-additions",children:["+",i]}),n("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&n("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((t)=>n("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>l===void 0?f(t.path):l(t),children:u===void 0?t.path:u(t)}),n("span",{className:"codex-edited-file-counts",children:[n("span",{className:"codex-diff-additions",children:["+",t.additions]}),n("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&n("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>o((t)=>!t),children:[d(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?s(b,{size:16,"aria-hidden":"true"}):s(v,{size:16,"aria-hidden":"true"})]})]})]})}
3
+ export{Fr,po,$t};
@@ -1 +1 @@
1
- import{e}from"./chunk-6kn920c5.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as g}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function d({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function yi({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o})}function $r({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o})}function Yo({...o}){return a(i.Close,{"data-slot":"dialog-close",...o})}function qr({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t})}function u({className:o,children:t,showCloseButton:n=!0,...s}){return l($r,{children:[a(qr,{}),l(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...s,children:[t,n&&l(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[a(g,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function w({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t})}function Q({className:o,showCloseButton:t=!1,children:n,...s}){return l("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...s,children:[n,t&&a(i.Close,{render:a(e,{variant:"outline"}),children:"Close"})]})}function m({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t})}function k({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t})}export{d,yi,$r,Yo,qr,u,w,Q,m,k};
1
+ import{e}from"./chunk-6kn920c5.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as g}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function d({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function Mi({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o})}function qr({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o})}function ir({...o}){return a(i.Close,{"data-slot":"dialog-close",...o})}function Vr({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t})}function u({className:o,children:t,showCloseButton:n=!0,...s}){return l(qr,{children:[a(Vr,{}),l(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...s,children:[t,n&&l(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[a(g,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function b({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t})}function X({className:o,showCloseButton:t=!1,children:n,...s}){return l("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...s,children:[n,t&&a(i.Close,{render:a(e,{variant:"outline"}),children:"Close"})]})}function m({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t})}function w({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t})}export{d,Mi,qr,ir,Vr,u,b,X,m,w};
@@ -1 +1 @@
1
- import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsx as e}from"react/jsx-runtime";function ze({className:i,size:t="default",...r}){return e(a.Root,{"data-slot":"switch","data-size":t,className:d("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",i),...r,children:e(a.Thumb,{"data-slot":"switch-thumb",className:"bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"})})}export{ze};
1
+ import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsx as e}from"react/jsx-runtime";function $e({className:i,size:t="default",...r}){return e(a.Root,{"data-slot":"switch","data-size":t,className:d("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",i),...r,children:e(a.Thumb,{"data-slot":"switch-thumb",className:"bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"})})}export{$e};
@@ -1 +1 @@
1
- import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as i}from"react/jsx-runtime";function K({className:r,...a}){return i(d,{"data-slot":"radio-group",className:o("grid w-full gap-3",r),...a})}function E({className:r,...a}){return i(e.Root,{"data-slot":"radio-group-item",className:o("group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:i(e.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:i("span",{className:"bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"})})})}export{K,E};
1
+ import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as i}from"react/jsx-runtime";function j({className:r,...a}){return i(d,{"data-slot":"radio-group",className:o("grid w-full gap-3",r),...a})}function P({className:r,...a}){return i(e.Root,{"data-slot":"radio-group-item",className:o("group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:i(e.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:i("span",{className:"bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"})})})}export{j,P};
@@ -1 +1 @@
1
- import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function he({className:e,...t}){return a("div",{"data-slot":"empty",className:n("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",e),...t})}function ve({className:e,...t}){return a("div",{"data-slot":"empty-header",className:n("flex max-w-sm flex-col items-center gap-2",e),...t})}var i=o("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function Ii({className:e,variant:t="default",...r}){return a("div",{"data-slot":"empty-icon","data-variant":t,className:n(i({variant:t,className:e})),...r})}function xe({className:e,...t}){return a("div",{"data-slot":"empty-title",className:n("font-heading text-lg font-medium tracking-tight",e),...t})}function ye({className:e,...t}){return a("div",{"data-slot":"empty-description",className:n("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function Pi({className:e,...t}){return a("div",{"data-slot":"empty-content",className:n("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}export{he,ve,Ii,xe,ye,Pi};
1
+ import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function ge({className:e,...t}){return a("div",{"data-slot":"empty",className:n("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",e),...t})}function fe({className:e,...t}){return a("div",{"data-slot":"empty-header",className:n("flex max-w-sm flex-col items-center gap-2",e),...t})}var i=o("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function fi({className:e,variant:t="default",...r}){return a("div",{"data-slot":"empty-icon","data-variant":t,className:n(i({variant:t,className:e})),...r})}function he({className:e,...t}){return a("div",{"data-slot":"empty-title",className:n("font-heading text-lg font-medium tracking-tight",e),...t})}function ve({className:e,...t}){return a("div",{"data-slot":"empty-description",className:n("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function hi({className:e,...t}){return a("div",{"data-slot":"empty-content",className:n("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}export{ge,fe,fi,he,ve,hi};
@@ -0,0 +1,2 @@
1
+ var et="chrome-hover hover:bg-foreground/8 data-[active=true]:bg-foreground/5",Y="chrome-hover hover:bg-foreground/8 data-active:bg-foreground/5";
2
+ export{et,Y};
@@ -0,0 +1,2 @@
1
+ import{Uo}from"./chunk-76w1a72z.js";import{o}from"./chunk-f3e3ged2.js";import{n,C}from"./chunk-9hvbm4be.js";import{E,x,ne}from"./chunk-3q6ssrs3.js";import{isBooleanOption as q,isGroupedSelect as A,isSelectOption as Z}from"@nyssance/codex-acp-v2/client";import{Zap as D}from"lucide-react";import{useRef as F}from"react";import{jsx as w}from"react/jsx-runtime";function gt({sessionId:l,options:u,disabled:B,onModelChange:h,onConfigChange:b,defaultGroup:G={id:"models",name:"Models"},catalog:I=(c)=>c,headerAction:L}){let{host:c,client:N}=n(),{t:i}=c,P=o((e)=>Boolean(e.configPending[l])),p=F({sessionId:l,model:!0}),O=P&&(p.current.sessionId!==l||p.current.model),k=o((e)=>{let r=e.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=x(u,"model"),a=x(u,"thought_level"),_=u.filter((e)=>e.configId!=="collaboration_mode"&&(e.category==="model_config"||e.category!=="mode"&&e!==t&&e!==a)),v=_.filter(Z),f=_.filter(q);if(!t&&!a&&v.length===0&&f.length===0)return null;let m=(e,r)=>{if(r===e.currentValue)return Promise.resolve();p.current={sessionId:l,model:e===t};let d=b?b(e.configId,r):N.setConfig(l,e.configId,r);return C(c,d),d},g=a?E(a):[],z=g.reduce((e,r)=>r.name.length>=e.length?r.name:e,""),R=t?ne(t):i("composer.model"),S=(e)=>({api_id:e.value,label:e.name}),V=I(t&&A(t.options)?t.options.map((e)=>({id:e.groupId,name:e.name,models:e.options.map(S)})):[{...G,models:t?E(t).map(S):[]}]),y=V.flatMap((e)=>e.models),M=y.find((e)=>e.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:R},s=f.find((e)=>e.configId==="fast_mode"||e.configId==="fast-mode");return w(Uo,{disabled:B||O||k,switching:O,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:y,showModelList:Boolean(t),onChange:(e)=>{if(e.api_id===t?.currentValue)return;if(h)h(e.api_id);else if(t)m(t,e.api_id)},header:{name:t?.name??i("composer.model"),action:L},modelGroups:V,t:i,effortConfig:a&&g.length>0?{name:"Effort",value:a.currentValue,levels:g,sizer:z,onChange:(e)=>m(a,e)}:void 0,selectOptions:v.map((e)=>({id:e.configId,name:e.name,value:e.currentValue,options:E(e).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>m(e,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:w(D,{className:"size-4","aria-hidden":"true"})},...f.filter((e)=>e!==s).map((e)=>({id:e.configId,name:e.name,currentValue:e.currentValue}))],onBooleanChange:(e,r)=>{let d=e==="fast_mode"?s:f.find((U)=>U.configId===e);if(!d)throw Error(`Unknown boolean config: ${e}`);m(d,r)}})}
2
+ export{gt};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-6kn920c5.js";import{d,u,b,X,m,w}from"./chunk-a2hygrpr.js";import{J}from"./chunk-ht28382s.js";import{createContext as g,useContext as C,useState as y,useSyncExternalStore as L}from"react";import{jsx as i,jsxs as S}from"react/jsx-runtime";var v=g(null),f=g(null),x=g(null);function gr({host:t,client:o,children:n}){let[l,a]=y(null);J(l!==null);let{t:c}=t;return i(v,{value:t,children:i(f,{value:o,children:S(x,{value:a,children:[n,i(d,{open:l!==null,onOpenChange:(D)=>!D&&a(null),children:S(u,{children:[S(b,{children:[i(m,{children:c("sessionList.deleteTitle")}),i(w,{children:c("sessionList.deleteDescription")})]}),S(X,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:c("sessionList.cancel")}),i(e,{onClick:()=>{if(l)T(t,o.delete(l.sessionId));a(null)},children:c("sessionList.delete")})]})]})})]})})})}function p(){let t=C(v);if(t===null)throw Error("Session list host is missing");return t}function s(){let t=C(f);if(t===null)throw Error("Session list client is missing");return t}function tt(){let t=C(x);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=s();return L((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function T(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
2
+ export{gr,p,s,tt,r,T};
@@ -0,0 +1,2 @@
1
+ import{Hn}from"./chunk-s2k5xynq.js";import{e}from"./chunk-6kn920c5.js";import{re,t,ie,o,Ve}from"./chunk-f3e3ged2.js";import{vo,Ee,Wt,bo,wo}from"./chunk-753s76b6.js";import{Re}from"./chunk-c0ac9k7h.js";import{ao}from"./chunk-nad1erxy.js";import{ro}from"./chunk-tm4ee7m3.js";import{jn,Kn}from"./chunk-qg1b5k6m.js";import{$n,qn}from"./chunk-m6h92nq4.js";import{Un}from"./chunk-tjpr0adf.js";import{io}from"./chunk-kw487283.js";import{Vn}from"./chunk-1dh0q11h.js";import{codexExtensionCapabilities as ze,codexMessageError as Be,codexRetryNotice as qe,codexTurnError as Oe,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Fe}from"lucide-react";import{useCallback as V,useEffect as A,useLayoutEffect as ve,useMemo as Q,useRef as b,useState as _}from"react";import{flushSync as Te}from"react-dom";import{jsx as l,jsxs as L}from"react/jsx-runtime";var ye=24;function Ke(n){let m=Math.max(0,n.turnTopPx-ye),v=Math.max(0,n.scrollHeightPx-n.viewportHeightPx),c=m-v;return{scrollTopPx:m,spacerPx:c>0?n.spacerPx+c:n.spacerPx}}function Ue({viewportRef:n,viewportProps:m,children:v}){return l("div",{ref:n,...m,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:v})}function _e({sessionId:n,turnId:m,root:v,error:c,connected:S}){let C=b(null),w=ie(),{t:N}=t(),R=V(()=>{w.loadHistoryTurn(n,m).catch(()=>{})},[w,n,m]);return A(()=>{if(!v||!C.current||!S||c)return;let B=new IntersectionObserver((T)=>{if(T.some((P)=>P.isIntersecting))B.disconnect(),R()},{root:v,rootMargin:"800px 0px"});return B.observe(C.current),()=>B.disconnect()},[v,S,c,R]),l("div",{ref:C,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":m,"data-markdown-pending":!0,children:c?L("div",{className:"flex flex-col items-center gap-2",children:[l("p",{role:"alert",className:"text-destructive text-xs",children:c}),l(e,{variant:"outline",size:"sm",onClick:R,disabled:!S,children:N("timeline.navigationRetry")})]}):L("div",{role:"status","aria-label":N("timeline.navigationLoading"),className:"space-y-3",children:[l("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),l("div",{className:"bg-muted h-3 w-4/5 rounded"}),l("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function $e(n,m){let v=b([]),c=b(null);if(c.current?.items!==n.items||c.current.state!==n.state||c.current.ended!==n.turnEndedAt||c.current.usage!==n.turnUsage||c.current.historyOrder!==m)c.current={state:n.state,items:n.items,ended:n.turnEndedAt,usage:n.turnUsage,historyOrder:m,turns:vo(n,v.current,m)};let S=c.current.turns;return v.current=S,S}function _n(n){return l(re,{host:n.host,client:n.client,children:l(De,{...n})})}function De({session:n,leading:m,afterTurn:v,answerActions:c,turnFooter:S,renderUserMessage:C,insert:w,navigation:N,anchorNewTurn:R=!1,Viewport:B=Ue}){let T=ie(),P=t(),y=o((r)=>r.historyNavigation[n.id]),d=$e(n,y?.turns),M=d.at(-1)?.key,xe=bo(n,d),x=n.state!=="idle",D=Q(()=>ro(d,y),[d,y]),Y=Q(()=>D.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[D]),he=Q(()=>N===void 0?[]:jn(d,n.turnUsage,y),[N,d,n.turnUsage,y]),Z=w&&w.afterItemId!==null?d.findIndex((r)=>r.items.some((u)=>u.id===w.afterItemId)):-1,j=b(d);j.current=d;let[a,be]=_(null),h=o((r)=>r.historyPages[n.id]),I=o((r)=>r.connection==="ready"),we=o((r)=>ze(r.agent).sessionRetry),ee=h!==void 0;A(()=>{if(I&&ee&&!n.restoring)T.loadHistoryNavigation(n.id).catch(()=>{})},[T,I,ee,n.id,n.restoring]);let[Se,Pe]=_(!1),F=b(null),[Ie,te]=_(!1),ne=b(0),W=b({key:M,running:x});W.current={key:M,running:x};let[oe,K]=_(0),k=b(0),E=b(null);k.current=oe;let He=V(()=>{if(E.current!==null)E.current.keepTop=!1},[]),{isFollowing:z,scrollToBottom:X,stopFollowing:q,schedulePin:le,contentResized:ae,beginLocate:ue,cancelLocation:se}=io(a,x,He),ce=V(()=>{if(a===null||!x)return;let r=d.at(-1)?.key;if(r===void 0)return;let u=ue(!0),s=()=>u.isCurrent()&&W.current.running&&W.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!s())return;let g=a.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(g===null)return;let f=a.scrollTop+g.getBoundingClientRect().top-a.getBoundingClientRect().top,H=Ke({turnTopPx:f,scrollHeightPx:a.scrollHeight,viewportHeightPx:a.clientHeight,spacerPx:k.current});E.current=H.spacerPx>0?{element:g,heightPx:g.getBoundingClientRect().height+H.spacerPx,keepTop:!0}:null,Te(()=>K(H.spacerPx)),requestAnimationFrame(()=>{if(s())u.finish(H.scrollTopPx)})})),p=F.current;if(p===null)return;p.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(s())i()})},[ue,x,a,d]);ve(()=>{if(!R||x)return;se(),E.current=null,k.current=0,K(0)},[R,se,x]);let G=V(()=>{q(),T.loadOlderHistory(n.id).catch(()=>{})},[T,n.id,q]);A(()=>{if(a===null)return;let r=()=>{let u=a.scrollTop<600;if(Pe(u),u&&!y?.complete&&I&&!n.restoring&&!z&&h?.cursor&&!h.loading&&!h.error)G()};return r(),a.addEventListener("scroll",r,{passive:!0}),()=>a.removeEventListener("scroll",r)},[I,h,z,G,a,n.restoring,y?.complete]),A(()=>{$n({sessionId:n.id,turns:Y,api:F.current,beforeReveal:q,terminals:n.terminals})},[n.id,n.terminals,Y,q]),A(()=>()=>qn(n.id),[n.id]);let Ne=V(async(r,u)=>{let s=++ne.current;te(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await T.loadHistoryTurn(n.id,r.nativeTurnId),await new Promise((f)=>requestAnimationFrame(()=>f()));if(!u())return null;let i=j.current.find((f)=>f.user?.id===(r.messageId??r.id))??j.current.find((f)=>f.user!==null&&r.nativeTurnId!==void 0&&f.items.some((H)=>ge(H)===r.nativeTurnId));if(!i?.user)return null;let p=i.user.id,g=F.current;if(g===null)throw Error("Virtual timeline is not mounted");return await g.scrollToKey(i.key,(f)=>f.querySelector(`[data-content-search-unit-key="${CSS.escape(p)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(p)}"]`)}finally{if(ne.current===s)te(!1)}},[T,n.id]),ke=V(async(r)=>{if(r.nativeTurnId!==void 0)await T.previewHistoryTurn(n.id,r.nativeTurnId)},[T,n.id]);A(()=>{if(a===null)return;let r=a.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let u=new ResizeObserver(()=>{let s=E.current,i=null;if(s!==null){let p=Math.max(0,s.heightPx-s.element.getBoundingClientRect().height);if(p!==k.current&&(p<k.current||s.keepTop)){if(k.current=p,Te(()=>K(p)),p===0)E.current=null}if(p>0&&s.keepTop)i=a.scrollTop+s.element.getBoundingClientRect().top-a.getBoundingClientRect().top-ye}ae(i)});if(u.observe(r),u.observe(a),M!==void 0){let s=a.querySelector(`[data-codex-turn="${CSS.escape(M)}"]`);if(s===null)throw Error("Latest turn is not mounted");u.observe(s)}return()=>u.disconnect()},[ae,M,a]),A(()=>{if(n.items.length===0)return;le()},[le,n.items]);let de=b(null);ve(()=>{if(a===null)return;let r=d.at(-1),u=de.current;if(de.current=r===void 0?null:{key:r.key,running:x},r===void 0||u===null||r.user===null||r.replayed)return;if(R){if(x&&n.turnEndedAt[r.user.id]===void 0&&(r.key!==u.key||!u.running))E.current=null,k.current=0,K(0),ce()}else if(r.key!==u.key)X()},[ce,R,x,X,a,n.turnEndedAt,d]);let Ae=(r,u)=>{let s=r,i=s.turn;if(i===void 0){if(s.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return l(_e,{sessionId:n.id,turnId:s.nativeTurnId,root:a,error:y?.turnErrors[s.nativeTurnId],connected:I&&!z&&!Ie})}let p=d.indexOf(i),g=i.key===xe,f=wo(n,d,p),H=!g&&f.continued,U=i.key===M,O=i.errors.at(-1),me=O===void 0?null:Be(O),J=O===void 0?null:ge(O),Le=U&&!g&&I&&we&&n.attached&&!n.readOnly&&!n.restoring&&O===n.items.at(-1)&&me!==null&&Oe(me).category==="overloaded"&&J!==null&&n.lastStopReason!=="end_turn"&&n.lastStopReason!=="cancelled",fe=S?.(i)??null,Ce=i.work.length>0||i.final.length>0||i.errors.length>0||g||fe!==null||Ee(i)||Wt(i)||U&&(n.error!==null||n.lastStopReason==="cancelled"),pe=i.user===null?null:Re(i);return L("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(C===void 0?l(Vn,{item:i.user,messageTime:pe}):C(i.user,pe)),Ce&&l(ao,{sessionId:n.id,turn:i,terminals:n.terminals,active:g,blocked:n.state==="requires_action",continued:H,edits:f.edits,activityItems:f.items,workStartedAt:f.startedAt,isLast:U,error:n.error,retrying:g?qe(n._meta)??void 0:void 0,retry:Le?{turnId:J,delaySeconds:Un(d),run:(Me)=>T.retrySession(n.id,J,Me)}:void 0,interrupted:Wt(i)||!g&&U&&n.lastStopReason==="cancelled",answerActions:c?.(i),footer:fe}),u===Z&&w?.node,v?.(i)]})};return L("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[l(B,{viewportRef:be,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":P.t("timeline.label")},children:l("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:L("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[w&&Z===-1&&w.node,l(Hn,{ref:F,entries:D,renderTurn:Ae,scrollElement:a,sessionKey:n.id,preserveViewport:!z,leadingInsetPx:12,leadingContent:m===void 0?void 0:l("div",{className:"pt-3",children:m})}),R&&l("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:oe}}),l("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),l("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),y?.error&&l("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:l(e,{variant:"outline",size:"sm",disabled:!I,title:y.error,onClick:()=>{T.loadHistoryNavigation(n.id).catch(()=>{})},children:P.t("timeline.navigationRetry")})}),Se&&h?.cursor&&!y?.complete&&L("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[l(e,{variant:"outline",size:"sm",disabled:!I||n.restoring||h.loading,onClick:G,children:h.loading?P.t("timeline.loadingEarlier"):P.t("timeline.loadEarlier")}),h.error&&l("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:h.error})]}),N!==void 0&&l(Kn,{items:he,audio:N.audio,scrollRoot:a,beforeReveal:q,ensureItemMounted:Ne,onPreviewItem:ke,onRevealError:(r)=>Ve(P,r),targetTopMarginPx:16},n.id),l("button",{type:"button",className:z?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:z?-1:void 0,onClick:X,"aria-label":P.t("timeline.scrollToBottom"),children:x?L("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[l("span",{className:"codex-wave-dot"}),l("span",{className:"codex-wave-dot"}),l("span",{className:"codex-wave-dot"})]}):l(Fe,{})})]})}
2
+ export{_n};
@@ -1 +1 @@
1
- import{PreviewCard as i}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsx as r}from"react/jsx-runtime";function $e({...e}){return r(i.Root,{"data-slot":"hover-card",...e})}function qe({...e}){return r(i.Trigger,{"data-slot":"hover-card-trigger",...e})}function Ve({className:e,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(i.Portal,{"data-slot":"hover-card-portal",children:r(i.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(i.Popup,{"data-slot":"hover-card-content",className:s("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 origin-(--transform-origin) rounded-lg p-4 text-sm shadow-md ring-1 outline-hidden duration-100",e),...n})})})}export{$e,qe,Ve};
1
+ import{PreviewCard as i}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsx as r}from"react/jsx-runtime";function Ae({...e}){return r(i.Root,{"data-slot":"hover-card",...e})}function Le({...e}){return r(i.Trigger,{"data-slot":"hover-card-trigger",...e})}function De({className:e,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(i.Portal,{"data-slot":"hover-card-portal",children:r(i.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(i.Popup,{"data-slot":"hover-card-content",className:s("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 origin-(--transform-origin) rounded-lg p-4 text-sm shadow-md ring-1 outline-hidden duration-100",e),...n})})})}export{Ae,Le,De};
@@ -1,2 +1,2 @@
1
- import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Qt({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
- export{Qt};
1
+ import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function It({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
+ export{It};
@@ -1,2 +1,2 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function wo({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
- export{wo};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function Yn({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
+ export{Yn};
@@ -1,2 +1,2 @@
1
- import{mo}from"./chunk-2ymhbrf9.js";function so(t,o){if(mo(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
- export{so};
1
+ import{uo}from"./chunk-sn80gr8g.js";function co(t,o){if(uo(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
+ export{co};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-6kn920c5.js";import{ue}from"./chunk-1drkvxzk.js";import{d,u,b,X,m,w}from"./chunk-a2hygrpr.js";import{f}from"./chunk-ek06eyp4.js";import{At,Lt,En,An,Ln,at}from"./chunk-8jpm8fnf.js";import{l}from"./chunk-1hy64ewz.js";import{j,P}from"./chunk-ana59z25.js";import{$e}from"./chunk-ak0k5vg6.js";import{k}from"./chunk-ncekagm6.js";import{isArrayProperty as S,isBooleanProperty as A,isNumberProperty as C,isStringProperty as E}from"@nyssance/codex-acp-v2/client";import{useEffect as N,useMemo as V,useState as R}from"react";import{jsx as o,jsxs as p}from"react/jsx-runtime";function q(r){if(!E(r))return null;if(r.oneOf&&r.oneOf.length>0)return r.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(r.enum&&r.enum.length>0)return r.enum.map((t)=>({value:t,label:t}));return null}function L(r){let t=r,n=t._meta?.alwith?.options;if(Array.isArray(n)&&Array.isArray(t.enum))return n.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((i)=>({value:String(i),label:String(i)}));if(Array.isArray(t.oneOf))return t.oneOf.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));return null}function Nr(r){let t=new Set(r.required??[]);return Object.entries(r.properties??{}).map(([n,i])=>({key:n,property:i,title:i.title??n,description:i.description??null,required:t.has(n),options:q(i),multiOptions:S(i)?L(i.items):null}))}function hr(r){let t={};for(let n of r){let i=n.property.default;if(i!==void 0&&i!==null)t[n.key]=i;else if(n.options)t[n.key]=n.options[0].value;else if(A(n.property))t[n.key]=!1;else if(S(n.property))t[n.key]=[]}return t}function Mr(r,t){if(r.multiOptions)return Array.isArray(t)&&t.length>0;if(!r.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function D({id:r,label:t,description:n,control:i}){return p("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[i,p(f,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[o("div",{className:"text-foreground text-sm",children:t}),n&&o("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function G({id:r,field:t,value:n,onChange:i}){if(t.multiOptions){let a=new Set(Array.isArray(n)?n:[]);return p(At,{children:[o(Lt,{variant:"label",children:t.title}),t.description&&o(at,{children:t.description}),o("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((c)=>{let g=`${r}:${c.value}`;return o(D,{id:g,...c,control:o(ue,{id:g,checked:a.has(c.value),onCheckedChange:(F)=>{let y=new Set(a);if(F)y.add(c.value);else y.delete(c.value);i([...y])}})},c.value)})})]})}if(t.options)return p(At,{children:[o(Lt,{variant:"label",children:t.title}),t.description&&o(at,{children:t.description}),o(j,{value:typeof n==="string"?n:"",onValueChange:(a)=>i(String(a)),className:"flex flex-col gap-1",children:t.options.map((a)=>{let c=`${r}:${a.value}`;return o(D,{id:c,...a,control:o(P,{value:a.value,id:c})},a.value)})})]});return p(An,{children:[o(Ln,{htmlFor:r,children:t.title}),A(t.property)?o($e,{id:r,checked:n===!0,onCheckedChange:(a)=>i(a)}):C(t.property)?o(l,{id:r,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(a)=>i(a.target.value===""?void 0:Number(a.target.value))}):o(k,{id:r,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(a)=>i(a.target.value)}),t.description&&o(at,{children:t.description})]})}function kn({requestId:r,schema:t,message:n,total:i,t:a,onRespond:c}){let g=V(()=>Nr(t),[t]),[F,y]=R(()=>hr(g));N(()=>y(hr(g)),[r,g]);let x=g.every((s)=>Mr(s,F[s.key])),O=()=>{if(!x)return;let s={};for(let[h,v]of Object.entries(F))if(v!==void 0)s[h]=v;c({action:"accept",content:s})};return o(d,{open:!0,onOpenChange:(s)=>!s&&c({action:"cancel"}),children:p(u,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(s)=>{if(s.key==="Enter"&&(s.metaKey||s.ctrlKey))s.preventDefault(),O()},children:[p(b,{children:[p("div",{className:"flex items-center justify-between gap-2 pe-8",children:[o(m,{children:t.title??a("approval.needed")}),i>1&&o("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),o(w,{children:n})]}),o("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o(En,{children:g.map((s)=>o(G,{id:`${r}:${s.key}`,field:s,value:F[s.key],onChange:(h)=>y((v)=>({...v,[s.key]:h}))},s.key))})}),p(X,{children:[o(e,{variant:"ghost",onClick:()=>c({action:"decline"}),children:a("actions.decline")}),o(e,{disabled:!x,onClick:O,children:a("actions.submit")})]})]})})}
2
+ export{Nr,hr,Mr,kn};
@@ -0,0 +1,3 @@
1
+ import{a,v}from"./chunk-y6r6tzfh.js";import{S}from"./chunk-sn80gr8g.js";import{co}from"./chunk-bftrddmr.js";import{G}from"./chunk-w45d5th9.js";import{so,Me}from"./chunk-hh498geh.js";import{po}from"./chunk-a1kmc6t8.js";import{qt}from"./chunk-8a1j96d1.js";import{cn as M}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var R=new WeakMap,w=1;function N(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=R.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return R.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(v,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(v,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(G,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var E=new Set;function mi({message:t,isMostRecentTurn:n,hiddenTools:s=E,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:T,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(A,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
+ `),b=!t.streaming&&C.trim().length>0?o(Ft,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=co(t.content,"compact"),x=l.reduce((e,c,p)=>c.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,c)=>c>x&&e.kind==="block"&&e.block.type==="text"),B=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&S(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let c=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return c.length===0?null:o(Me,{blocks:c},`activity:${N(c[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===B?b:void 0,renderText:T},N(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Bt,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(po,{blocks:f}):y(f))})}function Ft({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=a(),{t:u}=d;return g("div",{className:M("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(qt,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function A({label:t}){let{t:n}=a();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Bt({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(A,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(so,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
+ export{mi,Ft,Bt};
@@ -1,2 +1,2 @@
1
- var a=(e)=>String(e).padStart(2,"0");function Se(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
- export{Se};
1
+ var a=(e)=>String(e).padStart(2,"0");function Re(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
+ export{Re};
@@ -1,2 +1,2 @@
1
- var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function qt(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function So(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=qt(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
- export{qt,So};
1
+ var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function tn(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function Ho(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=tn(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
+ export{tn,Ho};
@@ -1,2 +1,2 @@
1
- function oo(r,e){if(!e.running)return{kind:"idle"};if(e.blocked)return{kind:"waiting"};if(e.retrying)return{kind:"retrying"};let t=r.findLast((i)=>i.kind==="tool"&&i.active);if(t)return{kind:"tool",ownerKey:t.key};let n=r.findLast((i)=>i.kind!=="user");if(n?.active){if(n.kind==="answer")return{kind:"speaking",ownerKey:n.key};if(n.kind==="text")return{kind:"thinking",ownerKey:n.key};if(n.kind==="reasoning")return{kind:"reasoning",ownerKey:n.key};if(n.kind==="plan")return{kind:"planning",ownerKey:n.key};if(n.kind==="compaction")return{kind:"tool",ownerKey:n.key}}if(n?.kind==="answer")return{kind:"idle"};return{kind:"thinking",ownerKey:n?.key}}
2
- export{oo};
1
+ function No(r,e){if(!e.running)return{kind:"idle"};if(e.blocked)return{kind:"waiting"};if(e.retrying)return{kind:"retrying"};let t=r.findLast((i)=>i.kind==="tool"&&i.active);if(t)return{kind:"tool",ownerKey:t.key};let n=r.findLast((i)=>i.kind!=="user");if(n?.active){if(n.kind==="answer")return{kind:"speaking",ownerKey:n.key};if(n.kind==="text")return{kind:"speaking",ownerKey:n.key};if(n.kind==="reasoning")return{kind:"reasoning",ownerKey:n.key};if(n.kind==="plan")return{kind:"planning",ownerKey:n.key};if(n.kind==="compaction")return{kind:"tool",ownerKey:n.key}}if(n?.kind==="answer")return{kind:"idle"};return{kind:"working",ownerKey:n?.key}}
2
+ export{No};
@@ -1,4 +1,4 @@
1
- function Oo(t,e){if(e===0)return null;let r=e-1;while(r>=0){let n=t[r];if(n===" "||n==="\t"||n===`
1
+ function Ao(t,e){if(e===0)return null;let r=e-1;while(r>=0){let n=t[r];if(n===" "||n==="\t"||n===`
2
2
  `)return null;if(n==="@"||n==="/"){let i=r===0?"":t[r-1],s=r===0||i===`
3
3
  `;if(n==="/"?s&&!/[/\\]/.test(t.slice(r+1,e)):s||i===" "||i==="\t")return{kind:n==="/"?"slash":"at",start:r,end:e,query:t.slice(r+1,e)}}r-=1}return null}
4
- export{Oo};
4
+ export{Ao};
@@ -1 +1 @@
1
- import{cn as e}from"cn";import{jsx as o}from"react/jsx-runtime";function Xo({className:t,...n}){return o("kbd",{"data-slot":"kbd",className:e("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",t),...n})}function xi({className:t,...n}){return o("kbd",{"data-slot":"kbd-group",className:e("inline-flex items-center gap-1",t),...n})}export{Xo,xi};
1
+ import{cn as e}from"cn";import{jsx as o}from"react/jsx-runtime";function Go({className:t,...n}){return o("kbd",{"data-slot":"kbd",className:e("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",t),...n})}function bi({className:t,...n}){return o("kbd",{"data-slot":"kbd-group",className:e("inline-flex items-center gap-1",t),...n})}export{Go,bi};
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-46gb51y9.js";import{I}from"./chunk-ckft9abb.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function ue(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let r=[];for(let[c,l]of e.content.entries()){if(!b(l))continue;let o=l.content;if(N(o))r.push({key:`${e.id}:${c}`,src:`data:${o.mimeType};base64,${o.data}`,alt:e.title??""});if(w(o))r.push({key:`${e.id}:${c}`,path:o.uri,alt:o.name})}if(r.length)return r;let i=e.rawInput;if(i!==null&&typeof i==="object"&&"path"in i&&typeof i.path==="string")return[{key:e.id,path:i.path,alt:i.path.split(/[\\/]/).at(-1)??i.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:i,openImage:c,t:l}=a(),[o,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(f);g({});for(let s of u)(s.src!==void 0?Promise.resolve(s.src):s.path!==void 0&&r?r(s.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[s.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[s.key]:{error:!0}}))});return()=>{t=!1}},[f,r,v]);let k=e.flatMap((t)=>{let u=o[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return n("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let s=o[t.key];if(!s)return n("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:n(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in s)return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:n(R,{"aria-hidden":"true"})},t.key);return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=o[d.key];return p&&"src"in p}).length;if(i)i(k,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function po({blocks:e}){let{t:r}=a(),i=e.flatMap(T),[c,l]=I(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((o)=>!o),children:[y("span",{className:"codex-activity-label",children:[n(S,{className:"codex-activity-icon","aria-hidden":"true"}),n("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:i.length})})]}),n(C,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&n(E,{images:i})]})}
2
- export{ue,po};
1
+ import{a}from"./chunk-y6r6tzfh.js";import{I}from"./chunk-ckft9abb.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function pe(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let r=[];for(let[c,l]of e.content.entries()){if(!b(l))continue;let o=l.content;if(N(o))r.push({key:`${e.id}:${c}`,src:`data:${o.mimeType};base64,${o.data}`,alt:e.title??""});if(w(o))r.push({key:`${e.id}:${c}`,path:o.uri,alt:o.name})}if(r.length)return r;let i=e.rawInput;if(i!==null&&typeof i==="object"&&"path"in i&&typeof i.path==="string")return[{key:e.id,path:i.path,alt:i.path.split(/[\\/]/).at(-1)??i.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:i,openImage:c,t:l}=a(),[o,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(f);g({});for(let s of u)(s.src!==void 0?Promise.resolve(s.src):s.path!==void 0&&r?r(s.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[s.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[s.key]:{error:!0}}))});return()=>{t=!1}},[f,r,v]);let k=e.flatMap((t)=>{let u=o[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return n("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let s=o[t.key];if(!s)return n("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:n(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in s)return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:n(R,{"aria-hidden":"true"})},t.key);return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=o[d.key];return p&&"src"in p}).length;if(i)i(k,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function lo({blocks:e}){let{t:r}=a(),i=e.flatMap(T),[c,l]=I(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((o)=>!o),children:[y("span",{className:"codex-activity-label",children:[n(S,{className:"codex-activity-icon","aria-hidden":"true"}),n("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:i.length})})]}),n(C,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&n(E,{images:i})]})}
2
+ export{pe,lo};
@@ -1,2 +1,2 @@
1
- import{Ho}from"./chunk-b81yxz7f.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function _o(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Ho(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
- export{_o};
1
+ import{nr}from"./chunk-r0t8zj4g.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function tr(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await nr(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
+ export{tr};
@@ -1,2 +1,2 @@
1
- function $o({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
- export{$o};
1
+ function Oo({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
+ export{Oo};
@@ -1,2 +1,2 @@
1
- import{$o}from"./chunk-y8qmxd0j.js";import{d,Yo,u,m}from"./chunk-et0rpfh9.js";import{cn as M}from"cn";import{XIcon as L}from"lucide-react";import{useCallback as O,useEffect as z,useMemo as j,useRef as H,useState as S}from"react";import{jsx as i,jsxs as A}from"react/jsx-runtime";function Uo({open:l,onOpenChange:P,url:h,filename:x,scale:v,onScaleChange:p,containerRef:T,containerClassName:I,dialogContentClassName:R,imageClassName:W}){let g=O((e)=>Math.min(4,Math.max(0.25,e)),[]),[Z,C]=S(1),o=g(v??Z),k=H(null),s=T??k,D=H(null),[f,N]=S({width:0,height:0}),[y,E]=S({width:0,height:0}),b=O((e)=>{let n=g(e);if(typeof p==="function"){p(n);return}C(n)},[p,g]);z(()=>{if(!l)return;if(!h)return;if(typeof v==="number")return;C(1)},[l,h,v]),z(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{N({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let X=O(()=>{b(1)},[b]),r=j(()=>{let{width:e,height:n}=y,{width:t,height:a}=f;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),w=e*c,_=n*c;return{width:w*o,height:_*o}},[o,y,f]);if(!h)return null;return i(d,{open:l,onOpenChange:P,children:A(u,{className:M("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",R),showCloseButton:!1,children:[i(m,{className:"sr-only",children:x||"Image preview"}),i(Yo,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(L,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=D.current,w=a&&c?$o({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(b(t),a&&w)requestAnimationFrame(()=>{a.scrollTo(w)})},className:M("h-full w-full scrollbar-thin overflow-auto",I),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(f.width,r.width),height:Math.max(f.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:x||"image preview",className:M("block object-contain select-none",W),decoding:"async",draggable:!1,ref:D,onDoubleClick:X,onLoad:(e)=>{let n=e.currentTarget;E({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))N({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
- export{Uo};
1
+ import{Oo}from"./chunk-dgnk7h62.js";import{d,ir,u,m}from"./chunk-a2hygrpr.js";import{cn as M}from"cn";import{XIcon as L}from"lucide-react";import{useCallback as O,useEffect as z,useMemo as j,useRef as H,useState as S}from"react";import{jsx as i,jsxs as A}from"react/jsx-runtime";function _o({open:l,onOpenChange:P,url:h,filename:x,scale:v,onScaleChange:p,containerRef:T,containerClassName:I,dialogContentClassName:R,imageClassName:W}){let g=O((e)=>Math.min(4,Math.max(0.25,e)),[]),[Z,C]=S(1),o=g(v??Z),k=H(null),s=T??k,D=H(null),[f,N]=S({width:0,height:0}),[y,E]=S({width:0,height:0}),b=O((e)=>{let n=g(e);if(typeof p==="function"){p(n);return}C(n)},[p,g]);z(()=>{if(!l)return;if(!h)return;if(typeof v==="number")return;C(1)},[l,h,v]),z(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{N({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let X=O(()=>{b(1)},[b]),r=j(()=>{let{width:e,height:n}=y,{width:t,height:a}=f;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),w=e*c,_=n*c;return{width:w*o,height:_*o}},[o,y,f]);if(!h)return null;return i(d,{open:l,onOpenChange:P,children:A(u,{className:M("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",R),showCloseButton:!1,children:[i(m,{className:"sr-only",children:x||"Image preview"}),i(ir,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(L,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=D.current,w=a&&c?Oo({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(b(t),a&&w)requestAnimationFrame(()=>{a.scrollTo(w)})},className:M("h-full w-full scrollbar-thin overflow-auto",I),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(f.width,r.width),height:Math.max(f.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:x||"image preview",className:M("block object-contain select-none",W),decoding:"async",draggable:!1,ref:D,onDoubleClick:X,onLoad:(e)=>{let n=e.currentTarget;E({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))N({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
+ export{_o};
@@ -1,2 +1,2 @@
1
- import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function jn(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Qr(){c()}function Kn(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function Qn(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return hr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Xr(e,n,t,i,o,a){if(a==="none")return;_(o,[hr(e,n,t,i,a)])}function hr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Lr(t,i);return vr(e,n)}function Lr(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function vr(e,n){return y+Dr(e,n)}function Yr(e,n){return D(vr(e,n))}function Dr(e,n){if(n<=l)return _r(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function _r(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function Zr(){return r.context?.state}function Jr(e){return g(e).ready}
2
- export{jn,Qr,Kn,Qn,Xr,hr,Lr,vr,Yr,Dr,_r,Zr,Jr};
1
+ import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Zn(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function si(){c()}function Jn(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function eo(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return xr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function li(e,n,t,i,o,a){if(a==="none")return;_(o,[xr(e,n,t,i,a)])}function xr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Er(t,i);return yr(e,n)}function Er(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function yr(e,n){return y+Ar(e,n)}function ci(e,n){return D(yr(e,n))}function Ar(e,n){if(n<=l)return Lr(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Lr(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function di(){return r.context?.state}function ui(e){return g(e).ready}
2
+ export{Zn,si,Jn,eo,li,xr,Er,yr,ci,Ar,Lr,di,ui};
@@ -0,0 +1,3 @@
1
+ import{q,V}from"./chunk-kbwjcnf6.js";import{e}from"./chunk-6kn920c5.js";import{d,u,b,X,m,w}from"./chunk-a2hygrpr.js";import{l}from"./chunk-1hy64ewz.js";import{Nt,Mt,Rt,xn,Z}from"./chunk-xd5rqbwp.js";import{ce}from"./chunk-xxkdv1zf.js";import{p,s,r}from"./chunk-b3nt7axf.js";import{le,U,D}from"./chunk-f7n8erng.js";import{sessionGroup as F}from"@nyssance/codex-acp-v2/client";import{cn as fe}from"cn";import{ArchiveIcon as ve,FolderIcon as Y,ListFilterIcon as ge,SearchIcon as xe,Trash2Icon as ee}from"lucide-react";import{useEffect as Se,useRef as ye,useState as f}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function te({className:v,...n}){return i(xn,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...n,className:fe("max-w-(--available-width) min-w-0 p-1",v)})}function H(v){return v instanceof Error?v.message:String(v)}function Le({children:v}){return i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"flex flex-col gap-8",children:v})})}function mr({Scroll:v=Le}){let{t:n,i18n:B}=p(),g=s(),N=r((t)=>t.archivedSessions),A=r((t)=>t.connection),[O,se]=f(""),[C,ie]=f("all"),[x,ne]=f("all"),[ae,re]=f(0),[G,K]=f(!0),[z,Q]=f(null),[_,R]=f(null),[I,j]=f(!1),S=ye(!1),[P,y]=f(null),[W,T]=f(null),[oe,J]=f(!1);Se(()=>{if(A!=="ready")return;let t=!1;K(!0),Q(null);async function h(){try{await g.listArchived({reset:!0});let o=new Set;while(!t&&g.state.archivedCursor!==null){let L=g.state.archivedCursor;if(o.has(L))throw Error("Archive pagination returned a repeated cursor");o.add(L),await g.listArchived()}}catch(o){if(!t)Q(H(o))}finally{if(!t)K(!1)}}return h(),()=>{t=!0}},[g,A,ae]);let c=r((t)=>t.projectContext),E=!(c!==null&&A==="ready"&&!G&&z===null)||I,k=(t)=>t.title??n("sessionList.untitled"),de=[...new Set(N.filter((t)=>c&&F(c,t).id!==D).map((t)=>c?F(c,t).id:t.cwd))].toSorted(),ue=O.trim().toLocaleLowerCase(B.language),M=N.filter((t)=>{let h=c?F(c,t).id:null,o=h===D;return k(t).toLocaleLowerCase(B.language).includes(ue)&&(C==="all"||(C==="quick"?o:!o))&&(x==="all"||(x==="quick"?o:h===x))}),me=new Intl.DateTimeFormat(B.language,{dateStyle:"medium",timeStyle:"short"});async function pe(t){if(S.current)return;S.current=!0,j(!0),R(null);try{await g.unarchive(t.sessionId)}catch(h){R(H(h))}finally{S.current=!1,j(!1)}}async function he(){if(S.current||!P)return;S.current=!0,j(!0),T(null);let t=[],h=[];try{for(let o of P){if(!g.state.archivedSessions.some((L)=>L.sessionId===o.sessionId))continue;try{await g.delete(o.sessionId)}catch(L){t.push(o),h.push(`${k(o)}: ${H(L)}`)}}if(t.length)y(t),T(h.join(`
2
+ `));else y(null)}finally{S.current=!1,j(!1)}}return a("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":n("sessionList.archives.title"),children:[a("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[a("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[i("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:n("sessionList.archives.title")}),a(e,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:E||N.length===0,onClick:()=>{T(null),J(!0),y([...N])},children:[i(ee,{className:"size-4","aria-hidden":"true"}),n("sessionList.archives.deleteAll")]})]}),a("div",{className:"flex shrink-0 flex-wrap gap-3",children:[a("div",{className:"relative min-w-48 flex-1",children:[i(xe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(l,{"aria-label":n("sessionList.archives.search"),placeholder:n("sessionList.archives.search"),value:O,onChange:(t)=>se(t.target.value),className:"rounded-md ps-9"})]}),a(Nt,{value:C,onValueChange:(t)=>{if(t===null)throw Error("Archive chat type cannot be empty");ie(t)},children:[a(Rt,{"aria-label":n("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[i(ge,{"aria-hidden":"true"}),i(Mt,{children:n(`sessionList.archives.${C==="all"?"allChats":C==="quick"?"quickChats":"projectChats"}`)})]}),a(te,{children:[i(Z,{value:"all",children:n("sessionList.archives.allChats")}),i(Z,{value:"quick",children:n("sessionList.archives.quickChats")}),i(Z,{value:"project",children:n("sessionList.archives.projectChats")})]})]}),a(Nt,{value:x,onValueChange:(t)=>{if(t===null)throw Error("Archive project filter cannot be empty");ne(t)},children:[a(Rt,{"aria-label":n("sessionList.archives.project"),className:"w-48 rounded-md",children:[i(Y,{"aria-hidden":"true"}),i(Mt,{className:"truncate",children:x==="all"?n("sessionList.archives.allProjects"):x==="quick"?n("sessionList.archives.noProject"):U(x,c??void 0)})]}),a(te,{children:[i(Z,{value:"all",children:n("sessionList.archives.allProjects")}),i(Z,{value:"quick",children:n("sessionList.archives.noProject")}),de.map((t)=>i(Z,{value:t,title:t,children:U(t,c??void 0)},t))]})]})]}),a(v,{children:[A!=="ready"?i("p",{role:"status",className:"text-muted-foreground",children:n("sessionList.archives.connecting")}):G?a("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[i(ce,{}),n("sessionList.archives.loading")]}):z?i(q,{variant:"destructive",children:a(V,{className:"flex items-center justify-between gap-4",children:[i("span",{children:z}),i(e,{variant:"outline",onClick:()=>re((t)=>t+1),children:n("sessionList.archives.retry")})]})}):N.length===0?a("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[i(ve,{"aria-hidden":"true",className:"size-8"}),i("p",{children:n("sessionList.archives.empty")})]}):M.length===0?i("p",{className:"text-muted-foreground py-12 text-center",children:n("sessionList.archives.noResults")}):(c?le(M,c):[]).filter(([,t])=>t.length>0).map(([t,h])=>a("section",{className:"flex flex-col gap-3",children:[a("div",{className:"flex items-center justify-between gap-3",children:[a("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:t===D?void 0:t,children:[i(Y,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("span",{className:"truncate",children:t===D?n("sessionList.archives.noProject"):U(t,c??void 0)})]}),i("span",{className:"text-muted-foreground shrink-0 text-sm",children:n("sessionList.archives.count",{count:h.length})})]}),i("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:h.map((o)=>a("article",{"aria-label":k(o),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[a("div",{className:"min-w-0 flex-1 basis-40",children:[i("h3",{className:"truncate text-sm font-medium",title:k(o),children:k(o)}),o.updatedAt!==null&&i("time",{dateTime:o.updatedAt,title:n("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:me.format(new Date(o.updatedAt))})]}),a("div",{className:"flex shrink-0 items-center gap-2",children:[i(e,{variant:"ghost",size:"icon-sm","aria-label":n("sessionList.delete"),title:n("sessionList.delete"),disabled:E,className:"text-muted-foreground hover:text-destructive",onClick:()=>{T(null),J(!1),y([o])},children:i(ee,{"aria-hidden":"true"})}),i(e,{variant:"secondary",size:"sm",disabled:E,onClick:()=>void pe(o),children:n("sessionList.archives.unarchive")})]})]},o.sessionId))})]},t)),_&&i(q,{variant:"destructive",children:i(V,{children:_})})]})]}),i(d,{open:P!==null,onOpenChange:(t)=>{if(!t&&!S.current)y(null)},children:a(u,{showCloseButton:!I,children:[a(b,{children:[i(m,{children:n("sessionList.archives.deleteTitle")}),i(w,{children:n(oe?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:P?.length??0})})]}),W&&i(q,{variant:"destructive",children:i(V,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:W})}),a(X,{children:[i(e,{variant:"outline",disabled:I,onClick:()=>y(null),children:n("sessionList.cancel")}),a(e,{variant:"destructive",className:"text-sm font-normal",disabled:E,onClick:()=>void he(),children:[I&&i(ce,{}),n("sessionList.archives.confirmDelete")]})]})]})})]})}
3
+ export{mr};
@@ -0,0 +1,2 @@
1
+ import{et,Y}from"./chunk-aprxk7c2.js";import{L}from"./chunk-tjykfxrd.js";import{z}from"./chunk-fteek5h4.js";import{J}from"./chunk-ht28382s.js";import{Ie,se,Se}from"./chunk-q256c3hn.js";import{PreviewCard as x}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as I}from"lucide-react";import{createContext as S,useContext as k,useLayoutEffect as T,useState as R}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as G}from"react/jsx-runtime";function fn(o){if(o.as==="ul"){let{as:i,className:r,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",r),...a})}let{as:t,className:n,...s}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...s})}function Te({className:o,...t}){return e("span",{"data-slot":"navigation-leading",className:p("flex size-6 shrink-0 items-center justify-center [&_.lucide]:size-3.5",o),...t})}function Xe({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[30px] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function Pt({open:o,onOpenChange:t,tooltip:n,leading:s,label:i,count:r,countLabel:a,active:l=!1,actions:N,headerChildren:f,wrapHeader:u,onHeaderClick:w,children:C}){let b=()=>{w?.(),t(!o)},m=p(Ie,"relative flex h-[30px] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),h=d(G,{children:[s!=null&&e(Te,{children:s}),f??e(L,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(Se,{content:r!==void 0?e(se,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??r})}):void 0,actions:N})})]}),P=f==null?d("div",{"data-active":l?"":void 0,title:n,className:p(m,Y),onClick:b,onKeyDown:(c)=>{if(c.target!==c.currentTarget)return;if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault(),b()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),h]}):e("div",{"data-active":l?"":void 0,className:m,children:h});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[u===void 0?P:u(P),o&&e(fn,{className:"mt-0.5",children:C})]})}var H=S(()=>{}),O=S(()=>{});function Ye(){return k(O)}function Ze(){return k(H)}function Je({active:o=!1,state:t,interruption:n=null,leased:s=!1,media:i,title:r,hoverCard:a,onHoverCardOpenChange:l,subtitle:N,preview:f,listeningPorts:u,onOpenPort:w,accessory:C,meta:b,hint:m,actions:h,className:P,...c}){let y=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(Ie,et,"group/navigation-row focus-visible:outline-ring flex h-[30px] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(f||u!=null&&u.length>0)&&"h-auto min-h-[30px] py-2.5",P),...c,children:[e(Te,{children:t!=null?e(z,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(L,{className:p("leading-none",t==="done"&&"font-semibold"),children:r}),N!=null&&e(L,{className:"text-muted-foreground text-xs",children:N}),f&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:f}),u!=null&&u.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:u.map((v)=>w?d("button",{type:"button",className:"underline",onPointerDown:(g)=>g.stopPropagation(),onKeyDown:(g)=>g.stopPropagation(),onClick:(g)=>{g.stopPropagation(),w(v)},children:[":",v]},v):d("span",{children:[":",v]},v))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[s&&e(I,{className:"text-muted-foreground size-3"}),e(Se,{content:C!=null?e(se,{children:C}):b??e(se,{}),actions:h}),m!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:m})]})]});if(a==null)return y;return e(_,{row:y,onOpenChange:l,children:a})}function _({row:o,children:t,onOpenChange:n}){let[s,i]=R(!1),[r,a]=R(!1),l=s||r;return T(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(H.Provider,{value:a,children:e(O.Provider,{value:()=>{i(!1),a(!1)},children:e(E,{open:l,onOpenChange:i,trigger:o,children:t})})})}function E({open:o,onOpenChange:t,trigger:n,children:s,side:i="inline-end",sideOffset:r=2,align:a="start",alignOffset:l}){return J(o),d(x.Root,{open:o,onOpenChange:t,children:[e(x.Trigger,{render:n,delay:700,closeDelay:100}),e(x.Portal,{children:e(x.Positioner,{side:i,sideOffset:r,align:a,alignOffset:l,className:"isolate z-50",children:e(x.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:s})})})})]})}
2
+ export{fn,Te,Xe,Pt,Ye,Ze,Je};
@@ -1 +1 @@
1
- import{cn as a}from"cn";import{jsx as o}from"react/jsx-runtime";function v({className:e,...t}){return o("label",{"data-slot":"label",className:a("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}export{v};
1
+ import{cn as a}from"cn";import{jsx as o}from"react/jsx-runtime";function f({className:e,...t}){return o("label",{"data-slot":"label",className:a("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}export{f};
@@ -0,0 +1,2 @@
1
+ import{g,Qt,ko,Xt,Co,Yt,To}from"./chunk-36t9x2qc.js";import{t,ie,ke,o}from"./chunk-f3e3ged2.js";import{ee}from"./chunk-zmpbfbnn.js";import{createStore as E}from"@alwith/api/client";import{isText as k,nativeTurnId as v}from"@nyssance/codex-acp-v2/client";import{jsx as m}from"react/jsx-runtime";var x=E({entries:{}});function p(i,e){x.setState((n)=>({entries:{...n.entries,[i]:e}}))}function q(i,e){let n=v(e),a=i.items.findLast((s)=>v(s)!==null);return!e.replayed&&n!==null&&a!==void 0&&v(a)===n}function M(i,e){for(let n of i.items){if(n.kind!=="user"||n.echo==="pending")continue;for(let a of[...Yt(n._meta),...n.content.filter(k).flatMap((s)=>Yt(s._meta))])if(a.questionItemId===e)return a.answer}return}function O({sessionId:i,item:e,question:n,index:a}){let s=ie(),{t:l}=t(),S=Qt(e.id,a),d=JSON.stringify([i,S]),u=ke(x,(r)=>r.entries[d]),c=o((r)=>r.sessions[i]),A=o((r)=>r.connection==="ready"),f=u?.draft??ko(n),b=c===void 0?u?.accepted:M(c,S)??u?.accepted,h=c!==void 0&&q(c,e),D=A&&c?.attached&&!c.restoring&&!c.readOnly,y=b!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!h?"closed":!D?"unavailable":"pending",C=async()=>{if(x.getState().entries[d]?.pending||y!=="pending")return;let r=s.state.sessions[i];if(r===void 0||!q(r,e)||!r.attached||r.readOnly||r.restoring)return;let I=Xt(n,f);if(!I.trim())return;let w={questionItemId:S,question:n.title,answer:I};p(d,{draft:f,pending:!0});try{await s.prompt(i,[{type:"text",text:Co(w),_meta:{codex:{questionReply:w}}}]),p(d,{draft:f,accepted:I})}catch(Q){p(d,{draft:f,error:Q instanceof Error?Q.message:String(Q)})}};if(y==="closed")return null;return m(To,{question:n,draft:f,status:y,answer:b,error:y==="pending"?u?.error:void 0,t:l,onChange:(r)=>p(d,{draft:r}),onSkip:()=>p(d,{draft:f,skipped:!0}),onSubmit:()=>{C()}})}function Kt({sessionId:i,item:e}){let n=o((s)=>s.sessions[i]),a=g(e._meta);if(n===void 0||n.readOnly||!q(n,e))return m(ee,{content:e.content.some((s)=>!k(s)||s.text.trim().length>0)?e.content:a.map((s)=>({type:"text",text:s.title})),messageId:e.id,streaming:!1});return m("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((s,l)=>m(O,{sessionId:i,item:e,question:s,index:l},Qt(e.id,l)))})}
2
+ export{Kt};
@@ -0,0 +1,2 @@
1
+ import{lr}from"./chunk-y6r6tzfh.js";import{createContext as s,useContext as l,useSyncExternalStore as m}from"react";import{jsx as r}from"react/jsx-runtime";var c=s(null),u=s(null);function re({host:e,client:n,children:i}){return r(lr,{host:e,children:r(c,{value:e,children:r(u,{value:n,children:i})})})}function t(){let e=l(c);if(e===null)throw Error("Timeline host is missing");return e}function ie(){let e=l(u);if(e===null)throw Error("Timeline client is missing");return e}function ke(e,n){return m((i)=>e.subscribe(i),()=>n(e.getState()),()=>n(e.getState()))}function o(e){let n=ie();return ke(n.store,e)}function Ve(e,n){if(e.reportError)e.reportError(n);else console.error(n)}
2
+ export{re,t,ie,ke,o,Ve};
@@ -0,0 +1,2 @@
1
+ import{groupSessions as le,projectName as U,isQuickChatDirectory as pr,QUICK_CHATS_GROUP as D}from"@nyssance/codex-acp-v2/client";
2
+ export{le,U,pr,D};
@@ -0,0 +1,2 @@
1
+ import{v}from"./chunk-y6r6tzfh.js";import{G}from"./chunk-w45d5th9.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function So({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(v,{text:t.content,streaming:!1})});if(!n(t))return null;return e(G,{entries:t.entries})}
2
+ export{So};
@@ -1,2 +1,2 @@
1
- var i=new Map,a=new Map,f=new Map;function xn(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function S(t,r){let n=i.get(t);if(!n)return;let e=r(n.attachments);i.set(t,{...n,attachments:e}),a.get(t)?.(e)}function at(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function ur(t){for(;;){let e=i.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=i.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function mr(t,r){if(r===null)i.delete(t);else i.set(t,r)}var s=new Map;function st(t,r){if(s.has(t))throw Error("A composer is already registered for this session");return s.set(t,r),()=>{if(s.get(t)===r)s.delete(t)}}function pr(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=s.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=i.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),i.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
2
- export{i,xn,S,at,ur,mr,st,pr};
1
+ var i=new Map,a=new Map,f=new Map;function ar(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function A(t,r){let n=i.get(t);if(!n)return;let e=r(n.attachments);i.set(t,{...n,attachments:e}),a.get(t)?.(e)}function vt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function Cr(t){for(;;){let e=i.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=i.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function Tr(t,r){if(r===null)i.delete(t);else i.set(t,r)}var s=new Map;function xt(t,r){if(s.has(t))throw Error("A composer is already registered for this session");return s.set(t,r),()=>{if(s.get(t)===r)s.delete(t)}}function Ir(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=s.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=i.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),i.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
2
+ export{i,ar,A,vt,Cr,Tr,xt,Ir};
@@ -1,2 +1,2 @@
1
- var t=new Map;var a=0;function zt(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=zt(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function xo(e,n){return d??=new l,d.connect(e,n)}
2
- export{zt,xo};
1
+ var t=new Map;var a=0;function Ot(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Ot(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function oo(e,n){return d??=new l,d.connect(e,n)}
2
+ export{Ot,oo};
@@ -1,2 +1,2 @@
1
- import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var Go={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},Wo={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function V({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=Go[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",Wo.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
- export{Go,Wo,V};
1
+ import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var hn={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},vn={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function z({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=hn[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",vn.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
+ export{hn,vn,z};
@@ -0,0 +1,2 @@
1
+ import{ze}from"./chunk-vcbv30ph.js";import{K,Jo}from"./chunk-gtqwgjjg.js";import{t}from"./chunk-f3e3ged2.js";import{Go}from"./chunk-cy6grsx0.js";import{ye,be,we}from"./chunk-hw99hhjf.js";import{cn as d}from"cn";import{SquareIcon as b}from"lucide-react";import{jsx as o,jsxs as n,Fragment as h}from"react/jsx-runtime";var f=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Wo({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=ze(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(h,{children:[a&&o(K,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(b,{className:"size-3 fill-current"})}),o("div",{className:d(l&&"cursor-not-allowed"),children:n(ye,{children:[o(be,{render:o(Jo,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(we,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(Go,{className:"shrink-0",children:f?"↩":"Enter"})]})]})})]})}
2
+ export{Wo};
@@ -0,0 +1,2 @@
1
+ import{i,A,vt}from"./chunk-fnbs3dq1.js";var Vo=5000;function xe(t){return"pastedText"in t}function $r(t){return`file://${encodeURI(t).replaceAll("#","%23").replaceAll("?","%3F")}`}function Fe(t,e,o){let n=(r,s)=>{for(let[a,x]of i){if(!x.attachments.some((p)=>p.id===e.id))continue;A(a,(p)=>p.map((d)=>d.id===e.id?{...e,url:s===void 0?"":$r(s),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!i.get(t)?.attachments.some((r)=>r.id===e.id))return;n("pending"),vt(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>n("ready",r)).catch(()=>n("error")))}function ft(t,e,o,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((a)=>a.kind==="file"&&a.type.startsWith("image/")))return;let r=t.clipboardData.getData("text/plain");if(r.length<Vo)return;t.preventDefault(),t.stopPropagation();let s={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};A(e,(a)=>[...a,s]),Fe(e,s,n)}
2
+ export{Vo,xe,$r,Fe,ft};
@@ -1,2 +1,2 @@
1
- import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function co({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
- export{co};
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function fo({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
+ export{fo};
@@ -1,2 +1,2 @@
1
- import{Do,te}from"./chunk-8dtaq4eh.js";import{_o}from"./chunk-nsns7rgs.js";import{rr,rn,an}from"./chunk-tjhwk02y.js";import{Wt,jt,Re,Ae,Kt}from"./chunk-3wg25354.js";import{cn as P}from"cn";import{ArrowUpIcon as fe,Loader2Icon as ge,SquareIcon as be,XIcon as ve}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as he,useRef as M,useState as Pe}from"react";import{flushSync as Ie}from"react-dom";import{jsx as a,jsxs as ye}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var No=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:ee,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:re,children:ne,...oe})=>{let s=Ae(),l=!!s,se=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ie,D]=Pe([]),c=l?s.attachments.files:ie,B=M(c);B.current=c;let ae=h(()=>{x.current?.click()},[]),O=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),W=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),ue=h((e)=>{let r=[...e],t=r.filter((i)=>O(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:W(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,W,O,z,H,b]),le=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),pe=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),G=l?s.attachments.add:ue,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Do(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${te}MB.`});return}}G(r)},[c,G,b]),j=l?s.attachments.remove:le,N=l?s.attachments.clear:pe,q=l?s.attachments.openFileDialog:ae;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(R&&x.current&&c.length===0)x.current.value=""},[c,R]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of B.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let me=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},X=he(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:j,clear:N,openFileDialog:q,fileInputRef:x}),[c,L,j,N,q]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let J=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await _o(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await re({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},ce=(e)=>{e.preventDefault(),J(e).catch(y)},de=h((e)=>{if(!e.trim())return;if(l&&s)Ie(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),K=a(jt.Provider,{value:()=>J(null),children:ye(Wt.Provider,{value:de,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:ee,onChange:me,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:ce,ref:A,"data-tour":"chat-input",...oe,children:a(rr,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",se&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:ne})})]})});return l?a(Re.Provider,{value:X,children:K}):a(Kt.Provider,{value:X,children:K})};function Mo({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function Ro({className:u,...o}){return a(rn,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Eo({className:u,...o}){return a(rn,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Ao({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var U=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a(an,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Lo=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(fe,{className:"size-4"});if(d==="submitted")g=a(ge,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(be,{className:"size-3 fill-current"});else if(d==="error")g=a(ve,{className:"size-4"});return a(an,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
2
- export{No,Mo,Ro,Eo,Ao,U,Lo};
1
+ import{er,oe}from"./chunk-qv4x469a.js";import{tr}from"./chunk-ddtb692j.js";import{or,an,sn}from"./chunk-ks05sstp.js";import{cn,dn,Be,Ue,un}from"./chunk-vcbv30ph.js";import{cn as P}from"cn";import{ArrowUpIcon as fe,Loader2Icon as ge,SquareIcon as be,XIcon as ve}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as he,useRef as M,useState as Pe}from"react";import{flushSync as Ie}from"react-dom";import{jsx as a,jsxs as ye}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Ko=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:ee,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:te,children:re,...ne})=>{let s=Ue(),l=!!s,se=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ie,D]=Pe([]),c=l?s.attachments.files:ie,U=M(c);U.current=c;let ae=h(()=>{x.current?.click()},[]),B=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),O=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),ue=h((e)=>{let r=[...e],t=r.filter((i)=>B(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:O(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,O,B,z,H,b]),le=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),pe=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=l?s.attachments.add:ue,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(er(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${oe}MB.`});return}}W(r)},[c,W,b]),G=l?s.attachments.remove:le,N=l?s.attachments.clear:pe,j=l?s.attachments.openFileDialog:ae;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(R&&x.current&&c.length===0)x.current.value=""},[c,R]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of U.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let me=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},q=he(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:G,clear:N,openFileDialog:j,fileInputRef:x}),[c,L,G,N,j]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let X=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await tr(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await te({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},ce=(e)=>{e.preventDefault(),X(e).catch(y)},de=h((e)=>{if(!e.trim())return;if(l&&s)Ie(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),J=a(dn.Provider,{value:()=>X(null),children:ye(cn.Provider,{value:de,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:ee,onChange:me,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:ce,ref:A,"data-tour":"chat-input",...ne,children:a(or,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",se&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:re})})]})});return l?a(Be.Provider,{value:q,children:J}):a(un.Provider,{value:q,children:J})};function Qo({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function Xo({className:u,...o}){return a(an,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Yo({className:u,...o}){return a(an,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Zo({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var K=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a(sn,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Jo=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(fe,{className:"size-4"});if(d==="submitted")g=a(ge,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(be,{className:"size-3 fill-current"});else if(d==="error")g=a(ve,{className:"size-4"});return a(sn,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
2
+ export{Ko,Qo,Xo,Yo,Zo,K,Jo};
@@ -0,0 +1,2 @@
1
+ import{K}from"./chunk-gtqwgjjg.js";import{t}from"./chunk-f3e3ged2.js";import{SquareSlashIcon as s}from"lucide-react";import{useRef as l}from"react";import{jsx as r}from"react/jsx-runtime";function jo({textareaRef:a,onOpenChange:p,menuOpen:e,disabled:m}){let{t:o}=t(),n=l(!1);return r(K,{"aria-label":o("composer.commands"),title:o("composer.commands"),disabled:m,"aria-pressed":e,onPointerDown:()=>{n.current=e},onClick:()=>{p(!n.current),a.current?.getTextarea()?.focus()},children:r(s,{className:"size-4"})})}
2
+ export{jo};