@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
package/README.md CHANGED
@@ -50,6 +50,35 @@ instead of following the bottom; `Viewport` replaces the scrolling element. Key
50
50
  session. This entry needs `@nyssance/codex-acp-v2` installed; it is an optional peer for the rest. `turns` exports the grouping for search sources and diagnostics, and `timeline-registry`
51
51
  lets search reveal a turn in the mounted timeline. `resource-content` renders a file, link or image the way the timeline does, for an application's `Markdown` inside it; outside the timeline, wrap it in `TimelineProvider`. The update scheduler moved to `@alwith/api/client`.
52
52
 
53
+ `conversation` exports `ConversationView`, one session's whole chat surface: the timeline, the
54
+ restoring, detached, stopped and read-only states, inline permission and URL requests, the form
55
+ dialog, the diff dialog and the `Composer`. The application passes the session, a
56
+ `ConversationClient` (`CodexClient` satisfies it) and a `ConversationHost`: the timeline host plus
57
+ optional long-paste files (`writeTextAttachment`) and titles for its own tools (`permissionTitle`,
58
+ `toolTitle`). Product content goes into slots: `header`, `overlay` (search, previews), `timeline`
59
+ (the `SessionTimeline` slots), `composer` and `children` (application dialogs). Errors go to
60
+ `host.reportError`; a `ReportedError` carries a `description` under its message. Key the view by
61
+ session.
62
+
63
+ The `Composer` keeps a draft per session (text, images, mentions) for the life of the page and
64
+ exposes it through `drafts`, `exportDraft`, `importDraft` and `setComposerDraft` for other windows
65
+ and extensions. Its footer has slash commands, `PermissionModeMenu`, `UsageMeter`, `ModelMenu` and
66
+ send, steer and stop. Hosts add tools before the send button through `actions` and adapters inside
67
+ the form through `children`; both read the composer through `useComposer()` (session, readiness,
68
+ the draft port, the interrupt hook for dictation and the receipt observer for hands-free turns).
69
+ `modelMenu` supplies the catalog policy (group order, decorations, short labels, a header action);
70
+ `modelSelector` replaces the menu, such as before a draft session exists. `ModelMenu` and
71
+ `PermissionModeMenu` write through `client.setConfig` unless the host passes `onConfigChange`, and
72
+ `ActionCard` answers through `client.respond` unless it passes `onRespond`. Outside a
73
+ `ConversationView`, wrap these in `ConversationProvider`.
74
+
75
+ `session-list` exports the sidebar's session list: project groups with five rows each and
76
+ "Show all", loading rows and retry, `SessionRow` with rename, fork or restore, archive, delete and
77
+ stop, the `SessionInfoCard` hover card, `ArchivedSessions` and the hooks behind them
78
+ (`useActivityPreview`, `useProjectSessions`). `SessionListProvider` takes the host and client and
79
+ owns the delete confirmation; slots add the application's row actions and group headers. Import
80
+ `@alwith/module-chat/session-list.css` once.
81
+
53
82
  `search` provides Desktop's complete find bar, DOM matching, highlights and navigation. The host supplies its viewport, labels and native-menu subscription; virtualized callers also supply source matches and an async turn-reveal callback. Key the component by session identity to discard the previous search on a session switch. Highlight ownership is per mounted search, and cancelled navigation cannot repaint after close. Source projection stays with the application's message model; the search component never reads a private store.
54
83
 
55
84
  `search-source` shares Unicode-aware literal matching and original UTF-16 offsets with DOM matching. This does **not** make raw tool fields, Markdown source or folded content equivalent to rendered text: the current per-turn occurrence index still requires a complete source-to-rendered mapping. Do not treat the current search counter as proof that every indexed match can be revealed. Automatic expansion of folded matches has not been agreed.
@@ -1 +1 @@
1
- import{en,n,i}from"./chunk-azmqtycn.js";export{en as ActivityHostProvider,i as ActivityMarkdown,n as useActivityHost};
1
+ import{nr,a,h}from"./chunk-1wc83vxg.js";export{nr as ActivityHostProvider,h as ActivityMarkdown,a as useActivityHost};
@@ -1 +1 @@
1
- import{Ye}from"../chunk-6qn5srgg.js";import{e}from"../chunk-801v0awm.js";import{P}from"../chunk-jrrvpnf3.js";import{u}from"../chunk-7q7c0mds.js";import{o}from"../chunk-hx6wfscz.js";import{v,c}from"../chunk-k7zzrns3.js";import{s}from"../chunk-c4621n0b.js";import{Oe,se,w,W}from"../chunk-dr6z453e.js";import{autoUpdate as K}from"@floating-ui/dom";import{cn as _}from"cn";import{useCallback as I,useEffect as z,useLayoutEffect as D,useMemo as j,useRef as X,useState as L}from"react";import{createPortal as J}from"react-dom";import{jsx as n,jsxs as p}from"react/jsx-runtime";var f="__other__";function me({current:l,total:q,anchorRef:E,t:x,onAccept:B,onDecline:H}){let S=j(()=>l?Oe(l.requestedSchema):[],[l]),[T,k]=L({}),Q=X(null);z(()=>{if(l?.elicitationId===void 0)return;let t={};for(let{key:d,property:r}of S)if(!w(r)){let g=W(r)[0];if(g)t[d]={selected:g.value}}k(t)},[l?.elicitationId,S]),z(()=>{if(l?.elicitationId!==void 0&&Q.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")Q.current.focus()},[l?.elicitationId]);let[C,M]=L(null),[R,G]=L(null),U=I(()=>{let t=E.current;if(!t)return;let d=t.getBoundingClientRect();if(d.width===0){let r=Math.min(640,window.innerWidth*0.9);M({left:(window.innerWidth-r)/2,width:r,bottom:24});return}M({left:d.left,width:d.width,bottom:window.innerHeight-d.bottom+20})},[E]);D(()=>{if(!l)return;let t=0,d=()=>{if(E.current){U();return}t=requestAnimationFrame(d)};return d(),()=>cancelAnimationFrame(t)},[l,U,E]),D(()=>{let t=E.current;if(!l||!t||!R)return;return K(t,R,U,{animationFrame:!0})},[l,R,E,U]);let F=j(()=>{if(!l)return!1;for(let{key:t,property:d}of S){let r=T[t];if(!r)return!1;if(w(d)){if(!r.selectedSet||r.selectedSet.size===0)return!1;if(r.selectedSet.has(f)&&!r.otherText?.trim())return!1}else{if(!r.selected)return!1;if(r.selected===f&&!r.otherText?.trim())return!1}}return!0},[l,S,T]),V=I(async()=>{if(!l)return;if(!F)return;let t={},d={};for(let{key:r,property:g}of S){let m=T[r];if(!m)continue;let b;if(w(g))t[r]=[...m.selectedSet??[]].map((h)=>h===f?(m.otherText??"").trim():h).filter(Boolean);else{let h=m.selected??"";if(t[r]=h===f?(m.otherText??"").trim():h,h!==f)b=W(g).find((i)=>i.value===h)?.preview}let N=m.notes?.trim();if(b||N)d[r]={...b&&{preview:b},...N&&{notes:N}}}await B(l.elicitationId,t,d)},[l,S,T,F,B]),O=I(async()=>{if(l)await H(l.elicitationId)},[l,H]);if(!l||!C)return null;return J(p("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),O()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:C.left,width:C.width,bottom:C.bottom,maxHeight:"70vh"},ref:(t)=>{Q.current=t,G(t)},children:[p("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[n("div",{className:"text-foreground text-sm font-medium",children:x("askUserQuestion.title")}),q>1&&n("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${q}`})]}),n("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n("div",{className:"space-y-4 px-3 py-3",children:S.map(({key:t,property:d},r)=>{let g=T[t],m=g?.selected,b=g?.selectedSet??new Set,N=W(d),h=w(d);return p("div",{className:"space-y-2",children:[p("div",{className:"flex items-center gap-2",children:[n(Ye,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:se(d).title??t}),n("div",{className:"text-foreground text-sm font-medium",children:se(d).description})]}),h?p("div",{className:"space-y-1.5 ps-1",children:[N.map((i)=>p("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[n(P,{checked:b.has(i.value),onCheckedChange:(a)=>{k((y)=>{let A=new Set(y[t]?.selectedSet??new Set);if(a)A.add(i.value);else A.delete(i.value);return{...y,[t]:{...y[t],selectedSet:A}}})}}),p("div",{className:"min-w-0 flex-1",children:[n("div",{className:"text-foreground text-sm",children:i.label}),i.description&&n("div",{className:"text-muted-foreground text-xs",children:i.description})]})]},i.value)),p("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[n(P,{checked:b.has(f),onCheckedChange:(i)=>{k((a)=>{let y=new Set(a[t]?.selectedSet??new Set);if(i)y.add(f);else y.delete(f);return{...a,[t]:{...a[t],selectedSet:y}}})}}),n("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:x("askUserQuestion.other")})]}),b.has(f)&&n("div",{className:"ps-7",children:n(u,{placeholder:x("askUserQuestion.otherPlaceholder"),value:g?.otherText??"",onChange:(i)=>k((a)=>({...a,[t]:{...a[t],otherText:i.target.value}}))})})]}):p(v,{value:m??"",onValueChange:(i)=>k((a)=>({...a,[t]:{...a[t],selected:i}})),className:"space-y-1.5 ps-1",children:[N.map((i)=>{let a=`${r}:${i.value}`;return p("div",{className:_("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",m===i.value&&"bg-muted/60"),children:[n(c,{value:i.value,id:a}),p(o,{htmlFor:a,className:"min-w-0 flex-1 cursor-pointer",children:[n("div",{className:"text-foreground text-sm font-normal",children:i.label}),i.description&&n("div",{className:"text-muted-foreground text-xs font-normal",children:i.description})]})]},i.value)}),p("div",{className:_("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",m===f&&"bg-muted/60"),children:[n(c,{value:f,id:`${r}:other`,className:"mt-0.5"}),n(o,{htmlFor:`${r}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:x("askUserQuestion.other")})]}),m===f&&n("div",{className:"ps-7",children:n(u,{placeholder:x("askUserQuestion.otherPlaceholder"),value:g?.otherText??"",onChange:(i)=>k((a)=>({...a,[t]:{...a[t],otherText:i.target.value}}))})})]}),!h&&m&&m!==f&&(()=>{let i=N.find((a)=>a.value===m)?.preview;if(!i)return null;return n("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:i})})(),N.some((i)=>i.preview)&&n(s,{placeholder:x("askUserQuestion.notesPlaceholder"),value:g?.notes??"",onChange:(i)=>k((a)=>({...a,[t]:{...a[t],notes:i.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),p("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[n(e,{variant:"ghost",size:"sm",onClick:()=>void O(),children:x("askUserQuestion.cancel")}),n(e,{size:"sm",disabled:!F,onClick:()=>void V(),children:x("askUserQuestion.submit")})]})]}),document.body)}export{me as ChoiceElicitationForm};
1
+ import{Re}from"../chunk-51qsyrd6.js";import{e}from"../chunk-a7mr12yc.js";import{ge}from"../chunk-9bjywaze.js";import{l}from"../chunk-1hy64ewz.js";import{f}from"../chunk-ek06eyp4.js";import{V,M}from"../chunk-zcrct67v.js";import{k}from"../chunk-ncekagm6.js";import{Fn,Et,ie,ct}from"../chunk-0vvn08gg.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as B}from"cn";import{useCallback as Q,useEffect as H,useLayoutEffect as O,useMemo as _,useRef as G,useState as R}from"react";import{createPortal as W}from"react-dom";import{jsx as i,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:r,total:F,anchorRef:N,t:p,onAccept:A,onDecline:I}){let x=_(()=>r?Fn(r.requestedSchema):[],[r]),[S,b]=R({}),T=G(null);H(()=>{if(r?.elicitationId===void 0)return;let t={};for(let{key:a,property:o}of x)if(!ie(o)){let u=ct(o)[0];if(u)t[a]={selected:u.value}}b(t)},[r?.elicitationId,x]),H(()=>{if(r?.elicitationId!==void 0&&T.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")T.current.focus()},[r?.elicitationId]);let[y,L]=R(null),[C,z]=R(null),E=Q(()=>{let t=N.current;if(!t)return;let a=t.getBoundingClientRect();if(a.width===0){let o=Math.min(640,window.innerWidth*0.9);L({left:(window.innerWidth-o)/2,width:o,bottom:24});return}L({left:a.left,width:a.width,bottom:window.innerHeight-a.bottom+20})},[N]);O(()=>{if(!r)return;let t=0,a=()=>{if(N.current){E();return}t=requestAnimationFrame(a)};return a(),()=>cancelAnimationFrame(t)},[r,E,N]),O(()=>{let t=N.current;if(!r||!t||!C)return;return j(t,C,E,{animationFrame:!0})},[r,C,N,E]);let U=_(()=>{if(!r)return!1;for(let{key:t,property:a}of x){let o=S[t];if(!o)return!1;if(ie(a)){if(!o.selectedSet||o.selectedSet.size===0)return!1;if(o.selectedSet.has(c)&&!o.otherText?.trim())return!1}else{if(!o.selected)return!1;if(o.selected===c&&!o.otherText?.trim())return!1}}return!0},[r,x,S]),D=Q(async()=>{if(!r)return;if(!U)return;let t={},a={};for(let{key:o,property:u}of x){let d=S[o];if(!d)continue;let g;if(ie(u))t[o]=[...d.selectedSet??[]].map((v)=>v===c?(d.otherText??"").trim():v).filter(Boolean);else{let v=d.selected??"";if(t[o]=v===c?(d.otherText??"").trim():v,v!==c)g=ct(u).find((s)=>s.value===v)?.preview}let h=d.notes?.trim();if(g||h)a[o]={...g&&{preview:g},...h&&{notes:h}}}await A(r.elicitationId,t,a)},[r,x,S,U,A]),q=Q(async()=>{if(r)await I(r.elicitationId)},[r,I]);if(!r||!y)return null;return W(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),q()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:y.left,width:y.width,bottom:y.bottom,maxHeight:"70vh"},ref:(t)=>{T.current=t,z(t)},children:[m("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[i("div",{className:"text-foreground text-sm font-medium",children:p("askUserQuestion.title")}),F>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${F}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:a},o)=>{let u=S[t],d=u?.selected,g=u?.selectedSet??new Set,h=ct(a),v=ie(a);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[i(Re,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:Et(a).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:Et(a).description})]}),v?m("div",{className:"space-y-1.5 ps-1",children:[h.map((s)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ge,{checked:g.has(s.value),onCheckedChange:(n)=>{b((w)=>{let P=new Set(w[t]?.selectedSet??new Set);if(n)P.add(s.value);else P.delete(s.value);return{...w,[t]:{...w[t],selectedSet:P}}})}}),m("div",{className:"min-w-0 flex-1",children:[i("div",{className:"text-foreground text-sm",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs",children:s.description})]})]},s.value)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ge,{checked:g.has(c),onCheckedChange:(s)=>{b((n)=>{let w=new Set(n[t]?.selectedSet??new Set);if(s)w.add(c);else w.delete(c);return{...n,[t]:{...n[t],selectedSet:w}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}):m(V,{value:d??"",onValueChange:(s)=>b((n)=>({...n,[t]:{...n[t],selected:s}})),className:"space-y-1.5 ps-1",children:[h.map((s)=>{let n=`${o}:${s.value}`;return m("div",{className:B("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===s.value&&"bg-muted/60"),children:[i(M,{value:s.value,id:n}),m(f,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer",children:[i("div",{className:"text-foreground text-sm font-normal",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs font-normal",children:s.description})]})]},s.value)}),m("div",{className:B("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[i(M,{value:c,id:`${o}:other`,className:"mt-0.5"}),i(f,{htmlFor:`${o}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}),!v&&d&&d!==c&&(()=>{let s=h.find((n)=>n.value===d)?.preview;if(!s)return null;return i("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:s})})(),h.some((s)=>s.preview)&&i(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[i(e,{variant:"ghost",size:"sm",onClick:()=>void q(),children:p("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!U,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
@@ -1 +1 @@
1
- import{Oe,se,w,W}from"../chunk-dr6z453e.js";export{Oe as elicitationFields,se as elicitationLabels,W as elicitationOptions,w as isMultiSelect};
1
+ import{Fn,Et,ie,ct}from"../chunk-0vvn08gg.js";export{Fn as elicitationFields,Et as elicitationLabels,ct as elicitationOptions,ie as isMultiSelect};
@@ -1 +1 @@
1
- import{on,ze,Fn,Dn}from"../chunk-5h13saah.js";export{on as PERMISSION_KIND_GROUP_ORDER,Fn as isAllowKind,Dn as isAlwaysKind,ze as sortPermissionOptions};
1
+ import{mr,Bn,Kr,Qr}from"../chunk-30g0y24x.js";export{mr as PERMISSION_KIND_GROUP_ORDER,Kr as isAllowKind,Qr as isAlwaysKind,Bn as sortPermissionOptions};
@@ -1 +1 @@
1
- import{ze}from"../chunk-5h13saah.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function Y({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=ze(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}export{Y as PermissionView};
1
+ import{Ln}from"../chunk-tre0r8qm.js";import"../chunk-30g0y24x.js";export{Ln as PermissionView};
@@ -1 +1 @@
1
- import{e}from"../chunk-801v0awm.js";import{P}from"../chunk-jrrvpnf3.js";import{L,A,tt,nt,_,rt}from"../chunk-6p5hgnpq.js";import{o}from"../chunk-hx6wfscz.js";import"../chunk-h38yw8y3.js";import{ne,re,Fe,De,Be,G}from"../chunk-sky795ex.js";import{u}from"../chunk-7q7c0mds.js";import{v,c}from"../chunk-k7zzrns3.js";import{R}from"../chunk-9s1cgt7s.js";import{s}from"../chunk-c4621n0b.js";import{isArrayProperty as w,isBooleanProperty as D,isNumberProperty as S,isStringProperty as C}from"@alwith/api";import{useEffect as E,useMemo as N,useState as V}from"react";import{jsx as a,jsxs as p}from"react/jsx-runtime";function q(r){if(!C(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 I(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 B(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:w(i)?I(i.items):null}))}function k(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(D(n.property))t[n.key]=!1;else if(w(n.property))t[n.key]=[]}return t}function K(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 O({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(o,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[a("div",{className:"text-foreground text-sm",children:t}),n&&a("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function T({id:r,field:t,value:n,onChange:i}){if(t.multiOptions){let l=new Set(Array.isArray(n)?n:[]);return p(ne,{children:[a(re,{variant:"label",children:t.title}),t.description&&a(G,{children:t.description}),a("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((d)=>{let f=`${r}:${d.value}`;return a(O,{id:f,...d,control:a(P,{id:f,checked:l.has(d.value),onCheckedChange:(y)=>{let g=new Set(l);if(y)g.add(d.value);else g.delete(d.value);i([...g])}})},d.value)})})]})}if(t.options)return p(ne,{children:[a(re,{variant:"label",children:t.title}),t.description&&a(G,{children:t.description}),a(v,{value:typeof n==="string"?n:"",onValueChange:(l)=>i(String(l)),className:"flex flex-col gap-1",children:t.options.map((l)=>{let d=`${r}:${l.value}`;return a(O,{id:d,...l,control:a(c,{value:l.value,id:d})},l.value)})})]});return p(De,{children:[a(Be,{htmlFor:r,children:t.title}),D(t.property)?a(R,{id:r,checked:n===!0,onCheckedChange:(l)=>i(l)}):S(t.property)?a(u,{id:r,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(l)=>i(l.target.value===""?void 0:Number(l.target.value))}):a(s,{id:r,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(l)=>i(l.target.value)}),t.description&&a(G,{children:t.description})]})}function ee({requestId:r,schema:t,message:n,total:i,t:l,onRespond:d}){let f=N(()=>B(t),[t]),[y,g]=V(()=>k(f));E(()=>g(k(f)),[r,f]);let b=f.every((m)=>K(m,y[m.key])),x=()=>{if(!b)return;let m={};for(let[h,F]of Object.entries(y))if(F!==void 0)m[h]=F;d({action:"accept",content:m})};return a(L,{open:!0,onOpenChange:(m)=>!m&&d({action:"cancel"}),children:p(A,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(m)=>{if(m.key==="Enter"&&(m.metaKey||m.ctrlKey))m.preventDefault(),x()},children:[p(tt,{children:[p("div",{className:"flex items-center justify-between gap-2 pe-8",children:[a(_,{children:t.title??l("approval.needed")}),i>1&&a("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),a(rt,{children:n})]}),a("div",{className:"min-h-0 flex-1 overflow-y-auto",children:a(Fe,{children:f.map((m)=>a(T,{id:`${r}:${m.key}`,field:m,value:y[m.key],onChange:(h)=>g((F)=>({...F,[m.key]:h}))},m.key))})}),p(nt,{children:[a(e,{variant:"ghost",onClick:()=>d({action:"decline"}),children:l("actions.decline")}),a(e,{disabled:!b,onClick:x,children:l("actions.submit")})]})]})})}export{ee as SchemaElicitationForm,B as elicitationFields,k as initialValues,K as isAnswered};
1
+ import{kr,ur,Tr,Dn}from"../chunk-sgbde4dv.js";import"../chunk-st90r31c.js";import"../chunk-4mnf89r3.js";import"../chunk-9bjywaze.js";import"../chunk-qbdqh38y.js";import"../chunk-1hy64ewz.js";import"../chunk-cw68hvkc.js";import"../chunk-ek06eyp4.js";import"../chunk-zcrct67v.js";import"../chunk-ncekagm6.js";import"../chunk-a7mr12yc.js";export{Dn as SchemaElicitationForm,kr as elicitationFields,ur as initialValues,Tr as isAnswered};
@@ -1 +1 @@
1
- import{e}from"../chunk-801v0awm.js";import{Ue,Ve,qe,Ke,Ge,We}from"../chunk-6qa5dt1k.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function C({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(Ue,{size:"sm",children:[n(Ve,{children:[a(Ke,{children:i("approval.needed")}),a(qe,{children:r})]}),a(Ge,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(We,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}export{C as UrlElicitationCard};
1
+ import{_n}from"../chunk-86kkb0z4.js";import"../chunk-d6nxypzc.js";import"../chunk-a7mr12yc.js";export{_n as UrlElicitationCard};
@@ -0,0 +1,2 @@
1
+ import{Ce}from"./chunk-j4teycge.js";import{D,Pn}from"./chunk-p0cc67an.js";import{t}from"./chunk-yx02h2ja.js";import{On}from"./chunk-cr294svm.js";import{ne,oe,re}from"./chunk-k50475tn.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 yn({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=Ce(),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(D,{"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(ne,{children:[o(oe,{render:o(Pn,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(re,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(On,{className:"shrink-0",children:f?"↩":"Enter"})]})]})})]})}
2
+ export{yn};
@@ -0,0 +1,2 @@
1
+ var i=new Map,a=new Map,f=new Map;function Mn(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 T(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 Ze(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function lr(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 cr(t,r){if(r===null)i.delete(t);else i.set(t,r)}var s=new Map;function Je(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 dr(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,Mn,T,Ze,lr,cr,Je,dr};
@@ -0,0 +1,2 @@
1
+ var ui=1e6,mi=5000000;function ao(_,e){return _+e>5000000}function pi(_){return(_/1e6).toFixed(1)}var Y=5;
2
+ export{ui,mi,ao,pi,Y};
@@ -0,0 +1,2 @@
1
+ function Fn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function Et(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function ie(t){return t.type==="array"}function ct(t){return(ie(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
+ export{Fn,Et,ie,ct};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-yx02h2ja.js";import{e}from"./chunk-a7mr12yc.js";import{uo}from"./chunk-e43pfcrt.js";import{ae,se,le,ce}from"./chunk-qpz97p1m.js";import{n,y}from"./chunk-vxnjsga5.js";import{Loader2Icon as u}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function qe({session:t,timeline:l}){let{host:s,client:a}=n(),{t:r}=s,c=o((f)=>f.historyPages[t.id]?.cursor!=null),d=()=>y(s,a.open(t.id,t.cwd)),p=i(uo,{...l,session:t,client:a,host:s});if(t.restoring)return t.items.length===0?m("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[i(u,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(ae,{className:"flex-1",children:[m(se,{children:[i(le,{children:r("conversation.reopen")}),i(ce,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!c)return i(ae,{className:"flex-1",children:m(se,{children:[i(le,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(ce,{className:"truncate font-mono",children:t.cwd})]})});return p}
2
+ export{qe};
@@ -0,0 +1,2 @@
1
+ var Q="quick-chats";function E(e){let t=n(e);if(/^[a-z]:\//i.test(t)||t.startsWith("//"))return/^[a-z]:\/users\/[^/]+\/documents\/(codex(?:\/.*)?|alwith)$/.test(t);return/^\/Users\/[^/]+\/Documents\/(Codex(?:\/.*)?|ALwith)$/.test(e.replace(/\/+$/,""))}function n(e){return e.replaceAll("\\","/").replace(/^\/\/\?\/UNC\//i,"//").replace(/^\/\/\?\//,"").replace(/\/+$/,"").toLowerCase()}function he(e){let t=new Map([["quick-chats",[]]]);for(let r of[...e].toSorted((s,o)=>(o.updatedAt??"").localeCompare(s.updatedAt??""))){let s=E(r.cwd)?"quick-chats":r.cwd,o=t.get(s);if(o)o.push(r);else t.set(s,[r])}return[...t]}function B(e){let t=e.replaceAll("\\","/").replace(/\/+$/,"").split("/").pop();return t?t:e}
2
+ export{Q,E,he,B};
@@ -1 +1 @@
1
- import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function u({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-9 w-full min-w-0 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",i),...r})}export{u};
1
+ import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function l({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-9 w-full min-w-0 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",i),...r})}export{l};
@@ -0,0 +1,2 @@
1
+ import{createContext as i,useContext as r}from"react";import{jsx as n}from"react/jsx-runtime";var e=i(null);function nr({host:t,children:o}){return n(e.Provider,{value:t,children:o})}function a(){let t=r(e);if(t===null)throw Error("Activity host is missing");return t}function h(t){let{Markdown:o}=a();return n(o,{...t})}
2
+ export{nr,a,h};
@@ -0,0 +1,2 @@
1
+ import{C,rn,Jo,an,er,sn,tr}from"./chunk-cj5pkg2y.js";import{t,J,be,o}from"./chunk-yx02h2ja.js";import{isText as D}from"@alwith/api";import{createStore as E}from"@alwith/api/client";import{nativeTurnId as y}from"@nyssance/codex-acp-v2/client";import{jsx as f,jsxs as R}from"react/jsx-runtime";var I=E({entries:{}});function m(n,s){I.setState((e)=>({entries:{...e.entries,[n]:s}}))}function v(n,s){let e=y(s),r=n.items.findLast((a)=>y(a)!==null),p=n.items.some((a)=>a.kind==="user"&&y(a)===e&&n.turnEndedAt[a.id]!==void 0);return!s.replayed&&e!==null&&r!==void 0&&n.state!=="idle"&&!p&&y(r)===e}function N(n,s){for(let e of n.items){if(e.kind!=="user"||e.echo==="pending")continue;for(let r of[...sn(e._meta),...e.content.filter(D).flatMap((p)=>sn(p._meta))])if(r.questionItemId===s)return r.answer}return}function M({sessionId:n,item:s,question:e,index:r}){let p=J(),{t:a}=t(),x=rn(s.id,r),c=JSON.stringify([n,x]),l=be(I,(i)=>i.entries[c]),u=o((i)=>i.sessions[n]),k=o((i)=>i.connection==="ready"),d=l?.draft??Jo(e),Q=u===void 0?l?.accepted:N(u,x)??l?.accepted,h=u!==void 0&&v(u,s),A=k&&u?.attached&&!u.restoring&&!u.readOnly,g=Q!==void 0?"answered":l?.skipped?"skipped":l?.pending?"submitting":!h?"closed":!A?"unavailable":"pending",q=async()=>{if(I.getState().entries[c]?.pending||g!=="pending")return;let i=p.state.sessions[n];if(i===void 0||!v(i,s)||!i.attached||i.readOnly||i.restoring)return;let w=an(e,d);if(!w.trim())return;let b={questionItemId:x,question:e.title,answer:w};m(c,{draft:d,pending:!0});try{await p.prompt(n,[{type:"text",text:er(b),_meta:{codex:{questionReply:b}}}]),m(c,{draft:d,accepted:w})}catch(S){m(c,{draft:d,error:S instanceof Error?S.message:String(S)})}};if(g==="closed")return R("section",{className:"text-muted-foreground flex min-w-0 flex-col gap-1 text-sm","aria-label":e.title,children:[f("p",{className:"whitespace-pre-wrap",children:e.title}),d.text.trim()&&f("p",{className:"whitespace-pre-wrap",children:d.text}),f("span",{role:"status",className:"text-xs",children:a("asyncQuestion.closed")})]});return f(tr,{question:e,draft:d,status:g,answer:Q,error:g==="pending"?l?.error:void 0,t:a,onChange:(i)=>m(c,{draft:i}),onSkip:()=>m(c,{draft:d,skipped:!0}),onSubmit:()=>{q()}})}function yo({sessionId:n,item:s}){return f("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":s.id,children:C(s._meta).map((e,r)=>f(M,{sessionId:n,item:s,question:e,index:r},rn(s.id,r)))})}
2
+ export{yo};
@@ -0,0 +1,2 @@
1
+ import{Be}from"./chunk-vyzzs0nc.js";import{Eo}from"./chunk-2sy8cs84.js";import{t}from"./chunk-yx02h2ja.js";import{L}from"./chunk-h80g3eme.js";import{isContentEntry as p,isEmbeddedResource as a,isResourceLink as f}from"@alwith/api";import{memo as g,useMemo as k}from"react";import{jsx as s,jsxs as u,Fragment as R}from"react/jsx-runtime";function y({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(p).filter((e)=>a(e.content)||f(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(L,{block:e.content},`${n.id}:${l}`))]})}var So=g(function({sessionId:r,items:e,terminals:l,streamingThoughtId:m}){let i=t().toolBlock,d=k(()=>e.map((o)=>{let c={...Eo(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(R,{children:[s(Be,{blocks:d}),e.map((o)=>o.kind==="tool"&&s(y,{item:o},o.id))]})});
2
+ export{So};
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-1wc83vxg.js";import{N}from"./chunk-acrrwrzy.js";import{isContentEntry as k,isImage as b,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 h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function ye(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(!k(l))continue;let o=l.content;if(b(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 I=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(I,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function Mo({blocks:e}){let{t:r}=a(),i=e.flatMap(T),[c,l]=N(`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{ye,Mo};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Vt(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function ke(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{Vt,ke};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Go(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function tn(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{Go,tn};
@@ -1,2 +1,2 @@
1
- import{Ct}from"./chunk-q7e2bdav.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as w,FileIcon as k}from"lucide-react";import{useEffect as H,useLayoutEffect as I,useRef as T,useState as b}from"react";import{jsx as e,jsxs as g,Fragment as y}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function h(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),i=o.getBoundingClientRect();return s.top>=i.top&&s.right<=i.right&&s.bottom<=i.bottom&&s.left>=i.left}function M({text:n,host:o}){let{t:s,Markdown:i}=o,c=T(null),[l,p]=b(!1),[d,f]=b(!1);return I(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){p(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");p(r.scrollHeight>A*x+1)};t();let u=new ResizeObserver(t);return u.observe(r),()=>u.disconnect()},[]),H(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,u=typeof IntersectionObserver>"u"?null:new IntersectionObserver((a)=>{for(let m of a){let v=m.target;if(!t.has(v))continue;h(v,m.isIntersecting&&m.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let a of t.keys()){if(r.contains(a))continue;u?.unobserve(a),t.delete(a)}for(let a of r.querySelectorAll(L)){if(t.has(a)||a.hasAttribute("inert"))continue;let m=a.getAttribute("aria-hidden");t.set(a,m),h(a,u===null&&R(a,r),m),u?.observe(a)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{u?.disconnect(),C.disconnect();for(let[a,m]of t)h(a,!0,m)}},[l,d]),g("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(i,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&g("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{f((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function xe({text:n,label:o}){let[s,i]=b(!1);return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:o,onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2000)},children:s?e(N,{className:"codex-message-action-confirmed"}):e(w,{})})}function S({image:n,openImage:o}){let[s,i]=b(!1),c=`data:${n.mimeType};base64,${n.data}`;return g(y,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?i(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(Ct,{src:c,alt:"",onClose:()=>i(!1)})]})}function kt({message:n,text:o,textParts:s,mentions:i,images:c,messageTime:l,host:p,bubbleStyle:d}){let{t:f,openImage:r}=p;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:g("div",{className:"group/codex-user codex-user-message-group",children:[i.length>0&&e("div",{className:"codex-user-mentions",children:i.map((t)=>g("span",{className:"codex-user-mention",title:t.title,children:[e(k,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(y,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,u)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:p}):g(y,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},u)):e(M,{text:o,host:p})})}),g("div",{className:"codex-user-actions",children:[e(xe,{text:o,label:f("actions.copy")}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
- export{xe,kt};
1
+ import{Po}from"./chunk-zzwnpk4q.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as w,FileIcon as k}from"lucide-react";import{useEffect as H,useLayoutEffect as I,useRef as T,useState as b}from"react";import{jsx as e,jsxs as g,Fragment as y}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function h(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),i=o.getBoundingClientRect();return s.top>=i.top&&s.right<=i.right&&s.bottom<=i.bottom&&s.left>=i.left}function M({text:n,host:o}){let{t:s,Markdown:i}=o,c=T(null),[l,p]=b(!1),[d,f]=b(!1);return I(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){p(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");p(r.scrollHeight>A*x+1)};t();let u=new ResizeObserver(t);return u.observe(r),()=>u.disconnect()},[]),H(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,u=typeof IntersectionObserver>"u"?null:new IntersectionObserver((a)=>{for(let m of a){let v=m.target;if(!t.has(v))continue;h(v,m.isIntersecting&&m.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let a of t.keys()){if(r.contains(a))continue;u?.unobserve(a),t.delete(a)}for(let a of r.querySelectorAll(L)){if(t.has(a)||a.hasAttribute("inert"))continue;let m=a.getAttribute("aria-hidden");t.set(a,m),h(a,u===null&&R(a,r),m),u?.observe(a)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{u?.disconnect(),C.disconnect();for(let[a,m]of t)h(a,!0,m)}},[l,d]),g("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(i,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&g("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{f((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function Yt({text:n,label:o}){let[s,i]=b(!1);return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:o,onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2000)},children:s?e(N,{className:"codex-message-action-confirmed"}):e(w,{})})}function S({image:n,openImage:o}){let[s,i]=b(!1),c=`data:${n.mimeType};base64,${n.data}`;return g(y,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?i(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(Po,{src:c,alt:"",onClose:()=>i(!1)})]})}function To({message:n,text:o,textParts:s,mentions:i,images:c,messageTime:l,host:p,bubbleStyle:d}){let{t:f,openImage:r}=p;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:g("div",{className:"group/codex-user codex-user-message-group",children:[i.length>0&&e("div",{className:"codex-user-mentions",children:i.map((t)=>g("span",{className:"codex-user-mention",title:t.title,children:[e(k,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(y,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,u)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:p}):g(y,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},u)):e(M,{text:o,host:p})})}),g("div",{className:"codex-user-actions",children:[e(Yt,{text:o,label:f("actions.copy")}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
+ export{Yt,To};
@@ -0,0 +1,2 @@
1
+ import{s,r}from"./chunk-33mgpcnd.js";import{E}from"./chunk-1dp50khb.js";import{useEffect as f,useMemo as p}from"react";function pr(c){let e=s(),i=c===null?null:e.projectPath(c),u=r((t)=>t.sessionList),l=r((t)=>t.connection),n=r((t)=>t.sessionListLoaded),o=r((t)=>t.sessionListError),a=()=>e.listSessions({reset:!0}).catch(()=>{return});return f(()=>{if(l==="ready"&&!n&&o===null)e.listSessions().catch(()=>{return})},[e,l,n,o]),{result:p(()=>{if(n)return{status:"ready",sessionRows:u.filter((t)=>i===null?E(t.cwd):e.projectPath(t.cwd)===i).toSorted((t,d)=>(d.updatedAt??"").localeCompare(t.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[e,u,n,o,i]),retry:a}}
2
+ export{pr};
@@ -1,2 +1,2 @@
1
- import{terminalOf as u,textOf as g}from"@alwith/api";function St(n,o,r){if(n.kind!=="tool"){let t=g(n.content),c=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(t);return{type:"thinking",id:n.id,thinking:c?c[1]:t,isComplete:!r}}if(n.name==="subagent"){let t=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:p(t.agentPath,n.id),threadId:f(t.agentThreadId,"agentThreadId",n.id),activity:y(t.activity,n.id),model:l(t.model,"model",n.id),reasoningEffort:l(t.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let t=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof t.tool!=="string"||!Array.isArray(t.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:t.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:t.agents}}let i=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},e=u(n,o);if(Array.isArray(i.command))i.command=i.command.map(String).join(" ");if(n.toolKind==="execute"&&typeof i.command!=="string"){let t=e?.command??n.title;if(t!==null)i.command=t}let a=n.rawOutput;if(typeof a==="object"&&a!==null&&"output"in a&&typeof a.output==="string")a=a.output;if(e!==null&&e.output.length>0)a=e.output;let d=e?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:i,rawOutput:a,...typeof d==="number"?{exitCode:d}:{}}}function s(n,o){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${o} is missing an object codex-acp-v2 always sends`);return n}function l(n,o,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${o}`)}function p(n,o){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${o} has no agent path`);return r}function f(n,o,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${o}`)}function y(n,o){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${o} has an unknown activity ${String(n)}`)}
2
- export{St};
1
+ import{terminalOf as u,textOf as g}from"@alwith/api";function Eo(n,o,r){if(n.kind!=="tool"){let t=g(n.content),c=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(t);return{type:"thinking",id:n.id,thinking:c?c[1]:t,isComplete:!r}}if(n.name==="subagent"){let t=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:p(t.agentPath,n.id),threadId:f(t.agentThreadId,"agentThreadId",n.id),activity:y(t.activity,n.id),model:l(t.model,"model",n.id),reasoningEffort:l(t.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let t=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof t.tool!=="string"||!Array.isArray(t.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:t.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:t.agents}}let i=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},e=u(n,o);if(Array.isArray(i.command))i.command=i.command.map(String).join(" ");if(n.toolKind==="execute"&&typeof i.command!=="string"){let t=e?.command??n.title;if(t!==null)i.command=t}let a=n.rawOutput;if(typeof a==="object"&&a!==null&&"output"in a&&typeof a.output==="string")a=a.output;if(e!==null&&e.output.length>0)a=e.output;let d=e?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:i,rawOutput:a,...typeof d==="number"?{exitCode:d}:{}}}function s(n,o){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${o} is missing an object codex-acp-v2 always sends`);return n}function l(n,o,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${o}`)}function p(n,o){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${o} has no agent path`);return r}function f(n,o,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${o}`)}function y(n,o){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${o} has an unknown activity ${String(n)}`)}
2
+ export{Eo};
@@ -0,0 +1,2 @@
1
+ var mr={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Bn(e){return[...e].toSorted((o,n)=>(mr[o.kind]??99)-(mr[n.kind]??99))}function Kr(e){return e==="allow_once"||e==="allow_always"}function Qr(e){return e==="allow_always"||e==="reject_always"}
2
+ export{mr,Bn,Kr,Qr};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-a7mr12yc.js";import{d,u,b,z,m,w}from"./chunk-cw68hvkc.js";import{X}from"./chunk-3m06tqqk.js";import{createContext as C,useContext as v,useState as L,useSyncExternalStore as h}from"react";import{jsx as i,jsxs as p}from"react/jsx-runtime";var f=C(null),x=C(null),D=C(null);function hr({host:t,client:o,children:n}){let[l,a]=L(null);X(l!==null);let{t:c}=t;return i(f,{value:t,children:i(x,{value:o,children:p(D,{value:a,children:[n,i(d,{open:l!==null,onOpenChange:(y)=>!y&&a(null),children:p(u,{children:[p(b,{children:[i(m,{children:c("sessionList.deleteTitle")}),i(w,{children:c("sessionList.deleteDescription")})]}),p(z,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:c("sessionList.cancel")}),i(e,{onClick:()=>{if(l)S(t,o.delete(l.sessionId));a(null)},children:c("sessionList.delete")})]})]})})]})})})}function g(){let t=v(f);if(t===null)throw Error("Session list host is missing");return t}function s(){let t=v(x);if(t===null)throw Error("Session list client is missing");return t}function bt(){let t=v(D);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=s();return h((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function S(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
2
+ export{hr,g,s,bt,r,S};
@@ -0,0 +1,2 @@
1
+ var gi=280;function po({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 xe({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 jt({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 go({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 fo({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 ho({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{gi,po,xe,jt,go,fo,ho};
@@ -0,0 +1,2 @@
1
+ import{createContext as o,useContext as n,useEffect as r}from"react";var ro=o(null);function X(t){let e=n(ro);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
+ export{ro,X};
@@ -1,3 +1,3 @@
1
- var jn=["full","compact","codexUI"];function Mt(t){return t==="compact"||t==="codexUI"}var bn=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function m(t){let o=bn.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
2
- `)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function Qn(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
3
- export{jn,Mt,bn,m,Qn};
1
+ var hi=["full","compact","codexUI"];function Ro(t){return t==="compact"||t==="codexUI"}var Dr=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function A(t){let o=Dr.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
2
+ `)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function vi(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
3
+ export{hi,Ro,Dr,A,vi};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-yx02h2ja.js";import{O,$t,F}from"./chunk-4dcagj01.js";import{e}from"./chunk-a7mr12yc.js";import{ae,se,le,ce}from"./chunk-qpz97p1m.js";import{st,n,y}from"./chunk-vxnjsga5.js";import{Ve}from"./chunk-czahfwp7.js";import{qe}from"./chunk-14a9wet3.js";import{ot,rt}from"./chunk-t9vvcy09.js";import{it}from"./chunk-d25r0vq3.js";import{LockIcon as N,UnplugIcon as A}from"lucide-react";import{useMemo as E}from"react";import{jsx as r,jsxs as a}from"react/jsx-runtime";function ir({host:t,client:l,...c}){let m=E(()=>t.openDiff?t:{...t,openDiff:ot},[t]);return a(st,{host:m,client:l,children:[r(R,{...c}),!t.openDiff&&r(rt,{})]})}function R({session:t,header:l,overlay:c,timeline:m,composer:x,welcome:C,children:u,rootRef:w}){let{host:s,client:h}=n(),{t:i}=s,d=o((p)=>p.connection==="ready"),f=o((p)=>p.historyPages[t.id]?.error),v=()=>y(s,h.open(t.id,t.cwd)),D=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return a("div",{"data-chat-drop-zone":!0,ref:w,className:"flex h-full min-h-0 flex-col",children:[l,a("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[c,d&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:a(O,{children:[r(A,{}),r($t,{children:i("conversation.stopped")}),r(F,{children:r(e,{size:"sm",variant:"outline",onClick:v,children:i("conversation.reconnect")})})]})}),t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:a(O,{children:[r(N,{}),r($t,{children:i("conversation.readOnlyTitle")}),a(F,{className:"flex flex-wrap items-center gap-2",children:[i("conversation.readOnlyDescription"),f&&r("p",{role:"alert",className:"text-destructive w-full break-words",children:f}),r(e,{size:"sm",variant:"outline",onClick:v,disabled:!d||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")})]})]})}),D?C??r(ae,{className:"flex-1",children:a(se,{children:[r(le,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),r(ce,{children:i("conversation.welcomeDescription")})]})}):r(qe,{session:t,timeline:m}),r(it,{sessionId:t.id}),x??r(Ve,{session:t})]}),u]})}
2
+ export{ir};
@@ -0,0 +1 @@
1
+ import{cva as s}from"class-variance-authority";import{cn as a}from"cn";import{jsx as r}from"react/jsx-runtime";var n=s("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function O({className:t,variant:e,...o}){return r("div",{"data-slot":"alert",role:"alert",className:a(n({variant:e}),t),...o})}function $t({className:t,...e}){return r("div",{"data-slot":"alert-title",className:a("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...e})}function F({className:t,...e}){return r("div",{"data-slot":"alert-description",className:a("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...e})}function ai({className:t,...e}){return r("div",{"data-slot":"alert-action",className:a("absolute top-2.5 end-3",t),...e})}export{O,$t,F,ai};
@@ -0,0 +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 Ee({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{Ee};
@@ -1 +1 @@
1
- import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var mn=o("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ye({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:d(mn({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{mn,Ye};
1
+ import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var Pr=o("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Re({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:d(Pr({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{Pr,Re};
@@ -1,2 +1,2 @@
1
- function Rt(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Lt(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
- export{Rt,Lt};
1
+ function Lo(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Do(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
+ export{Lo,Do};
@@ -0,0 +1 @@
1
+ import{cn as a}from"cn";import{Loader2Icon as r}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function ve({className:o,...n}){return e(r,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:a("size-4 animate-spin",o),...n})}export{ve};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-yx02h2ja.js";import{n}from"./chunk-vxnjsga5.js";import{codexExtensionCapabilities as T,codexTurnId as _,composerPrediction as q}from"@nyssance/codex-acp-v2/client";import{useEffect as x,useRef as v,useState as P}from"react";function Ye(e,p,u,f){let{client:g}=n(),b=o((i)=>T(i.agent).composerPredictions),y=e.items.findLast((i)=>i.kind==="user"),r=_(y?._meta),t=JSON.stringify([e.id,r,e.configOptions]),l=v(null),d=v(!1);x(()=>(d.current=!0,()=>{d.current=!1}),[]);let a=JSON.stringify([e.id,r]),[c,C]=P(null),[k,I]=P(null),m=f&&b&&p&&e.state==="idle"&&e.lastStopReason==="end_turn"&&!y?.replayed&&r!==null;x(()=>{if(!m||u||c===t||l.current?.source===a||r===null)return;l.current={key:t,source:a},g.requestPrediction(e.id,r).catch((i)=>{if(d.current&&l.current?.key===t)I({key:t,message:i instanceof Error?i.message:String(i)})})},[g,m,u,c,t,a,e.id,r]);let s=q(e._meta),S=m&&!u&&c!==t&&l.current?.key===t&&s?.sourceTurnId===r,E=S&&s.result.type==="completed"?s.result.text:null,O=f&&p&&e.state==="idle"&&!u&&c!==t?k?.key===t?k.message:S&&s.result.type==="failed"?"Prediction failed":null:null;return{text:E,error:O,invalidate:()=>C(t)}}
2
+ export{Ye};
@@ -1,2 +1,2 @@
1
- import{Ot}from"./chunk-j2mcvb68.js";import{Ft,Dt,Bt}from"./chunk-2f19pcpn.js";import{zt}from"./chunk-jn2pj92h.js";import{t}from"./chunk-vw2hv2sq.js";import{h}from"./chunk-fvnb8ds4.js";import{textOf as f}from"@alwith/api";import{nativeTurnId as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function sn(i,n){return{installUnlock:n==="none"?()=>()=>{}:Dt,preload:()=>{if(n!=="none")Ft(i)},playSequence:(a,d,l)=>Bt(a,d,l,i,n)}}function _t(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=f(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(I).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:h(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(Ot,{text:i.response,host:a})})]})}function Ht(i){return r(zt,{...i,renderPreview:(n)=>r(T,{item:n})})}
2
- export{sn,_t,Ht};
1
+ import{Uo}from"./chunk-87t0qtkr.js";import{Fo,Bo,zo}from"./chunk-bycbj1aq.js";import{$o}from"./chunk-6ndz2pf9.js";import{t}from"./chunk-yx02h2ja.js";import{q}from"./chunk-dqw30cz4.js";import{textOf as f}from"@alwith/api";import{nativeTurnId as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function _r(i,n){return{installUnlock:n==="none"?()=>()=>{}:Bo,preload:()=>{if(n!=="none")Fo(i)},playSequence:(a,d,l)=>zo(a,d,l,i,n)}}function Ho(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=f(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(I).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:q(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(Uo,{text:i.response,host:a})})]})}function Oo(i){return r($o,{...i,renderPreview:(n)=>r(T,{item:n})})}
2
+ export{_r,Ho,Oo};
@@ -0,0 +1,2 @@
1
+ import{i,T,Ze}from"./chunk-0n82kdek.js";var Nn=5000;function ee(t){return"pastedText"in t}function Cr(t){return`file://${encodeURI(t).replaceAll("#","%23").replaceAll("?","%3F")}`}function Te(t,e,o){let n=(r,s)=>{for(let[a,x]of i){if(!x.attachments.some((p)=>p.id===e.id))continue;T(a,(p)=>p.map((d)=>d.id===e.id?{...e,url:s===void 0?"":Cr(s),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!i.get(t)?.attachments.some((r)=>r.id===e.id))return;n("pending"),Ze(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>n("ready",r)).catch(()=>n("error")))}function Xe(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<Nn)return;t.preventDefault(),t.stopPropagation();let s={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};T(e,(a)=>[...a,s]),Te(e,s,n)}
2
+ export{Nn,ee,Cr,Te,Xe};
@@ -1,2 +1,2 @@
1
- import{$t}from"./chunk-9dsa5vm7.js";import{useCallback as Te,useEffect as P,useLayoutEffect as xe,useMemo as Q,useRef as I,useState as E}from"react";import"@alwith/module-chat/navigation-rail.css";import{jsx as T,jsxs as Ne,Fragment as Me}from"react/jsx-runtime";var ye=4,me=10;function we(h,x){let v=new Map(x.flatMap((c)=>c.itemIds.map((w)=>[w,c.key]))),p=Array(h.length),C;for(let c=h.length-1;c>=0;c--)C=v.get(h[c])??C,p[c]=C;let O=Math.max(-1,...x.map((c)=>c.key))+1,B=new Set,n=[];for(let[c,w]of h.entries()){let S=v.get(w),m=n.at(-1);if(!m||S!==void 0&&S!==m.key||S===void 0&&m.itemIds.length>=64&&p[c]!==m.key){let y=S!==void 0&&!B.has(S)?S:O++;m={key:y,startIndex:c,itemIds:[]},n.push(m),B.add(y)}m.itemIds.push(w)}return n}function ge(h,x){if(h.size!==x.size)return!1;for(let v of h)if(!x.has(v))return!1;return!0}function zt({audio:h,beforeReveal:x,ensureItemMounted:v,items:p,onPreviewItem:C,renderPreview:O,onRevealError:B,scrollRoot:n,targetTopMarginPx:c=16}){let[w,S]=E(()=>{let e=p.at(-1);return new Set(e===void 0?[]:[e.id])}),[m,y]=E(null),[W,A]=E(null),[X,U]=E(!1),[_,fe]=E(()=>new Set),[pe,ve]=E(!0),[be,j]=E(null),{installUnlock:Z,preload:ee,playSequence:te}=h,K=I(null),M=I(null),R=I(!1),H=I(null),L=I(0),N=I(null),G=I(new Set),V=Q(()=>p.map((e)=>e.id).join("\x00"),[p]),F=I(p);F.current=p;let ne=I(_),ie=I(w),re=I({itemIdsKey:V,scrollRoot:n});if(re.current.scrollRoot!==n)L.current+=1,re.current={itemIdsKey:V,scrollRoot:n};let g=Q(()=>v===void 0?p.filter((e)=>_.has(e.id)):p,[v,p,_]),se=Q(()=>g.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[g]),z=I({ids:"",groups:[]}),ae=g.map((e)=>e.id).join("\x00");if(z.current.ids!==ae)z.current={ids:ae,groups:we(g.map((e)=>e.id),z.current.groups)};P(()=>Z(),[Z]),P(()=>()=>{if(L.current+=1,N.current!==null)clearTimeout(N.current)},[]),P(()=>{y(null),U(!1),A(null),M.current=null,R.current=!1,H.current=null,j(null),G.current.clear()},[n]),P(()=>{ee()},[ee]),P(()=>{if(n===null)return;let e=new Set,t=new Map,i=new Set(F.current.map((o)=>o.id)),r=()=>{let o=new Set(t.values()),d=F.current.filter((f)=>o.has(f.id)).map((f)=>f.id),u=d.findIndex((f)=>e.has(f));if(u===-1)return;let b=u;for(let f=u+1;f<d.length;f++)if(e.has(d[f]))b=f;let k=new Set(d.slice(u,b+1));if(ge(ie.current,k))return;ie.current=k,S(k)},s=new IntersectionObserver((o)=>{for(let d of o){let u=t.get(d.target);if(d.isIntersecting)e.add(u);else e.delete(u)}r()},{root:n,rootMargin:`-${c}px 0px 0px 0px`}),a=()=>{let o=new Set,d=new Set;for(let u of n.querySelectorAll("[data-content-search-unit-key]")){let b=u.dataset.contentSearchUnitKey;if(b===void 0||!i.has(b)||o.has(b))continue;o.add(b);let k=u.closest("[data-turn-key]"),f=k===null||d.has(k)?u:k;if(d.add(f),t.has(f))continue;t.set(f,b),s.observe(f)}for(let u of t.keys()){if(d.has(u))continue;s.unobserve(u),e.delete(t.get(u)),t.delete(u)}if(r(),ge(ne.current,o))return;ne.current=o,fe(o)};a();let l=new MutationObserver((o)=>{if(o.some((u)=>[...u.addedNodes,...u.removedNodes].some((b)=>b instanceof Element&&(b.matches("[data-turn-key], [data-content-search-unit-key]")||b.querySelector("[data-turn-key], [data-content-search-unit-key]")!==null))))a()});return l.observe(n,{childList:!0,subtree:!0}),()=>{l.disconnect(),s.disconnect()}},[V,n,c]);let J=g.find((e)=>w.has(e.id))?.id??g.at(-1)?.id;xe(()=>{let e=K.current;if(e===null||M.current!==null||J===void 0)return;let t=e.querySelector(`[data-timeline-user-message-navigation-item-id="${CSS.escape(J)}"]`);if(t===null)return;let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<i.top)e.scrollTop+=r.top-i.top;else if(r.bottom>i.bottom)e.scrollTop+=r.bottom-i.bottom+1},[J,V]),P(()=>{let e=n?.querySelector("[data-timeline-user-message-navigation-content]");if(!n||!e)return;let t=()=>{let r=n.getBoundingClientRect(),s=e.getBoundingClientRect();if(r.width===0||s.width===0)return;let a=n.offsetWidth>0?r.width/n.offsetWidth:1;ve((s.left-r.left)/a>=48)},i=new ResizeObserver(t);return i.observe(n),i.observe(e),t(),()=>i.disconnect()},[n]);let Ie=Te(async(e,t="smooth")=>{if(n===null)throw Error("Thread user-message navigation scroll root is missing");let i=L.current+1;L.current=i,x();let r=()=>n.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`),s=r(),a=s!==null&&n.clientHeight>0&&s.closest("[data-turn-key]")!==null&&Math.abs(s.getBoundingClientRect().top-n.getBoundingClientRect().top)>n.clientHeight*2;if((s===null||a)&&v!==void 0){if(t==="instant"&&e.isLoaded===!1)return;s=await v(e,()=>L.current===i)??r(),t="instant"}if(L.current!==i)return;if(s===null)return;let l=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;s.scrollIntoView({behavior:l?"instant":t,block:"start"}),s.querySelector("[data-user-message-bubble], [data-composer-attachment-pill]")?.animate?.([{backgroundColor:"color-mix(in srgb, var(--foreground) 14%, transparent)"},{backgroundColor:"color-mix(in srgb, var(--foreground) 14%, transparent)",offset:0.35},{backgroundColor:"transparent"}],{duration:l?0:1000,easing:"cubic-bezier(0.23, 1, 0.32, 1)"})},[x,v,n]);if(g.length<ye||!pe)return null;let Y=()=>{if(N.current!==null)clearTimeout(N.current);N.current=null},oe=(e,t=!1)=>{if(Y(),C===void 0||e.isLoaded!==!1||G.current.has(e.turnKey))return;let i=()=>{N.current=null,G.current.add(e.turnKey),C(e).catch(()=>G.current.delete(e.turnKey))};if(t)i();else N.current=setTimeout(i,150)},q=m===null?null:g.find((e)=>e.id===m.item.id)??g.find((e)=>e.nativeTurnId!==void 0&&e.nativeTurnId===m.item.nativeTurnId)??m.item,ue=(e,t="smooth")=>{Ie(e,t).catch((i)=>{if(B)B(i);else throw i})},le=g.findIndex((e)=>e.id===(W??be)),de=K.current,he=m===null||!de?.contains(m.button)?0:Se(de,m.button),ce=(e)=>{let t=e?.closest("[data-timeline-user-message-navigation-item-id]"),i=K.current;if(t===void 0||t===null||!i.contains(t))return null;let r=t.dataset.timelineUserMessageNavigationItemId,s=g.findIndex((a)=>a.id===r);return{button:t,item:g[s],index:s}},D=(e)=>{let t=M.current;if(t?.pointerId!==e.pointerId)return;if(M.current=null,A(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return T("nav",{"aria-label":"User messages",className:"timeline-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:T($t,{open:X,onOpenChange:U,side:"inline-end",sideOffset:0,align:"center",alignOffset:he,trigger:T("div",{ref:K,"data-timeline-user-message-navigation-rail-list":!0,"data-scrubbing":W===null?void 0:"",className:"timeline-user-message-navigation-rail-list",onPointerEnter:()=>{H.current=null},onPointerDown:(e)=>{if(e.button!==0)return;Y();let t=ce(e.target instanceof Element?e.target:null);if(t===null)return;R.current=!1,M.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),A(t.item.id),y(t),U(!0)},onPointerMove:(e)=>{let t=M.current;if(t===null){let l=ce(e.target instanceof Element?e.target:null);if(l!==null){j(l.item.id);let o=H.current;if(o!==null&&o!==l.index)te(o,l.index,se);H.current=l.index,y((d)=>d?.item.id===l.item.id?d:l),oe(l.item)}return}if(t.pointerId!==e.pointerId)return;if((e.buttons&1)===0){D(e);return}let i=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(g.length-1,Math.floor((e.clientY-i.top+e.currentTarget.scrollTop)/me))),a={button:e.currentTarget.querySelectorAll("[data-timeline-user-message-navigation-item-id]")[r],item:g[r],index:r};if(a.item.id===t.itemId)return;te(t.itemIndex,a.index,se),H.current=a.index,M.current={...t,itemId:a.item.id,itemIndex:a.index},R.current=!0,A(a.item.id),y(a),ue(a.item,"instant")},onPointerUp:D,onPointerCancel:D,onLostPointerCapture:D,onPointerLeave:()=>{if(Y(),j(null),H.current=null,M.current===null&&!X)y(null)},children:T("div",{className:"flex flex-col",children:z.current.groups.map((e)=>T("div",{className:"flex w-9 shrink-0 flex-col [content-visibility:auto]",style:{height:e.itemIds.length*me},children:g.slice(e.startIndex,e.startIndex+e.itemIds.length).map((t,i)=>{let r=e.startIndex+i,s=Math.abs(r-le),a=le===-1||s>3?void 0:[1,0.7,0.4,0.2][s];return T("button",{type:"button","data-timeline-user-message-navigation-item-id":t.id,"data-scrub-target":W===t.id?"":void 0,"aria-current":w.has(t.id)?"true":void 0,"aria-label":`Jump to user message ${r+1}`,className:"timeline-user-message-navigation-row",onClick:(l)=>{if(R.current){R.current=!1;return}let o={button:l.currentTarget,item:t,index:r};y(o),U(!0),ue(t)},onFocus:(l)=>{oe(t,!0),y({button:l.currentTarget,item:t,index:r}),U(!0)},children:T("span",{className:"flex h-0.5 w-[30px] items-center",children:T("span",{className:"timeline-user-message-navigation-marker",style:a===void 0?void 0:{"--marker-progress":a}})})},t.id)})},e.key))})}),children:q!==null&&T("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:O?O(q):Ne(Me,{children:[T("div",{className:"min-w-0 truncate font-medium",children:q.label}),q.response.length>0&&T("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:q.response})]})})})})}function Se(h,x){let v=h.getBoundingClientRect(),p=x.getBoundingClientRect();return p.top+p.height/2-(v.top+v.height/2)}
2
- export{zt};
1
+ import{qo}from"./chunk-pb6xtb3n.js";import{useCallback as Te,useEffect as P,useLayoutEffect as xe,useMemo as Q,useRef as I,useState as E}from"react";import"@alwith/module-chat/navigation-rail.css";import{jsx as T,jsxs as Ne,Fragment as Me}from"react/jsx-runtime";var ye=4,me=10;function we(h,x){let v=new Map(x.flatMap((c)=>c.itemIds.map((w)=>[w,c.key]))),p=Array(h.length),C;for(let c=h.length-1;c>=0;c--)C=v.get(h[c])??C,p[c]=C;let O=Math.max(-1,...x.map((c)=>c.key))+1,B=new Set,n=[];for(let[c,w]of h.entries()){let S=v.get(w),m=n.at(-1);if(!m||S!==void 0&&S!==m.key||S===void 0&&m.itemIds.length>=64&&p[c]!==m.key){let y=S!==void 0&&!B.has(S)?S:O++;m={key:y,startIndex:c,itemIds:[]},n.push(m),B.add(y)}m.itemIds.push(w)}return n}function ge(h,x){if(h.size!==x.size)return!1;for(let v of h)if(!x.has(v))return!1;return!0}function $o({audio:h,beforeReveal:x,ensureItemMounted:v,items:p,onPreviewItem:C,renderPreview:O,onRevealError:B,scrollRoot:n,targetTopMarginPx:c=16}){let[w,S]=E(()=>{let e=p.at(-1);return new Set(e===void 0?[]:[e.id])}),[m,y]=E(null),[W,A]=E(null),[X,U]=E(!1),[_,fe]=E(()=>new Set),[pe,ve]=E(!0),[be,j]=E(null),{installUnlock:Z,preload:ee,playSequence:te}=h,K=I(null),M=I(null),R=I(!1),H=I(null),L=I(0),N=I(null),G=I(new Set),V=Q(()=>p.map((e)=>e.id).join("\x00"),[p]),F=I(p);F.current=p;let ne=I(_),ie=I(w),re=I({itemIdsKey:V,scrollRoot:n});if(re.current.scrollRoot!==n)L.current+=1,re.current={itemIdsKey:V,scrollRoot:n};let g=Q(()=>v===void 0?p.filter((e)=>_.has(e.id)):p,[v,p,_]),se=Q(()=>g.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[g]),z=I({ids:"",groups:[]}),ae=g.map((e)=>e.id).join("\x00");if(z.current.ids!==ae)z.current={ids:ae,groups:we(g.map((e)=>e.id),z.current.groups)};P(()=>Z(),[Z]),P(()=>()=>{if(L.current+=1,N.current!==null)clearTimeout(N.current)},[]),P(()=>{y(null),U(!1),A(null),M.current=null,R.current=!1,H.current=null,j(null),G.current.clear()},[n]),P(()=>{ee()},[ee]),P(()=>{if(n===null)return;let e=new Set,t=new Map,i=new Set(F.current.map((o)=>o.id)),r=()=>{let o=new Set(t.values()),d=F.current.filter((f)=>o.has(f.id)).map((f)=>f.id),u=d.findIndex((f)=>e.has(f));if(u===-1)return;let b=u;for(let f=u+1;f<d.length;f++)if(e.has(d[f]))b=f;let k=new Set(d.slice(u,b+1));if(ge(ie.current,k))return;ie.current=k,S(k)},s=new IntersectionObserver((o)=>{for(let d of o){let u=t.get(d.target);if(d.isIntersecting)e.add(u);else e.delete(u)}r()},{root:n,rootMargin:`-${c}px 0px 0px 0px`}),a=()=>{let o=new Set,d=new Set;for(let u of n.querySelectorAll("[data-content-search-unit-key]")){let b=u.dataset.contentSearchUnitKey;if(b===void 0||!i.has(b)||o.has(b))continue;o.add(b);let k=u.closest("[data-turn-key]"),f=k===null||d.has(k)?u:k;if(d.add(f),t.has(f))continue;t.set(f,b),s.observe(f)}for(let u of t.keys()){if(d.has(u))continue;s.unobserve(u),e.delete(t.get(u)),t.delete(u)}if(r(),ge(ne.current,o))return;ne.current=o,fe(o)};a();let l=new MutationObserver((o)=>{if(o.some((u)=>[...u.addedNodes,...u.removedNodes].some((b)=>b instanceof Element&&(b.matches("[data-turn-key], [data-content-search-unit-key]")||b.querySelector("[data-turn-key], [data-content-search-unit-key]")!==null))))a()});return l.observe(n,{childList:!0,subtree:!0}),()=>{l.disconnect(),s.disconnect()}},[V,n,c]);let J=g.find((e)=>w.has(e.id))?.id??g.at(-1)?.id;xe(()=>{let e=K.current;if(e===null||M.current!==null||J===void 0)return;let t=e.querySelector(`[data-timeline-user-message-navigation-item-id="${CSS.escape(J)}"]`);if(t===null)return;let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<i.top)e.scrollTop+=r.top-i.top;else if(r.bottom>i.bottom)e.scrollTop+=r.bottom-i.bottom+1},[J,V]),P(()=>{let e=n?.querySelector("[data-timeline-user-message-navigation-content]");if(!n||!e)return;let t=()=>{let r=n.getBoundingClientRect(),s=e.getBoundingClientRect();if(r.width===0||s.width===0)return;let a=n.offsetWidth>0?r.width/n.offsetWidth:1;ve((s.left-r.left)/a>=48)},i=new ResizeObserver(t);return i.observe(n),i.observe(e),t(),()=>i.disconnect()},[n]);let Ie=Te(async(e,t="smooth")=>{if(n===null)throw Error("Thread user-message navigation scroll root is missing");let i=L.current+1;L.current=i,x();let r=()=>n.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`),s=r(),a=s!==null&&n.clientHeight>0&&s.closest("[data-turn-key]")!==null&&Math.abs(s.getBoundingClientRect().top-n.getBoundingClientRect().top)>n.clientHeight*2;if((s===null||a)&&v!==void 0){if(t==="instant"&&e.isLoaded===!1)return;s=await v(e,()=>L.current===i)??r(),t="instant"}if(L.current!==i)return;if(s===null)return;let l=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;s.scrollIntoView({behavior:l?"instant":t,block:"start"}),s.querySelector("[data-user-message-bubble], [data-composer-attachment-pill]")?.animate?.([{backgroundColor:"color-mix(in srgb, var(--foreground) 14%, transparent)"},{backgroundColor:"color-mix(in srgb, var(--foreground) 14%, transparent)",offset:0.35},{backgroundColor:"transparent"}],{duration:l?0:1000,easing:"cubic-bezier(0.23, 1, 0.32, 1)"})},[x,v,n]);if(g.length<ye||!pe)return null;let Y=()=>{if(N.current!==null)clearTimeout(N.current);N.current=null},oe=(e,t=!1)=>{if(Y(),C===void 0||e.isLoaded!==!1||G.current.has(e.turnKey))return;let i=()=>{N.current=null,G.current.add(e.turnKey),C(e).catch(()=>G.current.delete(e.turnKey))};if(t)i();else N.current=setTimeout(i,150)},q=m===null?null:g.find((e)=>e.id===m.item.id)??g.find((e)=>e.nativeTurnId!==void 0&&e.nativeTurnId===m.item.nativeTurnId)??m.item,ue=(e,t="smooth")=>{Ie(e,t).catch((i)=>{if(B)B(i);else throw i})},le=g.findIndex((e)=>e.id===(W??be)),de=K.current,he=m===null||!de?.contains(m.button)?0:Se(de,m.button),ce=(e)=>{let t=e?.closest("[data-timeline-user-message-navigation-item-id]"),i=K.current;if(t===void 0||t===null||!i.contains(t))return null;let r=t.dataset.timelineUserMessageNavigationItemId,s=g.findIndex((a)=>a.id===r);return{button:t,item:g[s],index:s}},D=(e)=>{let t=M.current;if(t?.pointerId!==e.pointerId)return;if(M.current=null,A(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return T("nav",{"aria-label":"User messages",className:"timeline-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:T(qo,{open:X,onOpenChange:U,side:"inline-end",sideOffset:0,align:"center",alignOffset:he,trigger:T("div",{ref:K,"data-timeline-user-message-navigation-rail-list":!0,"data-scrubbing":W===null?void 0:"",className:"timeline-user-message-navigation-rail-list",onPointerEnter:()=>{H.current=null},onPointerDown:(e)=>{if(e.button!==0)return;Y();let t=ce(e.target instanceof Element?e.target:null);if(t===null)return;R.current=!1,M.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),A(t.item.id),y(t),U(!0)},onPointerMove:(e)=>{let t=M.current;if(t===null){let l=ce(e.target instanceof Element?e.target:null);if(l!==null){j(l.item.id);let o=H.current;if(o!==null&&o!==l.index)te(o,l.index,se);H.current=l.index,y((d)=>d?.item.id===l.item.id?d:l),oe(l.item)}return}if(t.pointerId!==e.pointerId)return;if((e.buttons&1)===0){D(e);return}let i=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(g.length-1,Math.floor((e.clientY-i.top+e.currentTarget.scrollTop)/me))),a={button:e.currentTarget.querySelectorAll("[data-timeline-user-message-navigation-item-id]")[r],item:g[r],index:r};if(a.item.id===t.itemId)return;te(t.itemIndex,a.index,se),H.current=a.index,M.current={...t,itemId:a.item.id,itemIndex:a.index},R.current=!0,A(a.item.id),y(a),ue(a.item,"instant")},onPointerUp:D,onPointerCancel:D,onLostPointerCapture:D,onPointerLeave:()=>{if(Y(),j(null),H.current=null,M.current===null&&!X)y(null)},children:T("div",{className:"flex flex-col",children:z.current.groups.map((e)=>T("div",{className:"flex w-9 shrink-0 flex-col [content-visibility:auto]",style:{height:e.itemIds.length*me},children:g.slice(e.startIndex,e.startIndex+e.itemIds.length).map((t,i)=>{let r=e.startIndex+i,s=Math.abs(r-le),a=le===-1||s>3?void 0:[1,0.7,0.4,0.2][s];return T("button",{type:"button","data-timeline-user-message-navigation-item-id":t.id,"data-scrub-target":W===t.id?"":void 0,"aria-current":w.has(t.id)?"true":void 0,"aria-label":`Jump to user message ${r+1}`,className:"timeline-user-message-navigation-row",onClick:(l)=>{if(R.current){R.current=!1;return}let o={button:l.currentTarget,item:t,index:r};y(o),U(!0),ue(t)},onFocus:(l)=>{oe(t,!0),y({button:l.currentTarget,item:t,index:r}),U(!0)},children:T("span",{className:"flex h-0.5 w-[30px] items-center",children:T("span",{className:"timeline-user-message-navigation-marker",style:a===void 0?void 0:{"--marker-progress":a}})})},t.id)})},e.key))})}),children:q!==null&&T("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:O?O(q):Ne(Me,{children:[T("div",{className:"min-w-0 truncate font-medium",children:q.label}),q.response.length>0&&T("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:q.response})]})})})})}function Se(h,x){let v=h.getBoundingClientRect(),p=x.getBoundingClientRect();return p.top+p.height/2-(v.top+v.height/2)}
2
+ export{$o};
@@ -0,0 +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 to={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},no={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function xt({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=to[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",no.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{to,no,xt};
@@ -0,0 +1,2 @@
1
+ import{s,r}from"./chunk-33mgpcnd.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function gr(e,o){let a=s(),c=r((t)=>t.connection),i=r((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=r((t)=>v(t.sessions[e]?.items)),f=r((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await a.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(o==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[a,e,c,f,i,o]),i?u:p??u}
2
+ export{gr};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-a7mr12yc.js";import{zn,Un,$n,qn,Vn,Gn}from"./chunk-d6nxypzc.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function _n({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(zn,{size:"sm",children:[n(Un,{children:[a(qn,{children:i("approval.needed")}),a($n,{children:r})]}),a(Vn,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(Gn,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
+ export{_n};