@alwith/module-chat 0.5.2 → 0.5.3

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 (354) hide show
  1. package/README.md +29 -0
  2. package/dist/activity-host.js +1 -1
  3. package/dist/approval/choice-elicitation-form.js +1 -1
  4. package/dist/approval/choice-schema.js +1 -1
  5. package/dist/approval/permission-options.js +1 -1
  6. package/dist/approval/permission-view.js +1 -1
  7. package/dist/approval/schema-elicitation-form.js +1 -1
  8. package/dist/approval/url-elicitation-card.js +1 -1
  9. package/dist/chunk-0j15twx6.js +2 -0
  10. package/dist/chunk-0n82kdek.js +2 -0
  11. package/dist/chunk-0pa5t12s.js +2 -0
  12. package/dist/chunk-0vvn08gg.js +2 -0
  13. package/dist/chunk-14a9wet3.js +2 -0
  14. package/dist/chunk-1dp50khb.js +2 -0
  15. package/dist/{chunk-7q7c0mds.js → chunk-1hy64ewz.js} +1 -1
  16. package/dist/chunk-1wc83vxg.js +2 -0
  17. package/dist/chunk-20bww40d.js +2 -0
  18. package/dist/chunk-20gtemb9.js +2 -0
  19. package/dist/chunk-20re64ta.js +2 -0
  20. package/dist/{chunk-bkbemt8g.js → chunk-23wzpgbs.js} +2 -2
  21. package/dist/{chunk-w3yddw6n.js → chunk-2b185a0a.js} +2 -2
  22. package/dist/chunk-2snmjnz9.js +2 -0
  23. package/dist/{chunk-p6558tbk.js → chunk-2sy8cs84.js} +2 -2
  24. package/dist/chunk-30g0y24x.js +2 -0
  25. package/dist/chunk-33mgpcnd.js +2 -0
  26. package/dist/chunk-3jcxkpvs.js +2 -0
  27. package/dist/chunk-3m06tqqk.js +2 -0
  28. package/dist/{chunk-d8gwsw6j.js → chunk-3nmqebb6.js} +3 -3
  29. package/dist/chunk-4d8q9bpy.js +2 -0
  30. package/dist/chunk-4dcagj01.js +1 -0
  31. package/dist/chunk-4mnf89r3.js +1 -0
  32. package/dist/{chunk-6qn5srgg.js → chunk-51qsyrd6.js} +1 -1
  33. package/dist/{chunk-15nwm04a.js → chunk-543v9eke.js} +2 -2
  34. package/dist/chunk-61vxy6yd.js +1 -0
  35. package/dist/chunk-67txww0x.js +2 -0
  36. package/dist/{chunk-vhat5rbz.js → chunk-691gxr2e.js} +2 -2
  37. package/dist/chunk-6fht8rx9.js +2 -0
  38. package/dist/{chunk-jn2pj92h.js → chunk-6ndz2pf9.js} +2 -2
  39. package/dist/chunk-7gaper2w.js +2 -0
  40. package/dist/chunk-802bgza1.js +2 -0
  41. package/dist/chunk-86kkb0z4.js +2 -0
  42. package/dist/{chunk-j2mcvb68.js → chunk-87t0qtkr.js} +6 -6
  43. package/dist/{chunk-dgp9q950.js → chunk-8kjsqjy6.js} +1 -1
  44. package/dist/chunk-8mvg9a32.js +2 -0
  45. package/dist/chunk-8r010kvn.js +1 -0
  46. package/dist/chunk-9bjywaze.js +1 -0
  47. package/dist/chunk-9hqz5fbc.js +2 -0
  48. package/dist/chunk-9v2gk9ex.js +2 -0
  49. package/dist/chunk-9x4et210.js +2 -0
  50. package/dist/{chunk-801v0awm.js → chunk-a7mr12yc.js} +1 -1
  51. package/dist/chunk-aaqk0jrt.js +2 -0
  52. package/dist/chunk-acrrwrzy.js +2 -0
  53. package/dist/chunk-asxwsg2p.js +2 -0
  54. package/dist/{chunk-ypvjzkfb.js → chunk-awrzpp7x.js} +2 -2
  55. package/dist/{chunk-8vvn71rf.js → chunk-aygzz2yg.js} +2 -2
  56. package/dist/chunk-b5g1j1zv.js +2 -0
  57. package/dist/{chunk-2f19pcpn.js → chunk-bycbj1aq.js} +2 -2
  58. package/dist/chunk-cgxcxfh1.js +3 -0
  59. package/dist/chunk-cj5pkg2y.js +4 -0
  60. package/dist/chunk-ckp6661s.js +2 -0
  61. package/dist/chunk-cr294svm.js +1 -0
  62. package/dist/chunk-ctedwb0a.js +3 -0
  63. package/dist/chunk-cw68hvkc.js +1 -0
  64. package/dist/chunk-czahfwp7.js +2 -0
  65. package/dist/chunk-d25r0vq3.js +2 -0
  66. package/dist/chunk-d4yhdesy.js +2 -0
  67. package/dist/{chunk-6qa5dt1k.js → chunk-d6nxypzc.js} +1 -1
  68. package/dist/{chunk-9ab18v07.js → chunk-dfengqjx.js} +2 -2
  69. package/dist/chunk-dnn8064m.js +2 -0
  70. package/dist/chunk-dqw30cz4.js +2 -0
  71. package/dist/chunk-dzydvx7r.js +4 -0
  72. package/dist/{chunk-8e7xf2tb.js → chunk-e3mkvx24.js} +1 -1
  73. package/dist/chunk-e43pfcrt.js +2 -0
  74. package/dist/{chunk-hx6wfscz.js → chunk-ek06eyp4.js} +1 -1
  75. package/dist/chunk-eyre28p1.js +2 -0
  76. package/dist/chunk-fqj76wq8.js +2 -0
  77. package/dist/chunk-h4sw0pez.js +2 -0
  78. package/dist/chunk-h80g3eme.js +2 -0
  79. package/dist/{chunk-d675nr2b.js → chunk-hesyytcd.js} +2 -2
  80. package/dist/{chunk-5j3wnans.js → chunk-hmtgx7fw.js} +2 -2
  81. package/dist/chunk-hr9d9zpb.js +2 -0
  82. package/dist/chunk-hwwhxb3x.js +1 -0
  83. package/dist/chunk-j4teycge.js +2 -0
  84. package/dist/{chunk-ea7zsd2s.js → chunk-jdv29apq.js} +2 -2
  85. package/dist/chunk-jf5651fz.js +2 -0
  86. package/dist/{chunk-b5mkvr4d.js → chunk-jmx0awnf.js} +2 -2
  87. package/dist/{chunk-h0dq9ztv.js → chunk-jnfp7j32.js} +2 -2
  88. package/dist/{chunk-cw9tg2sz.js → chunk-k50475tn.js} +1 -1
  89. package/dist/{chunk-42zr8zpv.js → chunk-kbvkr5mr.js} +2 -2
  90. package/dist/chunk-maepz12p.js +3 -0
  91. package/dist/chunk-maj7m5s7.js +4 -0
  92. package/dist/chunk-mgakm5yv.js +2 -0
  93. package/dist/chunk-mk10tgjk.js +2 -0
  94. package/dist/{chunk-t5nstx0k.js → chunk-mmdpwbef.js} +2 -2
  95. package/dist/chunk-n3raktzz.js +2 -0
  96. package/dist/{chunk-c4621n0b.js → chunk-ncekagm6.js} +1 -1
  97. package/dist/chunk-npjw8dm5.js +2 -0
  98. package/dist/chunk-p0cc67an.js +2 -0
  99. package/dist/{chunk-9dsa5vm7.js → chunk-pb6xtb3n.js} +2 -2
  100. package/dist/chunk-pcngn73n.js +2 -0
  101. package/dist/chunk-ptt7q7za.js +3 -0
  102. package/dist/{chunk-7kcdf82d.js → chunk-px7xxz3v.js} +2 -2
  103. package/dist/{chunk-h38yw8y3.js → chunk-qbdqh38y.js} +1 -1
  104. package/dist/chunk-qf3a35g4.js +2 -0
  105. package/dist/chunk-qpz97p1m.js +1 -0
  106. package/dist/chunk-r41p7378.js +2 -0
  107. package/dist/{chunk-h6df4xfd.js → chunk-r6e2abj6.js} +2 -2
  108. package/dist/{chunk-v0zn87k5.js → chunk-rkqe8p8n.js} +2 -2
  109. package/dist/{chunk-8k7wzkna.js → chunk-rqbbb37p.js} +2 -2
  110. package/dist/chunk-rzajhyrq.js +2 -0
  111. package/dist/chunk-sc746nr6.js +2 -0
  112. package/dist/chunk-sgbde4dv.js +2 -0
  113. package/dist/chunk-st90r31c.js +1 -0
  114. package/dist/{chunk-6vky4fcv.js → chunk-t2ceq16d.js} +2 -2
  115. package/dist/chunk-t9vvcy09.js +3 -0
  116. package/dist/chunk-tgb70x2n.js +2 -0
  117. package/dist/chunk-tj44vjyv.js +2 -0
  118. package/dist/chunk-tptnjbrd.js +2 -0
  119. package/dist/chunk-tre0r8qm.js +2 -0
  120. package/dist/chunk-vxnjsga5.js +2 -0
  121. package/dist/chunk-vyzzs0nc.js +7 -0
  122. package/dist/chunk-w0y1svj7.js +3 -0
  123. package/dist/{chunk-1d4c9j8w.js → chunk-w2tmm1va.js} +2 -2
  124. package/dist/{chunk-jeyvacx6.js → chunk-w92s8704.js} +5 -5
  125. package/dist/chunk-w99ah6qt.js +3 -0
  126. package/dist/chunk-wf4tq3fn.js +1 -0
  127. package/dist/chunk-wqwqx3hc.js +2 -0
  128. package/dist/chunk-wtk721nx.js +2 -0
  129. package/dist/chunk-x3b4dpac.js +2 -0
  130. package/dist/chunk-x71x2atx.js +2 -0
  131. package/dist/chunk-xem94nq0.js +4 -0
  132. package/dist/chunk-yx02h2ja.js +2 -0
  133. package/dist/chunk-z8fdvq3v.js +2 -0
  134. package/dist/{chunk-k7zzrns3.js → chunk-zcrct67v.js} +1 -1
  135. package/dist/chunk-zjg9n6zj.js +2 -0
  136. package/dist/chunk-zwvyfjj8.js +2 -0
  137. package/dist/chunk-zy6338m6.js +2 -0
  138. package/dist/{chunk-q7e2bdav.js → chunk-zzwnpk4q.js} +2 -2
  139. package/dist/codex/activity-group.js +1 -1
  140. package/dist/codex/assistant-message.js +1 -1
  141. package/dist/codex/async-question-card.js +1 -1
  142. package/dist/codex/disclosure-state.js +1 -1
  143. package/dist/codex/edited-files-card.js +1 -1
  144. package/dist/codex/image-view-activity.js +1 -1
  145. package/dist/codex/markdown-renderer.js +1 -1
  146. package/dist/codex/navigation-audio.js +1 -1
  147. package/dist/codex/navigation-preview.js +1 -1
  148. package/dist/codex/navigation-rail.js +1 -1
  149. package/dist/codex/patch-view.js +1 -2
  150. package/dist/codex/plan.js +1 -1
  151. package/dist/codex/timeline-virtualizer.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 -3
  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 -3
  165. package/dist/composer/prompt-input.js +1 -1
  166. package/dist/conversation/action-card.d.ts +20 -0
  167. package/dist/conversation/action-card.js +1 -0
  168. package/dist/conversation/composer/composer.d.ts +21 -0
  169. package/dist/conversation/composer/composer.js +1 -0
  170. package/dist/conversation/composer/config-options.d.ts +6 -0
  171. package/dist/conversation/composer/config-options.js +1 -0
  172. package/dist/conversation/composer/context.d.ts +32 -0
  173. package/dist/conversation/composer/context.js +1 -0
  174. package/dist/conversation/composer/drafts.d.ts +15 -0
  175. package/dist/conversation/composer/drafts.js +1 -0
  176. package/dist/conversation/composer/file-items.d.ts +3 -0
  177. package/dist/conversation/composer/file-items.js +1 -0
  178. package/dist/conversation/composer/long-text.d.ts +14 -0
  179. package/dist/conversation/composer/long-text.js +1 -0
  180. package/dist/conversation/composer/mention-chips.d.ts +4 -0
  181. package/dist/conversation/composer/mention-chips.js +1 -0
  182. package/dist/conversation/composer/mention-uri.d.ts +7 -0
  183. package/dist/conversation/composer/mention-uri.js +1 -0
  184. package/dist/conversation/composer/model-menu.d.ts +26 -0
  185. package/dist/conversation/composer/model-menu.js +1 -0
  186. package/dist/conversation/composer/pasted-text-attachment.d.ts +5 -0
  187. package/dist/conversation/composer/pasted-text-attachment.js +1 -0
  188. package/dist/conversation/composer/permission-mode-menu.d.ts +8 -0
  189. package/dist/conversation/composer/permission-mode-menu.js +1 -0
  190. package/dist/conversation/composer/prediction.d.ts +6 -0
  191. package/dist/conversation/composer/prediction.js +1 -0
  192. package/dist/conversation/composer/slash-command-button.d.ts +8 -0
  193. package/dist/conversation/composer/slash-command-button.js +1 -0
  194. package/dist/conversation/composer/submit-button.d.ts +7 -0
  195. package/dist/conversation/composer/submit-button.js +1 -0
  196. package/dist/conversation/composer/usage-meter.d.ts +7 -0
  197. package/dist/conversation/composer/usage-meter.js +1 -0
  198. package/dist/conversation/context.d.ts +14 -0
  199. package/dist/conversation/context.js +1 -0
  200. package/dist/conversation/conversation-body.d.ts +7 -0
  201. package/dist/conversation/conversation-body.js +1 -0
  202. package/dist/conversation/conversation-view.d.ts +17 -0
  203. package/dist/conversation/conversation-view.js +1 -0
  204. package/dist/conversation/conversation.d.ts +18 -0
  205. package/dist/conversation/conversation.js +1 -0
  206. package/dist/conversation/diff-modal.d.ts +7 -0
  207. package/dist/conversation/diff-modal.js +1 -0
  208. package/dist/conversation/session-actions.d.ts +3 -0
  209. package/dist/conversation/session-actions.js +1 -0
  210. package/dist/conversation/types.d.ts +21 -0
  211. package/dist/conversation/types.js +0 -0
  212. package/dist/image-lightbox.js +1 -1
  213. package/dist/image-preview-dialog.js +1 -1
  214. package/dist/lib/code-highlighter.js +1 -1
  215. package/dist/lib/fuzzy.js +1 -1
  216. package/dist/lib/group-blocks.js +1 -1
  217. package/dist/lib/image-encode.js +1 -1
  218. package/dist/lib/limits.js +1 -1
  219. package/dist/lib/markdown-parser.js +1 -1
  220. package/dist/lib/markdown-rules.js +1 -1
  221. package/dist/lib/model-name.js +1 -1
  222. package/dist/lib/pointer-centered-zoom.js +1 -1
  223. package/dist/lib/prepare-prompt-files.js +1 -1
  224. package/dist/lib/stream-style.js +1 -1
  225. package/dist/lib/streaming-markdown.js +1 -1
  226. package/dist/locales.d.ts +1120 -0
  227. package/dist/locales.js +1 -1
  228. package/dist/search/chat-search.js +1 -1
  229. package/dist/search/dom-matches.js +1 -1
  230. package/dist/search/find-bar.js +1 -1
  231. package/dist/search/literal-matches.js +1 -1
  232. package/dist/session-list/archived-sessions.d.ts +7 -0
  233. package/dist/session-list/archived-sessions.js +1 -0
  234. package/dist/session-list/highlight.d.ts +2 -0
  235. package/dist/session-list/highlight.js +1 -0
  236. package/dist/session-list/host.d.ts +43 -0
  237. package/dist/session-list/host.js +1 -0
  238. package/dist/session-list/hover-info-card.d.ts +21 -0
  239. package/dist/session-list/hover-info-card.js +1 -0
  240. package/dist/session-list/locales.d.ts +247 -0
  241. package/dist/session-list/locales.js +1 -0
  242. package/dist/session-list/navigation.d.ts +50 -0
  243. package/dist/session-list/navigation.js +1 -0
  244. package/dist/session-list/overflow-marquee.d.ts +2 -0
  245. package/dist/session-list/overflow-marquee.js +1 -0
  246. package/dist/session-list/row-stop-button.d.ts +4 -0
  247. package/dist/session-list/row-stop-button.js +1 -0
  248. package/dist/session-list/session-groups.d.ts +5 -0
  249. package/dist/session-list/session-groups.js +1 -0
  250. package/dist/session-list/session-info-card.d.ts +10 -0
  251. package/dist/session-list/session-info-card.js +1 -0
  252. package/dist/session-list/session-list.css +95 -0
  253. package/dist/session-list/session-list.d.ts +37 -0
  254. package/dist/session-list/session-list.js +1 -0
  255. package/dist/session-list/session-row.d.ts +10 -0
  256. package/dist/session-list/session-row.js +1 -0
  257. package/dist/session-list/session-state-dot.d.ts +10 -0
  258. package/dist/session-list/session-state-dot.js +1 -0
  259. package/dist/session-list/sidebar-overlay.d.ts +2 -0
  260. package/dist/session-list/sidebar-overlay.js +1 -0
  261. package/dist/session-list/trailing-swap.d.ts +11 -0
  262. package/dist/session-list/trailing-swap.js +1 -0
  263. package/dist/session-list/use-activity-preview.d.ts +2 -0
  264. package/dist/session-list/use-activity-preview.js +1 -0
  265. package/dist/session-list/use-project-sessions.d.ts +16 -0
  266. package/dist/session-list/use-project-sessions.js +1 -0
  267. package/dist/session-list/virtual-session-rows.d.ts +9 -0
  268. package/dist/session-list/virtual-session-rows.js +1 -0
  269. package/dist/session-timeline/activity-group.js +1 -1
  270. package/dist/session-timeline/activity-projection.js +1 -1
  271. package/dist/session-timeline/assistant-content.js +1 -1
  272. package/dist/session-timeline/assistant-turn.js +1 -1
  273. package/dist/session-timeline/async-questions.js +1 -1
  274. package/dist/session-timeline/edited-files-card.js +1 -1
  275. package/dist/session-timeline/history-timeline.js +1 -1
  276. package/dist/session-timeline/host.js +1 -1
  277. package/dist/session-timeline/navigation-rail.js +1 -1
  278. package/dist/session-timeline/plan.js +1 -1
  279. package/dist/session-timeline/question-reply.js +1 -1
  280. package/dist/session-timeline/resource-content.js +1 -1
  281. package/dist/session-timeline/session-timeline.js +1 -1
  282. package/dist/session-timeline/timeline-registry.js +1 -1
  283. package/dist/session-timeline/turn-error.js +1 -1
  284. package/dist/session-timeline/turn-retry.js +1 -1
  285. package/dist/session-timeline/turn-time.js +1 -1
  286. package/dist/session-timeline/turns.js +1 -1
  287. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  288. package/dist/session-timeline/user-message.js +1 -1
  289. package/dist/ui/alert.d.ts +10 -0
  290. package/dist/ui/alert.js +1 -0
  291. package/dist/ui/badge.js +1 -1
  292. package/dist/ui/button.js +1 -1
  293. package/dist/ui/card.js +1 -1
  294. package/dist/ui/checkbox.js +1 -1
  295. package/dist/ui/dialog.js +1 -1
  296. package/dist/ui/dropdown-menu.js +1 -1
  297. package/dist/ui/empty.d.ts +11 -0
  298. package/dist/ui/empty.js +1 -0
  299. package/dist/ui/field.js +1 -1
  300. package/dist/ui/hover-card.js +1 -1
  301. package/dist/ui/input-group-textarea.js +1 -1
  302. package/dist/ui/input-group.js +1 -1
  303. package/dist/ui/input.js +1 -1
  304. package/dist/ui/kbd.d.ts +3 -0
  305. package/dist/ui/kbd.js +1 -0
  306. package/dist/ui/label.js +1 -1
  307. package/dist/ui/radio-group.js +1 -1
  308. package/dist/ui/select.d.ts +15 -0
  309. package/dist/ui/select.js +1 -0
  310. package/dist/ui/separator.js +1 -1
  311. package/dist/ui/skeleton.d.ts +2 -0
  312. package/dist/ui/skeleton.js +1 -0
  313. package/dist/ui/spinner.d.ts +2 -0
  314. package/dist/ui/spinner.js +1 -0
  315. package/dist/ui/switch.js +1 -1
  316. package/dist/ui/textarea.js +1 -1
  317. package/dist/ui/tooltip.js +1 -1
  318. package/package.json +16 -3
  319. package/dist/chunk-16y5rmm5.js +0 -2
  320. package/dist/chunk-20zcgxa5.js +0 -4
  321. package/dist/chunk-2epnn4sq.js +0 -1
  322. package/dist/chunk-3vt71emt.js +0 -2
  323. package/dist/chunk-4svwa5p8.js +0 -3
  324. package/dist/chunk-4tkxmh52.js +0 -2
  325. package/dist/chunk-5grywgpq.js +0 -4
  326. package/dist/chunk-5h13saah.js +0 -2
  327. package/dist/chunk-6p5hgnpq.js +0 -1
  328. package/dist/chunk-9pdj44jr.js +0 -2
  329. package/dist/chunk-9s1cgt7s.js +0 -1
  330. package/dist/chunk-aqj0v5a9.js +0 -7
  331. package/dist/chunk-azmqtycn.js +0 -2
  332. package/dist/chunk-bfe7xk9m.js +0 -3
  333. package/dist/chunk-dm31xvh3.js +0 -2
  334. package/dist/chunk-dr6z453e.js +0 -2
  335. package/dist/chunk-fgsd4fsd.js +0 -2
  336. package/dist/chunk-fvnb8ds4.js +0 -2
  337. package/dist/chunk-h87xp1gv.js +0 -2
  338. package/dist/chunk-jh8jske0.js +0 -2
  339. package/dist/chunk-jrrvpnf3.js +0 -1
  340. package/dist/chunk-jsb0zged.js +0 -2
  341. package/dist/chunk-k2y4cpra.js +0 -2
  342. package/dist/chunk-m2myfd89.js +0 -2
  343. package/dist/chunk-m2wxz0sj.js +0 -2
  344. package/dist/chunk-nxarfyj2.js +0 -2
  345. package/dist/chunk-p1pd1twf.js +0 -2
  346. package/dist/chunk-phe3an96.js +0 -2
  347. package/dist/chunk-qh5fhcrh.js +0 -3
  348. package/dist/chunk-sky795ex.js +0 -1
  349. package/dist/chunk-t3vgbc9s.js +0 -2
  350. package/dist/chunk-trgq8rq1.js +0 -2
  351. package/dist/chunk-v72t4sf9.js +0 -2
  352. package/dist/chunk-vw2hv2sq.js +0 -2
  353. package/dist/chunk-x9pramem.js +0 -2
  354. package/dist/chunk-xjen1yt6.js +0 -2
@@ -1,2 +0,0 @@
1
- import{ut,N,ge,mt,pt,gt}from"./chunk-nxarfyj2.js";import{forwardRef as pe,useCallback as K,useEffect as me,useImperativeHandle as Re,useLayoutEffect as w,useMemo as re,useRef as s,useState as F}from"react";import{jsx as R,jsxs as ie}from"react/jsx-runtime";var He=12,j=2,q=800,fe=new Map;function Te({turnKey:W,heightPx:x,placeholder:_=!1,deferUntilReady:n=!1,observe:H,onReady:L,children:z}){let h=s(null),[T,U]=F(!1),G=K((m)=>{h.current=m,H(W,m)},[H,W]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let b=()=>{L(m),U(!0)};if(m.querySelector("[data-markdown-pending]")===null){b();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),b()});return d.observe(m,{childList:!0,subtree:!0}),()=>d.disconnect()},[L]),ie("div",{style:T?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:G,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":W,"aria-busy":!T||void 0,style:!T&&!_&&n?{visibility:"hidden"}:void 0,"data-turn-ready":T?"":void 0,children:z}),!T&&!_&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:ie("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var ct=pe(function({entries:x,renderTurn:_,scrollElement:n,sessionKey:H,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},T){let U=s(null),[G,m]=F(z),b=L!==void 0&&L!==null;w(()=>{let e=U.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[b]);let d=re(()=>fe.get(H),[H]),[J,Q]=F(()=>d?.turnHeightsByKey??{}),i=re(()=>ut({entries:x,gapPx:He,measuredHeightsByKey:J,leadingInsetPx:b?G:z}),[x,J,b,G,z]),xe=re(()=>{let e=N({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:j,viewportHeightPx:q}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return ge({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,oe]=F(xe),[y,ue]=F(q),[c,ae]=F(null),k=s(d?.distanceFromBottomPx??0),S=s(M),se=s(i.turnKeys),l=s(J),E=s(i),ce=s(i),P=s(new Map),v=s(null),C=s(null),D=s(null),O=s(new Map),Y=s(!1),de=s(()=>{}),A=s(null),le=K(()=>{if(!h||n===null||v.current!==null||A.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=E.current.turnIndexByKey.get(r),B=g===void 0?a.height:E.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)A.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Z=s(le);Z.current=le;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=N({distanceFromBottomPx:o,layout:i,overscanCount:j,viewportHeightPx:t}),u=S.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(k.current=o,S.current=a,se.current=i.turnKeys,ue(t),a!==u)oe(a)},[i]),V=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),ye=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Z.current();let r={...l.current,[t]:o};l.current=r,Q(r)},[]),ee=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);O.current.set(r,u)}if(D.current!==null||O.current.size===0)return;D.current=requestAnimationFrame(()=>{D.current=null;let t=[...O.current].filter(([r,u])=>l.current[r]!==u);if(O.current.clear(),t.length===0)return;Z.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,Q(o)})}),C.current},[]),ve=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)ee().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),ee().observe(t)},[ee]);me(()=>()=>{if(C.current?.disconnect(),D.current!==null)cancelAnimationFrame(D.current);O.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{de.current=()=>{if(n===null)return;let e=V(n);if(v.current!==null){k.current=e,ue(n.clientHeight||q);return}p(e,n.clientHeight||q)}},[V,n,p]),w(()=>{if(n===null)return;if(!Y.current){Y.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?E.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>de.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,Q(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=gt({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||q),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ae(null)})},[i,c,n,p]),w(()=>{let e=ce.current;if(ce.current=i,E.current=i,n===null||c!==null){A.current=null;return}let t=A.current;A.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(V(n),n.clientHeight);return}let r=k.current;if(h&&e!==i&&Y.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=V(n);if(u<=96&&!h){p(u,y);return}let a=N({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=mt({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,V,n,p,y,h]),w(()=>{S.current=M},[M]),me(()=>()=>{v.current?.complete(),v.current=null;let e=S.current,o=E.current.turnKeys[e.startIndex];fe.set(H,{distanceFromBottomPx:k.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[H]),Re(T,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=pt({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=N({distanceFromBottomPx:a,layout:i,overscanCount:j,viewportHeightPx:y});return S.current=g,oe(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ae(f)})}}),[i,y]);let I=M,X=se.current;if(!(X===i.turnKeys||X.length===i.turnKeys.length&&X.every((e,t)=>e===i.turnKeys[t]))){let e=X[M.startIndex];I=(e===void 0?null:ge({anchorKey:e,layout:i,previousRange:M}))??N({distanceFromBottomPx:k.current,layout:i,overscanCount:j,viewportHeightPx:y})}let te=x.length-1,he=x[te],ne=x.slice(I.startIndex,Math.min(I.endIndex,te)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(he!==void 0)ne.push({entry:he,index:te});return ie("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":ne.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[b&&R("div",{ref:U,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),ne.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Te,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:ve,onReady:ye,children:_(e,t)})},e.turnKey))]})});
2
- export{ct};
@@ -1,2 +0,0 @@
1
- import{O}from"./chunk-aqj0v5a9.js";import{St}from"./chunk-p6558tbk.js";import{t}from"./chunk-vw2hv2sq.js";import{p}from"./chunk-fgsd4fsd.js";import{isContentEntry as a,isEmbeddedResource as f,isResourceLink as g}from"@alwith/api";import{memo as k,useMemo as y}from"react";import{jsx as s,jsxs as u,Fragment as T}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(a).filter((e)=>f(e.content)||g(e.content));if(r.length===0)return null;return u("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(p,{block:e.content},`${n.id}:${l}`))]})}var It=k(function({sessionId:r,items:e,terminals:l,streamingThoughtId:m}){let i=t().toolBlock,d=y(()=>e.map((o)=>{let c={...St(o,l,o.kind==="thought"&&o.id===m),id:JSON.stringify([r,o.id])};return c.type==="tool_use"&&o.kind==="tool"&&i!==void 0?i(c,o):c}),[r,e,l,m,i]);return u(T,{children:[s(O,{blocks:d}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
- export{It};
@@ -1,2 +0,0 @@
1
- function cn(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function Le(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(cn(n,i))}return{imageFiles:e,sawNonImageFile:o}}function Ae(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function un(t){return[...t].filter((e)=>!s(e)).join("")}function rn(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function q(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=un(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-rn(e,o)),r=Math.max(0,i-rn(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
2
- export{cn,Le,Ae,un,rn,q};
@@ -1,2 +0,0 @@
1
- import{n}from"./chunk-azmqtycn.js";import{d}from"./chunk-trgq8rq1.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@alwith/api";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as v}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function M(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 i=l.content;if(N(i))r.push({key:`${e.id}:${c}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(w(i))r.push({key:`${e.id}:${c}`,path:i.uri,alt:i.name})}if(r.length)return r;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:a,openImage:c,t:l}=n(),[i,y]=v({}),[x,I]=v(0),h=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(h);y({});for(let o of u)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&r?r(o.path):Promise.reject(Error("Image loading is unavailable"))).then((m)=>{if(t)y((g)=>({...g,[o.key]:{src:m}}))},()=>{if(t)y((m)=>({...m,[o.key]:{error:!0}}))});return()=>{t=!1}},[h,r,x]);let k=e.flatMap((t)=>{let u=i[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return s("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let o=i[t.key];if(!o)return s("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:s(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>I((p)=>p+1),children:s(R,{"aria-hidden":"true"})},t.key);return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let p=e.slice(0,u).filter((m)=>{let g=i[m.key];return g&&"src"in g}).length;if(a)a(k,p);else c?.(o.src)},children:s("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function Nt({blocks:e}){let{t:r}=n(),a=e.flatMap(T),[c,l]=d(`image-view:${e[0].id}`,!1);return f("div",{className:"codex-activity-item",children:[f("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((i)=>!i),children:[f("span",{className:"codex-activity-label",children:[s(S,{className:"codex-activity-icon","aria-hidden":"true"}),s("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:a.length})})]}),s(C,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&s(E,{images:a})]})}
2
- export{M,Nt};
@@ -1,2 +0,0 @@
1
- var Gn=280;function ut({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function N({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function ge({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function mt({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function pt({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function gt({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
- export{Gn,ut,N,ge,mt,pt,gt};
@@ -1,2 +0,0 @@
1
- var a=(e)=>String(e).padStart(2,"0");function z(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{z};
@@ -1,2 +0,0 @@
1
- import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function Y({name:p,value:P,levels:h,disabled:c,onChange:v}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===P)),[M,d]=k(null),l=y(null),[I,b]=k(null),x=y(0),s=M??I??g,w=(t)=>{let n=++x.current;b(t);let e=()=>{if(x.current===n)b(null)};try{Promise.resolve(v(o[t].value)).then(e,e)}catch(N){throw e(),N}},f=76,r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/(n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/(n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
- export{Y};
@@ -1,3 +0,0 @@
1
- import{fe,he}from"./chunk-bfe7xk9m.js";import{a}from"./chunk-5grywgpq.js";import{t}from"./chunk-vw2hv2sq.js";import{It}from"./chunk-k2y4cpra.js";import{Q}from"./chunk-h87xp1gv.js";import{vt}from"./chunk-3vt71emt.js";import{bt}from"./chunk-jeyvacx6.js";import{Et}from"./chunk-4tkxmh52.js";import{ye,we}from"./chunk-8k7wzkna.js";import{z}from"./chunk-p1pd1twf.js";import{Kt,h,U,Wt}from"./chunk-fvnb8ds4.js";import{isContentEntry as ge,isEmbeddedResource as ee,isImage as te,isResourceLink as pe,isText as ue}from"@alwith/api";import{codexMessageError as X,codexTurnError as Y,nativeTurnId as ke}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as xe,SparklesIcon as Te}from"lucide-react";import{memo as Ie}from"react";import{jsx as s,jsxs as l,Fragment as W}from"react/jsx-runtime";function Z(r){if(te(r))return`${r.mimeType.toLowerCase()}:${r.data}`;if(ee(r)&&"blob"in r.resource&&r.resource.mimeType?.toLowerCase().startsWith("image/"))return`${r.resource.mimeType.toLowerCase()}:${r.resource.blob}`;return null}function u({sessionId:r,entry:n,terminals:d,streaming:o,streamingThoughtId:w}){let{t:m}=t();switch(n.kind){case"activity":return s(It,{sessionId:r,items:n.items,terminals:d,streamingThoughtId:w});case"text":return s(Q,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(Et,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return l(ye,{children:[s("div",{children:m("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return l("div",{className:"codex-context-compaction",children:[s(Te,{"aria-hidden":"true"}),s("span",{children:n.item.status==="completed"?m("stream.codex.contextCompacted"):m("timeline.compacting")})]})}}function Ce({sessionId:r,turn:n,terminals:d,active:o,blocked:w=!1,continued:m=!1,edits:F=n.edits,activityItems:C=n.items,workStartedAt:ne=n.startedAt,isLast:O,error:f,interrupted:P,retry:G,retrying:p,answerActions:K,footer:se}){let{t:c}=t(),N=n.errors.map((e)=>{let i=X(e);if(i===null)throw Error("Turn error item is missing its diagnostics");let I=G?.turnId===ke(e)?G:void 0;return s(we,{error:i,retry:I},`${e.id}:${I?.delaySeconds??"manual"}`)});if(O&&f!==null&&!n.errors.some((e)=>{let i=X(e);return i!==null&&i.stopReason===f.stopReason&&Y(i).message===Y(f).message}))N.push(s(we,{error:f},"current-run-error"));let A=N.length>0?s("div",{className:"codex-turn-errors",children:N}):null,b=n.work.filter((e)=>e.kind==="compaction"&&e.item.status==="completed"),v=n.work.filter((e)=>!b.includes(e)),ie=b.length>0&&v.length===0&&n.final.length===0;if(Kt(n)||ie)return l(W,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(u,{sessionId:r,entry:e,terminals:d,streaming:!1,streamingThoughtId:null},e.key))}),A]});let E=U(n),y=C.findLast((e)=>e.kind!=="user"),R=o&&y?.kind==="thought"?y.id:null,B=n.final.filter((e)=>a(e._meta).length===0).map(h).join(`
2
- `),k=o?null:z(n,"assistant"),H=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),V=new Set(n.final.flatMap((e)=>e.content.map(Z).filter((i)=>i!==null))),S=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(ge).flatMap((i,I)=>{let g=i.content,de=e.name==="image_generation"&&te(g),ce=e.toolKind!=="read"&&e.toolKind!=="search"&&(pe(g)||ee(g)&&("blob"in g.resource));if(!de&&!ce)return[];let M=Z(g);if(M!==null){if(V.has(M))return[];V.add(M)}return[{key:`${e.id}:${I}`,block:g}]})}),x=n.final.some((e)=>a(e._meta).length===0&&e.content.some((i)=>!ue(i)||i.text.trim().length>0)),oe=H.length>0||S.length>0||x||n.final.some((e)=>a(e._meta).length>0),T=n.items.findIndex((e)=>n.final.includes(e)),_=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),j=v.filter((e)=>T===-1||_(e)<T),J=v.filter((e)=>T!==-1&&_(e)>T),re=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...J.map((e)=>({kind:"work",entry:e,index:_(e)}))].toSorted((e,i)=>e.index-i.index),ae=o&&(!x||J.length>0),me=C.some((e)=>e.kind==="tool"&&(e.status==="pending"||e.status==="in_progress")),L=y?._meta?.codex,le=y?.kind==="assistant"&&!(typeof L==="object"&&L!==null&&("messageCompletedAt"in L)),q=ae&&!w&&!me&&!le&&R===null&&p===void 0,D=Wt({...n,items:C});return l(W,{children:[s(he,{stateKey:JSON.stringify([r,n.key]),active:o&&!x,defaultExpanded:P||E||o&&!x,...D,startedAt:D.startedAt??ne,loading:q&&n.work.length===0,work:m?[]:j.map((e)=>s(u,{sessionId:r,entry:e,terminals:d,streaming:o,streamingThoughtId:R},e.key)),answer:oe||m?l("div",{className:"flex min-w-0 flex-col gap-3",children:[m&&j.map((e)=>s(u,{sessionId:r,entry:e,terminals:d,streaming:!1,streamingThoughtId:null},e.key)),re.map((e)=>{if(e.kind==="work")return s(u,{sessionId:r,entry:e.entry,terminals:d,streaming:o,streamingThoughtId:R},e.entry.key);let i=e.item;return a(i._meta).length>0?s(vt,{sessionId:r,item:i},i.id):s(Q,{content:i.content,messageId:i.id,streaming:o},i.id)}),H.map((e)=>l("div",{className:"codex-image-generation",role:"status","aria-label":c(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),l("span",{className:"codex-image-generation-status",children:[o&&s(xe,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),c(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),S.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:S.map((e)=>s(Q,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),!o&&!m&&(B.trim().length>0?s(fe,{text:B,isMostRecentTurn:O,time:k,afterCopy:K}):l("div",{className:"flex items-center gap-0.5",children:[K,k&&s("span",{className:"codex-user-time ms-1",title:k.full,children:k.short})]}))]}):null,footer:l(W,{children:[q&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:c("message.thinking")})}),b.map((e)=>s(u,{sessionId:r,entry:e,terminals:d,streaming:!1,streamingThoughtId:null},e.key)),se,F.length>0&&!o&&!m&&s(bt,{items:F}),(P||E)&&s("div",{className:"codex-interrupted-turn",role:"status",children:c(E?"timeline.historyInterrupted":"timeline.interrupted")}),!o&&A]})}),o&&p!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return e===void 0?c("timeline.capacityReconnecting"):c("timeline.capacityReconnectingProgress",{progress:e})})():p.message}),o&&A]})}var ft=Ie(Ce);
3
- export{ft};
@@ -1 +0,0 @@
1
- import{o}from"./chunk-hx6wfscz.js";import{B}from"./chunk-h38yw8y3.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsx as t,jsxs as m}from"react/jsx-runtime";function ne({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e})}function re({className:a,variant:e="legend",...d}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...d})}function Fe({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e})}var c=p("group/field data-[invalid=true]:text-destructive flex w-full gap-3",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function De({className:a,orientation:e="vertical",...d}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...d})}function Rn({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e})}function Be({className:a,...e}){return t(o,{"data-slot":"field-label",className:l("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e})}function Ln({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e})}function G({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-muted-foreground text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",a),...e})}function An({children:a,className:e,...d}){return m("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...d,children:[t(B,{className:"absolute inset-0 top-1/2"}),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a})]})}function _n({className:a,children:e,errors:d,...n}){let s=u(()=>{if(e)return e;if(!d?.length)return null;let i=[...new Map(d.map((r)=>[r?.message,r])).values()];if(i?.length==1)return i[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((r,f)=>r?.message&&t("li",{children:r.message},f))})},[e,d]);if(!s)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...n,children:s})}export{ne,re,Fe,De,Rn,Be,Ln,G,An,_n};
@@ -1,2 +0,0 @@
1
- import{createContext as d,useCallback as n,useContext as i,useEffect as tt,useMemo as D,useRef as I,useState as B}from"react";import{jsx as G}from"react/jsx-runtime";var C=d(null),Z=d(null);function Pn(){return i(Z)}var J=d(null);function Nn(){return i(J)}var S=d(null);function _e(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var E=()=>i(C);function Mn(){let r=i(S);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var et=()=>i(S);function Sn({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,attachments:U,onAttachmentsChange:L,children:K}){let T=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),W=A!==void 0,[N,Q]=B(r),p=A??N,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let j=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,W)R?.(t);else Q(t)},[W,R]),g=n(()=>P(""),[P]),x=U!==void 0,[V,X]=B([]),v=U??V,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)L?.(e);else X(e)},[x,L]),w=I(null),O=I(()=>{}),M=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let z=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:T(u),filename:u.name,size:u.size,lastModified:u.lastModified,...z===void 0?{}:{sourcePath:z}}})]})},[f,T,s]),k=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),H=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);tt(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let _=n(()=>{O.current?.()},[]),b=D(()=>({files:v,add:M,remove:k,clear:H,openFileDialog:_,fileInputRef:w}),[v,M,k,H,_]),q=n((t,e)=>{w.current=t.current,O.current=e},[]),Y=D(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:j,clearSubmitted:c??g},attachments:b,__registerFileInput:q}),[p,P,g,j,c,b,q]);return G(C.Provider,{value:Y,children:G(S.Provider,{value:b,children:K})})}var ee=d(null);function y(){let r=et(),l=i(ee),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
- export{Z,Pn,J,Nn,S,_e,E,Mn,Sn,ee,y};
@@ -1,2 +0,0 @@
1
- import{useCallback as r,useState as x}from"react";var t=new Map;function d(o,e,k=!1){let[p,S]=x(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||k&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let b=r((c)=>{S((s)=>{let f=s.key===o?s.expanded:t.get(o)??e,a=typeof c==="function"?c(f):c;return t.set(o,a),s.key===o?{key:o,expanded:a}:s})},[o,e]);return[n,b]}
2
- export{d};
@@ -1,2 +0,0 @@
1
- var Vn=1e6,qn=5000000;function at(_,e){return _+e>5000000}function Kn(_){return(_/1e6).toFixed(1)}var me=5;
2
- export{Vn,qn,at,Kn,me};
@@ -1,2 +0,0 @@
1
- import{en}from"./chunk-azmqtycn.js";import{createContext as r,useContext as s,useSyncExternalStore as u}from"react";import{jsx as o}from"react/jsx-runtime";var l=r(null),c=r(null);function Me({host:e,client:n,children:i}){return o(en,{host:e,children:o(l,{value:e,children:o(c,{value:n,children:i})})})}function t(){let e=s(l);if(e===null)throw Error("Timeline host is missing");return e}function b(){let e=s(c);if(e===null)throw Error("Timeline client is missing");return e}function Se(e,n){return u((i)=>e.subscribe(i),()=>n(e.getState()),()=>n(e.getState()))}function g(e){let n=b();return Se(n.store,e)}function V(e,n){if(e.reportError)e.reportError(n);else console.error(n)}
2
- export{Me,t,b,Se,g,V};
@@ -1,2 +0,0 @@
1
- import{createStore as l}from"@alwith/api/client";var Ee=l({sessionId:null,turns:[],api:null,beforeReveal:null});function tn(e){Ee.setState(e)}function nn(e){if(Ee.getState().sessionId===e)Ee.setState({sessionId:null,turns:[],api:null,beforeReveal:null})}async function tr(e,t,n){let i=Ee.getState();if(n.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(t,void 0,{align:"top"})}
2
- export{Ee,tn,nn,tr};
@@ -1,2 +0,0 @@
1
- import{pe,lt}from"./chunk-h6df4xfd.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function X(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=pe(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function In(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return lt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{X,In};