@alwith/module-chat 0.6.9 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/README.md +30 -1
  2. package/assets/catalogs/anthropic/models.json +308 -0
  3. package/assets/provider-catalog.json +29 -0
  4. package/dist/activity-host.js +1 -1
  5. package/dist/app-reference.d.ts +9 -0
  6. package/dist/app-reference.js +1 -0
  7. package/dist/approval/choice-elicitation-form.js +1 -1
  8. package/dist/approval/choice-schema.js +1 -1
  9. package/dist/approval/permission-options.js +1 -1
  10. package/dist/approval/permission-view.js +1 -1
  11. package/dist/approval/schema-elicitation-form.js +1 -1
  12. package/dist/approval/url-elicitation-card.js +1 -1
  13. package/dist/{chunk-xgcwrqpw.js → chunk-06yzz0yx.js} +2 -2
  14. package/dist/chunk-0aqnqk7b.js +2 -0
  15. package/dist/{chunk-v5mb5c61.js → chunk-0d0bfb8e.js} +2 -2
  16. package/dist/chunk-0r4b11t4.js +2 -0
  17. package/dist/chunk-0srja8yh.js +2 -0
  18. package/dist/{chunk-4jh2wk80.js → chunk-0xmj4d4z.js} +2 -2
  19. package/dist/chunk-1647cyqx.js +2 -0
  20. package/dist/{chunk-wwq7d7qm.js → chunk-19yjze8m.js} +5 -5
  21. package/dist/{chunk-8428vfp3.js → chunk-1axvr26t.js} +2 -2
  22. package/dist/{chunk-8fnjpx11.js → chunk-1bt8a25d.js} +2 -2
  23. package/dist/chunk-1g54ee1j.js +2 -0
  24. package/dist/{chunk-bxmgvyfe.js → chunk-1mf3b58j.js} +2 -2
  25. package/dist/{chunk-kxw57gdb.js → chunk-1sxmqb44.js} +2 -2
  26. package/dist/{chunk-q0bwkhpy.js → chunk-1tb3d2x4.js} +2 -2
  27. package/dist/chunk-1ye5ygbk.js +2 -0
  28. package/dist/chunk-24dqkjvg.js +2 -0
  29. package/dist/chunk-26bm75r2.js +2 -0
  30. package/dist/{chunk-f2a9rqfz.js → chunk-2761tcb3.js} +2 -2
  31. package/dist/{chunk-q5fn378d.js → chunk-290e7g1q.js} +2 -2
  32. package/dist/chunk-2s5598rk.js +2 -0
  33. package/dist/{chunk-p38vws4a.js → chunk-2wex96dp.js} +2 -2
  34. package/dist/{chunk-z5c4njqk.js → chunk-3ab38s9g.js} +2 -2
  35. package/dist/{chunk-j18830g5.js → chunk-3ddgyzhz.js} +3 -3
  36. package/dist/chunk-3kzmec3f.js +2 -0
  37. package/dist/{chunk-qdw6bkg1.js → chunk-3pcbgsm6.js} +2 -2
  38. package/dist/{chunk-grgq7twf.js → chunk-3tsy36rq.js} +2 -2
  39. package/dist/chunk-4gstmex3.js +2 -0
  40. package/dist/chunk-52tcfvz0.js +2 -0
  41. package/dist/{chunk-18j37y1m.js → chunk-53ptmmsx.js} +2 -2
  42. package/dist/chunk-5q0kb3yb.js +2 -0
  43. package/dist/{chunk-29jan02g.js → chunk-5s85tvas.js} +2 -2
  44. package/dist/chunk-5y5b3w22.js +2 -0
  45. package/dist/{chunk-nsy1ne51.js → chunk-5ykpe629.js} +2 -2
  46. package/dist/{chunk-fgr2g610.js → chunk-5zq0s9fd.js} +3 -3
  47. package/dist/chunk-677dyzb1.js +4 -0
  48. package/dist/chunk-6cbj9r2x.js +2 -0
  49. package/dist/{chunk-4nnyn9b2.js → chunk-6fvrhr9x.js} +2 -2
  50. package/dist/chunk-6g5z3pff.js +2 -0
  51. package/dist/chunk-6tkjdrnj.js +2 -0
  52. package/dist/chunk-6z3nch41.js +1 -0
  53. package/dist/{chunk-njre3ygs.js → chunk-782x5ryb.js} +2 -2
  54. package/dist/chunk-799h4586.js +2 -0
  55. package/dist/{chunk-76a04a6j.js → chunk-7cj104ba.js} +2 -2
  56. package/dist/chunk-7m08m4m1.js +2 -0
  57. package/dist/chunk-7p3nx5bx.js +2 -0
  58. package/dist/chunk-7qmj50a2.js +2 -0
  59. package/dist/{chunk-jxgtgpa9.js → chunk-7wgt5rjw.js} +2 -2
  60. package/dist/{chunk-jg6r0ckn.js → chunk-7wj3dcpj.js} +2 -2
  61. package/dist/chunk-7xc69d48.js +2 -0
  62. package/dist/chunk-844s61q1.js +2 -0
  63. package/dist/chunk-87br10bq.js +2 -0
  64. package/dist/chunk-88j29hzx.js +2 -0
  65. package/dist/chunk-8a1th59e.js +2 -0
  66. package/dist/{chunk-e0c8pmjc.js → chunk-8c7x6vrs.js} +3 -3
  67. package/dist/{chunk-d9mmpjrr.js → chunk-8jgstab4.js} +2 -2
  68. package/dist/{chunk-k7y6dqf2.js → chunk-8pdapsc7.js} +2 -2
  69. package/dist/{chunk-kctrzc57.js → chunk-8t1brzbh.js} +2 -2
  70. package/dist/chunk-8wydj0hv.js +2 -0
  71. package/dist/{chunk-fd8x014y.js → chunk-8xn58z0x.js} +3 -3
  72. package/dist/{chunk-8d86yqzq.js → chunk-9he6963p.js} +2 -2
  73. package/dist/chunk-9n2wwk4g.js +2 -0
  74. package/dist/{chunk-a8j61zs9.js → chunk-a953k2dj.js} +3 -3
  75. package/dist/chunk-aardrb6e.js +2 -0
  76. package/dist/{chunk-n3d2mv93.js → chunk-acmc2r2s.js} +3 -3
  77. package/dist/chunk-akk3k2sc.js +4 -0
  78. package/dist/chunk-b0bd8abz.js +2 -0
  79. package/dist/{chunk-ek3v1g24.js → chunk-b5jq0ken.js} +2 -2
  80. package/dist/{chunk-hx3mqvkw.js → chunk-b8c460mr.js} +2 -2
  81. package/dist/{chunk-5f889j6j.js → chunk-ba4fa6fc.js} +2 -2
  82. package/dist/{chunk-9e6rv193.js → chunk-bp6f5tv8.js} +2 -2
  83. package/dist/chunk-bqdnxftw.js +2 -0
  84. package/dist/{chunk-9cqpn67f.js → chunk-btrg3ywt.js} +2 -2
  85. package/dist/chunk-bv175dn9.js +2 -0
  86. package/dist/{chunk-xgyb00qq.js → chunk-cctw9m9a.js} +2 -2
  87. package/dist/{chunk-958qyr8g.js → chunk-cdgfr4n0.js} +2 -2
  88. package/dist/chunk-cqskn18r.js +2 -0
  89. package/dist/chunk-crg1ttkp.js +2 -0
  90. package/dist/{chunk-v0mbfaqw.js → chunk-cx1sg5dt.js} +2 -2
  91. package/dist/{chunk-eq7vpgn7.js → chunk-d51rg15n.js} +2 -2
  92. package/dist/chunk-der9jtk9.js +2 -0
  93. package/dist/{chunk-8689y4n5.js → chunk-djk0ebpk.js} +2 -2
  94. package/dist/{chunk-1fh3vvpe.js → chunk-eeqppv9j.js} +3 -3
  95. package/dist/chunk-eg9c12vk.js +2 -0
  96. package/dist/{chunk-x6yxbndc.js → chunk-ehhzhjyb.js} +2 -2
  97. package/dist/{chunk-h4r8cx37.js → chunk-ex20n22v.js} +2 -2
  98. package/dist/{chunk-jwzwz2wr.js → chunk-f2wy8jza.js} +2 -2
  99. package/dist/{chunk-18z4wmhb.js → chunk-f8tv9m81.js} +2 -2
  100. package/dist/{chunk-stqqrke0.js → chunk-fgre64ge.js} +2 -2
  101. package/dist/chunk-fkmka3v9.js +2 -0
  102. package/dist/{chunk-4cb0c8ae.js → chunk-fnvjemhq.js} +2 -2
  103. package/dist/chunk-fp3rp1qc.js +2 -0
  104. package/dist/{chunk-snd4q8wg.js → chunk-ggkjq8rk.js} +2 -2
  105. package/dist/{chunk-rfahybr0.js → chunk-gnpvd7wg.js} +2 -2
  106. package/dist/{chunk-yftn8cw0.js → chunk-h1embxgj.js} +2 -2
  107. package/dist/chunk-h9rwby5r.js +2 -0
  108. package/dist/chunk-hhdeh622.js +2 -0
  109. package/dist/chunk-hqdbv5hw.js +2 -0
  110. package/dist/chunk-j5trhvx8.js +4 -0
  111. package/dist/{chunk-bt0t1pev.js → chunk-j71h60r0.js} +2 -2
  112. package/dist/{chunk-pdrz9qs1.js → chunk-j7w4jr8y.js} +2 -2
  113. package/dist/{chunk-9wk2xp6v.js → chunk-jgseey5x.js} +3 -3
  114. package/dist/{chunk-36mdfph1.js → chunk-jpm15hcd.js} +2 -2
  115. package/dist/{chunk-3jfkrwjq.js → chunk-jzyj96ws.js} +1 -1
  116. package/dist/{chunk-fnw16wjx.js → chunk-k5cjaeza.js} +2 -2
  117. package/dist/{chunk-3zwbr9xs.js → chunk-kgjdh49d.js} +2 -2
  118. package/dist/{chunk-pks7f314.js → chunk-m7exm1n3.js} +5 -5
  119. package/dist/{chunk-80r0jch1.js → chunk-mdp2zdqm.js} +2 -2
  120. package/dist/{chunk-5f5jfr40.js → chunk-mmywt5fq.js} +2 -2
  121. package/dist/{chunk-fqgz93sy.js → chunk-mxh0vcye.js} +2 -2
  122. package/dist/chunk-mz8tjgre.js +2 -0
  123. package/dist/{chunk-tqz7csrk.js → chunk-mzwwsacy.js} +2 -2
  124. package/dist/{chunk-ewjh6s2b.js → chunk-n13y99dj.js} +2 -2
  125. package/dist/chunk-nktaekpq.js +2 -0
  126. package/dist/chunk-nrvd7njv.js +2 -0
  127. package/dist/{chunk-24kpx8fg.js → chunk-nxjr0z23.js} +2 -2
  128. package/dist/chunk-p95ndy0b.js +3 -0
  129. package/dist/{chunk-5v8f2sbp.js → chunk-pfqz31kk.js} +2 -2
  130. package/dist/{chunk-yfws137b.js → chunk-pjgym6rx.js} +2 -2
  131. package/dist/{chunk-ha2f2cwz.js → chunk-pnavf2zs.js} +2 -2
  132. package/dist/{chunk-7egc2evj.js → chunk-pr5wv14q.js} +2 -2
  133. package/dist/{chunk-fw2jj4hh.js → chunk-q2z9w661.js} +2 -2
  134. package/dist/{chunk-0eewkw7t.js → chunk-q4f8zazc.js} +2 -2
  135. package/dist/chunk-qyj4d255.js +5 -0
  136. package/dist/chunk-r29b0ap8.js +2 -0
  137. package/dist/{chunk-7x150rqz.js → chunk-r6b9fdnm.js} +2 -2
  138. package/dist/{chunk-3v39hqex.js → chunk-r9ny4bqk.js} +2 -2
  139. package/dist/{chunk-vttgk30b.js → chunk-r9szj8sp.js} +2 -2
  140. package/dist/{chunk-tv1frh1m.js → chunk-rb4p3h5b.js} +2 -2
  141. package/dist/{chunk-658y6xth.js → chunk-rge2pazt.js} +2 -2
  142. package/dist/chunk-rgn6pdaa.js +2 -0
  143. package/dist/chunk-rhcpe6m6.js +2 -0
  144. package/dist/{chunk-1zypzzje.js → chunk-rhxyb55x.js} +2 -2
  145. package/dist/{chunk-qm649qdv.js → chunk-rq7t6qry.js} +2 -2
  146. package/dist/{chunk-7qwbxdyb.js → chunk-rtdjp07m.js} +2 -2
  147. package/dist/{chunk-gbsqs904.js → chunk-rvbbb9rf.js} +2 -2
  148. package/dist/chunk-rvjfb004.js +2 -0
  149. package/dist/{chunk-s4m2h876.js → chunk-rwh1yvqn.js} +2 -2
  150. package/dist/chunk-s267ztm1.js +2 -0
  151. package/dist/{chunk-ajjd22hb.js → chunk-s4v10afm.js} +3 -3
  152. package/dist/{chunk-xbqvb31f.js → chunk-sjes4cxr.js} +2 -2
  153. package/dist/chunk-snee6rb9.js +5 -0
  154. package/dist/{chunk-hbm3sgw7.js → chunk-st0gd22t.js} +2 -2
  155. package/dist/{chunk-brfr0m5g.js → chunk-sygx6n0s.js} +2 -2
  156. package/dist/chunk-t3sqxded.js +2 -0
  157. package/dist/chunk-tbv1mfdg.js +3 -0
  158. package/dist/{chunk-wbhxpwm7.js → chunk-tme1d6xh.js} +2 -2
  159. package/dist/{chunk-zae7p9pm.js → chunk-v28fv6c4.js} +2 -2
  160. package/dist/chunk-vdc46qt2.js +2 -0
  161. package/dist/{chunk-pza08wvz.js → chunk-vk7kqa6a.js} +2 -2
  162. package/dist/{chunk-t1zw5wrq.js → chunk-vkbaa74h.js} +2 -2
  163. package/dist/{chunk-9p1jvznr.js → chunk-vpzjhbfa.js} +2 -2
  164. package/dist/chunk-vxexg361.js +2 -0
  165. package/dist/chunk-vxn8gfy4.js +2 -0
  166. package/dist/{chunk-1341xyde.js → chunk-wj2xjzds.js} +2 -2
  167. package/dist/{chunk-np76wm1k.js → chunk-wz6a2j26.js} +2 -2
  168. package/dist/chunk-x2ayy0ys.js +7 -0
  169. package/dist/{chunk-wyr7zv2j.js → chunk-xary32dg.js} +2 -2
  170. package/dist/{chunk-kjt77brz.js → chunk-xvfvxjyp.js} +2 -2
  171. package/dist/{chunk-1940kkcm.js → chunk-xw2zfj4c.js} +2 -2
  172. package/dist/{chunk-70bm3f7n.js → chunk-xztxaq9k.js} +2 -2
  173. package/dist/{chunk-jzaxy8af.js → chunk-y3mk12gg.js} +2 -2
  174. package/dist/{chunk-k10kbwqc.js → chunk-y7gzr914.js} +2 -2
  175. package/dist/{chunk-84gk74hf.js → chunk-y8md080p.js} +2 -2
  176. package/dist/{chunk-zk2hwm10.js → chunk-y8sc8n3j.js} +2 -2
  177. package/dist/{chunk-ym6h1x3a.js → chunk-ycj91akv.js} +2 -2
  178. package/dist/chunk-ym0pvy7y.js +2 -0
  179. package/dist/{chunk-2kz2z86n.js → chunk-yzhqbz2p.js} +2 -2
  180. package/dist/chunk-z8ymt0ny.js +2 -0
  181. package/dist/{chunk-tptx1zs3.js → chunk-z94nsbnw.js} +2 -2
  182. package/dist/chunk-z9ch23p0.js +2 -0
  183. package/dist/chunk-z9q7rgbf.js +2 -0
  184. package/dist/chunk-zfjpfj30.js +2 -0
  185. package/dist/{chunk-akvpgx43.js → chunk-zntkqbcv.js} +2 -2
  186. package/dist/{chunk-fbmbc4wt.js → chunk-zxwvq5f4.js} +2 -2
  187. package/dist/chunk-zyznsm1p.js +2 -0
  188. package/dist/client.d.ts +13 -0
  189. package/dist/client.js +1 -1
  190. package/dist/codex/activity-group.js +1 -1
  191. package/dist/codex/assistant-message.js +1 -1
  192. package/dist/codex/async-question-card.js +1 -1
  193. package/dist/codex/disclosure-state.js +1 -1
  194. package/dist/codex/edited-files-card.js +1 -1
  195. package/dist/codex/image-view-activity.js +1 -1
  196. package/dist/codex/markdown-renderer.js +1 -1
  197. package/dist/codex/navigation-audio.js +1 -1
  198. package/dist/codex/navigation-preview.js +1 -1
  199. package/dist/codex/navigation-rail.js +1 -1
  200. package/dist/codex/patch-view.js +1 -1
  201. package/dist/codex/plan.js +1 -1
  202. package/dist/codex/timeline-virtualizer.js +1 -1
  203. package/dist/codex/turn-activity.js +1 -1
  204. package/dist/codex/user-message.d.ts +3 -1
  205. package/dist/codex/user-message.js +1 -1
  206. package/dist/codex/virtualized-turn-list.js +1 -1
  207. package/dist/collections/collection-emoji.js +1 -1
  208. package/dist/collections/collection-menu.js +1 -1
  209. package/dist/collections/collection-panel.js +1 -1
  210. package/dist/collections/collections.js +1 -1
  211. package/dist/collections/host.js +1 -1
  212. package/dist/collections/locales.js +1 -1
  213. package/dist/collections/model.js +1 -1
  214. package/dist/collections/store.js +1 -1
  215. package/dist/composer/completion-filter.js +1 -1
  216. package/dist/composer/completion-menu.js +1 -1
  217. package/dist/composer/completion-trigger.js +1 -1
  218. package/dist/composer/effort-slider.js +1 -1
  219. package/dist/composer/inline-document.d.ts +12 -0
  220. package/dist/composer/inline-document.js +1 -0
  221. package/dist/composer/inline-dom.d.ts +10 -0
  222. package/dist/composer/inline-dom.js +1 -0
  223. package/dist/composer/menu-radio.js +1 -1
  224. package/dist/composer/model-select.js +1 -1
  225. package/dist/composer/permission-mode-select.js +1 -1
  226. package/dist/composer/prompt-input-attachments.js +1 -1
  227. package/dist/composer/prompt-input-clipboard.js +1 -1
  228. package/dist/composer/prompt-input-context.js +1 -1
  229. package/dist/composer/prompt-input-inline.d.ts +20 -0
  230. package/dist/composer/prompt-input-inline.js +1 -0
  231. package/dist/composer/prompt-input-textarea.d.ts +3 -1
  232. package/dist/composer/prompt-input-textarea.js +1 -1
  233. package/dist/composer/prompt-input.js +1 -1
  234. package/dist/conversation/action-card.js +1 -1
  235. package/dist/conversation/composer/app-mentions.js +1 -1
  236. package/dist/conversation/composer/apps-menu.d.ts +4 -2
  237. package/dist/conversation/composer/apps-menu.js +1 -1
  238. package/dist/conversation/composer/composer.js +1 -1
  239. package/dist/conversation/composer/config-options.js +1 -1
  240. package/dist/conversation/composer/context.js +1 -1
  241. package/dist/conversation/composer/drafts.d.ts +2 -0
  242. package/dist/conversation/composer/drafts.js +1 -1
  243. package/dist/conversation/composer/file-items.js +1 -1
  244. package/dist/conversation/composer/long-text.d.ts +2 -1
  245. package/dist/conversation/composer/long-text.js +1 -1
  246. package/dist/conversation/composer/mention-chips.js +1 -1
  247. package/dist/conversation/composer/mention-uri.js +1 -1
  248. package/dist/conversation/composer/model-menu.js +1 -1
  249. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  250. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  251. package/dist/conversation/composer/prediction.js +1 -1
  252. package/dist/conversation/composer/prompt-history.d.ts +3 -1
  253. package/dist/conversation/composer/prompt-history.js +1 -1
  254. package/dist/conversation/composer/slash-command-button.js +1 -1
  255. package/dist/conversation/composer/submit-button.js +1 -1
  256. package/dist/conversation/composer/usage-meter.js +1 -1
  257. package/dist/conversation/connection-notice.js +1 -1
  258. package/dist/conversation/context.js +1 -1
  259. package/dist/conversation/conversation-body.js +1 -1
  260. package/dist/conversation/conversation-search.js +1 -1
  261. package/dist/conversation/conversation-view.js +1 -1
  262. package/dist/conversation/conversation.js +1 -1
  263. package/dist/conversation/diff-modal.js +1 -1
  264. package/dist/conversation/draft-project-picker.js +1 -1
  265. package/dist/conversation/session-actions.js +1 -1
  266. package/dist/conversation/subagent-sessions.js +1 -1
  267. package/dist/conversation/subagent-tasks.js +1 -1
  268. package/dist/conversation/types.d.ts +2 -0
  269. package/dist/generated/commands.js +1 -1
  270. package/dist/image-lightbox.js +1 -1
  271. package/dist/image-preview-dialog.js +1 -1
  272. package/dist/image.js +1 -1
  273. package/dist/lib/app-reference.d.ts +12 -0
  274. package/dist/lib/app-reference.js +1 -0
  275. package/dist/lib/application-metadata.d.ts +6 -0
  276. package/dist/lib/application-metadata.js +1 -0
  277. package/dist/lib/code-highlighter.js +1 -1
  278. package/dist/lib/file-url.js +1 -1
  279. package/dist/lib/fuzzy.js +1 -1
  280. package/dist/lib/group-blocks.js +1 -1
  281. package/dist/lib/image-encode.js +1 -1
  282. package/dist/lib/limits.js +1 -1
  283. package/dist/lib/markdown-parser.js +1 -1
  284. package/dist/lib/markdown-rules.js +1 -1
  285. package/dist/lib/model-name.js +1 -1
  286. package/dist/lib/pointer-centered-zoom.js +1 -1
  287. package/dist/lib/prepare-prompt-files.js +1 -1
  288. package/dist/lib/stream-style.js +1 -1
  289. package/dist/lib/streaming-markdown.js +1 -1
  290. package/dist/lib/tool-artifacts.js +1 -1
  291. package/dist/locales.js +1 -1
  292. package/dist/oauth/claude-login.d.ts +16 -0
  293. package/dist/oauth/claude-login.js +1 -0
  294. package/dist/oauth.d.ts +2 -0
  295. package/dist/oauth.js +1 -0
  296. package/dist/plugins/catalog-header.js +1 -1
  297. package/dist/plugins/catalog-skeleton.js +1 -1
  298. package/dist/plugins/host.js +1 -1
  299. package/dist/plugins/locales.js +1 -1
  300. package/dist/plugins/new-chat-directory.js +1 -1
  301. package/dist/plugins/pane.js +1 -1
  302. package/dist/plugins/panel-item.js +1 -1
  303. package/dist/plugins/plugin-detail-page.js +1 -1
  304. package/dist/plugins/plugin-icon.js +1 -1
  305. package/dist/plugins/plugin-icons.js +1 -1
  306. package/dist/plugins/plugins-page.js +1 -1
  307. package/dist/plugins/plugins.js +1 -1
  308. package/dist/plugins/read-skill-document.js +1 -1
  309. package/dist/plugins/skill-document.js +1 -1
  310. package/dist/plugins/skills-tab.js +1 -1
  311. package/dist/plugins/store.js +1 -1
  312. package/dist/plugins/toolbox-layout.js +1 -1
  313. package/dist/search/chat-search.js +1 -1
  314. package/dist/search/codex-source-matches.js +1 -1
  315. package/dist/search/dom-matches.js +1 -1
  316. package/dist/search/find-bar.js +1 -1
  317. package/dist/search/literal-matches.js +1 -1
  318. package/dist/session-list/account-menu.js +1 -1
  319. package/dist/session-list/activity-list.js +1 -1
  320. package/dist/session-list/archived-sessions.js +1 -1
  321. package/dist/session-list/help-menu.js +1 -1
  322. package/dist/session-list/highlight.js +1 -1
  323. package/dist/session-list/host.js +1 -1
  324. package/dist/session-list/hover-info-card.js +1 -1
  325. package/dist/session-list/locales.js +1 -1
  326. package/dist/session-list/navigation-controls.js +1 -1
  327. package/dist/session-list/navigation-header.js +1 -1
  328. package/dist/session-list/navigation-store.js +1 -1
  329. package/dist/session-list/navigation-tabs.js +1 -1
  330. package/dist/session-list/navigation.js +1 -1
  331. package/dist/session-list/overflow-marquee.js +1 -1
  332. package/dist/session-list/platform.js +1 -1
  333. package/dist/session-list/row-stop-button.js +1 -1
  334. package/dist/session-list/session-groups.js +1 -1
  335. package/dist/session-list/session-info-card.js +1 -1
  336. package/dist/session-list/session-list.js +1 -1
  337. package/dist/session-list/session-row.js +1 -1
  338. package/dist/session-list/session-state-dot.js +1 -1
  339. package/dist/session-list/session-state-menu.js +1 -1
  340. package/dist/session-list/shortcut-hint.js +1 -1
  341. package/dist/session-list/shortcut.js +1 -1
  342. package/dist/session-list/sidebar-overlay.js +1 -1
  343. package/dist/session-list/trailing-swap.js +1 -1
  344. package/dist/session-list/use-activity-notification.js +1 -1
  345. package/dist/session-list/use-activity-preview.js +1 -1
  346. package/dist/session-list/use-cmd-held.js +1 -1
  347. package/dist/session-list/use-project-sessions.js +1 -1
  348. package/dist/session-list/virtual-session-rows.js +1 -1
  349. package/dist/session-timeline/activity-group.js +1 -1
  350. package/dist/session-timeline/activity-projection.js +1 -1
  351. package/dist/session-timeline/assistant-content.js +1 -1
  352. package/dist/session-timeline/assistant-image-references.js +1 -1
  353. package/dist/session-timeline/assistant-turn.js +1 -1
  354. package/dist/session-timeline/async-questions.js +1 -1
  355. package/dist/session-timeline/edited-files-card.js +1 -1
  356. package/dist/session-timeline/history-timeline.js +1 -1
  357. package/dist/session-timeline/host.js +1 -1
  358. package/dist/session-timeline/image-generation-progress.js +1 -1
  359. package/dist/session-timeline/navigation-rail.js +1 -1
  360. package/dist/session-timeline/plan.js +1 -1
  361. package/dist/session-timeline/question-reply.js +1 -1
  362. package/dist/session-timeline/resource-content.js +1 -1
  363. package/dist/session-timeline/session-timeline.js +1 -1
  364. package/dist/session-timeline/timeline-registry.js +1 -1
  365. package/dist/session-timeline/turn-activity.js +1 -1
  366. package/dist/session-timeline/turn-error.js +1 -1
  367. package/dist/session-timeline/turn-retry.js +1 -1
  368. package/dist/session-timeline/turn-time.js +1 -1
  369. package/dist/session-timeline/turns.js +1 -1
  370. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  371. package/dist/session-timeline/user-message.js +1 -1
  372. package/dist/settings/codex-account-card.js +1 -1
  373. package/dist/settings/login-card.js +1 -1
  374. package/dist/settings/model-alias-settings.js +1 -1
  375. package/dist/settings/model-aliases.js +1 -1
  376. package/dist/settings/provider-logos.d.ts +1 -0
  377. package/dist/settings/provider-logos.js +1 -1
  378. package/dist/settings/provider-section.js +1 -1
  379. package/dist/settings/providers-port.js +1 -1
  380. package/dist/settings/providers.d.ts +1 -0
  381. package/dist/settings/providers.js +1 -1
  382. package/dist/settings/settings-bridge.js +1 -1
  383. package/dist/settings/settings.js +1 -1
  384. package/native/win32-x64/alwith_native_chat.dll +0 -0
  385. package/native/win32-x64/artifact.json +1 -1
  386. package/package.json +7 -2
  387. package/dist/chunk-02jpgxy7.js +0 -2
  388. package/dist/chunk-0y1c3v1b.js +0 -2
  389. package/dist/chunk-1bfxezrb.js +0 -2
  390. package/dist/chunk-2kjbas8a.js +0 -2
  391. package/dist/chunk-2tc8kgsa.js +0 -2
  392. package/dist/chunk-32s8dn1a.js +0 -2
  393. package/dist/chunk-3m59n5gr.js +0 -2
  394. package/dist/chunk-3twka9f7.js +0 -2
  395. package/dist/chunk-4j6gy4me.js +0 -2
  396. package/dist/chunk-57p1s7hy.js +0 -2
  397. package/dist/chunk-5t8zx5e4.js +0 -3
  398. package/dist/chunk-5yq8k08p.js +0 -2
  399. package/dist/chunk-6pnsagt4.js +0 -2
  400. package/dist/chunk-6z36709h.js +0 -2
  401. package/dist/chunk-70j4ee5r.js +0 -2
  402. package/dist/chunk-75ve01mr.js +0 -2
  403. package/dist/chunk-7jmqq7b5.js +0 -4
  404. package/dist/chunk-80a1fdx8.js +0 -2
  405. package/dist/chunk-8504eft8.js +0 -7
  406. package/dist/chunk-8an4t4kh.js +0 -2
  407. package/dist/chunk-8rpen55z.js +0 -3
  408. package/dist/chunk-9rt2pfsm.js +0 -2
  409. package/dist/chunk-a8gzs651.js +0 -2
  410. package/dist/chunk-acnqnrqb.js +0 -2
  411. package/dist/chunk-bpenajbp.js +0 -2
  412. package/dist/chunk-c47xfjk4.js +0 -2
  413. package/dist/chunk-c61yvpy3.js +0 -2
  414. package/dist/chunk-c7p3vpyx.js +0 -2
  415. package/dist/chunk-ckhw0gr5.js +0 -5
  416. package/dist/chunk-d0ta9y85.js +0 -2
  417. package/dist/chunk-dz5ymd3t.js +0 -2
  418. package/dist/chunk-f1r8wh4e.js +0 -2
  419. package/dist/chunk-fzgra242.js +0 -2
  420. package/dist/chunk-g0gq72z9.js +0 -2
  421. package/dist/chunk-g79y6q3f.js +0 -2
  422. package/dist/chunk-gfrzmgz4.js +0 -2
  423. package/dist/chunk-gkp0e28t.js +0 -2
  424. package/dist/chunk-gwa7hbzr.js +0 -2
  425. package/dist/chunk-h4adycra.js +0 -2
  426. package/dist/chunk-h9ywpga2.js +0 -4
  427. package/dist/chunk-hkjj3prp.js +0 -2
  428. package/dist/chunk-jkyepwr1.js +0 -2
  429. package/dist/chunk-kmeccf75.js +0 -2
  430. package/dist/chunk-m1adrey8.js +0 -2
  431. package/dist/chunk-m7wse5yk.js +0 -2
  432. package/dist/chunk-nm4dtceb.js +0 -2
  433. package/dist/chunk-p5mfv6t6.js +0 -2
  434. package/dist/chunk-p6gwrqjp.js +0 -2
  435. package/dist/chunk-q9h89nv1.js +0 -2
  436. package/dist/chunk-qcj6f1rq.js +0 -2
  437. package/dist/chunk-s8xpf179.js +0 -2
  438. package/dist/chunk-stzsxdpp.js +0 -2
  439. package/dist/chunk-w0dfvr05.js +0 -2
  440. package/dist/chunk-w65d6934.js +0 -2
  441. package/dist/chunk-w7p443ya.js +0 -1
  442. package/dist/chunk-wr5r2t2m.js +0 -2
  443. package/dist/chunk-xrbydq2j.js +0 -2
  444. package/dist/chunk-yvr086m7.js +0 -2
  445. package/dist/chunk-zfag3ne0.js +0 -2
  446. package/dist/chunk-zjevkw68.js +0 -2
  447. package/dist/chunk-zmbf0v0n.js +0 -2
  448. package/dist/chunk-zqe4mjgy.js +0 -2
@@ -1,2 +1,2 @@
1
- function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function zt(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
- export{zt};
1
+ function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function Xt(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
+ export{Xt};
@@ -0,0 +1,2 @@
1
+ import{cn as a}from"cn";import{useRef as u,useState as M}from"react";import{jsx as l}from"react/jsx-runtime";var d=45,w=8;function E({className:i,children:p,onMouseEnter:c,onMouseLeave:f,...m}){let s=u(null),[t,r]=M(0);return l("span",{className:a("min-w-0 overflow-hidden",i),onMouseEnter:(e)=>{let n=s.current;if(!n)return;let o=n.scrollWidth-n.clientWidth;if(o>w)r(getComputedStyle(n).direction==="rtl"?o:-o);c?.(e)},onMouseLeave:(e)=>{r(0),f?.(e)},...m,children:l("span",{ref:s,className:a("block whitespace-nowrap",t===0?"truncate":"overflow-visible"),style:{transform:`translateX(${t}px)`,transition:`transform ${Math.abs(t)/d}s linear`},children:p})})}
2
+ export{E};
@@ -0,0 +1,2 @@
1
+ import{a,s,n,m}from"./chunk-hqdbv5hw.js";import{D}from"./chunk-sjes4cxr.js";import{P,J,Se}from"./chunk-bv175dn9.js";import{we,j,ae}from"./chunk-rhcpe6m6.js";import{To}from"./chunk-5y5b3w22.js";import{xe}from"./chunk-ex20n22v.js";import{ye}from"./chunk-rgn6pdaa.js";import{be}from"./chunk-zntkqbcv.js";import{Gt}from"./chunk-mmywt5fq.js";import{Po}from"./chunk-tme1d6xh.js";import{ActivityIcon as E}from"lucide-react";import{useEffect as G,useMemo as A}from"react";import{Kbd as K}from"@nyssance/shadcn/vega/components/ui/kbd";import{jsx as c,jsxs as C,Fragment as T}from"react/jsx-runtime";function M(i,d){return i.find((l)=>l.sessionId===d.sessionId)??{sessionId:d.sessionId,cwd:d.cwd,title:d.title||null,updatedAt:null,archived:!1}}function qr({selectedId:i,onSelect:d,isForeground:l,onOpen:w,accessory:k,rowActions:R}){let h=a(),{t:N}=h,p=n((t)=>t.runStates),v=n((t)=>t.drafts),u=n((t)=>t.sessionList),g=j((t)=>t.activityOrder),f=A(()=>g.flatMap((t)=>{let e=p[t];return e&&we({runStates:p,drafts:v},t)?[{sid:t,record:e,sessionRow:M(u,e)}]:[]}),[g,p,v,u]),b=A(()=>{let t=new Map;for(let e of f){let r=e.sid===i||l?.(e.sid)?"foreground":"background",S=t.get(r)??[];S.push(e),t.set(r,S)}return["foreground","background"].filter((e)=>t.has(e)||e==="background").map((e)=>({key:e,rows:t.get(e)??[]}))},[f,i,l]),y=j((t)=>t.activityCollapsedGroups),o=ae(),L=b.flatMap((t)=>t.key==="foreground"||!y.has(t.key)?t.rows:[]),x=(t)=>{if(w?.(t))return;d(t)},O=Po();G(()=>{let t=(e)=>{if(e.defaultPrevented||e.isComposing||e.repeat||!To(e))return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;let r=Number(e.key);if(!Number.isInteger(r)||r<1||r>9)return;let S=L[r-1];if(!S)return;e.preventDefault(),x(S.sessionRow)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let I=(t)=>{let e=L.indexOf(t);return c(H,{sessionRow:t.sessionRow,state:t.record.state,interruption:t.record.interruption,active:t.sid===i,tasks:t.record.tasks,listeningPorts:t.record.listeningPorts,onOpen:()=>x(t.sessionRow),accessory:k?.(t.sid),actions:R?.(t.sessionRow),hint:e<9&&O?c(K,{children:be(`CommandOrControl+${e+1}`)}):void 0},t.sid)};return c(P,{children:b.map((t)=>t.key==="foreground"?c(P,{children:t.rows.map(I)},t.key):c(J,{open:!y.has(t.key),onOpenChange:(e)=>{let r=new Set(y);if(e)r.delete(t.key);else r.add(t.key);o({activityCollapsedGroups:r})},leading:c(E,{className:"text-muted-foreground size-3.5 shrink-0"}),label:N("sessionList.background"),count:t.rows.length,children:t.rows.map(I)},t.key))})}function H({sessionRow:i,state:d,interruption:l,active:w,tasks:k,listeningPorts:R,accessory:h,actions:N,onOpen:p,hint:v}){let u=a(),g=s(),{t:f}=u,b=i.title??f("sessionList.untitled"),y=Gt(i.sessionId,d);return C(T,{children:[c(Se,{"data-session-id":i.sessionId,active:w,role:"button",tabIndex:0,hoverCard:c(ye,{sessionRow:i,actions:N}),onClick:p,onKeyDown:(o)=>{if(o.target!==o.currentTarget)return;if(o.key==="Enter"||o.key===" ")o.preventDefault(),p()},state:d,interruption:l,title:b,preview:y,listeningPorts:R,onOpenPort:u.openLink&&((o)=>u.openLink?.(`http://localhost:${o}`)),accessory:h,hint:v,actions:c(xe,{title:f("sessionList.stop"),onStop:()=>m(u,g.stopSession(i.sessionId))})}),k.map((o)=>C("div",{className:"border-border/60 before:border-border/60 relative ms-4 flex min-h-7 items-center gap-2 border-s py-1 ps-4 pe-2 text-xs before:absolute before:start-0 before:top-3.5 before:w-2 before:border-t",children:[c(D,{state:"running"}),c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate leading-5",title:o.title,children:o.title})]},o.id))]})}
2
+ export{qr};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-f1r8wh4e.js";import{tn,e,f}from"./chunk-6pnsagt4.js";import{Ut}from"./chunk-gfrzmgz4.js";import{Xt}from"./chunk-02jpgxy7.js";import{en}from"./chunk-p6gwrqjp.js";import{Dt,Ht}from"./chunk-8rpen55z.js";import{Ot}from"./chunk-18z4wmhb.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function Fr({host:t,client:c,...s}){let m=O(()=>t.openDiff?t:{...t,openDiff:Dt},[t]);return i(tn,{host:m,client:c,children:[r(I,{...s}),!t.openDiff&&r(Ht,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,v=o((a)=>a.connection==="ready"),y=o((a)=>a.historyPages[t.id]?.error),u=()=>f(d,R.open(t.id,t.cwd)),x=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!x&&r(en,{sessionId:t.id,rootRef:p}),s,v&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:u,children:n("conversation.reconnect")})})]})}),x?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(Xt,{session:t,timeline:m}),r(Ot,{sessionId:t.id}),t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),y&&r("p",{role:"alert",className:"text-destructive break-words",children:y})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:u,disabled:!v||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Ut,{session:t})]}),T]})}
2
- export{Fr};
1
+ import{o}from"./chunk-844s61q1.js";import{un,e,y}from"./chunk-rvjfb004.js";import{Wt}from"./chunk-eg9c12vk.js";import{cn}from"./chunk-z8ymt0ny.js";import{qt}from"./chunk-7xc69d48.js";import{jt,$t}from"./chunk-tbv1mfdg.js";import{Kt}from"./chunk-f8tv9m81.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function ea({host:t,client:c,...s}){let m=O(()=>t.openDiff?t:{...t,openDiff:jt},[t]);return i(un,{host:m,client:c,children:[r(I,{...s}),!t.openDiff&&r($t,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),u=()=>y(d,R.open(t.id,t.cwd)),x=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!x&&r(qt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:u,children:n("conversation.reconnect")})})]})}),x?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(cn,{session:t,timeline:m}),r(Kt,{sessionId:t.id}),t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:u,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Wt,{session:t})]}),T]})}
2
+ export{ea};
@@ -0,0 +1,3 @@
1
+ import{c}from"./chunk-8pdapsc7.js";import{P,p}from"./chunk-bv175dn9.js";import{yt}from"./chunk-yzhqbz2p.js";import{Ee,l,Le,Ke,i}from"./chunk-aardrb6e.js";import{U,O,ne,B,G,me,bt}from"./chunk-6z3nch41.js";import{pe}from"./chunk-gnpvd7wg.js";import{$e}from"./chunk-ggkjq8rk.js";import{x}from"./chunk-btrg3ywt.js";import{wt,L}from"./chunk-2761tcb3.js";import{z,fe}from"./chunk-h1embxgj.js";import{Ct}from"./chunk-7wj3dcpj.js";import{xt}from"./chunk-6g5z3pff.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as se,CircleArrowUpIcon as ie,MoreVerticalIcon as le,PlusIcon as F,PuzzleIcon as oe,RefreshCwIcon as re,SearchIcon as ce,Trash2Icon as de,XIcon as ue}from"lucide-react";import{memo as ge,useDeferredValue as ve,useEffect as K,useMemo as Q,useState as I}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as xe,DialogContent as he,DialogDescription as Ne,DialogHeader as ke,DialogTitle as ye,DialogTrigger as be}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Pe,DropdownMenuContent as we,DropdownMenuItem as Ce,DropdownMenuTrigger as Ie}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as W}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Se}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as Z}from"react/jsx-runtime";function T(t){return t.interface?.displayName??t.name}function X(t){return t.interface?.shortDescription??""}function De({plugin:t,marketplace:d}){let{t:u}=l(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),f=i((n)=>n.install),m=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",r=u(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(se,{className:"text-muted-foreground size-4 shrink-0","aria-label":r});return e(k,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||m,"aria-label":r,title:m?u("plugins.disabledReason.unknown"):r,onClick:()=>void f({plugin:t,marketplace:d}).catch(()=>{}),children:g?e(E,{"aria-hidden":"true"}):e(F,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Me({plugin:t,marketplace:d,actions:u,onOpen:g}){let a=X(t),f=t.interface?.developerName,m=t.localVersion??t.version,r=[f,m?`v${m}`:null].filter(Boolean).join(" · ");return s(me,{className:"toolbox-row relative",children:[e(k,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":T(t),onClick:()=>g({plugin:t,marketplace:d})}),e(B,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(L,{name:t.name})})}),s(O,{className:"pointer-events-none relative min-w-0",children:[e(bt,{className:"mb-0.5",children:T(t)}),e(ne,{className:"line-clamp-1",title:a,children:a||d.interface?.displayName||d.name}),r&&e(ne,{"data-toolbox-metadata":"",children:r})]}),e(U,{className:"relative w-8 shrink-0 justify-center",children:u})]})}function J(){return Ke((t)=>t.connection==="ready"&&ee(t.agent))}var D=48;function ze({marketplace:t,plugins:d,onOpen:u}){let{t:g}=l(),a=i((n)=>n.removeMarketplace),[f,m]=I(0),r=Math.min(f,Math.max(0,Math.ceil(d.length/D)-1));if(d.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:d.length}),t.path!==null&&s(Pe,{children:[e(Ie,{render:e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(le,{})}),e(we,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ce,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(de,{className:"size-3.5"}),g("plugins.marketplace.remove")]})})]})]}),e(G,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:d.slice(r*D,(r+1)*D).map((n)=>e(Me,{onOpen:u,plugin:n,marketplace:t,actions:e(De,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),d.length>D&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(k,{variant:"outline",size:"sm",className:"h-9",disabled:r===0,onClick:()=>m(r-1),children:g("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",Math.ceil(d.length/D)]}),e(k,{variant:"outline",size:"sm",className:"h-9",disabled:(r+1)*D>=d.length,onClick:()=>m(r+1),children:g("plugins.nextPage")})]})]},t.name)}var Oe=ge(function({query:d,onOpen:u}){let{t:g}=l(),a=i((n)=>n.marketplaces),f=i((n)=>n.featuredPluginIds),m=Q(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,T(v),X(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),r=Q(()=>{let n=new Set(f);return m.map(({marketplace:v,entries:h})=>({marketplace:v,plugins:h.filter(({plugin:y,text:b})=>d===""?v.path!==null||n.has(y.id):b.includes(d)).map(({plugin:y})=>y)}))},[m,f,d]);return s(Z,{children:[r.map(({marketplace:n,plugins:v})=>e(ze,{marketplace:n,plugins:v,onOpen:u},JSON.stringify([n.name,n.path,d]))),r.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Be(){let{t}=l(),d=J(),u=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[f,m]=I(""),[r,n]=I(!1),[v,h]=I(!1),[y,b]=I(null),A=async()=>{let N=f.trim();if(!N||r)return;n(!0),b(null);try{await u({source:N}),m(""),h(!1)}catch(S){b(S instanceof Error?S.message:String(S))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(k,{size:"sm",className:"h-9",variant:"outline",disabled:!d||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(E,{}):e(ie,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:v,onOpenChange:(N)=>{if(!r)h(N)},children:[s(be,{render:e(k,{size:"sm",className:"h-9",variant:"outline",disabled:!d}),children:[e(F,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ke,{children:[e(ye,{children:t("plugins.marketplace.addTitle")}),e(Ne,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(N)=>{N.preventDefault(),A()},children:[e(Se,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(W,{id:"marketplace-source",value:f,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(k,{type:"button",variant:"ghost",disabled:r,onClick:()=>h(!1),children:t("plugins.marketplace.addCancel")}),s(k,{type:"submit",disabled:r||f.trim()==="",children:[r&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Te({onOpen:t,query:d}){let u=J(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!u,f=ve(d.trim().toLowerCase());return e(x,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${z} flex flex-col gap-8`,children:[g.map((m)=>s("p",{className:"text-destructive px-2 text-xs",children:[m.marketplacePath,": ",m.message]},m.marketplacePath)),a?e(pe,{}):e(Oe,{query:f,onOpen:t})]})})}function fr({cwd:t,active:d,extensions:u,onOpenCatalog:g}){let{t:a}=l(),f=Le(),m=Ee(f),r=i((o)=>o.refresh),n=i((o)=>o.loading),v=i((o)=>o.error),[h,y]=I("plugins"),[b,A]=I({plugins:"",skills:""}),N=h==="skills"?b.skills:b.plugins,S=(o)=>A((M)=>({...M,[h]:o})),Y=Ke((o)=>JSON.stringify([...new Set(o.sessionList.map((M)=>$e(M.cwd,o.projectContext)).filter((M)=>M!==null))].toSorted())),H=JSON.stringify([...new Set([$e(t,f.state.projectContext),...JSON.parse(Y)].filter((o)=>o!==null))].toSorted()),R=i((o)=>o.installed),q=a(h==="skills"?"plugins.skills.search":"plugins.search"),[w,V]=I(null),C=J();K(()=>{if(!d||!C)return;if(m.getState().loadedScope!==H)r(JSON.parse(H))},[d,C,r,H,m]),K(()=>{if(!C)return;return f.onSkillsChanged(()=>void r(void 0,{background:!0}))},[C,r,f]);let j=(o)=>{g?.(),y("plugins"),V(o)},_=(o)=>{g?.(),y(o),V(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(wt,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[u&&s(p,{className:`${c} h-8 gap-2 px-2`,active:u.active,onClick:u.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((o)=>s(p,{className:`${c} h-8 gap-2 px-2`,active:!u?.active&&h===o&&w===null,onClick:()=>_(o),children:[o==="plugins"?e(oe,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${o}`)})]},o))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(x,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(P,{children:!C||n&&R.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):R.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):R.map((o)=>s(p,{title:T(o.plugin),className:`${c} gap-2 px-2`,active:!u?.active&&w?.plugin.id===o.plugin.id,onClick:()=>j(o),children:[e(L,{name:o.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:T(o.plugin)})]},o.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:u?.active?u.content:s(Z,{children:[w&&e(Ct,{entry:w,onBack:()=>_("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(fe,{children:e(yt,{title:a(`plugins.headings.${h}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(ce,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(W,{className:"h-9 rounded-full ps-9 pe-9","aria-label":q,value:N,onChange:(o)=>S(o.target.value),placeholder:q}),N&&e(k,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>S(""),children:e(ue,{})})]}),e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void r(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(re,{})}),h==="plugins"&&e(Be,{})]})})}),(h==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[h==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(k,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void r(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:h!=="plugins",className:h==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Te,{query:b.plugins,onOpen:j})}),e("div",{hidden:h!=="skills",className:h==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(xt,{query:b.skills,ready:C,onOpenPlugin:j})})]})]})]})})]})}
3
+ export{fr};
@@ -1,2 +1,2 @@
1
- import{cn as v}from"cn";import{ChevronDownIcon as h,ChevronUpIcon as g,XIcon as b}from"lucide-react";import{useEffect as z,useImperativeHandle as B,useRef as N}from"react";import{Button as i}from"@nyssance/shadcn/vega/components/ui/button";import{Input as E}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as k}from"react/jsx-runtime";function ji({ref:f,value:r,onChange:p,onFind:o,onClose:s,placeholder:d,autoFocusOpen:a=!0,prevTitle:l,nextTitle:c,className:m}){let n=N(null);B(f,()=>{if(n.current===null)throw Error("FindBar input is not mounted");return n.current},[]),z(()=>{if(!a)return;let e=n.current;if(e===null)throw Error("FindBar input is not mounted");e.focus({preventScroll:!0}),e.select()},[a]);let u=!r;return k("div",{className:v("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",m),children:[t(E,{ref:n,value:r,onChange:(e)=>p(e.target.value),placeholder:d,className:"h-7 text-xs",onKeyDown:(e)=>{if(e.key==="Escape"){e.preventDefault(),s();return}if(e.key==="Enter"){if(e.preventDefault(),r)o(e.shiftKey)}}}),t(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!0),title:l?`${l} (⇧↵)`:"⇧↵",children:t(g,{className:"size-3.5"})}),t(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!1),title:c?`${c} (↵)`:"↵",children:t(h,{className:"size-3.5"})}),t(i,{size:"icon",variant:"ghost",className:"size-6",onClick:s,title:"Esc",children:t(b,{className:"size-3.5"})})]})}
2
- export{ji};
1
+ import{cn as v}from"cn";import{ChevronDownIcon as h,ChevronUpIcon as g,XIcon as b}from"lucide-react";import{useEffect as z,useImperativeHandle as B,useRef as N}from"react";import{Button as i}from"@nyssance/shadcn/vega/components/ui/button";import{Input as E}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as k}from"react/jsx-runtime";function Do({ref:f,value:r,onChange:p,onFind:o,onClose:s,placeholder:d,autoFocusOpen:a=!0,prevTitle:l,nextTitle:c,className:m}){let n=N(null);B(f,()=>{if(n.current===null)throw Error("FindBar input is not mounted");return n.current},[]),z(()=>{if(!a)return;let e=n.current;if(e===null)throw Error("FindBar input is not mounted");e.focus({preventScroll:!0}),e.select()},[a]);let u=!r;return k("div",{className:v("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",m),children:[t(E,{ref:n,value:r,onChange:(e)=>p(e.target.value),placeholder:d,className:"h-7 text-xs",onKeyDown:(e)=>{if(e.key==="Escape"){e.preventDefault(),s();return}if(e.key==="Enter"){if(e.preventDefault(),r)o(e.shiftKey)}}}),t(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!0),title:l?`${l} (⇧↵)`:"⇧↵",children:t(g,{className:"size-3.5"})}),t(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!1),title:c?`${c} (↵)`:"↵",children:t(h,{className:"size-3.5"})}),t(i,{size:"icon",variant:"ghost",className:"size-6",onClick:s,title:"Esc",children:t(b,{className:"size-3.5"})})]})}
2
+ export{Do};
@@ -1,2 +1,2 @@
1
- import{L}from"./chunk-xbqvb31f.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function Pr({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(L,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(L,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
2
- export{Pr};
1
+ import{D}from"./chunk-sjes4cxr.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function Kr({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(D,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(D,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
2
+ export{Kr};
@@ -1,2 +1,2 @@
1
- import{xi}from"./chunk-v5mb5c61.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function yi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return xi(a,r)}
2
- export{yi};
1
+ import{Wi}from"./chunk-0d0bfb8e.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function qi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Wi(a,r)}
2
+ export{qi};
@@ -1,2 +1,2 @@
1
- import{ko}from"./chunk-z5c4njqk.js";import{N}from"./chunk-75ve01mr.js";import{cn as v}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as b}from"react";import{Button as P}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as E,HoverCardContent as R,HoverCardTrigger as D}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as e,jsxs as r,Fragment as K}from"react/jsx-runtime";function F(t){return e(R,{align:"start",...t})}function vo({data:t,t:n,className:l,...m}){let c=N(),[u,f]=b(!1),[I,d]=b(1),C=z(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",A=a||(o?n("input.image"):n("input.attachment"));return L(()=>{if(!u)return;let p=0.1,h=(i)=>Math.min(10,Math.max(0.1,i)),g=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,y=s==="+"||s==="=",H=s==="-"||s==="_",x=s==="0";if(!y&&!H&&!x)return;i.preventDefault(),d((w)=>{if(x)return 1;if(y)return h(w+p);return h(w-p)})};return window.addEventListener("keydown",g,{passive:!1}),()=>window.removeEventListener("keydown",g)},[u]),r(K,{children:[r(E,{children:[e(D,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(P,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),f(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(k,{className:"size-3"})}),r(P,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(T,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),e(F,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e(ko,{containerRef:C,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:I,url:t.url})]})}function yo({children:t,className:n,...l}){let m=N();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(M,{children:t(c)},c.id))})}
2
- export{vo,yo};
1
+ import{$o}from"./chunk-3ab38s9g.js";import{f}from"./chunk-6cbj9r2x.js";import{cn as v}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as P}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as E,HoverCardContent as R,HoverCardTrigger as D}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as e,jsxs as r,Fragment as K}from"react/jsx-runtime";function F(t){return e(R,{align:"start",...t})}function Oo({data:t,t:n,className:l,...m}){let c=f(),[u,h]=P(!1),[I,d]=P(1),C=z(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",A=a||(o?n("input.image"):n("input.attachment"));return L(()=>{if(!u)return;let p=0.1,g=(i)=>Math.min(10,Math.max(0.1,i)),y=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,x=s==="+"||s==="=",H=s==="-"||s==="_",w=s==="0";if(!x&&!H&&!w)return;i.preventDefault(),d((b)=>{if(w)return 1;if(x)return g(b+p);return g(b-p)})};return window.addEventListener("keydown",y,{passive:!1}),()=>window.removeEventListener("keydown",y)},[u]),r(K,{children:[r(E,{children:[e(D,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(N,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),h(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(k,{className:"size-3"})}),r(N,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(T,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),e(F,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e($o,{containerRef:C,filename:a||n("input.image"),onOpenChange:h,onScaleChange:d,open:u,scale:I,url:t.url})]})}function Bo({children:t,className:n,...l}){let m=f();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(M,{children:t(c)},c.id))})}
2
+ export{Oo,Bo};
@@ -1,2 +1,2 @@
1
- import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function Vt(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
2
- export{Vt};
1
+ import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function en(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
2
+ export{en};
@@ -1,2 +1,2 @@
1
- import{codexMessageError as u,codexTurnError as i}from"@nyssance/codex-acp-v2/client";var a=[10,30,120,300];function ri(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||i(l).kind!=="overloaded")break;if(n++,o.user!==null)break}return a[n-1]??null}
2
- export{ri};
1
+ import{codexMessageError as u,codexTurnError as i}from"@nyssance/codex-acp-v2/client";var a=[10,30,120,300];function _i(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||i(l).kind!=="overloaded")break;if(n++,o.user!==null)break}return a[n-1]??null}
2
+ export{_i};
@@ -0,0 +1,5 @@
1
+ import{d}from"./chunk-z9ch23p0.js";function Vo(a,s){let i=document.createDocumentFragment(),o="",r=()=>{if(o)i.append(document.createTextNode(o));o=""};for(let e of d(s)){if(typeof e==="string"){o+=e;continue}r();let c=document.createElement("span");c.contentEditable="false",c.dataset.inlineApp=e.id,c.setAttribute("aria-label",e.name),c.className="inline-flex items-center gap-1 align-middle whitespace-nowrap text-xs leading-none font-normal text-[color:var(--app-reference-foreground,var(--color-blue-500))] select-all me-1";let t=(u,m)=>{let f=document.createElement("img");f.src=u,f.alt="",f.draggable=!1,f.className=`size-3 shrink-0 object-contain ${m}`,c.append(f)};if(e.iconUrl)t(e.iconUrl,e.iconUrlDark?"dark:hidden":"");if(e.iconUrlDark)t(e.iconUrlDark,e.iconUrl?"hidden dark:block":"");let l=document.createElement("span");l.textContent=e.name,c.append(l),i.append(c);let p=document.createElement("span");p.dataset.inlineAnchor="",p.textContent="​",i.append(p)}r();let n=document.createElement("br");n.dataset.inlineCaret="",i.append(n),a.replaceChildren(i)}function wn(a,s){let i=[],o=new Map(s.map((n)=>[n.id,n])),r=(n)=>{if(n.nodeType===Node.TEXT_NODE){i.push(...(n.textContent??"").split(""));return}if(n instanceof HTMLElement){if(n.hasAttribute("data-inline-caret"))return;if(n.hasAttribute("data-inline-anchor")){i.push(...(n.textContent??"").replace("​","").split(""));return}let e=n.dataset.inlineApp;if(e!==void 0){let t=o.get(e);if(t)i.push(t);return}if(n.tagName==="BR"){i.push(`
2
+ `);return}if((n.tagName==="DIV"||n.tagName==="P")&&i.length&&i.at(-1)!==`
3
+ `)i.push(`
4
+ `)}for(let e of n.childNodes)r(e)};for(let n of a.childNodes)r(n);return i}function jo(a,s,i){let o=window.getSelection();if(!o?.rangeCount)return i;let r=o.getRangeAt(0);if(!a.contains(r.startContainer)||!a.contains(r.endContainer))return i;let n=(e,c)=>{let t=document.createRange();return t.selectNodeContents(a),t.setEnd(e,c),wn(t.cloneContents(),s).length};return{start:n(r.startContainer,r.startOffset),end:n(r.endContainer,r.endOffset)}}function kn(a,s){let i=(n)=>{let e=Math.max(0,n);for(let[c,t]of[...a.childNodes].entries())if(t.nodeType===Node.TEXT_NODE){let l=t.textContent?.length??0;if(e<=l)return[t,e];e-=l}else if(t instanceof HTMLElement&&t.hasAttribute("data-inline-anchor")){let l=t.firstChild,p=(t.textContent??"").replace("​","").length;if(l&&e<=p)return[l,e+(l.textContent?.startsWith("​")?1:0)];e-=p}else if(t instanceof HTMLElement&&t.dataset.inlineApp!==void 0){if(e===0)return[a,c];e--}else if(t instanceof HTMLElement&&t.tagName==="BR")return[a,c];return[a,a.childNodes.length]},o=document.createRange();o.setStart(...i(s.start)),o.setEnd(...i(s.end));let r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}
5
+ export{Vo,wn,jo,kn};
@@ -0,0 +1,2 @@
1
+ function ro(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function pn(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function Fe(t){return t.type==="array"}function St(t){return(Fe(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{ro,pn,Fe,St};
@@ -1,2 +1,2 @@
1
- import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Et({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function E({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
2
- export{Et,E};
1
+ import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Bt({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function F({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
2
+ export{Bt,F};
@@ -1,2 +1,2 @@
1
- import{_}from"./chunk-4jh2wk80.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function qo({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(_,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
- export{qo};
1
+ import{N}from"./chunk-0xmj4d4z.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function Qo({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(N,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
+ export{Qo};
@@ -1,2 +1,2 @@
1
- import{useCallback as l,useSyncExternalStore as d}from"react";var Ve="chat.modelAliases",c={},r="gateway:alwith-managed-litellm:";function o(e){if(e===void 0)return c;if(typeof e!=="object"||e===null||Array.isArray(e)||Object.entries(e).some(([t,n])=>!t.startsWith(r)||t.length===r.length||typeof n!=="string"||!n.trim()||n.length>100))throw Error("Invalid model aliases");return e}function It(e){let t=l((n)=>e.subscribe((s)=>{if(s.includes(Ve))n()}),[e]);return d(t,()=>o(e.get(Ve)))}async function Nt(e,t,n){if(!t.startsWith(r)||t.length===r.length)throw Error("Invalid ALwith model ID");let s=await e.read(),i={...o(s.values[Ve])},a=n.trim();if(a)i[t]=a;else delete i[t];o(i),await e.write({action:"update",expectedRevision:s.revision,changes:{[Ve]:i}})}
2
- export{Ve,It,Nt};
1
+ import{useCallback as l,useSyncExternalStore as d}from"react";var qe="chat.modelAliases",c={},r="gateway:alwith-managed-litellm:";function o(e){if(e===void 0)return c;if(typeof e!=="object"||e===null||Array.isArray(e)||Object.entries(e).some(([t,n])=>!t.startsWith(r)||t.length===r.length||typeof n!=="string"||!n.trim()||n.length>100))throw Error("Invalid model aliases");return e}function Tt(e){let t=l((n)=>e.subscribe((s)=>{if(s.includes(qe))n()}),[e]);return d(t,()=>o(e.get(qe)))}async function Nt(e,t,n){if(!t.startsWith(r)||t.length===r.length)throw Error("Invalid ALwith model ID");let s=await e.read(),i={...o(s.values[qe])},a=n.trim();if(a)i[t]=a;else delete i[t];o(i),await e.write({action:"update",expectedRevision:s.revision,changes:{[qe]:i}})}
2
+ export{qe,Tt,Nt};
@@ -1,2 +1,2 @@
1
- var a=(e)=>String(e).padStart(2,"0");function it(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
- export{it};
1
+ var a=(e)=>String(e).padStart(2,"0");function gt(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
+ export{gt};
@@ -1,2 +1,2 @@
1
- import{P}from"./chunk-n3d2mv93.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function da(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function Ri(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=P(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(P(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function Fi(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!da(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(Ln),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function Ln(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function re(t){return A(t.content)}function st(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Rn(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Di(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function Hi(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function Oi(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!Hi(t,e[n-1],o))break;n--}return e[n]?.key}function Ui(t,e,n){let o=n,s=n;while(o>0&&Hi(t,e[o-1],e[o]))o--;while(s+1<e.length&&Hi(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
- export{da,Ri,Fi,Ln,re,st,Rn,Di,Hi,Oi,Ui};
1
+ import{M}from"./chunk-acmc2r2s.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Na(t){return t.kind==="tool"&&t.name==="mcp_startup"}function E(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function er(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function j(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(A(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=E(e),i=e._meta?.codex,d=M(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(M(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function tr(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Na(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>_({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(Zn),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>j(x,c,b<v,a[b-1])),x})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function Zn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function ce(t){return S(t.content)}function ft(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Qn(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function nr(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function or(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function ir(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!or(t,e[n-1],o))break;n--}return e[n]?.key}function rr(t,e,n){let o=n,s=n;while(o>0&&or(t,e[o-1],e[o]))o--;while(s+1<e.length&&or(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
+ export{Na,er,tr,Zn,ce,ft,Qn,nr,or,ir,rr};
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-hqdbv5hw.js";import{Bt}from"./chunk-r6b9fdnm.js";import{E}from"./chunk-nktaekpq.js";import{zt,ke}from"./chunk-bv175dn9.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as A}from"lucide-react";import{useEffect as g,useState as D}from"react";import{Input as w}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as M}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as O}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function Ye(t,n){let i=n==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:i})}function ye({sessionRow:t,actions:n,shortcut:i,renaming:r=!1,onRename:m}){let{t:s,i18n:C,PathAction:u}=a(),f=ke(),y=zt();g(()=>{f(r)},[r,f]);let[I,p]=D(t.title??"");g(()=>{if(r)p(t.title??"")},[r,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?s("sessionList.archived"):t.updatedAt!==null?Ye(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(Bt,{title:r?o(w,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":s("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(E,{className:"min-w-0 flex-1",children:t.title??s("sessionList.untitled")})}),i]}),titleIcon:o(A,{className:"size-3.5"}),details:v,actions:l||n!==void 0?h(O,{children:[l,l&&n!==void 0&&o(M,{}),n]}):void 0})}
2
+ export{Ye,ye};
@@ -0,0 +1,2 @@
1
+ import{s}from"./chunk-hqdbv5hw.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function we(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let a=t.filter((o)=>we(e,o)),S=new Set(a),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[o,i]of Object.entries(e.runStates)){if(S.has(o)||!we(e,o))continue;let r=n.runStates[o],g=!r||i.state!==r.state||i.since!==r.since||i.lastActivityAt!==r.lastActivityAt||i.interruption!==r.interruption;if(i.reusableDraft&&e.drafts[o]!==void 0||c&&g&&(!r||i.state!=="idle")&&i.interruption!=="runtime restarted")a.push(o)}return a.length===t.length&&a.every((o,i)=>o===t[i])?t:a}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function yn(t){let n=u.get(t);if(n)return n;let e=v(t),a=new Set,S=(i)=>{e={...e,...i};for(let r of a)r()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),r=d(e.activityOrder,c,i);if(c=i,r!==e.activityOrder)S({activityOrder:r})});let o={get:()=>e,set:S,subscribe:(i)=>(a.add(i),()=>a.delete(i))};return u.set(t,o),o}function Wr(t){u.get(t)?.set(v(t))}function j(t){let n=yn(s());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ae(){return yn(s()).set}function Zr(){let t=j((e)=>e.view),n=ae();return[t,(e)=>n({view:e})]}
2
+ export{we,yn,Wr,j,ae,Zr};
@@ -1,2 +1,2 @@
1
- import{w}from"./chunk-w65d6934.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function je({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=w();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
- export{je};
1
+ import{_}from"./chunk-s267ztm1.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function Qe({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=_();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
+ export{Qe};
@@ -1,2 +1,2 @@
1
- import{Yo}from"./chunk-3twka9f7.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 Qo({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=Yo(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}
2
- export{Qo};
1
+ import{hi}from"./chunk-52tcfvz0.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 fi({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=hi(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}
2
+ export{fi};
@@ -1,2 +1,2 @@
1
- import{Un}from"./chunk-2tc8kgsa.js";async function $i(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function lt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Un(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
- export{$i,lt};
1
+ import{bn}from"./chunk-0aqnqk7b.js";async function Ho(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function tt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of bn(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
+ export{Ho,tt};
@@ -1,2 +1,2 @@
1
- import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var Ke="group/trailing";function Ee({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function qe({content:n,actions:e,className:r}){if(n==null&&e==null)return null;return s("span",{className:i("group/swap relative flex min-h-5 min-w-5 shrink-0 items-center justify-end",r),children:[n!=null&&t("span",{className:i("flex items-center justify-end",e!=null&&"group-focus-within/trailing:hidden group-hover/trailing:hidden group-has-[[data-popup-open]]/swap:hidden"),children:n}),e!=null&&t("span",{className:"absolute inset-y-0 end-0 hidden w-max items-center justify-end gap-0.5 group-focus-within/trailing:flex group-hover/trailing:flex has-[[data-popup-open]]:flex",onClick:(a)=>a.stopPropagation(),onKeyDown:(a)=>a.stopPropagation(),children:e})]})}
2
- export{Ke,Ee,qe};
1
+ import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var Xe="group/trailing";function Ue({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function Je({content:n,actions:e,className:r}){if(n==null&&e==null)return null;return s("span",{className:i("group/swap relative flex min-h-5 min-w-5 shrink-0 items-center justify-end",r),children:[n!=null&&t("span",{className:i("flex items-center justify-end",e!=null&&"group-focus-within/trailing:hidden group-hover/trailing:hidden group-has-[[data-popup-open]]/swap:hidden"),children:n}),e!=null&&t("span",{className:"absolute inset-y-0 end-0 hidden w-max items-center justify-end gap-0.5 group-focus-within/trailing:flex group-hover/trailing:flex has-[[data-popup-open]]:flex",onClick:(a)=>a.stopPropagation(),onKeyDown:(a)=>a.stopPropagation(),children:e})]})}
2
+ export{Xe,Ue,Je};
@@ -0,0 +1,2 @@
1
+ import{Me}from"./chunk-844s61q1.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function un({host:o,client:n,children:t}){let s=a(()=>({host:o,client:n}),[o,n]);return r(Me,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function y(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
2
+ export{un,e,y};
@@ -1,2 +1,2 @@
1
- import{ei}from"./chunk-9e6rv193.js";import{Se,t,_e,o,ct}from"./chunk-f1r8wh4e.js";import{Fi,st,Rn,Oi,Ui}from"./chunk-658y6xth.js";import{it}from"./chunk-tv1frh1m.js";import{li}from"./chunk-fgr2g610.js";import{ai}from"./chunk-29jan02g.js";import{_i,Pi}from"./chunk-36mdfph1.js";import{qi,Wi}from"./chunk-v0mbfaqw.js";import{ri}from"./chunk-0eewkw7t.js";import{si}from"./chunk-pza08wvz.js";import{bi}from"./chunk-7jmqq7b5.js";import{codexExtensionCapabilities as Me,codexMessageError as ze,codexRetryNotice as Ve,codexTurnError as Be,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as qe}from"lucide-react";import{useCallback as M,useEffect as N,useLayoutEffect as ve,useMemo as Q,useRef as h,useState as U}from"react";import{flushSync as Te}from"react-dom";import{Button as Y}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as i,jsxs as E}from"react/jsx-runtime";var ye=24;function Oe(e){let d=Math.max(0,e.turnTopPx-ye),g=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),s=d-g;return{scrollTopPx:d,spacerPx:s>0?e.spacerPx+s:e.spacerPx}}function Fe({viewportRef:e,viewportProps:d,children:g}){return i("div",{ref:e,...d,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:g})}function Ke({sessionId:e,turnId:d,root:g,error:s,connected:R}){let z=h(null),V=_e(),{t:b}=t(),S=M(()=>{V.loadHistoryTurn(e,d).catch(()=>{})},[V,e,d]);return N(()=>{if(!g||!z.current||!R||s)return;let w=new IntersectionObserver((_)=>{if(_.some((v)=>v.isIntersecting))w.disconnect(),S()},{root:g,rootMargin:"800px 0px"});return w.observe(z.current),()=>w.disconnect()},[g,R,s,S]),i("div",{ref:z,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":d,"data-markdown-pending":!0,children:s?E("div",{className:"flex flex-col items-center gap-2",children:[i("p",{role:"alert",className:"text-destructive text-xs",children:s}),i(Y,{variant:"outline",size:"sm",onClick:S,disabled:!R,children:b("timeline.navigationRetry")})]}):E("div",{role:"status","aria-label":b("timeline.navigationLoading"),className:"space-y-3",children:[i("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),i("div",{className:"bg-muted h-3 w-4/5 rounded"}),i("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function Ue(e,d){let g=h([]),s=h(null);if(s.current?.items!==e.items||s.current.state!==e.state||s.current.ended!==e.turnEndedAt||s.current.usage!==e.turnUsage||s.current.historyOrder!==d)s.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:d,turns:Fi(e,g.current,d)};let R=s.current.turns;return g.current=R,R}function tt(e){return i(Se,{host:e.host,client:e.client,children:i(We,{...e})})}function We({session:e,leading:d,afterTurn:g,turnWork:s,answerActions:R,turnFooter:z,renderUserMessage:V,insert:b,navigation:S,anchorNewTurn:w=!1,Viewport:_=Fe}){let v=_e(),A=t(),T=o((n)=>n.historyNavigation[e.id]),c=Ue(e,T?.turns),L=c.at(-1)?.key,xe=Oi(e,c),y=e.state==="running"||e.state==="requires_action",W=Q(()=>ai(c,T),[c,T]),Z=Q(()=>W.flatMap((n)=>n.turn===void 0?[]:[{...n.turn,key:n.turnKey}]),[W]),he=Q(()=>S===void 0?[]:_i(c,e.turnUsage,T),[S,c,e.turnUsage,T]),ee=b&&b.afterItemId!==null?c.findIndex((n)=>n.items.some((a)=>a.id===b.afterItemId)):-1,D=h(c);D.current=c;let[l,be]=U(null),x=o((n)=>n.historyPages[e.id]),k=o((n)=>n.connection==="ready"),we=o((n)=>Me(n.agent).sessionRetry),te=x!==void 0;N(()=>{if(k&&te&&!e.restoring)v.loadHistoryNavigation(e.id).catch(()=>{})},[v,k,te,e.id,e.restoring]);let[Re,ke]=U(!1),O=h(null),[Pe,ne]=U(!1),re=h(0),j=h({key:L,running:y});j.current={key:L,running:y};let[ie,F]=U(0),I=h(0),H=h(null);I.current=ie;let Ie=M(()=>{if(H.current!==null)H.current.keepTop=!1},[]),{isFollowing:C,scrollToBottom:X,stopFollowing:B,schedulePin:oe,contentResized:le,beginLocate:ae,cancelLocation:ue}=si(l,y,Ie),se=M(()=>{if(l===null||!y)return;let n=c.at(-1)?.key;if(n===void 0)return;let a=ae(!0),u=()=>a.isCurrent()&&j.current.running&&j.current.key===n,r=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!u())return;let f=l.querySelector(`[data-codex-turn="${CSS.escape(n)}"]`);if(f===null)return;let m=l.scrollTop+f.getBoundingClientRect().top-l.getBoundingClientRect().top,P=Oe({turnTopPx:m,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:I.current});H.current=P.spacerPx>0?{element:f,heightPx:f.getBoundingClientRect().height+P.spacerPx,keepTop:!0}:null,Te(()=>F(P.spacerPx)),requestAnimationFrame(()=>{if(u())a.finish(P.scrollTopPx)})})),p=O.current;if(p===null)return;p.scrollToKey(n,void 0,{align:"top"}).then(()=>{if(u())r()})},[ae,y,l,c]);ve(()=>{if(!w||y)return;ue(),H.current=null,I.current=0,F(0)},[w,ue,y]);let G=M(()=>{B(),v.loadOlderHistory(e.id).catch(()=>{})},[v,e.id,B]);N(()=>{if(l===null)return;let n=()=>{let a=l.scrollTop<600;if(ke(a),a&&!T?.complete&&k&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)G()};return n(),l.addEventListener("scroll",n,{passive:!0}),()=>l.removeEventListener("scroll",n)},[k,x,C,G,l,e.restoring,T?.complete]),N(()=>{qi({sessionId:e.id,turns:Z,api:O.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),N(()=>()=>Wi(e.id),[e.id]);let He=M(async(n,a)=>{let u=++re.current;ne(!0);try{if(n.isLoaded===!1&&n.nativeTurnId!==void 0)await v.loadHistoryTurn(e.id,n.nativeTurnId),await new Promise((m)=>requestAnimationFrame(()=>m()));if(!a())return null;let r=D.current.find((m)=>m.user?.id===(n.messageId??n.id))??D.current.find((m)=>m.user!==null&&n.nativeTurnId!==void 0&&m.items.some((P)=>ge(P)===n.nativeTurnId));if(!r?.user)return null;let p=r.user.id,f=O.current;if(f===null)throw Error("Virtual timeline is not mounted");return await f.scrollToKey(r.key,(m)=>m.querySelector(`[data-content-search-unit-key="${CSS.escape(p)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(p)}"]`)}finally{if(re.current===u)ne(!1)}},[v,e.id]),Ne=M(async(n)=>{if(n.nativeTurnId!==void 0)await v.previewHistoryTurn(e.id,n.nativeTurnId)},[v,e.id]);N(()=>{if(l===null)return;let n=l.querySelector("[data-codex-timeline]");if(n===null)throw Error("Timeline content element is missing");let a=new ResizeObserver(()=>{let u=H.current,r=null;if(u!==null){let p=Math.max(0,u.heightPx-u.element.getBoundingClientRect().height);if(p!==I.current&&(p<I.current||u.keepTop)){if(I.current=p,Te(()=>F(p)),p===0)H.current=null}if(p>0&&u.keepTop)r=l.scrollTop+u.element.getBoundingClientRect().top-l.getBoundingClientRect().top-ye}le(r)});if(a.observe(n),a.observe(l),L!==void 0){let u=l.querySelector(`[data-codex-turn="${CSS.escape(L)}"]`);if(u===null)throw Error("Latest turn is not mounted");a.observe(u)}return()=>a.disconnect()},[le,L,l]),N(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let ce=h(null);ve(()=>{if(l===null)return;let n=c.at(-1),a=ce.current;if(ce.current=n===void 0?null:{key:n.key,running:y},n===void 0||a===null||n.user===null||n.replayed)return;if(w){if(y&&e.turnEndedAt[n.user.id]===void 0&&(n.key!==a.key||!a.running))H.current=null,I.current=0,F(0),se()}else if(n.key!==a.key)X()},[se,w,y,X,l,e.turnEndedAt,c]);let Ee=(n,a)=>{let u=n,r=u.turn;if(r===void 0){if(u.nativeTurnId===void 0)throw Error(`Turn is missing at index ${a}`);return i(Ke,{sessionId:e.id,turnId:u.nativeTurnId,root:l,error:T?.turnErrors[u.nativeTurnId],connected:k&&!C&&!Pe})}let p=c.indexOf(r),f=r.key===xe,m=Ui(e,c,p),P=!f&&m.continued,K=r.key===L,q=r.errors.at(-1),de=q===void 0?null:ze(q),J=q===void 0?null:ge(q),Ae=!e.subagent&&K&&!f&&k&&we&&e.attached&&!e.readOnly&&!e.restoring&&q===e.items.at(-1)&&de!==null&&Be(de).kind==="overloaded"&&J!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",me=z?.(r)??null,pe=s?.(r)??null,Le=pe!==null||r.work.length>0||r.final.length>0||r.errors.length>0||f||me!==null||st(r)||Rn(r)||K&&(e.error!==null||e.lastStopReason==="cancelled"),fe=r.user===null?null:it(r);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":r.key,className:"flex flex-col gap-1.5",children:[r.user!==null&&(V===void 0?i(bi,{item:r.user,messageTime:fe}):V(r.user,fe)),Le&&i(li,{sessionId:e.id,turn:r,terminals:e.terminals,active:f,blocked:e.state==="requires_action",continued:P,edits:m.edits,activityItems:m.items,workStartedAt:m.startedAt,isLast:K,error:e.error,retrying:f?Ve(e._meta)??void 0:void 0,retry:Ae?{turnId:J,delaySeconds:ri(c),run:(Ce)=>v.retrySession(e.id,J,Ce)}:void 0,interrupted:Rn(r)||!f&&K&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:R?.(r),footer:me}),a===ee&&b?.node,g?.(r)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[i(_,{viewportRef:be,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":A.t("timeline.label")},children:i("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:E("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[b&&ee===-1&&b.node,i(ei,{ref:O,entries:W,renderTurn:Ee,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:d===void 0?void 0:i("div",{className:"pt-3",children:d})}),w&&i("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),i("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),i("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&i("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:i(Y,{variant:"outline",size:"sm",disabled:!k,title:T.error,onClick:()=>{v.loadHistoryNavigation(e.id).catch(()=>{})},children:A.t("timeline.navigationRetry")})}),Re&&x?.cursor&&!T?.complete&&E("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[i(Y,{variant:"outline",size:"sm",disabled:!k||e.restoring||x.loading,onClick:G,children:x.loading?A.t("timeline.loadingEarlier"):A.t("timeline.loadEarlier")}),x.error&&i("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),S!==void 0&&i(Pi,{items:he,audio:S.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ne,onRevealError:(n)=>ct(A,n),targetTopMarginPx:16},e.id),i("button",{type:"button",className:C?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:C?-1:void 0,onClick:X,"aria-label":A.t("timeline.scrollToBottom"),children:y?E("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[i("span",{className:"codex-wave-dot"}),i("span",{className:"codex-wave-dot"}),i("span",{className:"codex-wave-dot"})]}):i(qe,{})})]})}
2
- export{tt};
1
+ import{bi}from"./chunk-bp6f5tv8.js";import{Me,t,Ae,o,vt}from"./chunk-844s61q1.js";import{tr,ft,Qn,ir,rr}from"./chunk-rge2pazt.js";import{gt}from"./chunk-rb4p3h5b.js";import{Hi}from"./chunk-5zq0s9fd.js";import{Fi}from"./chunk-5s85tvas.js";import{Pi,Ii}from"./chunk-jpm15hcd.js";import{cr,dr}from"./chunk-cx1sg5dt.js";import{_i}from"./chunk-q4f8zazc.js";import{Di}from"./chunk-vk7kqa6a.js";import{Zi}from"./chunk-677dyzb1.js";import{codexExtensionCapabilities as ze,codexMessageError as Ve,codexRetryNotice as Be,codexTurnError as qe,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Oe}from"lucide-react";import{useCallback as M,useEffect as N,useLayoutEffect as ve,useMemo as Q,useRef as h,useState as U}from"react";import{flushSync as Te}from"react-dom";import{Button as Y}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as i,jsxs as E}from"react/jsx-runtime";var ye=24;function Fe(e){let d=Math.max(0,e.turnTopPx-ye),g=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),s=d-g;return{scrollTopPx:d,spacerPx:s>0?e.spacerPx+s:e.spacerPx}}function Ke({viewportRef:e,viewportProps:d,children:g}){return i("div",{ref:e,...d,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:g})}function Ue({sessionId:e,turnId:d,root:g,error:s,connected:R}){let z=h(null),V=Ae(),{t:b}=t(),S=M(()=>{V.loadHistoryTurn(e,d).catch(()=>{})},[V,e,d]);return N(()=>{if(!g||!z.current||!R||s)return;let w=new IntersectionObserver((_)=>{if(_.some((v)=>v.isIntersecting))w.disconnect(),S()},{root:g,rootMargin:"800px 0px"});return w.observe(z.current),()=>w.disconnect()},[g,R,s,S]),i("div",{ref:z,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":d,"data-markdown-pending":!0,children:s?E("div",{className:"flex flex-col items-center gap-2",children:[i("p",{role:"alert",className:"text-destructive text-xs",children:s}),i(Y,{variant:"outline",size:"sm",onClick:S,disabled:!R,children:b("timeline.navigationRetry")})]}):E("div",{role:"status","aria-label":b("timeline.navigationLoading"),className:"space-y-3",children:[i("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),i("div",{className:"bg-muted h-3 w-4/5 rounded"}),i("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function _e(e,d){let g=h([]),s=h(null);if(s.current?.items!==e.items||s.current.state!==e.state||s.current.ended!==e.turnEndedAt||s.current.usage!==e.turnUsage||s.current.historyOrder!==d)s.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:d,turns:tr(e,g.current,d)};let R=s.current.turns;return g.current=R,R}function dt(e){return i(Me,{host:e.host,client:e.client,children:i(We,{...e})})}function We({session:e,leading:d,afterTurn:g,turnWork:s,answerActions:R,turnFooter:z,renderUserMessage:V,insert:b,navigation:S,anchorNewTurn:w=!1,Viewport:_=Ke}){let v=Ae(),A=t(),T=o((n)=>n.historyNavigation[e.id]),c=_e(e,T?.turns),L=c.at(-1)?.key,xe=ir(e,c),y=e.state==="running"||e.state==="requires_action",W=Q(()=>Fi(c,T),[c,T]),Z=Q(()=>W.flatMap((n)=>n.turn===void 0?[]:[{...n.turn,key:n.turnKey}]),[W]),he=Q(()=>S===void 0?[]:Pi(c,e.turnUsage,T),[S,c,e.turnUsage,T]),ee=b&&b.afterItemId!==null?c.findIndex((n)=>n.items.some((a)=>a.id===b.afterItemId)):-1,D=h(c);D.current=c;let[l,be]=U(null),x=o((n)=>n.historyPages[e.id]),k=o((n)=>n.connection==="ready"),we=o((n)=>ze(n.agent).sessionRetry),te=x!==void 0;N(()=>{if(k&&te&&!e.restoring)v.loadHistoryNavigation(e.id).catch(()=>{})},[v,k,te,e.id,e.restoring]);let[Re,Se]=U(!1),O=h(null),[ke,ne]=U(!1),re=h(0),j=h({key:L,running:y});j.current={key:L,running:y};let[ie,F]=U(0),I=h(0),H=h(null);I.current=ie;let Pe=M(()=>{if(H.current!==null)H.current.keepTop=!1},[]),{isFollowing:C,scrollToBottom:X,stopFollowing:B,schedulePin:oe,contentResized:le,beginLocate:ae,cancelLocation:ue}=Di(l,y,Pe),se=M(()=>{if(l===null||!y)return;let n=c.at(-1)?.key;if(n===void 0)return;let a=ae(!0),u=()=>a.isCurrent()&&j.current.running&&j.current.key===n,r=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!u())return;let f=l.querySelector(`[data-codex-turn="${CSS.escape(n)}"]`);if(f===null)return;let m=l.scrollTop+f.getBoundingClientRect().top-l.getBoundingClientRect().top,P=Fe({turnTopPx:m,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:I.current});H.current=P.spacerPx>0?{element:f,heightPx:f.getBoundingClientRect().height+P.spacerPx,keepTop:!0}:null,Te(()=>F(P.spacerPx)),requestAnimationFrame(()=>{if(u())a.finish(P.scrollTopPx)})})),p=O.current;if(p===null)return;p.scrollToKey(n,void 0,{align:"top"}).then(()=>{if(u())r()})},[ae,y,l,c]);ve(()=>{if(!w||y)return;ue(),H.current=null,I.current=0,F(0)},[w,ue,y]);let G=M(()=>{B(),v.loadOlderHistory(e.id).catch(()=>{})},[v,e.id,B]);N(()=>{if(l===null)return;let n=()=>{let a=l.scrollTop<600;if(Se(a),a&&!T?.complete&&k&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)G()};return n(),l.addEventListener("scroll",n,{passive:!0}),()=>l.removeEventListener("scroll",n)},[k,x,C,G,l,e.restoring,T?.complete]),N(()=>{cr({sessionId:e.id,turns:Z,api:O.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),N(()=>()=>dr(e.id),[e.id]);let Ie=M(async(n,a)=>{let u=++re.current;ne(!0);try{if(n.isLoaded===!1&&n.nativeTurnId!==void 0)await v.loadHistoryTurn(e.id,n.nativeTurnId),await new Promise((m)=>requestAnimationFrame(()=>m()));if(!a())return null;let r=D.current.find((m)=>m.user?.id===(n.messageId??n.id))??D.current.find((m)=>m.user!==null&&n.nativeTurnId!==void 0&&m.items.some((P)=>ge(P)===n.nativeTurnId));if(!r?.user)return null;let p=r.user.id,f=O.current;if(f===null)throw Error("Virtual timeline is not mounted");return await f.scrollToKey(r.key,(m)=>m.querySelector(`[data-content-search-unit-key="${CSS.escape(p)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(p)}"]`)}finally{if(re.current===u)ne(!1)}},[v,e.id]),He=M(async(n)=>{if(n.nativeTurnId!==void 0)await v.previewHistoryTurn(e.id,n.nativeTurnId)},[v,e.id]);N(()=>{if(l===null)return;let n=l.querySelector("[data-codex-timeline]");if(n===null)throw Error("Timeline content element is missing");let a=new ResizeObserver(()=>{let u=H.current,r=null;if(u!==null){let p=Math.max(0,u.heightPx-u.element.getBoundingClientRect().height);if(p!==I.current&&(p<I.current||u.keepTop)){if(I.current=p,Te(()=>F(p)),p===0)H.current=null}if(p>0&&u.keepTop)r=l.scrollTop+u.element.getBoundingClientRect().top-l.getBoundingClientRect().top-ye}le(r)});if(a.observe(n),a.observe(l),L!==void 0){let u=l.querySelector(`[data-codex-turn="${CSS.escape(L)}"]`);if(u===null)throw Error("Latest turn is not mounted");a.observe(u)}return()=>a.disconnect()},[le,L,l]),N(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let ce=h(null);ve(()=>{if(l===null)return;let n=c.at(-1),a=ce.current;if(ce.current=n===void 0?null:{key:n.key,running:y},n===void 0||a===null||n.user===null||n.replayed)return;if(w){if(y&&e.turnEndedAt[n.user.id]===void 0&&(n.key!==a.key||!a.running))H.current=null,I.current=0,F(0),se()}else if(n.key!==a.key)X()},[se,w,y,X,l,e.turnEndedAt,c]);let Ne=(n,a)=>{let u=n,r=u.turn;if(r===void 0){if(u.nativeTurnId===void 0)throw Error(`Turn is missing at index ${a}`);return i(Ue,{sessionId:e.id,turnId:u.nativeTurnId,root:l,error:T?.turnErrors[u.nativeTurnId],connected:k&&!C&&!ke})}let p=c.indexOf(r),f=r.key===xe,m=rr(e,c,p),P=!f&&m.continued,K=r.key===L,q=r.errors.at(-1),de=q===void 0?null:Ve(q),J=q===void 0?null:ge(q),Ee=!e.subagent&&K&&!f&&k&&we&&e.attached&&!e.readOnly&&!e.restoring&&q===e.items.at(-1)&&de!==null&&qe(de).kind==="overloaded"&&J!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",me=z?.(r)??null,pe=s?.(r)??null,Le=pe!==null||r.work.length>0||r.final.length>0||r.errors.length>0||f||me!==null||ft(r)||Qn(r)||K&&(e.error!==null||e.lastStopReason==="cancelled"),fe=r.user===null?null:gt(r);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":r.key,className:"flex flex-col gap-1.5",children:[r.user!==null&&(V===void 0?i(Zi,{item:r.user,messageTime:fe}):V(r.user,fe)),Le&&i(Hi,{sessionId:e.id,turn:r,terminals:e.terminals,active:f,blocked:e.state==="requires_action",continued:P,edits:m.edits,activityItems:m.items,workStartedAt:m.startedAt,isLast:K,error:e.error,retrying:f?Be(e._meta)??void 0:void 0,retry:Ee?{turnId:J,delaySeconds:_i(c),run:(Ce)=>v.retrySession(e.id,J,Ce)}:void 0,interrupted:Qn(r)||!f&&K&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:R?.(r),footer:me}),a===ee&&b?.node,g?.(r)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[i(_,{viewportRef:be,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":A.t("timeline.label")},children:i("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:E("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[b&&ee===-1&&b.node,i(bi,{ref:O,entries:W,renderTurn:Ne,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:d===void 0?void 0:i("div",{className:"pt-3",children:d})}),w&&i("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),i("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),i("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&i("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:i(Y,{variant:"outline",size:"sm",disabled:!k,title:T.error,onClick:()=>{v.loadHistoryNavigation(e.id).catch(()=>{})},children:A.t("timeline.navigationRetry")})}),Re&&x?.cursor&&!T?.complete&&E("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[i(Y,{variant:"outline",size:"sm",disabled:!k||e.restoring||x.loading,onClick:G,children:x.loading?A.t("timeline.loadingEarlier"):A.t("timeline.loadEarlier")}),x.error&&i("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),S!==void 0&&i(Ii,{items:he,audio:S.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:Ie,onPreviewItem:He,onRevealError:(n)=>vt(A,n),targetTopMarginPx:16},e.id),i("button",{type:"button",className:C?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:C?-1:void 0,onClick:X,"aria-label":A.t("timeline.scrollToBottom"),children:y?E("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[i("span",{className:"codex-wave-dot"}),i("span",{className:"codex-wave-dot"}),i("span",{className:"codex-wave-dot"})]}):i(Oe,{})})]})}
2
+ export{dt};
@@ -0,0 +1,2 @@
1
+ import{No}from"./chunk-hqdbv5hw.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function Lr({host:o,children:t}){return s(n,{value:o,children:t})}function _(){let o=i(n),e={...No(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function Co(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function ie(){let o=_();return(t)=>Co(o,t)}function wo(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
+ export{Lr,_,Co,ie,wo};
@@ -1,3 +1,3 @@
1
- import{d,T}from"./chunk-32s8dn1a.js";import{V}from"./chunk-1fh3vvpe.js";import{ci}from"./chunk-xgcwrqpw.js";import{ie}from"./chunk-76a04a6j.js";import{di,ot}from"./chunk-wwq7d7qm.js";import{gi}from"./chunk-e0c8pmjc.js";import{Mn}from"./chunk-zfag3ne0.js";import{cn as M}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,w=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return v.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(T,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(T,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ie,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var E=new Set;function wa({message:t,isMostRecentTurn:n,hiddenTools:s=E,time:i,beforeCopy:r,afterCopy:c,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
- `),b=!t.streaming&&C.trim().length>0?o(bn,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:c,time:i}):null,l=ci(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),B=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&V(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(ot,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===B?b:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Cn,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(gi,{blocks:f}):y(f))})}function bn({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let c=d(),{t:u}=c;return g("div",{className:M("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Mn,{text:t,label:u("actions.copy"),host:c}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=d();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Cn({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...c}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(di,{...c,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
- export{wa,bn,Cn};
1
+ import{u,A}from"./chunk-1647cyqx.js";import{q}from"./chunk-eeqppv9j.js";import{Ui}from"./chunk-06yzz0yx.js";import{le}from"./chunk-7cj104ba.js";import{Gi,mt}from"./chunk-19yjze8m.js";import{Bi}from"./chunk-8c7x6vrs.js";import{Wn}from"./chunk-24dqkjvg.js";import{cn as M}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,w=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return v.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(A,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(A,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(le,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var E=new Set;function qa({message:t,isMostRecentTurn:n,hiddenTools:s=E,time:i,beforeCopy:r,afterCopy:c,providerIcon:p,renderText:T,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
+ `),b=!t.streaming&&C.trim().length>0?o(Un,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:c,time:i}):null,d=Ui(t.content,"compact"),x=d.reduce((e,a,l)=>a.kind==="codexActivityGroup"?l:e,-1),h=d.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),B=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&q(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((l)=>l.type!=="tool_use"||!s.has(l.name));return a.length===0?null:o(mt,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===B?b:void 0,renderText:T},R(e.block))},m=x===-1?0:h===-1?d.length:h;return o(On,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:p,work:d.slice(0,m).map(k),answer:d.length>m?d.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(Bi,{blocks:f}):y(f))})}function Un({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let c=u(),{t:p}=c;return g("div",{className:M("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Wn,{text:t,label:p("actions.copy"),host:c}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=u();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function On({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...c}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(Gi,{...c,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
+ export{qa,Un,On};
@@ -1,2 +1,2 @@
1
- import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var go={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},fo={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function L({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=go[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",fo.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
- export{go,fo,L};
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 Ao={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},Eo={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function D({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=Ao[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",Eo.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{Ao,Eo,D};
@@ -0,0 +1,5 @@
1
+ import{v,mr}from"./chunk-zfjpfj30.js";import{isResourceLink as g,isText as h}from"@nyssance/codex-acp-v2/client";import{useRef as R}from"react";function Yo(o,m,x,y=!1){let i=R(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
2
+ `):n.value.slice(n.selectionEnd).includes(`
3
+ `))return;if(!e){if(!s||n.value!==""||y)return;let u=o.items.flatMap((a)=>{if(a.kind!=="user")return[];let f=a.content.filter(h).map((l)=>l.text).join(`
4
+ `),p=a.content.filter(g).flatMap((l)=>{let d=v(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:mr(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
+ export{Yo};
@@ -1,2 +1,2 @@
1
- import{At}from"./chunk-wr5r2t2m.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function vr({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(At,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
- export{vr};
1
+ import{Ot}from"./chunk-vxexg361.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function Fr({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(Ot,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
+ export{Fr};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-f1r8wh4e.js";import{e}from"./chunk-6pnsagt4.js";import{g,K}from"./chunk-w0dfvr05.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=g(a.configOptions,"model");return t===void 0?void 0:K(t)}function Le(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=g(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(l?.inputTokens),k=f(l?.outputTokens),x=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||N+k+x+w,R=N+x,C=R>0?A.format(x/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(N)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(x)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],v=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Le(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var Gt=W(_);
2
- export{Le,Gt};
1
+ import{o}from"./chunk-844s61q1.js";import{e}from"./chunk-rvjfb004.js";import{h,Z}from"./chunk-7qmj50a2.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=h(a.configOptions,"model");return t===void 0?void 0:Z(t)}function Oe(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=h(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,N=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||N+k+g+w,R=N+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(N)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],v=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Oe(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var Yt=W(_);
2
+ export{Oe,Yt};
@@ -0,0 +1,2 @@
1
+ import{c}from"./chunk-8pdapsc7.js";import{s,n}from"./chunk-hqdbv5hw.js";import{P,g,p,J}from"./chunk-bv175dn9.js";import{_,ie,wo}from"./chunk-s267ztm1.js";import{Qe}from"./chunk-rhxyb55x.js";import{R,Y}from"./chunk-kgjdh49d.js";import{ve,oe}from"./chunk-1tb3d2x4.js";import{closestCorners as ge,DndContext as fe,KeyboardSensor as Ce,PointerSensor as ye,useSensor as W,useSensors as Se}from"@dnd-kit/core";import{SortableContext as X,sortableKeyboardCoordinates as De,useSortable as ae,verticalListSortingStrategy as Z}from"@dnd-kit/sortable";import{CSS as ce}from"@dnd-kit/utilities";import{cn as G}from"cn";import{BrushCleaningIcon as we,MessageSquareIcon as Ne,MoreHorizontalIcon as Ie,PencilIcon as he,PlusIcon as de,StarIcon as be,Trash2Icon as me}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as k}from"react";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ee,DialogContent as te,DialogDescription as ne,DialogFooter as le,DialogHeader as re,DialogTitle as se}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as H,DropdownMenuTrigger as Re}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Pe}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a,Fragment as ze}from"react/jsx-runtime";function Te({collectionId:l,sessionId:y,children:b}){let{attributes:v,listeners:N,setNodeRef:i,transform:u,transition:f,isDragging:x}=ae({id:JSON.stringify([l,y]),data:{type:"session",collectionId:l,sessionId:y}});return e("div",{ref:i,style:{transform:ce.Transform.toString(u),transition:f},className:G("w-full min-w-0",x&&"opacity-50"),...v,...N,role:"group",children:b})}function Be({collection:l,children:y,onEdit:b,onConfirm:v,onNewChat:N}){let{t:i}=_(),u=oe(),f=ie(),{attributes:x,listeners:m,setNodeRef:I,transform:L,transition:T,isDragging:z}=ae({id:l.id,disabled:{draggable:l.id===R,droppable:!1},data:{type:"collection"}});return e("div",{ref:I,style:{transform:ce.Transform.toString(L),transition:T},className:G("w-full min-w-0",z&&"opacity-50"),children:e(J,{open:!l.collapsed,onOpenChange:(d)=>f(u({type:"collapse",id:l.id,collapsed:!d})),label:Y(l,i),count:l.sessionIds.length,leading:l.id===R?e(be,{className:"size-3.5"}):e(Qe,{emoji:l.emoji,onChange:(d)=>f(u({type:"emoji",id:l.id,emoji:d}))}),wrapHeader:(d)=>e("div",{...x,...m,role:"group",children:d}),actions:a(Ee,{children:[e(Re,{onClick:(d)=>d.stopPropagation(),onPointerDown:(d)=>d.stopPropagation(),render:e(w,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:Y(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:a(Le,{children:[l.id!==R&&a(H,{onClick:b,children:[e(he,{}),i("collection.rename")]}),a(H,{onClick:N,children:[e(de,{}),i("collection.newChat")]}),a(H,{onClick:()=>v("clear"),children:[e(we,{}),i("collection.clearCollection")]}),l.id!==R&&a(H,{variant:"destructive",onClick:()=>v("delete"),children:[e(me,{}),i("collection.deleteCollection")]})]})})]}),children:y})})}function He({children:l}){return e("div",{className:"min-h-0 flex-1 overflow-y-auto ps-2 pe-0 pb-1",children:l})}function Tr({renderRow:l,onSelect:y,onNewChat:b,Scroll:v=He}){let N=_(),{t:i}=N,u=oe(),f=ie(),x=s(),{collections:m,order:I}=ve(),L=n((o)=>o.sessionList),T=n((o)=>o.archivedSessions),z=n((o)=>o.sessionListLoaded),d=n((o)=>o.sessionListError),F=Me(()=>new Map([...T,...L].map((o)=>[o.sessionId,o])),[T,L]),U=N.isMac??wo(),[S,M]=k(null),[E,K]=k(""),[q,O]=k(""),[D,B]=k(null),[C,A]=k(!1),pe=Se(W(ye,{activationConstraint:{distance:5}}),W(Ce,{coordinateGetter:De})),j=I.flatMap((o)=>m[o].collapsed?[]:m[o].sessionIds.flatMap((t)=>{let r=F.get(t);return r&&!r.archived?[r]:[]}));xe(()=>{let o=(t)=>{if(t.defaultPrevented||t.isComposing||t.repeat||t.shiftKey||t.altKey)return;if(U?!t.metaKey||t.ctrlKey:!t.ctrlKey||t.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(t.target instanceof HTMLElement&&(t.target.isContentEditable||t.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let r=Number(t.key)-1;if(!Number.isInteger(r)||r<0||r>8||!j[r])return;t.preventDefault(),y(j[r])};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[j,U,y]);let ue=({active:o,over:t})=>{if(t===null)return;let r=o.data.current,h=t.data.current;if(r?.type==="session"&&h!==void 0){let V=h.type==="session"?String(h.collectionId):String(t.id);f(u({type:"move",sourceCollectionId:String(r.collectionId),collectionId:V,sessionId:String(r.sessionId),index:h.type==="session"?m[V].sessionIds.indexOf(String(h.sessionId)):void 0}))}else if(r?.type==="collection"&&h?.type==="collection"&&String(t.id)!==R)f(u({type:"reorder",id:String(o.id),index:I.indexOf(String(t.id))}))},Q=(o,t)=>{A(!0),f(o.then(t).finally(()=>A(!1)))};return a(ze,{children:[e(v,{children:a(P,{children:[a(p,{className:G(c,"font-normal"),onClick:()=>{M("new"),K(""),O("")},children:[e(g,{children:e(de,{})}),e("span",{children:i("collection.newCollection")})]}),d&&a("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:d}),e(w,{variant:"ghost",onClick:()=>f(x.listSessions({reset:!0})),children:i("collection.retry")})]}),e(fe,{sensors:pe,collisionDetection:ge,onDragEnd:ue,children:e(X,{items:I,strategy:Z,children:e(P,{children:I.map((o)=>e(Be,{collection:m[o],onNewChat:()=>b(o),onEdit:()=>{M(o),K(m[o].name),O(m[o].emoji??"")},onConfirm:(t)=>B({id:o,type:t}),children:e(X,{items:m[o].sessionIds.map((t)=>JSON.stringify([o,t])),strategy:Z,children:m[o].sessionIds.map((t)=>{let r=F.get(t);if(r?.archived)return null;if(!r)return z?a("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(g,{children:e(Ne,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(w,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>f(u({type:"remove",sessionId:t,collectionId:o})),children:e(me,{})})]},t):null;return e(Te,{collectionId:o,sessionId:t,children:l(r,()=>{},o)},t)})})},o))})})})]})}),e(ee,{open:S!==null,onOpenChange:(o)=>{if(!o&&!C)M(null)},children:a(te,{children:[a(re,{children:[e(se,{children:i(S==="new"?"collection.newCollection":"collection.rename")}),e(ne,{children:i("collection.collectionName")})]}),a("form",{onSubmit:(o)=>{if(o.preventDefault(),S===null||!E.trim()||C)return;let t=S==="new"?`collection-${crypto.randomUUID()}`:S;Q(u([S==="new"?{type:"create",id:t,name:E}:{type:"rename",id:t,name:E},{type:"emoji",id:t,emoji:q}]),()=>M(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:E,onChange:(o)=>K(o.target.value),disabled:C}),S!=="new"&&e(Qe,{emoji:q,onChange:O}),a(le,{children:[e(w,{type:"button",variant:"outline",disabled:C,onClick:()=>M(null),children:i("collection.cancel")}),e(w,{type:"submit",disabled:C||!E.trim(),children:i("collection.confirm")})]})]})]})}),e(ee,{open:D!==null,onOpenChange:(o)=>{if(!o&&!C)B(null)},children:a(te,{children:[a(re,{children:[e(se,{children:i(D?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ne,{children:i("collection.confirmCollectionChange",{name:D===null?"":Y(m[D.id],i)})})]}),a(le,{children:[e(w,{variant:"outline",disabled:C,onClick:()=>B(null),children:i("collection.cancel")}),e(w,{disabled:C,onClick:()=>{if(D!==null)Q(u({type:D.type,id:D.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
2
+ export{Tr};
@@ -0,0 +1,3 @@
1
+ import{yi,ct}from"./chunk-a953k2dj.js";import{t,te}from"./chunk-844s61q1.js";import{createStore as d}from"@alwith/api/client";import{Dialog as f,DialogContent as p,DialogDescription as m,DialogHeader as u,DialogTitle as h}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function jt(e){c.setState({request:{path:e.path,patch:Ro(e.patch,e.path)}})}function Ro(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
2
+ `,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function $t(){let{t:e,theme:a}=t(),n=te(c,(o)=>o.request),s=n===null?null:yi(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(ct,{patch:n.patch,theme:a})})]})})}
3
+ export{jt,Ro,$t};
@@ -1,2 +1,2 @@
1
- import{fe}from"./chunk-m1adrey8.js";import{useEffect as s,useState as w}from"react";function lo(){let[i,e]=w(!1);return s(()=>{let t=fe()?"Meta":"Control",o=(n)=>{if(n.key===t)e(!0)},r=(n)=>{if(n.key===t)e(!1)},d=()=>e(!1);return window.addEventListener("keydown",o),window.addEventListener("keyup",r),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",r),window.removeEventListener("blur",d)}},[]),i}
2
- export{lo};
1
+ import{Ce}from"./chunk-5y5b3w22.js";import{useEffect as s,useState as w}from"react";function Po(){let[i,e]=w(!1);return s(()=>{let t=Ce()?"Meta":"Control",o=(n)=>{if(n.key===t)e(!0)},r=(n)=>{if(n.key===t)e(!1)},d=()=>e(!1);return window.addEventListener("keydown",o),window.addEventListener("keyup",r),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",r),window.removeEventListener("blur",d)}},[]),i}
2
+ export{Po};
@@ -1,2 +1,2 @@
1
- function _o({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
- export{_o};
1
+ function qo({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
+ export{qo};
@@ -0,0 +1,2 @@
1
+ import{I}from"./chunk-cdgfr4n0.js";import{a}from"./chunk-hqdbv5hw.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as s}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function Gr({children:p}){let{t:n}=a(),[o,l]=s(!1),r=c(null),[u,d]=s();return I(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}l(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:u},children:p})]})}
2
+ export{Gr};