@alwith/module-chat 0.6.0 → 0.6.2

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 (380) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/approval/choice-elicitation-form.js +1 -1
  3. package/dist/approval/choice-schema.js +1 -1
  4. package/dist/approval/permission-options.js +1 -1
  5. package/dist/approval/permission-view.js +1 -1
  6. package/dist/approval/schema-elicitation-form.js +1 -1
  7. package/dist/approval/url-elicitation-card.js +1 -1
  8. package/dist/{chunk-69p0nqws.js → chunk-07srtfz3.js} +2 -2
  9. package/dist/chunk-0ag4ewq9.js +2 -0
  10. package/dist/{chunk-7491nfcw.js → chunk-0fmepk2y.js} +3 -3
  11. package/dist/{chunk-yvr086m7.js → chunk-1b2jsf2v.js} +2 -2
  12. package/dist/{chunk-te3mzdae.js → chunk-2bbspcb4.js} +2 -2
  13. package/dist/{chunk-6h2ysmec.js → chunk-2z1cpz8a.js} +2 -2
  14. package/dist/{chunk-8j39jdxr.js → chunk-31t5ap7s.js} +3 -3
  15. package/dist/{chunk-5wc30q2q.js → chunk-35z0nr4v.js} +2 -2
  16. package/dist/{chunk-r0bmsz7b.js → chunk-3aadhvbj.js} +2 -2
  17. package/dist/{chunk-zrh4de8p.js → chunk-3mrdv5yq.js} +2 -2
  18. package/dist/chunk-3stf1tm2.js +2 -0
  19. package/dist/{chunk-wcwgk4bg.js → chunk-41nq4hjc.js} +2 -2
  20. package/dist/{chunk-gdr4245h.js → chunk-4jh2wk80.js} +2 -2
  21. package/dist/chunk-4xjzvwg4.js +2 -0
  22. package/dist/{chunk-wxsb337y.js → chunk-4xp0q7vs.js} +3 -3
  23. package/dist/{chunk-rz3njmhn.js → chunk-53k7yvr8.js} +1 -1
  24. package/dist/chunk-57p1s7hy.js +2 -0
  25. package/dist/{chunk-f06zyvek.js → chunk-5azv8vz6.js} +2 -2
  26. package/dist/{chunk-9vxev5r7.js → chunk-601kr76a.js} +3 -3
  27. package/dist/{chunk-1rs9getz.js → chunk-67x8znmk.js} +2 -2
  28. package/dist/{chunk-twbp4j4c.js → chunk-6d5c94rn.js} +2 -2
  29. package/dist/chunk-6hxa1n8n.js +2 -0
  30. package/dist/chunk-6m54xxts.js +2 -0
  31. package/dist/chunk-6pwy0ncf.js +2 -0
  32. package/dist/{chunk-cansmt47.js → chunk-6wtrmxev.js} +3 -3
  33. package/dist/{chunk-cpvaqbtq.js → chunk-6wv99fdt.js} +2 -2
  34. package/dist/{chunk-4kevwekp.js → chunk-6zcjn8ra.js} +2 -2
  35. package/dist/chunk-718drhrv.js +2 -0
  36. package/dist/chunk-753z0tkd.js +2 -0
  37. package/dist/{chunk-m7e2zvyk.js → chunk-7bcm8mpx.js} +2 -2
  38. package/dist/{chunk-fyvq1tqw.js → chunk-7eq01k20.js} +3 -3
  39. package/dist/{chunk-q005jp78.js → chunk-7jx2k96e.js} +2 -2
  40. package/dist/{chunk-ddj8ag0b.js → chunk-7nb0qea6.js} +3 -3
  41. package/dist/{chunk-m8s9nw8b.js → chunk-7xe2v72q.js} +2 -2
  42. package/dist/{chunk-zettt6hy.js → chunk-7zcr1wzv.js} +2 -2
  43. package/dist/{chunk-t63mwyg0.js → chunk-8hen6y4t.js} +2 -2
  44. package/dist/{chunk-d4pm6n4q.js → chunk-8hgrrycr.js} +2 -2
  45. package/dist/{chunk-2g7k5pkt.js → chunk-8t3hyxk4.js} +2 -2
  46. package/dist/{chunk-6r8jsyqk.js → chunk-8wdkc41j.js} +2 -2
  47. package/dist/chunk-9b8y72yf.js +3 -0
  48. package/dist/{chunk-7g2fjbn8.js → chunk-9c8cyz7r.js} +2 -2
  49. package/dist/{chunk-kcke05ds.js → chunk-9ff3htdp.js} +2 -2
  50. package/dist/chunk-9g7qvbhx.js +2 -0
  51. package/dist/{chunk-0ms8k740.js → chunk-9hskky1n.js} +2 -2
  52. package/dist/{chunk-yep82kwy.js → chunk-9k4f13c1.js} +2 -2
  53. package/dist/{chunk-55gczv3j.js → chunk-9n028hnr.js} +2 -2
  54. package/dist/{chunk-hd879x7s.js → chunk-9rgrb198.js} +3 -3
  55. package/dist/{chunk-ezscf6qz.js → chunk-9w4fg6bn.js} +2 -2
  56. package/dist/{chunk-d09kxrbp.js → chunk-9yrctk84.js} +2 -2
  57. package/dist/{chunk-0d5830mq.js → chunk-a45jg9xv.js} +6 -6
  58. package/dist/{chunk-pvnc76cr.js → chunk-aarpb5np.js} +2 -2
  59. package/dist/{chunk-9cqfjpfk.js → chunk-abjr18n6.js} +3 -3
  60. package/dist/{chunk-9x48rd50.js → chunk-az434tgy.js} +2 -2
  61. package/dist/{chunk-4s4e7zzx.js → chunk-b5ywqwnr.js} +2 -2
  62. package/dist/{chunk-fjwn02v3.js → chunk-bb1y2fy7.js} +2 -2
  63. package/dist/{chunk-3sqxe0mw.js → chunk-be7ja8gh.js} +3 -3
  64. package/dist/{chunk-z32chhqm.js → chunk-bjfcyfp5.js} +2 -2
  65. package/dist/chunk-bk80xpsy.js +2 -0
  66. package/dist/{chunk-0jz7wsbx.js → chunk-brqgdzhr.js} +2 -2
  67. package/dist/chunk-bt01an6h.js +2 -0
  68. package/dist/{chunk-1z5htskd.js → chunk-bydgccyt.js} +2 -2
  69. package/dist/chunk-c11c29rv.js +5 -0
  70. package/dist/{chunk-1wh82w54.js → chunk-c2a0x69n.js} +2 -2
  71. package/dist/{chunk-gxjtydsk.js → chunk-c4dk6j2h.js} +2 -2
  72. package/dist/{chunk-ewjh6s2b.js → chunk-ce3wg766.js} +2 -2
  73. package/dist/chunk-cm5rcd9q.js +2 -0
  74. package/dist/chunk-cn9g220k.js +2 -0
  75. package/dist/chunk-d1pc0mrb.js +2 -0
  76. package/dist/{chunk-jsc8qzkj.js → chunk-d67ypca2.js} +2 -2
  77. package/dist/{chunk-887d80ps.js → chunk-db0g8rr1.js} +2 -2
  78. package/dist/{chunk-sc7qd3kj.js → chunk-dbrs7sen.js} +2 -2
  79. package/dist/{chunk-ht6p9j86.js → chunk-dj8e2ymr.js} +2 -2
  80. package/dist/{chunk-hfjvr394.js → chunk-e24d6hfs.js} +2 -2
  81. package/dist/chunk-e4h6f6dh.js +2 -0
  82. package/dist/chunk-e8jfja20.js +2 -0
  83. package/dist/{chunk-s7fc1rkz.js → chunk-eb12xkn0.js} +2 -2
  84. package/dist/{chunk-f192h0js.js → chunk-ehcpnhfw.js} +2 -2
  85. package/dist/chunk-enr3j794.js +2 -0
  86. package/dist/chunk-eryds6y3.js +2 -0
  87. package/dist/{chunk-j6e2t91q.js → chunk-ezhzktjg.js} +2 -2
  88. package/dist/{chunk-m0q3bf05.js → chunk-fkpmrb5t.js} +2 -2
  89. package/dist/{chunk-60z20w9q.js → chunk-fzfmg9pk.js} +2 -2
  90. package/dist/chunk-g3snk3nb.js +2 -0
  91. package/dist/chunk-g4frp0r0.js +2 -0
  92. package/dist/chunk-g7v2xgfh.js +2 -0
  93. package/dist/{chunk-y0cxqkzd.js → chunk-ggqv2qpg.js} +2 -2
  94. package/dist/{chunk-b4evrc3r.js → chunk-gjg213m6.js} +2 -2
  95. package/dist/chunk-gvwmyxwf.js +2 -0
  96. package/dist/{chunk-wvs6ttt3.js → chunk-gyps0vc5.js} +3 -3
  97. package/dist/chunk-h3hzsg0s.js +2 -0
  98. package/dist/{chunk-ss5xzk9q.js → chunk-h4r8cx37.js} +2 -2
  99. package/dist/{chunk-8mc330j2.js → chunk-hfzt777k.js} +2 -2
  100. package/dist/{chunk-yd68z08r.js → chunk-hp1w7xrp.js} +2 -2
  101. package/dist/chunk-hrgtpvkw.js +2 -0
  102. package/dist/{chunk-cc33s37q.js → chunk-j5engcds.js} +2 -2
  103. package/dist/chunk-j6mkqhey.js +2 -0
  104. package/dist/{chunk-d39kpmyz.js → chunk-k20e64v3.js} +2 -2
  105. package/dist/{chunk-dmsy511f.js → chunk-k8xqzrg6.js} +1 -1
  106. package/dist/{chunk-8ht645rn.js → chunk-ksyb8hyt.js} +2 -2
  107. package/dist/chunk-m33eg346.js +2 -0
  108. package/dist/{chunk-n6kdjmh7.js → chunk-m9mvh1gy.js} +2 -2
  109. package/dist/{chunk-d444rgtm.js → chunk-maa70rv4.js} +2 -2
  110. package/dist/{chunk-938k294j.js → chunk-mfnq8nnd.js} +3 -3
  111. package/dist/chunk-mhnhkg65.js +2 -0
  112. package/dist/{chunk-ps74k3c4.js → chunk-mmm1rq2a.js} +2 -2
  113. package/dist/{chunk-q3b79z6s.js → chunk-mz18hxbn.js} +2 -2
  114. package/dist/chunk-n6dbc0md.js +2 -0
  115. package/dist/{chunk-8qnrhq54.js → chunk-n9fwnebe.js} +2 -2
  116. package/dist/{chunk-pa354z8g.js → chunk-nk266xxm.js} +2 -2
  117. package/dist/{chunk-xhrs52gv.js → chunk-npsgbfh2.js} +2 -2
  118. package/dist/{chunk-yht2h676.js → chunk-nx701kdw.js} +2 -2
  119. package/dist/{chunk-fynzxex7.js → chunk-p0egvanw.js} +2 -2
  120. package/dist/{chunk-qcabefs0.js → chunk-p9ra3xxb.js} +2 -2
  121. package/dist/{chunk-tm5dbbgp.js → chunk-pp9fngkx.js} +2 -2
  122. package/dist/{chunk-xke4r5kr.js → chunk-q92p35wp.js} +2 -2
  123. package/dist/{chunk-8jxcdap5.js → chunk-qcj6f1rq.js} +2 -2
  124. package/dist/chunk-qexqjw6k.js +2 -0
  125. package/dist/chunk-qez4ygej.js +2 -0
  126. package/dist/chunk-qyp7c0j8.js +1 -0
  127. package/dist/{chunk-cfhg44ce.js → chunk-qznyjv2c.js} +2 -2
  128. package/dist/{chunk-t3vcp85z.js → chunk-r0v0wxn7.js} +2 -2
  129. package/dist/chunk-r1sdshyw.js +2 -0
  130. package/dist/{chunk-qmhnhgc5.js → chunk-rch4xpj1.js} +2 -2
  131. package/dist/{chunk-r25wz0yx.js → chunk-rg5jhh45.js} +2 -2
  132. package/dist/chunk-sqwscqfk.js +2 -0
  133. package/dist/{chunk-yvkt9ewq.js → chunk-stghje2t.js} +2 -2
  134. package/dist/{chunk-wc48fzq2.js → chunk-t8n1ny7h.js} +2 -2
  135. package/dist/{chunk-50brsmjd.js → chunk-teg61ef5.js} +2 -2
  136. package/dist/chunk-tjjqaf65.js +2 -0
  137. package/dist/chunk-v0h2wsj4.js +2 -0
  138. package/dist/{chunk-0e4zew7m.js → chunk-v3jehrgj.js} +2 -2
  139. package/dist/chunk-v4cf374m.js +2 -0
  140. package/dist/{chunk-kyxdpg6a.js → chunk-v5wqxqrh.js} +1 -1
  141. package/dist/chunk-v7dyjpv3.js +2 -0
  142. package/dist/{chunk-y7nq2yre.js → chunk-vkc6mwyb.js} +2 -2
  143. package/dist/chunk-vpm5ddtt.js +4 -0
  144. package/dist/{chunk-qx0xeepz.js → chunk-vwzkw97t.js} +2 -2
  145. package/dist/{chunk-93d3a9wy.js → chunk-w0dfvr05.js} +2 -2
  146. package/dist/{chunk-8nds14dw.js → chunk-wnsk4tw5.js} +2 -2
  147. package/dist/chunk-wyjzpncq.js +2 -0
  148. package/dist/{chunk-3pvs8s3b.js → chunk-x4qnkn8f.js} +2 -2
  149. package/dist/{chunk-t9djctkk.js → chunk-xecs5c6a.js} +1 -1
  150. package/dist/{chunk-97yvajhc.js → chunk-xhtpqc8p.js} +2 -2
  151. package/dist/{chunk-mb99bpqx.js → chunk-xvzz0xh6.js} +2 -2
  152. package/dist/{chunk-5fj4ewez.js → chunk-y2g8d94r.js} +2 -2
  153. package/dist/chunk-y7v0ghc9.js +2 -0
  154. package/dist/{chunk-5c5z2b48.js → chunk-yd6ae6py.js} +2 -2
  155. package/dist/{chunk-pqw5qz4e.js → chunk-yf39xswe.js} +2 -2
  156. package/dist/{chunk-z20ss7qj.js → chunk-yjk5a037.js} +2 -2
  157. package/dist/{chunk-wh5dd7mq.js → chunk-yq55kqn1.js} +2 -2
  158. package/dist/{chunk-y39xsj1f.js → chunk-yr6ar090.js} +1 -1
  159. package/dist/{chunk-6cbbnb7a.js → chunk-z49yf5bx.js} +2 -2
  160. package/dist/{chunk-vxk0kgbf.js → chunk-z4nv1j97.js} +2 -2
  161. package/dist/{chunk-a1snxcra.js → chunk-zb14ervr.js} +2 -2
  162. package/dist/{chunk-6883ebtb.js → chunk-zd40j8qb.js} +2 -2
  163. package/dist/{chunk-qvadb210.js → chunk-zn9xn0pj.js} +2 -2
  164. package/dist/chunk-zr2a9z0m.js +2 -0
  165. package/dist/codex/activity-group.js +1 -1
  166. package/dist/codex/assistant-message.js +1 -1
  167. package/dist/codex/async-question-card.js +1 -1
  168. package/dist/codex/disclosure-state.js +1 -1
  169. package/dist/codex/edited-files-card.js +1 -1
  170. package/dist/codex/image-view-activity.js +1 -1
  171. package/dist/codex/markdown-renderer.js +1 -1
  172. package/dist/codex/navigation-audio.js +1 -1
  173. package/dist/codex/navigation-preview.js +1 -1
  174. package/dist/codex/navigation-rail.js +1 -1
  175. package/dist/codex/patch-view.js +1 -1
  176. package/dist/codex/timeline-virtualizer.js +1 -1
  177. package/dist/codex/turn-activity.js +1 -1
  178. package/dist/codex/user-message.js +1 -1
  179. package/dist/codex/virtualized-turn-list.js +1 -1
  180. package/dist/collections/collection-emoji.js +1 -1
  181. package/dist/collections/collection-menu.js +1 -1
  182. package/dist/collections/collection-panel.js +1 -1
  183. package/dist/collections/collections.js +1 -1
  184. package/dist/collections/host.js +1 -1
  185. package/dist/collections/model.js +1 -1
  186. package/dist/collections/store.js +1 -1
  187. package/dist/composer/completion-filter.js +1 -1
  188. package/dist/composer/completion-menu.js +1 -1
  189. package/dist/composer/completion-trigger.js +1 -1
  190. package/dist/composer/effort-slider.d.ts +2 -1
  191. package/dist/composer/effort-slider.js +1 -1
  192. package/dist/composer/menu-radio.js +1 -1
  193. package/dist/composer/model-select.d.ts +2 -1
  194. package/dist/composer/model-select.js +1 -1
  195. package/dist/composer/permission-mode-select.js +1 -1
  196. package/dist/composer/prompt-input-attachments.js +1 -1
  197. package/dist/composer/prompt-input-clipboard.js +1 -1
  198. package/dist/composer/prompt-input-context.js +1 -1
  199. package/dist/composer/prompt-input-textarea.js +1 -1
  200. package/dist/composer/prompt-input.js +1 -1
  201. package/dist/conversation/action-card.js +1 -1
  202. package/dist/conversation/composer/app-mentions.d.ts +6 -0
  203. package/dist/conversation/composer/app-mentions.js +1 -0
  204. package/dist/conversation/composer/apps-menu.d.ts +4 -0
  205. package/dist/conversation/composer/apps-menu.js +1 -0
  206. package/dist/conversation/composer/composer.d.ts +4 -1
  207. package/dist/conversation/composer/composer.js +1 -1
  208. package/dist/conversation/composer/config-options.js +1 -1
  209. package/dist/conversation/composer/context.js +1 -1
  210. package/dist/conversation/composer/drafts.js +1 -1
  211. package/dist/conversation/composer/file-items.js +1 -1
  212. package/dist/conversation/composer/long-text.js +1 -1
  213. package/dist/conversation/composer/mention-chips.js +1 -1
  214. package/dist/conversation/composer/mention-uri.js +1 -1
  215. package/dist/conversation/composer/model-menu.js +1 -1
  216. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  217. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  218. package/dist/conversation/composer/prediction.js +1 -1
  219. package/dist/conversation/composer/prompt-history.js +1 -1
  220. package/dist/conversation/composer/slash-command-button.js +1 -1
  221. package/dist/conversation/composer/submit-button.js +1 -1
  222. package/dist/conversation/composer/usage-meter.js +1 -1
  223. package/dist/conversation/connection-notice.js +1 -1
  224. package/dist/conversation/context.js +1 -1
  225. package/dist/conversation/conversation-body.js +1 -1
  226. package/dist/conversation/conversation-search.js +1 -1
  227. package/dist/conversation/conversation-view.js +1 -1
  228. package/dist/conversation/conversation.js +1 -1
  229. package/dist/conversation/diff-modal.js +1 -1
  230. package/dist/conversation/draft-project-picker.js +1 -1
  231. package/dist/conversation/session-actions.js +1 -1
  232. package/dist/conversation/subagent-sessions.d.ts +10 -1
  233. package/dist/conversation/subagent-sessions.js +1 -1
  234. package/dist/conversation/subagent-tasks.d.ts +12 -0
  235. package/dist/conversation/subagent-tasks.js +1 -0
  236. package/dist/conversation/types.d.ts +16 -1
  237. package/dist/generated/commands.js +1 -1
  238. package/dist/image-lightbox.js +1 -1
  239. package/dist/image-preview-dialog.js +1 -1
  240. package/dist/image.d.ts +104 -0
  241. package/dist/image.js +1 -0
  242. package/dist/lib/code-highlighter.js +1 -1
  243. package/dist/lib/fuzzy.js +1 -1
  244. package/dist/lib/group-blocks.js +1 -1
  245. package/dist/lib/image-encode.js +1 -1
  246. package/dist/lib/limits.js +1 -1
  247. package/dist/lib/markdown-parser.js +1 -1
  248. package/dist/lib/markdown-parser.worker.js +46 -44
  249. package/dist/lib/markdown-rules.js +1 -1
  250. package/dist/lib/model-name.js +1 -1
  251. package/dist/lib/pointer-centered-zoom.js +1 -1
  252. package/dist/lib/prepare-prompt-files.js +1 -1
  253. package/dist/lib/stream-style.js +1 -1
  254. package/dist/lib/streaming-markdown.js +1 -1
  255. package/dist/lib/tool-artifacts.d.ts +2 -0
  256. package/dist/lib/tool-artifacts.js +1 -0
  257. package/dist/locales.d.ts +91 -0
  258. package/dist/locales.js +1 -1
  259. package/dist/plugins/catalog-skeleton.js +1 -1
  260. package/dist/plugins/host.js +1 -1
  261. package/dist/plugins/panel-item.js +1 -1
  262. package/dist/plugins/plugin-detail-page.js +1 -1
  263. package/dist/plugins/plugin-icon.js +1 -1
  264. package/dist/plugins/plugin-icons.js +1 -1
  265. package/dist/plugins/plugins-page.js +1 -1
  266. package/dist/plugins/plugins.js +1 -1
  267. package/dist/plugins/read-skill-document.js +1 -1
  268. package/dist/plugins/skill-document.js +1 -1
  269. package/dist/plugins/skills-tab.js +1 -1
  270. package/dist/plugins/store.js +1 -1
  271. package/dist/plugins/toolbox-layout.js +1 -1
  272. package/dist/search/chat-search.js +1 -1
  273. package/dist/search/codex-source-matches.js +1 -1
  274. package/dist/search/dom-matches.js +1 -1
  275. package/dist/search/find-bar.js +1 -1
  276. package/dist/search/literal-matches.js +1 -1
  277. package/dist/session-list/account-menu.js +1 -1
  278. package/dist/session-list/activity-list.js +1 -1
  279. package/dist/session-list/archived-sessions.js +1 -1
  280. package/dist/session-list/help-menu.js +1 -1
  281. package/dist/session-list/host.js +1 -1
  282. package/dist/session-list/hover-info-card.js +1 -1
  283. package/dist/session-list/navigation-controls.js +1 -1
  284. package/dist/session-list/navigation-header.js +1 -1
  285. package/dist/session-list/navigation-store.js +1 -1
  286. package/dist/session-list/navigation-tabs.js +1 -1
  287. package/dist/session-list/navigation.js +1 -1
  288. package/dist/session-list/overflow-marquee.js +1 -1
  289. package/dist/session-list/platform.js +1 -1
  290. package/dist/session-list/row-stop-button.js +1 -1
  291. package/dist/session-list/session-groups.js +1 -1
  292. package/dist/session-list/session-info-card.js +1 -1
  293. package/dist/session-list/session-list.js +1 -1
  294. package/dist/session-list/session-row.js +1 -1
  295. package/dist/session-list/session-state-dot.js +1 -1
  296. package/dist/session-list/session-state-menu.js +1 -1
  297. package/dist/session-list/shortcut-hint.js +1 -1
  298. package/dist/session-list/shortcut.js +1 -1
  299. package/dist/session-list/sidebar-overlay.js +1 -1
  300. package/dist/session-list/trailing-swap.js +1 -1
  301. package/dist/session-list/use-activity-notification.js +1 -1
  302. package/dist/session-list/use-activity-preview.js +1 -1
  303. package/dist/session-list/use-cmd-held.js +1 -1
  304. package/dist/session-list/use-project-sessions.js +1 -1
  305. package/dist/session-list/virtual-session-rows.js +1 -1
  306. package/dist/session-timeline/activity-group.js +1 -1
  307. package/dist/session-timeline/activity-projection.js +1 -1
  308. package/dist/session-timeline/assistant-content.js +1 -1
  309. package/dist/session-timeline/assistant-turn.d.ts +7 -1
  310. package/dist/session-timeline/assistant-turn.js +1 -1
  311. package/dist/session-timeline/async-questions.js +1 -1
  312. package/dist/session-timeline/edited-files-card.js +1 -1
  313. package/dist/session-timeline/history-timeline.js +1 -1
  314. package/dist/session-timeline/host.js +1 -1
  315. package/dist/session-timeline/navigation-rail.js +1 -1
  316. package/dist/session-timeline/plan.js +1 -1
  317. package/dist/session-timeline/question-reply.js +1 -1
  318. package/dist/session-timeline/resource-content.js +1 -1
  319. package/dist/session-timeline/session-timeline.d.ts +2 -0
  320. package/dist/session-timeline/session-timeline.js +1 -1
  321. package/dist/session-timeline/timeline-registry.js +1 -1
  322. package/dist/session-timeline/turn-activity.js +1 -1
  323. package/dist/session-timeline/turn-error.js +1 -1
  324. package/dist/session-timeline/turn-retry.js +1 -1
  325. package/dist/session-timeline/turns.js +1 -1
  326. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  327. package/dist/session-timeline/user-message.js +1 -1
  328. package/dist/settings/codex-account-card.js +1 -1
  329. package/dist/settings/login-card.js +1 -1
  330. package/dist/settings/model-alias-settings.js +1 -1
  331. package/dist/settings/model-aliases.js +1 -1
  332. package/dist/settings/provider-logos.js +1 -1
  333. package/dist/settings/provider-section.js +1 -1
  334. package/dist/settings/providers-port.js +1 -1
  335. package/dist/settings/providers.js +1 -1
  336. package/dist/settings/settings-bridge.js +1 -1
  337. package/dist/settings/settings.js +1 -1
  338. package/native/win32-x64/alwith_native_chat.dll +0 -0
  339. package/native/win32-x64/artifact.json +1 -1
  340. package/package.json +10 -5
  341. package/dist/chunk-05c7f7pa.js +0 -2
  342. package/dist/chunk-1vmk34zf.js +0 -2
  343. package/dist/chunk-2emf349g.js +0 -2
  344. package/dist/chunk-3tbg92ns.js +0 -3
  345. package/dist/chunk-5p1fxq0k.js +0 -2
  346. package/dist/chunk-758e6qf7.js +0 -4
  347. package/dist/chunk-78qh8049.js +0 -2
  348. package/dist/chunk-7962trd3.js +0 -2
  349. package/dist/chunk-9g0j2ptv.js +0 -2
  350. package/dist/chunk-9pgh7zjb.js +0 -2
  351. package/dist/chunk-9vm0y271.js +0 -2
  352. package/dist/chunk-axyfaexd.js +0 -2
  353. package/dist/chunk-d32738zq.js +0 -2
  354. package/dist/chunk-gva03q5f.js +0 -2
  355. package/dist/chunk-haxhf3gd.js +0 -2
  356. package/dist/chunk-j1f4spe0.js +0 -2
  357. package/dist/chunk-jeedg61t.js +0 -2
  358. package/dist/chunk-js95dpfd.js +0 -2
  359. package/dist/chunk-jwkm2kgd.js +0 -2
  360. package/dist/chunk-ktpg1m74.js +0 -2
  361. package/dist/chunk-kyjhngd2.js +0 -2
  362. package/dist/chunk-kymztvkv.js +0 -2
  363. package/dist/chunk-nvxcys2c.js +0 -2
  364. package/dist/chunk-pfft1e99.js +0 -2
  365. package/dist/chunk-pvzceygv.js +0 -2
  366. package/dist/chunk-pyah1qdm.js +0 -2
  367. package/dist/chunk-qcy0m7c4.js +0 -2
  368. package/dist/chunk-qf163g6t.js +0 -2
  369. package/dist/chunk-r29eygte.js +0 -2
  370. package/dist/chunk-rbj9twq1.js +0 -2
  371. package/dist/chunk-sn5n38j6.js +0 -2
  372. package/dist/chunk-tdys88q3.js +0 -2
  373. package/dist/chunk-tggrc8e5.js +0 -2
  374. package/dist/chunk-v1x1b7cv.js +0 -5
  375. package/dist/chunk-vetfnaz1.js +0 -2
  376. package/dist/chunk-w3eddq0g.js +0 -2
  377. package/dist/chunk-w49gke0h.js +0 -2
  378. package/dist/chunk-wkw61zwr.js +0 -2
  379. package/dist/chunk-xmrsdhtw.js +0 -2
  380. package/dist/chunk-yamfntjx.js +0 -1
@@ -1,7 +1,7 @@
1
- import{d,P}from"./chunk-50brsmjd.js";import{Cn}from"./chunk-m0q3bf05.js";import{j}from"./chunk-9vxev5r7.js";import{V}from"./chunk-2emf349g.js";import{De,ti}from"./chunk-q005jp78.js";import{ie}from"./chunk-76a04a6j.js";import{cn as v}from"cn";import{BotIcon as me,CheckIcon as pe,CopyIcon as ge}from"lucide-react";import{Fragment as fe,useEffect as F,useRef as D,useState as E}from"react";import{jsx as n,jsxs as p,Fragment as R}from"react/jsx-runtime";function H(e,t){let[a,o]=E(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var q=new WeakMap,z=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=q.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=z;return z+=1,q.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function U(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var xe="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function B({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:xe})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function ve(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function he(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function K(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function ee({block:e}){if(e.type!=="tool_use")return null;if(O(e))return n(K,{});let t=j(e).category;if(t==="read")return n(Ce,{});if(t==="search"||t==="fetch")return n(ye,{});if(t==="execute")return n(ve,{});if(t==="edit")return n(he,{});return n(K,{})}function A(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function we(e){return j(e).target}function W(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function O(e){return W(e)||e.name==="dynamic_tool"}function te(e,t){let{category:a}=j(e),o=we(e),i=N(e.status);if(O(e))return{leading:e.title};if(a==="execute"){let r=A(e,"command")?.split(`
2
- `)[0]??o;return r?{leading:t(i?"stream.codex.running":"stream.codex.ran"),trailing:r}:{leading:t(i?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let r=A(e,"pattern")??A(e,"query")??o;return r?{leading:t(i?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let r=A(e,"query")??A(e,"url")??o;return r?{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return o?{leading:t("stream.codex.readLabel"),trailing:o}:{leading:t("stream.codex.readFiles")};if(a==="edit")return o?{leading:t(i?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:o}:{leading:t(i?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return o?{leading:t(i?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:o}:{leading:t(i?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return o?{leading:t(i?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:o}:{leading:t(i?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Le(e,t){let a=te(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function Ne(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
1
+ import{d,T}from"./chunk-teg61ef5.js";import{wn}from"./chunk-fkpmrb5t.js";import{V}from"./chunk-601kr76a.js";import{b}from"./chunk-57p1s7hy.js";import{De,di}from"./chunk-7jx2k96e.js";import{ie}from"./chunk-76a04a6j.js";import{cn as v}from"cn";import{BotIcon as me,CheckIcon as pe,CopyIcon as ge}from"lucide-react";import{Fragment as fe,useEffect as P,useRef as O,useState as _}from"react";import{jsx as n,jsxs as p,Fragment as D}from"react/jsx-runtime";function W(e,t){let[a,o]=_(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var q=new WeakMap,z=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=q.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=z;return z+=1,q.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var xe="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function M({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:xe})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function ve(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function he(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function K(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function ee({block:e}){if(e.type!=="tool_use")return null;if(U(e))return n(K,{});let t=V(e).category;if(t==="read")return n(Ce,{});if(t==="search"||t==="fetch")return n(ye,{});if(t==="execute")return n(ve,{});if(t==="edit")return n(he,{});return n(K,{})}function I(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function we(e){return V(e).target}function j(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function U(e){return j(e)||e.name==="dynamic_tool"}function te(e,t){let{category:a}=V(e),o=we(e),i=N(e.status);if(U(e))return{leading:e.title};if(a==="execute"){let r=I(e,"command")?.split(`
2
+ `)[0]??o;return r?{leading:t(i?"stream.codex.running":"stream.codex.ran"),trailing:r}:{leading:t(i?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let r=I(e,"pattern")??I(e,"query")??o;return r?{leading:t(i?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let r=I(e,"query")??I(e,"url")??o;return r?{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return o?{leading:t("stream.codex.readLabel"),trailing:o}:{leading:t("stream.codex.readFiles")};if(a==="edit")return o?{leading:t(i?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:o}:{leading:t(i?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return o?{leading:t(i?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:o}:{leading:t(i?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return o?{leading:t(i?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:o}:{leading:t(i?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Le(e,t){let a=te(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function Ne(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
3
3
  `).trim()}function be(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="image"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Te(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="audio"?[{data:a.data,mimeType:a.mimeType}]:[]})}function $e(e){if(typeof e==="string"&&e.length>0)return e;return}function ke(e){return e.type==="diff"}function Ae(e){let t=e.content.find(ke);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
- `)}function ne(e){let t=$e(e.rawOutput);if(t!==void 0)return t;let a=Ne(e.content);if(a.length>0)return a;return Ae(e)}function J({block:e,command:t}){let{t:a,Output:o,commandStatus:i}=d(),[r,u]=E(!1),[c,l]=E(!1),m=ne(e),s=i===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):i(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
5
- `)),u(!0),setTimeout(()=>u(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:v("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:g,children:r?n(pe,{}):n(ge,{})})]}),m!==void 0&&(o===void 0?n("pre",{className:"codex-command-output",children:m}):n(o,{text:m})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ae({block:e}){let{t,openLink:a,Patch:o,openImage:i,commandStatus:r,expandToolOutput:u=!1}=d(),c=ne(e),l=o===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let k=x;return k.patch?.text?[k.patch.text]:[]}).join(`
6
- `),m=be(e.content),s=Te(e.content),[g,f]=V(`tool:${e.id}`,!1),C=H(`tool:${e.id}`,g),h=j(e),w=h.category,y=te(e,t),b=w==="execute"?A(e,"command"):void 0;if(e.userShell&&b!==void 0)return n(J,{block:e,command:b});let T=b!==void 0||O(e)||m.length>0||s.length>0||Boolean(l)||u&&c!==void 0,I=!T&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let M=p("span",{className:"codex-activity-label",children:[n(ee,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):p(R,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(I!==void 0?p(R,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:I,onClick:()=>a(I),children:y.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[T?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[M,n(B,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:M}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&p(R,{children:[b!==void 0?n(J,{block:e,command:b}):o!==void 0&&l?n(o,{patch:l}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let k=`data:${x.mimeType};base64,${x.data}`,G=n("img",{src:k,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?G:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(k),children:G},k)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}function oe({block:e}){if(e.type==="tool_use")return n(ae,{block:e});if(e.type==="thinking")return n(ue,{block:e});if(e.type==="collab")return n(le,{block:e});return n(re,{block:e})}function re({block:e}){let{t,openSession:a}=d(),o=N(e.status),[i,r]=V(`subagent:${e.id}`,o),u=D(o);F(()=>{if(o)r(!0);if(u.current&&!o)r(!1);u.current=o},[o,r]);let c=`${Ee(e.activity,o,e.name,t)}${se(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?i:void 0,disabled:!m,onClick:()=>r((s)=>!s),children:[p("span",{className:"codex-activity-label",children:[n(Me,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:c})})]}),m&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ae,{block:s},s.id);if(s.type==="thinking")return n(ue,{block:s},L(s));if(s.type==="subagent")return n(re,{block:s},s.id);if(s.type==="collab")return n(le,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(P,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(ie,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Be=8;function Ie(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Be}function Me({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Ie(e),"aria-hidden":"true"})}function Ee(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var Se=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function se(e,t,a){if(e===null)return"";if(t===null)return` · ${Cn(e)}`;let o=Se.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${Cn(e)} · ${o}`}var _e={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function de(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=de(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${_e[e.tool]}.${o}`)}function Re(e){return e.agents.filter((t)=>t.nickname!==null)}function ce(e,t){let a=e.agents.length>0?e.agents.length:1;return`${Z(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var S="\x01";function _(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${S}${r}${S}`]));return e(t,{...a,...i}).split(new RegExp(`${S}(\\w+)${S}`,"u")).map((r,u)=>n(fe,{children:u%2===1?o[r]:r},`${u}:${r}`))}function Fe({agent:e,showModel:t}){let{t:a,openSession:o}=d(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return p("span",{children:[r,e.role!==null&&` (${e.role})`,t&&se(e.model,e.reasoningEffort,a)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Pe(e,t){let a=e.prompt?.trim()?e.prompt:null,o=de(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,u=Re(e),c=[];if(u.length===0)c.push({key:"generic",node:Z(e,"row",t)});for(let l of u){let m=n(Fe,{agent:l,showModel:e.tool==="spawnAgent"});if(i)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:_(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(Q,{prompt:a})})})});else if(r)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:_(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:m,prompt:n(Q,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";c.push({key:l.threadId,node:_(t,"stream.codex.collab.agentRow",{action:Z(e,"row",t),state:g},{agent:m})})}}if(!i&&!r&&a!==null)c.push({key:"input",node:_(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return c}function le({block:e}){let{t}=d(),[a,o]=V(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=ce(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(me,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(B,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Pe(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function ue({block:e}){let{t,i18n:a}=d(),o=Boolean(e.isComplete),[i,r]=V(`thinking:${L(e)}`,!1),u=D(null),c=e.thinking.trim().length>0;F(()=>{if(o||!c)return;let s=u.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[c,o]);let l=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:U(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?i:void 0,disabled:!c,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?l:n("span",{className:"codex-activity-running",children:l})})}),c&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(P,{text:m,streaming:!o})})})})]})}function Oe(e){if(W(e))return"mcp";let t=j(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ue(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ve(e,t,a){let o=new Map,i=[],r=new Set;for(let c of e){if(W(c)&&typeof c.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(c.rawInput.server);continue}if(O(c)){if(!i.some((m)=>m.kind==="named"&&m.title===c.title))i.push({kind:"named",title:c.title});continue}let l=Oe(c);if(!o.has(l))i.push({kind:"category",category:l});o.set(l,(o.get(l)??0)+1)}let u=i.map((c,l)=>{if(c.kind==="named")return c.title;if(c.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ue(c.category,o.get(c.category),l===0,t)});if(a.startsWith("zh"))return u.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(u)}function ei({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:u,providerIcon:c,children:l}){let{t:m,i18n:s}=d(),[g,f]=V(`work:${e}`,i,!0),C=H(`work:${e}`,g||o),h=D(null),[w,y]=E(0);F(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let T=()=>{let M=h.current;if(M===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-M)};T();let I=window.setInterval(T,1000);return()=>window.clearInterval(I)},[o,r,t]);let b=t!==void 0?m(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:U(t,s.language)}):o&&w>=1000?m("stream.codex.workingFor",{duration:U(w,s.language)}):m(o?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((T)=>!T),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:c}),n("span",{children:b}),n(B,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&l})})})]})}function Ze(e,t){if(e.type==="tool_use")return Le(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return ce(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function He(e,t,a=1000){let[o,i]=E({text:e,live:t}),r=D(Date.now());return F(()=>{if(e===o.text&&t===o.live)return;let u=Date.now(),c=Math.max(0,r.current+a-u);if(c===0||t!==o.live){r.current=u,i({text:e,live:t});return}let l=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},c);return()=>window.clearTimeout(l)},[o,t,a,e]),t===o.live?o.text:e}function We({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=d(),i=e.some(X),r=L(e[0]),u=e.every((C)=>C.type==="tool_use"&&j(C).category==="execute"),[c,l]=V(`group:${r}`,t&&!u),m=H(`group:${r}`,c),s=e.findLast(X)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=He(i?Ze(s,a):Ve(g,a,o.language),i);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((C)=>!C),children:[p("span",{className:"codex-activity-label",children:[n(ee,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(B,{expanded:c})]}),n("div",{className:v("codex-activity-group-grid",c&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((C)=>n(oe,{block:C},L(C)))})})})]})}function Y({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(We,{blocks:e,defaultExpanded:t})}function nt({blocks:e,defaultExpanded:t}){if(!e.some(De))return n(Y,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&De(i[0])===De(o))i.push(o);else a.push([o])}return n(R,{children:a.map((o)=>De(o[0])?n(ti,{blocks:o.filter(De)},L(o[0])):n(Y,{blocks:o,defaultExpanded:t},L(o[0])))})}
7
- export{ei,nt};
4
+ `)}function ne(e){let t=$e(e.rawOutput);if(t!==void 0)return t;let a=Ne(e.content);if(a.length>0)return a;return Ae(e)}function J({block:e,command:t}){let{t:a,Output:o,commandStatus:i}=d(),[r,u]=_(!1),[c,l]=_(!1),m=ne(e),s=i===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):i(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
5
+ `)),u(!0),setTimeout(()=>u(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:v("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:g,children:r?n(pe,{}):n(ge,{})})]}),m!==void 0&&(o===void 0?n("pre",{className:"codex-command-output",children:m}):n(o,{text:m})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ae({block:e}){let{t,openLink:a,Patch:o,openImage:i,commandStatus:r,expandToolOutput:u=!1}=d(),c=ne(e),l=o===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let B=x;return B.patch?.text?[B.patch.text]:[]}).join(`
6
+ `),m=be(e.content),s=Te(e.content),[g,f]=b(`tool:${e.id}`,!1),C=W(`tool:${e.id}`,g),h=V(e),w=h.category,y=te(e,t),k=w==="execute"?I(e,"command"):void 0;if(e.userShell&&k!==void 0)return n(J,{block:e,command:k});let A=k!==void 0||U(e)||m.length>0||s.length>0||Boolean(l)||u&&c!==void 0,E=!A&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(ee,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):p(D,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(E!==void 0?p(D,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:E,onClick:()=>a(E),children:y.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[A?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[S,n(M,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&p(D,{children:[k!==void 0?n(J,{block:e,command:k}):o!==void 0&&l?n(o,{patch:l}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let B=`data:${x.mimeType};base64,${x.data}`,G=n("img",{src:B,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?G:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(B),children:G},B)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}function oe({block:e}){if(e.type==="tool_use")return n(ae,{block:e});if(e.type==="thinking")return n(ue,{block:e});if(e.type==="collab")return n(le,{block:e});return n(re,{block:e})}function re({block:e}){let{t,openSession:a}=d(),o=N(e.status),[i,r]=b(`subagent:${e.id}`,o),u=O(o);P(()=>{if(o)r(!0);if(u.current&&!o)r(!1);u.current=o},[o,r]);let c=`${Ee(e.activity,o,e.name,t)}${se(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?i:void 0,disabled:!m,onClick:()=>r((s)=>!s),children:[p("span",{className:"codex-activity-label",children:[n(Me,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:c})})]}),m&&n(M,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ae,{block:s},s.id);if(s.type==="thinking")return n(ue,{block:s},L(s));if(s.type==="subagent")return n(re,{block:s},s.id);if(s.type==="collab")return n(le,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(T,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(ie,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Be=8;function Ie(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Be}function Me({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Ie(e),"aria-hidden":"true"})}function Ee(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var Se=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function se(e,t,a){if(e===null)return"";if(t===null)return` · ${wn(e)}`;let o=Se.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${wn(e)} · ${o}`}var _e={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function de(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function H(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=de(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${_e[e.tool]}.${o}`)}function Re(e){return e.agents.filter((t)=>t.nickname!==null)}function ce(e,t){let a=e.agents.length>0?e.agents.length:1;return`${H(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var R="\x01";function F(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${R}${r}${R}`]));return e(t,{...a,...i}).split(new RegExp(`${R}(\\w+)${R}`,"u")).map((r,u)=>n(fe,{children:u%2===1?o[r]:r},`${u}:${r}`))}function Fe({agent:e,showModel:t}){let{t:a,openSession:o}=d(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return p("span",{children:[r,e.role!==null&&` (${e.role})`,t&&se(e.model,e.reasoningEffort,a)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Pe(e,t){let a=e.prompt?.trim()?e.prompt:null,o=de(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,u=Re(e),c=[];if(u.length===0)c.push({key:"generic",node:H(e,"row",t)});for(let l of u){let m=n(Fe,{agent:l,showModel:e.tool==="spawnAgent"});if(i)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(Q,{prompt:a})})})});else if(r)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:m,prompt:n(Q,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";c.push({key:l.threadId,node:F(t,"stream.codex.collab.agentRow",{action:H(e,"row",t),state:g},{agent:m})})}}if(!i&&!r&&a!==null)c.push({key:"input",node:F(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return c}function le({block:e}){let{t}=d(),[a,o]=b(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=ce(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(me,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(M,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Pe(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function ue({block:e}){let{t,i18n:a}=d(),o=Boolean(e.isComplete),[i,r]=b(`thinking:${L(e)}`,!1),u=O(null),c=e.thinking.trim().length>0;P(()=>{if(o||!c)return;let s=u.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[c,o]);let l=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:Z(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?i:void 0,disabled:!c,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?l:n("span",{className:"codex-activity-running",children:l})})}),c&&n(M,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(T,{text:m,streaming:!o})})})})]})}function Oe(e){if(j(e))return"mcp";let t=V(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ue(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ve(e,t,a){let o=new Map,i=[],r=new Set;for(let c of e){if(j(c)&&typeof c.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(c.rawInput.server);continue}if(U(c)){if(!i.some((m)=>m.kind==="named"&&m.title===c.title))i.push({kind:"named",title:c.title});continue}let l=Oe(c);if(!o.has(l))i.push({kind:"category",category:l});o.set(l,(o.get(l)??0)+1)}let u=i.map((c,l)=>{if(c.kind==="named")return c.title;if(c.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ue(c.category,o.get(c.category),l===0,t)});if(a.startsWith("zh"))return u.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(u)}function ci({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:u,providerIcon:c,children:l}){let{t:m,i18n:s}=d(),[g,f]=b(`work:${e}`,i,!0),C=W(`work:${e}`,g||o),h=O(null),[w,y]=_(0);P(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let A=()=>{let S=h.current;if(S===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-S)};A();let E=window.setInterval(A,1000);return()=>window.clearInterval(E)},[o,r,t]);let k=t!==void 0?m(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:Z(t,s.language)}):o&&w>=1000?m("stream.codex.workingFor",{duration:Z(w,s.language)}):m(o?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((A)=>!A),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:c}),n("span",{children:k}),n(M,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&l})})})]})}function Ze(e,t){if(e.type==="tool_use")return Le(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return ce(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function He(e,t,a=1000){let[o,i]=_({text:e,live:t}),r=O(Date.now());return P(()=>{if(e===o.text&&t===o.live)return;let u=Date.now(),c=Math.max(0,r.current+a-u);if(c===0||t!==o.live){r.current=u,i({text:e,live:t});return}let l=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},c);return()=>window.clearTimeout(l)},[o,t,a,e]),t===o.live?o.text:e}function We({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=d(),i=e.some(X),r=L(e[0]),u=e.every((C)=>C.type==="tool_use"&&V(C).category==="execute"),[c,l]=b(`group:${r}`,t&&!u),m=W(`group:${r}`,c),s=e.findLast(X)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=He(i?Ze(s,a):Ve(g,a,o.language),i);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((C)=>!C),children:[p("span",{className:"codex-activity-label",children:[n(ee,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(M,{expanded:c})]}),n("div",{className:v("codex-activity-group-grid",c&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((C)=>n(oe,{block:C},L(C)))})})})]})}function Y({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(We,{blocks:e,defaultExpanded:t})}function nt({blocks:e,defaultExpanded:t}){if(!e.some(De))return n(Y,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&De(i[0])===De(o))i.push(o);else a.push([o])}return n(D,{children:a.map((o)=>De(o[0])?n(di,{blocks:o.filter(De)},L(o[0])):n(Y,{blocks:o,defaultExpanded:t},L(o[0])))})}
7
+ export{ci,nt};
@@ -1,2 +1,2 @@
1
- function bo({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{bo};
1
+ function Co({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{Co};
@@ -1,4 +1,4 @@
1
- import{ho,vo,Ot}from"./chunk-xmrsdhtw.js";import{Ye,I}from"./chunk-w49gke0h.js";import{cn as M}from"cn";import{forwardRef as R,useCallback as F,useEffect as x,useImperativeHandle as K,useRef as d}from"react";import{InputGroupTextarea as z}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as q}from"react/jsx-runtime";var L=(c)=>!c.shiftKey,N=()=>!1,ln=R(({onChange:c,onKeyDown:T,onCompositionStart:b,onCompositionEnd:y,className:E,placeholder:C,bashMode:H=!1,isSendShortcut:S=L,isNewlineShortcut:P=N,...h},w)=>{let n=Ye(),p=I(),u=d(!1),i=d(!1),a=d(null),l=d(null),o=F(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||u.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);x(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,r=new ResizeObserver(([s])=>{if(s&&s.contentRect.width!==t)t=s.contentRect.width,o()});return r.observe(e),o(),()=>{if(r.disconnect(),l.current!==null)cancelAnimationFrame(l.current);l.current=null}},[o]),x(o,[o,n?.textInput.value,h.value]);let f=H&&(n?.textInput.value??"").startsWith("!"),k=(e)=>{if(u.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||i.current)return;if(T?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
- `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(f&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(P(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:r,selectionEnd:s,value:m}=t,g=`${m.slice(0,r)}
3
- ${m.slice(s)}`;if(n)n.textInput.setInput(g);else t.value=g;let v=r+1;t.setSelectionRange(v,v),o();return}if(S(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let r=t.querySelector('button[type="submit"]');if(!r||r.disabled)return;t.requestSubmit(r)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&p.files.length>0){e.preventDefault();let t=p.files.at(-1);if(t)p.remove(t.id)}},A=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:s}=ho(t),m=vo(t);if(r.length>0)e.preventDefault(),p.add(r);else if(s&&!m)e.preventDefault()},D=n?{value:u.current&&a.current?a.current.value:f?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=u.current?e.currentTarget.value:Ot(e.currentTarget);n.textInput.setInput(f?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!u.current)Ot(e.currentTarget);o(),c?.(e)}};return K(w,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||i.current,getTextarea:()=>a.current}),[]),q(z,{"data-chat-input":!0,ref:a,rows:3,className:M("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{u.current=!1;let t=Ot(e.currentTarget);n?.textInput.setInput(f?`!${t}`:t),o(),y?.(e),i.current=!0,requestAnimationFrame(()=>{i.current=!1})},onCompositionStart:(e)=>{i.current=!1,u.current=!0,b?.(e)},onKeyDown:k,onPaste:A,placeholder:C,...h,...D})});ln.displayName="PromptInputTextarea";
1
+ import{vo,yo,Ot}from"./chunk-j6mkqhey.js";import{Ye,N}from"./chunk-cm5rcd9q.js";import{cn as D}from"cn";import{forwardRef as M,useCallback as R,useEffect as x,useImperativeHandle as F,useRef as d}from"react";import{InputGroupTextarea as K}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as q}from"react/jsx-runtime";var z=(c)=>!c.shiftKey,L=()=>!1,ln=M(({onChange:c,onKeyDown:T,onCompositionStart:b,onCompositionEnd:y,className:E,placeholder:I,bashMode:C=!1,isSendShortcut:H=z,isNewlineShortcut:S=L,...h},P)=>{let n=Ye(),p=N(),u=d(!1),i=d(!1),a=d(null),l=d(null),o=R(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||u.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);x(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,r=new ResizeObserver(([s])=>{if(s&&s.contentRect.width!==t)t=s.contentRect.width,o()});return r.observe(e),o(),()=>{if(r.disconnect(),l.current!==null)cancelAnimationFrame(l.current);l.current=null}},[o]),x(o,[o,n?.textInput.value,h.value]);let f=C&&(n?.textInput.value??"").startsWith("!"),w=(e)=>{if(u.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||i.current)return;if(T?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
+ `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(f&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(S(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:r,selectionEnd:s,value:m}=t,g=`${m.slice(0,r)}
3
+ ${m.slice(s)}`;if(n)n.textInput.setInput(g);else t.value=g;let v=r+1;t.setSelectionRange(v,v),o();return}if(H(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let r=t.querySelector('button[type="submit"]');if(!r||r.disabled)return;t.requestSubmit(r)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&p.files.length>0){e.preventDefault();let t=p.files.at(-1);if(t)p.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:s}=vo(t),m=yo(t);if(r.length>0)e.preventDefault(),p.add(r);else if(s&&!m)e.preventDefault()},A=n?{value:u.current&&a.current?a.current.value:f?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=u.current?e.currentTarget.value:Ot(e.currentTarget);n.textInput.setInput(f?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!u.current)Ot(e.currentTarget);o(),c?.(e)}};return F(P,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||i.current,getTextarea:()=>a.current}),[]),q(K,{"data-chat-input":!0,ref:a,rows:3,className:D("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{u.current=!1;let t=Ot(e.currentTarget);n?.textInput.setInput(f?`!${t}`:t),o(),y?.(e),i.current=!0,requestAnimationFrame(()=>{i.current=!1})},onCompositionStart:(e)=>{i.current=!1,u.current=!0,b?.(e)},onKeyDown:w,onPaste:k,placeholder:I,...h,...A})});ln.displayName="PromptInputTextarea";
4
4
  export{ln};
@@ -1,2 +1,2 @@
1
- var s=new Map,a=new Map,f=new Map;function Do(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function B(t,r){let n=s.get(t);if(!n)return;let e=r(n.attachments);s.set(t,{...n,attachments:e}),a.get(t)?.(e)}function Vt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function Tr(t){for(;;){let e=s.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=s.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function Ir(t,r){if(r===null)s.delete(t);else s.set(t,r)}var i=new Map;function jt(t,r){if(i.has(t))throw Error("A composer is already registered for this session");return i.set(t,r),()=>{if(i.get(t)===r)i.delete(t)}}function Nr(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=i.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=s.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),s.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
2
- export{s,Do,B,Vt,Tr,Ir,jt,Nr};
1
+ var s=new Map,a=new Map,f=new Map;function Bo(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function z(t,r){let n=s.get(t);if(!n)return;let e=r(n.attachments);s.set(t,{...n,attachments:e}),a.get(t)?.(e)}function jt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function Rr(t){for(;;){let e=s.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=s.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function Fr(t,r){if(r===null)s.delete(t);else s.set(t,r)}var i=new Map;function $t(t,r){if(i.has(t))throw Error("A composer is already registered for this session");return i.set(t,r),()=>{if(i.get(t)===r)i.delete(t)}}function Dr(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=i.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=s.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),s.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
2
+ export{s,Bo,z,jt,Rr,Fr,$t,Dr};
@@ -1,2 +1,2 @@
1
- import{createStore as r}from"@alwith/api/client";var He=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function Oi(e){He.setState({...e,terminals:e.terminals??{}})}function Ui(e){if(He.getState().sessionId===e)He.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function Bi(e,n,t){let i=He.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
2
- export{He,Oi,Ui,Bi};
1
+ import{createStore as r}from"@alwith/api/client";var He=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function ji(e){He.setState({...e,terminals:e.terminals??{}})}function $i(e){if(He.getState().sessionId===e)He.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function Ki(e,n,t){let i=He.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
2
+ export{He,ji,$i,Ki};
@@ -1,2 +1,2 @@
1
- import{yo}from"./chunk-8nds14dw.js";import{I}from"./chunk-w49gke0h.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 po({data:t,t:n,className:l,...m}){let c=I(),[u,f]=b(!1),[N,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(yo,{containerRef:C,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:N,url:t.url})]})}function mo({children:t,className:n,...l}){let m=I();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{po,mo};
1
+ import{bo}from"./chunk-wnsk4tw5.js";import{N}from"./chunk-cm5rcd9q.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 go({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(bo,{containerRef:C,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:I,url:t.url})]})}function fo({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{go,fo};
@@ -1,4 +1,4 @@
1
- import{Questionnaire as r}from"@shadcn/react/questionnaire";import{useEffect as N,useId as v,useRef as b}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Textarea as R}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as i,jsxs as c,Fragment as S}from"react/jsx-runtime";function p(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function _(e){if(!p(e)||!p(e.codex))return[];let n=e.codex,o=n.questions;if(n.delivery!=="async"||!Array.isArray(o))return[];if(!o.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((m)=>typeof m==="string"))))return[];return o}function An(e,n){return JSON.stringify(["request_user_input_async",e,n])}function Ai(e){return{selected:e.options?.length?0:null,text:""}}function Yt(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function Ei(e){return`<send_user_message_question_reply>
1
+ import{Questionnaire as r}from"@shadcn/react/questionnaire";import{useEffect as N,useId as v,useRef as b}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Textarea as R}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as i,jsxs as c,Fragment as S}from"react/jsx-runtime";function p(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function P(e){if(!p(e)||!p(e.codex))return[];let n=e.codex,o=n.questions;if(n.delivery!=="async"||!Array.isArray(o))return[];if(!o.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((m)=>typeof m==="string"))))return[];return o}function En(e,n){return JSON.stringify(["request_user_input_async",e,n])}function Hi(e){return{selected:e.options?.length?0:null,text:""}}function Yt(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function Oi(e){return`<send_user_message_question_reply>
2
2
  ${JSON.stringify([e])}
3
- </send_user_message_question_reply>`}function En(e){if(!p(e)||!p(e.codex))return[];let n=e.codex;return(Array.isArray(n.questionReplyParts)?n.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[n.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:m,answer:y})=>({questionItemId:t,question:m,answer:y}))}function Li({question:e,draft:n,status:o,answer:t,error:m,onChange:y,onSubmit:x,onSkip:C,t:u}){let g=v(),h=b(!1),a=b(null);N(()=>()=>{if(a.current!==null)cancelAnimationFrame(a.current)},[]);let l=o==="pending",A=o==="answered"||o==="skipped",f=e.options??[],w=l&&Yt(e,n).trim().length>0,Q="flex cursor-pointer items-start gap-2 text-sm in-data-readonly:cursor-default in-data-readonly:opacity-50";return i("section",{"aria-labelledby":`${g}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:A?c(S,{children:[i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:e.title}),i("p",{className:"text-sm whitespace-pre-wrap",children:o==="answered"?t:u("asyncQuestion.skipped")})]}):c(r.Root,{items:f.length>0?[{name:"answer",choices:[...f.map((s,d)=>({value:String(d)})),{value:"other"}]}]:void 0,shortcuts:"letters",noValidate:!0,className:"flex min-w-0 flex-col gap-3",onSubmit:(s)=>{if(s.preventDefault(),w)x()},children:[c(r.Item,{name:"answer",className:"m-0 flex min-w-0 flex-col gap-3 border-0 p-0",children:[i(r.Title,{render:i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap"}),children:e.title}),f.length>0&&c(r.Choices,{className:"flex flex-col gap-2","aria-disabled":!l||void 0,"data-readonly":!l||void 0,children:[f.map((s,d)=>c(r.Choice,{value:String(d),checked:n.selected===d,onChange:()=>l&&y({...n,selected:d}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{className:"whitespace-pre-wrap",children:s})]},d)),c(r.Choice,{value:"other",checked:n.selected===null,onChange:()=>l&&y({...n,selected:null}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{children:u("asyncQuestion.other")})]})]}),i(r.Input,{render:i(R,{rows:1,className:"min-h-0 resize-none"}),onCompositionStart:()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null,h.current=!0},onCompositionEnd:()=>{if(h.current=!1,a.current!==null)cancelAnimationFrame(a.current);a.current=requestAnimationFrame(()=>{a.current=null})},onKeyDown:(s)=>{if(s.key==="Enter")s.stopPropagation();if(s.key!=="Enter"||s.shiftKey||s.altKey||s.ctrlKey||s.metaKey||h.current||a.current!==null||s.nativeEvent.isComposing||s.nativeEvent.keyCode===229)return;if(s.preventDefault(),l&&Yt(e,{...n,text:s.currentTarget.value}).trim().length>0)x()},"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:n.text,readOnly:!l,onChange:(s)=>y({selected:null,text:s.target.value})}),m&&i("p",{role:"alert",className:"text-destructive text-sm",children:m})]}),c("div",{className:"flex flex-wrap items-center gap-2",children:[i(r.Submit,{render:i(k,{size:"sm"}),disabled:!w,children:u(o==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),i(r.Skip,{render:i(k,{size:"sm",variant:"ghost"}),disabled:!l,onClick:C,children:u("asyncQuestion.skip")}),(o==="closed"||o==="unavailable")&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${o}`)})]})]})})}
4
- export{_,An,Ai,Yt,Ei,En,Li};
3
+ </send_user_message_question_reply>`}function Ln(e){if(!p(e)||!p(e.codex))return[];let n=e.codex;return(Array.isArray(n.questionReplyParts)?n.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[n.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:m,answer:y})=>({questionItemId:t,question:m,answer:y}))}function Ui({question:e,draft:n,status:o,answer:t,error:m,onChange:y,onSubmit:x,onSkip:C,t:u}){let g=v(),h=b(!1),a=b(null);N(()=>()=>{if(a.current!==null)cancelAnimationFrame(a.current)},[]);let l=o==="pending",A=o==="answered"||o==="skipped",f=e.options??[],w=l&&Yt(e,n).trim().length>0,Q="flex cursor-pointer items-start gap-2 text-sm in-data-readonly:cursor-default in-data-readonly:opacity-50";return i("section",{"aria-labelledby":`${g}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:A?c(S,{children:[i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:e.title}),i("p",{className:"text-sm whitespace-pre-wrap",children:o==="answered"?t:u("asyncQuestion.skipped")})]}):c(r.Root,{items:f.length>0?[{name:"answer",choices:[...f.map((s,d)=>({value:String(d)})),{value:"other"}]}]:void 0,shortcuts:"letters",noValidate:!0,className:"flex min-w-0 flex-col gap-3",onSubmit:(s)=>{if(s.preventDefault(),w)x()},children:[c(r.Item,{name:"answer",className:"m-0 flex min-w-0 flex-col gap-3 border-0 p-0",children:[i(r.Title,{render:i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap"}),children:e.title}),f.length>0&&c(r.Choices,{className:"flex flex-col gap-2","aria-disabled":!l||void 0,"data-readonly":!l||void 0,children:[f.map((s,d)=>c(r.Choice,{value:String(d),checked:n.selected===d,onChange:()=>l&&y({...n,selected:d}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{className:"whitespace-pre-wrap",children:s})]},d)),c(r.Choice,{value:"other",checked:n.selected===null,onChange:()=>l&&y({...n,selected:null}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{children:u("asyncQuestion.other")})]})]}),i(r.Input,{render:i(R,{rows:1,className:"min-h-0 resize-none"}),onCompositionStart:()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null,h.current=!0},onCompositionEnd:()=>{if(h.current=!1,a.current!==null)cancelAnimationFrame(a.current);a.current=requestAnimationFrame(()=>{a.current=null})},onKeyDown:(s)=>{if(s.key==="Enter")s.stopPropagation();if(s.key!=="Enter"||s.shiftKey||s.altKey||s.ctrlKey||s.metaKey||h.current||a.current!==null||s.nativeEvent.isComposing||s.nativeEvent.keyCode===229)return;if(s.preventDefault(),l&&Yt(e,{...n,text:s.currentTarget.value}).trim().length>0)x()},"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:n.text,readOnly:!l,onChange:(s)=>y({selected:null,text:s.target.value})}),m&&i("p",{role:"alert",className:"text-destructive text-sm",children:m})]}),c("div",{className:"flex flex-wrap items-center gap-2",children:[i(r.Submit,{render:i(k,{size:"sm"}),disabled:!w,children:u(o==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),i(r.Skip,{render:i(k,{size:"sm",variant:"ghost"}),disabled:!l,onClick:C,children:u("asyncQuestion.skip")}),(o==="closed"||o==="unavailable")&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${o}`)})]})]})})}
4
+ export{P,En,Hi,Yt,Oi,Ln,Ui};
@@ -1,2 +1,2 @@
1
- import{di}from"./chunk-wh5dd7mq.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function kn({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(di,{src:c,alt:"",onClose:()=>a(!1)})]})}function ci({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e(kn,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
- export{kn,ci};
1
+ import{yi}from"./chunk-yq55kqn1.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function Tn({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(yi,{src:c,alt:"",onClose:()=>a(!1)})]})}function vi({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e(Tn,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
+ export{Tn,vi};
@@ -0,0 +1,2 @@
1
+ import{r,a,o,p}from"./chunk-d1pc0mrb.js";import{L}from"./chunk-8hen6y4t.js";import{k,Q,ye}from"./chunk-xhtpqc8p.js";import{he,G,oe}from"./chunk-2z1cpz8a.js";import{so}from"./chunk-m9mvh1gy.js";import{me}from"./chunk-h4r8cx37.js";import{pe}from"./chunk-gvwmyxwf.js";import{ge}from"./chunk-9k4f13c1.js";import{At}from"./chunk-53k7yvr8.js";import{ro}from"./chunk-c4dk6j2h.js";import{ActivityIcon as E}from"lucide-react";import{useEffect as K,useMemo as P}from"react";import{Kbd as M}from"@nyssance/shadcn/vega/components/ui/kbd";import{jsx as c,jsxs as D,Fragment as q}from"react/jsx-runtime";function H(n,d){return n.find((l)=>l.sessionId===d.sessionId)??{sessionId:d.sessionId,cwd:d.cwd,title:d.title||null,updatedAt:null,archived:!1}}function Sr({selectedId:n,onSelect:d,isForeground:l,onOpen:w,accessory:R,rowActions:h}){let N=r(),{t:x}=N,m=o((t)=>t.runStates),v=o((t)=>t.drafts),u=o((t)=>t.sessionList),g=G((t)=>t.activityOrder),f=P(()=>g.flatMap((t)=>{let e=m[t];return e&&he({runStates:m,drafts:v},t)?[{sid:t,record:e,sessionRow:H(u,e)}]:[]}),[g,m,v,u]),b=P(()=>{let t=new Map;for(let e of f){let i=e.sid===n||l?.(e.sid)?"foreground":"background",S=t.get(i)??[];S.push(e),t.set(i,S)}return["foreground","background"].filter((e)=>t.has(e)||e==="background").map((e)=>({key:e,rows:t.get(e)??[]}))},[f,n,l]),y=G((t)=>t.activityCollapsedGroups),s=oe(),I=b.flatMap((t)=>t.key==="foreground"||!y.has(t.key)?t.rows:[]),A=(t)=>{if(w?.(t))return;d(t)},O=ro();K(()=>{let t=(e)=>{if(e.defaultPrevented||e.isComposing||e.repeat||!so(e))return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;let i=Number(e.key);if(!Number.isInteger(i)||i<1||i>9)return;let S=I[i-1];if(!S)return;e.preventDefault(),A(S.sessionRow)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let C=(t)=>{let e=I.indexOf(t);return c(T,{sessionRow:t.sessionRow,state:t.record.state,interruption:t.record.interruption,active:t.sid===n,tasks:t.record.tasks,listeningPorts:t.record.listeningPorts,onOpen:()=>A(t.sessionRow),accessory:R?.(t.sid),actions:h?.(t.sessionRow),hint:e<9&&O?c(M,{children:ge(`CommandOrControl+${e+1}`)}):void 0},t.sid)};return c(k,{children:b.map((t)=>t.key==="foreground"?c(k,{children:t.rows.map(C)},t.key):c(Q,{open:!y.has(t.key),onOpenChange:(e)=>{let i=new Set(y);if(e)i.delete(t.key);else i.add(t.key);s({activityCollapsedGroups:i})},leading:c(E,{className:"text-muted-foreground size-3.5 shrink-0"}),label:x("sessionList.background"),count:t.rows.length,children:t.rows.map(C)},t.key))})}function T({sessionRow:n,state:d,interruption:l,active:w,tasks:R,listeningPorts:h,accessory:N,actions:x,onOpen:m,hint:v}){let u=r(),g=a(),{t:f}=u,b=n.title??f("sessionList.untitled"),y=At(n.sessionId,d);return D(q,{children:[c(ye,{"data-session-id":n.sessionId,active:w,role:"button",tabIndex:0,hoverCard:c(pe,{sessionRow:n,actions:x}),onClick:m,onKeyDown:(s)=>{if(s.target!==s.currentTarget)return;if(s.key==="Enter"||s.key===" ")s.preventDefault(),m()},state:d,interruption:l,title:b,preview:y,listeningPorts:h,onOpenPort:u.openLink&&((s)=>u.openLink?.(`http://localhost:${s}`)),accessory:N,hint:v,actions:c(me,{title:f("sessionList.stop"),onStop:()=>p(u,g.stopSession(n.sessionId))})}),R.map((s)=>D("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(L,{state:"running"}),c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate leading-5",title:s.title,children:s.title})]},s.id))]})}
2
+ export{Sr};
@@ -1,2 +1,2 @@
1
- async function Eo(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
- export{Eo};
1
+ async function Oo(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
+ export{Oo};
@@ -0,0 +1,2 @@
1
+ import{qi}from"./chunk-teg61ef5.js";import{createContext as s,useContext as l,useSyncExternalStore as m}from"react";import{jsx as r}from"react/jsx-runtime";var c=s(null),u=s(null);function ke({host:e,client:i,children:o}){return r(qi,{host:e,children:r(c,{value:e,children:r(u,{value:i,children:o})})})}function n(){let e=l(c);if(e===null)throw Error("Timeline host is missing");return e}function Se(){let e=l(u);if(e===null)throw Error("Timeline client is missing");return e}function X(e,i){return m((o)=>e.subscribe(o),()=>i(e.getState()),()=>i(e.getState()))}function t(e){let i=Se();return X(i.store,e)}function st(e,i){if(e.reportError)e.reportError(i);else console.error(i)}
2
+ export{ke,n,Se,X,t,st};
@@ -1,2 +1,2 @@
1
- import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function rn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
- export{rn};
1
+ import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function an({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
+ export{an};
@@ -0,0 +1,5 @@
1
+ import{bn}from"./chunk-7nb0qea6.js";import{n}from"./chunk-bt01an6h.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function Xr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
+ `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Jr(o){let s=new Map,e=null;for(let t of o.split(`
3
+ `)){if(t.startsWith("diff --git ")){e=null;continue}if(t.startsWith("+++ ")){let i=t.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(t.startsWith("--- ")){let i=t.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(t.startsWith("+"))e.additions+=1;else if(t.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[t,i]of o)if(e===t||e.endsWith(`/${t}`))return i;return{additions:0,deletions:0}}function ea(o){let s=new Map;for(let e of o)for(let t of e.content){if(!p(t))continue;let i=t.patch?Jr(t.patch.text):new Map;for(let a of t.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=t.patch?Xr(t.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
+ ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function si({items:o}){let s=n(),{openDiff:e,FileIcon:t}=s;return c(bn,{files:ea(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:t===void 0?void 0:(i)=>g(h,{children:[c(t,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
+ export{Xr,Jr,ea,si};
@@ -1,2 +1,2 @@
1
- var M="collection-default";function q(o,e){return o.id==="collection-default"?e("collection.defaultFavorites"):o.name}function Ne(){return{collections:{["collection-default"]:{id:"collection-default",name:"",nameIsCustom:!1,collapsed:!1,sessionIds:[]}},order:["collection-default"],sessionMeta:{}}}function It(o,e){let i={...o.collections},l=(s,n)=>{if(!i[s])throw Error(`Collection missing: ${s}`);i[s]={...i[s],...n}},r=(s,n)=>l(s,{sessionIds:i[s].sessionIds.filter((d)=>d!==n)}),t=(s,n)=>{let d=i[s];if(!d)throw Error(`Collection missing: ${s}`);for(let c of o.order)if(c!==s&&i[c].sessionIds.includes(n))r(c,n);if(!d.sessionIds.includes(n))l(s,{sessionIds:[...d.sessionIds,n],collapsed:!1})};switch(e.type){case"create":{if(!e.name.trim())throw Error("Collection name is empty");if(i[e.id]={id:e.id,name:e.name.trim(),...e.emoji===void 0?{}:{emoji:e.emoji},collapsed:!1,sessionIds:[]},e.sessionId!==void 0){if(e.sourceCollectionId!==void 0)r(e.sourceCollectionId,e.sessionId);t(e.id,e.sessionId)}return{...o,collections:i,order:[...o.order,e.id]}}case"rename":if(e.id==="collection-default")throw Error("Default collection cannot be renamed");if(!e.name.trim())throw Error("Collection name is empty");l(e.id,{name:e.name.trim(),nameIsCustom:!0,...e.emoji===void 0?{}:{emoji:e.emoji}});break;case"collapse":l(e.id,{collapsed:e.collapsed});break;case"emoji":l(e.id,{emoji:e.emoji});break;case"clear":l(e.id,{sessionIds:[]});break;case"delete":if(e.id==="collection-default")throw Error("Default collection cannot be deleted");return delete i[e.id],{...o,collections:i,order:o.order.filter((s)=>s!==e.id)};case"add":t(e.collectionId,e.sessionId);break;case"materialize":return t(e.collectionId,e.sessionId),{...o,collections:i,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],cwd:e.cwd}}};case"move":{r(e.sourceCollectionId,e.sessionId),t(e.collectionId,e.sessionId);let n=i[e.collectionId].sessionIds.filter((d)=>d!==e.sessionId);n.splice(e.index??n.length,0,e.sessionId),l(e.collectionId,{sessionIds:n,collapsed:!1});break}case"reorder":{if(e.id==="collection-default")throw Error("Default collection cannot be reordered");let s=o.order.filter((n)=>n!==e.id);return s.splice(e.index,0,e.id),{...o,order:s}}case"forget":{for(let n of o.order)r(n,e.sessionId);let s={...o.sessionMeta};return delete s[e.sessionId],{...o,collections:i,sessionMeta:s}}case"remove":for(let s of e.collectionId===void 0?o.order:[e.collectionId])r(s,e.sessionId);break;case"favorite":if(o.order.some((s)=>i[s].sessionIds.includes(e.sessionId)))for(let s of o.order)r(s,e.sessionId);else t("collection-default",e.sessionId);break;case"meta":{let s=o.sessionMeta[e.sessionId],n={...s};if(e.meta.cwd!==void 0)n.cwd=e.meta.cwd;if(e.meta.title!==void 0&&!s?.titleOverride)n.title=e.meta.title;if(s?.cwd===n.cwd&&s?.title===n.title)return o;return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:n}}}case"renameSession":{let s=e.title.trim();return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],title:s||void 0,titleOverride:s.length>0}}}}}return{...o,collections:i}}function rr(o,e=Ne()){let i={collections:{...e.collections},order:[...e.order],sessionMeta:{...e.sessionMeta}};for(let l of o){for(let[r,t]of Object.entries(l.sessionMeta??{})){let s=i.sessionMeta[r];i.sessionMeta[r]=s?.titleOverride?{...t,...s}:{...s,...t}}for(let r of l.order){if(r==="collection-default")continue;let t=l.collections[r];if(!t)throw Error(`Persisted collection missing: ${r}`);let s=i.collections[r];if(i.collections[r]={...t,...e.collections[r],sessionIds:[...new Set([...s?.sessionIds??[],...t.sessionIds??[]])]},!i.order.includes(r))i.order.push(r)}}return i}
2
- export{M,q,Ne,It,rr};
1
+ var A="collection-default";function W(o,e){return o.id==="collection-default"?e("collection.defaultFavorites"):o.name}function Ne(){return{collections:{["collection-default"]:{id:"collection-default",name:"",nameIsCustom:!1,collapsed:!1,sessionIds:[]}},order:["collection-default"],sessionMeta:{}}}function It(o,e){let i={...o.collections},l=(s,n)=>{if(!i[s])throw Error(`Collection missing: ${s}`);i[s]={...i[s],...n}},r=(s,n)=>l(s,{sessionIds:i[s].sessionIds.filter((d)=>d!==n)}),t=(s,n)=>{let d=i[s];if(!d)throw Error(`Collection missing: ${s}`);for(let c of o.order)if(c!==s&&i[c].sessionIds.includes(n))r(c,n);if(!d.sessionIds.includes(n))l(s,{sessionIds:[...d.sessionIds,n],collapsed:!1})};switch(e.type){case"create":{if(!e.name.trim())throw Error("Collection name is empty");if(i[e.id]={id:e.id,name:e.name.trim(),...e.emoji===void 0?{}:{emoji:e.emoji},collapsed:!1,sessionIds:[]},e.sessionId!==void 0){if(e.sourceCollectionId!==void 0)r(e.sourceCollectionId,e.sessionId);t(e.id,e.sessionId)}return{...o,collections:i,order:[...o.order,e.id]}}case"rename":if(e.id==="collection-default")throw Error("Default collection cannot be renamed");if(!e.name.trim())throw Error("Collection name is empty");l(e.id,{name:e.name.trim(),nameIsCustom:!0,...e.emoji===void 0?{}:{emoji:e.emoji}});break;case"collapse":l(e.id,{collapsed:e.collapsed});break;case"emoji":l(e.id,{emoji:e.emoji});break;case"clear":l(e.id,{sessionIds:[]});break;case"delete":if(e.id==="collection-default")throw Error("Default collection cannot be deleted");return delete i[e.id],{...o,collections:i,order:o.order.filter((s)=>s!==e.id)};case"add":t(e.collectionId,e.sessionId);break;case"materialize":return t(e.collectionId,e.sessionId),{...o,collections:i,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],cwd:e.cwd}}};case"move":{r(e.sourceCollectionId,e.sessionId),t(e.collectionId,e.sessionId);let n=i[e.collectionId].sessionIds.filter((d)=>d!==e.sessionId);n.splice(e.index??n.length,0,e.sessionId),l(e.collectionId,{sessionIds:n,collapsed:!1});break}case"reorder":{if(e.id==="collection-default")throw Error("Default collection cannot be reordered");let s=o.order.filter((n)=>n!==e.id);return s.splice(e.index,0,e.id),{...o,order:s}}case"forget":{for(let n of o.order)r(n,e.sessionId);let s={...o.sessionMeta};return delete s[e.sessionId],{...o,collections:i,sessionMeta:s}}case"remove":for(let s of e.collectionId===void 0?o.order:[e.collectionId])r(s,e.sessionId);break;case"favorite":if(o.order.some((s)=>i[s].sessionIds.includes(e.sessionId)))for(let s of o.order)r(s,e.sessionId);else t("collection-default",e.sessionId);break;case"meta":{let s=o.sessionMeta[e.sessionId],n={...s};if(e.meta.cwd!==void 0)n.cwd=e.meta.cwd;if(e.meta.title!==void 0&&!s?.titleOverride)n.title=e.meta.title;if(s?.cwd===n.cwd&&s?.title===n.title)return o;return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:n}}}case"renameSession":{let s=e.title.trim();return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],title:s||void 0,titleOverride:s.length>0}}}}}return{...o,collections:i}}function pr(o,e=Ne()){let i={collections:{...e.collections},order:[...e.order],sessionMeta:{...e.sessionMeta}};for(let l of o){for(let[r,t]of Object.entries(l.sessionMeta??{})){let s=i.sessionMeta[r];i.sessionMeta[r]=s?.titleOverride?{...t,...s}:{...s,...t}}for(let r of l.order){if(r==="collection-default")continue;let t=l.collections[r];if(!t)throw Error(`Persisted collection missing: ${r}`);let s=i.collections[r];if(i.collections[r]={...t,...e.collections[r],sessionIds:[...new Set([...s?.sessionIds??[],...t.sessionIds??[]])]},!i.order.includes(r))i.order.push(r)}}return i}
2
+ export{A,W,Ne,It,pr};
@@ -1,2 +1,2 @@
1
- import{fe}from"./chunk-n6kdjmh7.js";import{useEffect as s,useState as w}from"react";function no(){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{no};
1
+ import{fe}from"./chunk-m9mvh1gy.js";import{useEffect as s,useState as w}from"react";function ro(){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{ro};
@@ -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 Bt(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{Bt};
@@ -0,0 +1,2 @@
1
+ import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as _,useRef as I,useState as q}from"react";import{jsx as z}from"react/jsx-runtime";var C=d(null),pn=d(null);function ma(){return i(pn)}var mn=d(null);function ga(){return i(mn)}var Ze=d(null);function Qe(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Ye=()=>i(C);function fa(){let r=i(Ze);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(Ze);function Uo({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,attachments:y,onAttachmentsChange:U,children:D}){let L=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),S=A!==void 0,[B,G]=q(r),p=A??B,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let T=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,S)R?.(t);else G(t)},[S,R]),g=n(()=>P(""),[P]),x=y!==void 0,[J,K]=q([]),v=y??J,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)U?.(e);else K(e)},[x,U]),W=I(null),j=I(()=>{}),w=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let H=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:L(u),filename:u.name,size:u.size,lastModified:u.lastModified,...H===void 0?{}:{sourcePath:H}}})]})},[f,L,s]),O=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),M=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let E=n(()=>{j.current?.()},[]),b=_(()=>({files:v,add:w,remove:O,clear:M,openFileDialog:E,fileInputRef:W}),[v,w,O,M,E]),k=n((t,e)=>{W.current=t.current,j.current=e},[]),Q=_(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:T,clearSubmitted:c??g},attachments:b,__registerFileInput:k}),[p,P,g,T,c,b,k]);return z(C.Provider,{value:Q,children:z(Ze.Provider,{value:b,children:D})})}var gn=d(null);function N(){let r=X(),l=i(gn),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
+ export{pn,ma,mn,ga,Ze,Qe,Ye,fa,Uo,gn,N};
@@ -0,0 +1,2 @@
1
+ import{t}from"./chunk-bt01an6h.js";import{e}from"./chunk-xecs5c6a.js";import{codexExtensionCapabilities as w,codexTurnId as M,composerPrediction as j,isBooleanOption as B,isSelectOption as F}from"@nyssance/codex-acp-v2/client";import{useEffect as b,useMemo as C,useRef as O,useState as R}from"react";function Gt(r,g,s,y){let{client:S}=e(),P=t((n)=>w(n.agent).composerPredictions),k=C(()=>r.items.findLast((n)=>n.kind==="user"),[r.items]),i=M(k?._meta),_=C(()=>r.configOptions.flatMap((n)=>F(n)||B(n)?[[n.configId,n.currentValue]]:[]).toSorted(([n],[c])=>String(n).localeCompare(String(c))),[r.configOptions]),o=JSON.stringify([r.id,i,_]),u=j(r._meta),d=r._meta?.codex,m=typeof d==="object"&&d!==null&&"prediction"in d?d.prediction:null,l=O(null),f=O(!1);b(()=>(f.current=!0,()=>{f.current=!1}),[]);let[a,q]=R(null),[v,x]=R(null),p=y&&P&&g&&r.state==="idle"&&r.lastStopReason==="end_turn"&&!k?.replayed&&i!==null;b(()=>{if(!p||s||a===o||l.current?.key===o||i===null)return;let n={key:o,previousResult:m};l.current=n,x(null),S.requestPrediction(r.id,i).catch((c)=>{if(f.current&&l.current===n)x({key:o,message:c instanceof Error?c.message:String(c)})})},[S,p,s,a,o,m,r.id,i]);let I=p&&!s&&a!==o&&l.current?.key===o&&l.current.previousResult!==m&&u?.sourceTurnId===i,E=I&&u.result.type==="completed"?u.result.text:null,T=y&&g&&r.state==="idle"&&!s&&a!==o?v?.key===o?v.message:I&&u.result.type==="failed"?u.result.message:null:null;return{text:E,error:T,invalidate:()=>{if(p)q(o)}}}
2
+ export{Gt};
@@ -0,0 +1,2 @@
1
+ import{S}from"./chunk-6zcjn8ra.js";import{createContext as m,useContext as c,useState as D,useSyncExternalStore as L}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as h,DialogDescription as w,DialogFooter as P,DialogHeader as H,DialogTitle as R}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as d}from"react/jsx-runtime";var g=m(null),v=m(null),f=m(null);function Nr({host:e,client:t,children:n}){let[s,l]=D(null);S(s!==null);let{t:u}=e;return i(g,{value:e,children:i(v,{value:t,children:d(f,{value:l,children:[n,i(y,{open:s!==null,onOpenChange:(x)=>!x&&l(null),children:d(h,{children:[d(H,{children:[i(R,{children:u("sessionList.deleteTitle")}),i(w,{children:u("sessionList.deleteDescription")})]}),d(P,{children:[i(C,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),i(C,{onClick:()=>{if(s)p(e,t.delete(s.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function r(){let e=c(g);if(e===null)throw Error("Session list host is missing");return e}function lo(){return c(g)}function a(){let e=c(v);if(e===null)throw Error("Session list client is missing");return e}function Lt(){let e=c(f);if(e===null)throw Error("Session list provider is missing");return e}function o(e){let t=a();return L((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function p(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{Nr,r,lo,a,Lt,o,p};
@@ -1,2 +1,2 @@
1
- import{Vo}from"./chunk-sn5n38j6.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 Bo({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=Vo(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{Bo};
1
+ import{qo}from"./chunk-753z0tkd.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 Ko({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=qo(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{Ko};
@@ -1,2 +1,2 @@
1
- import{Hi}from"./chunk-gva03q5f.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Ln(t,r,e={}){let o=r.trim();if(o.length===0)return[];return Hi(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
- export{Ln};
1
+ import{Vi}from"./chunk-mhnhkg65.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Fn(t,r,e={}){let o=r.trim();if(o.length===0)return[];return Vi(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
+ export{Fn};
@@ -1,2 +1,2 @@
1
- import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function oi(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||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
2
- export{oi};
1
+ import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function ni(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||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
2
+ export{ni};
@@ -1,2 +1,2 @@
1
- import{ni}from"./chunk-9vxev5r7.js";function Yo(t,o){if(ni(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
- export{Yo};
1
+ import{ui}from"./chunk-601kr76a.js";function ai(t,o){if(ui(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
+ export{ai};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-1vmk34zf.js";import{codexTurnError as T}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as h}from"lucide-react";import{useEffect as R,useRef as s,useState as u}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as d}from"react/jsx-runtime";function In({children:i}){return d("div",{className:"codex-error-message",role:"alert",children:[n(h,{"aria-hidden":"true"}),n("div",{className:"min-w-0 flex-1",children:i})]})}function Nn({error:i,retry:e}){let{t:m}=t(),f=T(i),[c]=u(()=>e?.delaySeconds==null?null:Date.now()+e.delaySeconds*1000),[p,v]=u(e?.delaySeconds??null),[N,y]=u(!1),[x,g]=u(null),o=s(!1),w=s(!1),E=s(e?.run);E.current=e?.run;let S=s((b)=>{let a=E.current;if(o.current||a===void 0)return;o.current=!0,y(!0),g(null),a(b).catch((r)=>{w.current=!0,o.current=!1,v(null),y(!1),g(r instanceof Error?r.message:String(r))})}),l=e!==void 0&&f.retryable;return R(()=>{if(!l||c===null)return;let a=setInterval(()=>{if(w.current||o.current)return;let r=Math.max(0,Math.ceil((c-Date.now())/1000));if(v(r),r===0)S.current("automatic")},1000);return()=>clearInterval(a)},[c,l]),d(In,{children:[d("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:f.message}),l&&n(C,{variant:"outline",size:"sm",disabled:N,onClick:()=>S.current("manual"),children:p===null?m("timeline.retry"):m("timeline.retryCountdown",{seconds:p})})]}),x!==null&&n("div",{className:"text-muted-foreground mt-2 text-sm",children:x})]})}
2
- export{In,Nn};
1
+ import{n}from"./chunk-bt01an6h.js";import{codexTurnError as T}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as h}from"lucide-react";import{useEffect as R,useRef as s,useState as u}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as d}from"react/jsx-runtime";function kn({children:i}){return d("div",{className:"codex-error-message",role:"alert",children:[t(h,{"aria-hidden":"true"}),t("div",{className:"min-w-0 flex-1",children:i})]})}function Sn({error:i,retry:e}){let{t:m}=n(),f=T(i),[c]=u(()=>e?.delaySeconds==null?null:Date.now()+e.delaySeconds*1000),[p,v]=u(e?.delaySeconds??null),[N,y]=u(!1),[x,g]=u(null),o=s(!1),w=s(!1),E=s(e?.run);E.current=e?.run;let S=s((b)=>{let a=E.current;if(o.current||a===void 0)return;o.current=!0,y(!0),g(null),a(b).catch((r)=>{w.current=!0,o.current=!1,v(null),y(!1),g(r instanceof Error?r.message:String(r))})}),l=e!==void 0&&f.retryable;return R(()=>{if(!l||c===null)return;let a=setInterval(()=>{if(w.current||o.current)return;let r=Math.max(0,Math.ceil((c-Date.now())/1000));if(v(r),r===0)S.current("automatic")},1000);return()=>clearInterval(a)},[c,l]),d(kn,{children:[d("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:f.message}),l&&t(C,{variant:"outline",size:"sm",disabled:N,onClick:()=>S.current("manual"),children:p===null?m("timeline.retry"):m("timeline.retryCountdown",{seconds:p})})]}),x!==null&&t("div",{className:"text-muted-foreground mt-2 text-sm",children:x})]})}
2
+ export{kn,Sn};
@@ -0,0 +1,2 @@
1
+ import{be}from"./chunk-g3snk3nb.js";import{Uo,N}from"./chunk-cm5rcd9q.js";import{Mo,Ao,Eo,Lo,Ro,R}from"./chunk-6pwy0ncf.js";import{n,t}from"./chunk-bt01an6h.js";import{e}from"./chunk-xecs5c6a.js";import{zo}from"./chunk-4xjzvwg4.js";import{_o}from"./chunk-3stf1tm2.js";import{ho}from"./chunk-zn9xn0pj.js";import{go,fo}from"./chunk-bb1y2fy7.js";import{ln}from"./chunk-abjr18n6.js";import{fn}from"./chunk-p9ra3xxb.js";import{s,Bo,z,$t}from"./chunk-az434tgy.js";import{Bt}from"./chunk-ce3wg766.js";import{Le,Vt}from"./chunk-v7dyjpv3.js";import{Kt,Wt}from"./chunk-zr2a9z0m.js";import{Vo}from"./chunk-0ag4ewq9.js";import{zt}from"./chunk-enr3j794.js";import{ko}from"./chunk-ksyb8hyt.js";import{Zt}from"./chunk-j5engcds.js";import{Gt}from"./chunk-cn9g220k.js";import{So}from"./chunk-qznyjv2c.js";import{No}from"./chunk-9g7qvbhx.js";import{Io}from"./chunk-v4cf374m.js";import{Ut}from"./chunk-sqwscqfk.js";import{hasFuzzyFileSearch as Nt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as St}from"lucide-react";import{useCallback as O,useEffect as kt,useLayoutEffect as Z,useMemo as tt,useRef as V,useState as F}from"react";import{jsx as i,jsxs as v,Fragment as _t}from"react/jsx-runtime";var Ot=["image/png","image/jpeg","image/webp","image/gif"],et=[];async function Ft(r){let h=await(await fetch(r.url)).blob();return new Promise((l,C)=>{let T=new FileReader;T.onerror=()=>C(T.error),T.onload=()=>{let U=T.result;l(U.slice(U.indexOf(",")+1))},T.readAsDataURL(h)})}function Dt(r){let{t:h}=n(),l=N();return i(R,{"aria-label":h("composer.attachImage"),title:h("composer.attachImage"),onClick:()=>l.openFileDialog(),...r,children:i(St,{className:"size-4"})})}function Ht({session:r,onSubmit:h,onShellCommand:l,onHandOff:C,modelSelector:T,modelMenu:U,inputHeader:rt,actions:ft,leadingTools:ht,agentControls:X=!0,placeholder:gt,children:xt,attachmentPolicy:yt,predictions:Pt=!0,disabled:bt=!1,preparing:ot=!1,allowPendingInput:vt=!1}){let{host:D,client:E}=e(),{t:p}=D,B=O((o)=>{if(D.reportError)D.reportError(o);else console.error(o)},[D]),[nt,_]=F(()=>({text:s.get(r.id)?.text??"",revision:0})),{text:d}=nt,[A,wt]=F(()=>s.get(r.id)?.attachments??et),[g,H]=F(()=>s.get(r.id)?.mentions??[]),q=A.some((o)=>Le(o)&&o.pastedText.status!=="ready"),[M,at]=F(!1),[K,It]=F(!1),[J,it]=F(!1),u=V(null),ct=V(null),a=V(nt),S=O((o)=>{ct.current?.(),a.current={text:o,revision:a.current.revision+1},_(a.current)},[]),Tt=So(r,S),st=tt(()=>({read:()=>{let c=u.current?.getTextarea(),x=c===null||c===void 0?[a.current.text.length,a.current.text.length]:[c.selectionStart,c.selectionEnd];return{target:r.id,...a.current,selection:x}},compareAndSet(c,x,w){if(c.target!==r.id||c.revision!==a.current.revision)return null;a.current={text:x,revision:a.current.revision+1},_(a.current);let y=u.current?.getTextarea();if(y!==null&&y!==void 0)y.value=x,y.setSelectionRange(w[0],w[1]);return{target:r.id,...a.current,selection:w}}}),[r.id]),L=V(null),mt=O((o)=>(L.current=o,()=>{if(L.current===o)L.current=null}),[]),W=r.state!=="idle",P=l!==void 0&&d.startsWith("!"),f=!bt&&!ot&&r.attached&&!r.restoring&&!r.readOnly,k=!r.readOnly&&(vt||f),j=Gt(r,f&&!M&&!K&&!q&&!J,d.length>0||A.length>0||g.length>0,Pt&&!P),pt=j.invalidate;Z(()=>{s.set(r.id,{text:d,attachments:A,mentions:g,modelId:s.get(r.id)?.modelId??null})},[r.id,d,A,g]),Z(()=>Bo(r.id,wt),[r.id]),Z(()=>$t(r.id,(o)=>{if(!k||M)throw Error("The composer cannot take text now; try again later");if(d.length||A.length||g.length)throw Error("The composer already has a draft; send or clear it first");S(o)}),[r.id,k,M,d,A,g,S]);let lt=t((o)=>Nt(o.agent)),At=tt(()=>lt&&f?async(o)=>Bt((await E.fuzzyFileSearch({query:o,roots:[r.cwd],cancellationToken:null})).files):void 0,[E,lt,f,r.cwd]),Q=O((o)=>{H((c)=>c.includes(o)?c:[...c,o])},[]);kt(()=>{u.current?.focus()},[]);let dt=O(async({text:o,files:c})=>{let x=l!==void 0&&o.startsWith("!")?o.slice(1):null;if(x!==null){if(x.trim().length===0)return;if(c.length||g.length)throw Error("Shell commands cannot include file references or attachments");if(r.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let w=o.trim();if(w.length===0&&c.length===0&&g.length===0)return;let y=L.current;at(!0);let I=s.get(r.id),Rt=a.current.revision,G=null;try{let b=zo(w);for(let m of g){let Y={kind:"file",absPath:m};b.push({type:"resource_link",uri:Kt(Y),name:Wt(Y)})}if(w.length>0)b.push({type:"text",text:w});for(let m of c)if(Le(m)){if(m.pastedText.status!=="ready")throw Error("Text attachment is not ready");b.push({type:"resource_link",uri:m.url,name:m.filename??"pasted-text.txt"})}else b.push({type:"image",data:await Ft(m),mimeType:m.mediaType});if(a.current.revision===Rt&&s.get(r.id)===I)a.current={text:"",revision:a.current.revision+1},G=a.current.revision,_(a.current),H([]),z(r.id,()=>et),s.set(r.id,{text:"",attachments:et,mentions:[],modelId:I?.modelId??null}),u.current?.resetHeight();if(x!==null&&l)await l(x);else if(h)if(y===null)await h(b);else await h(b,(m)=>{if(y.signal.aborted||L.current!==y)return;y.accept(m),C?.(r.id,m)});else if(y===null)await E.prompt(r.id,b);else{let m=await E.prompt(r.id,b);y.accept(m)}pt();for(let m of I?.attachments??[])if(m.url.startsWith("blob:")&&!s.get(r.id)?.attachments.some((Y)=>Y.id===m.id))URL.revokeObjectURL(m.url)}catch(b){if(I&&G!==null&&a.current.revision===G&&s.get(r.id)?.attachments.length===0&&s.get(r.id)?.mentions.length===0)a.current={text:I.text,revision:G+1},_(a.current),H(I.mentions),s.set(r.id,I),z(r.id,()=>I.attachments);throw b}finally{at(!1),u.current?.focus()}},[E,r.id,r.state,g,h,l,C,pt]),Mt=()=>{E.cancel(r.id).catch(B)},Ct=O((o)=>{let c=o.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:be})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});B(c)},[B,p]),Et=tt(()=>({session:r,ready:f,inputReady:k,sending:M,textareaRef:u,draft:st,interruptRef:ct,observeReceipts:mt,addMention:Q,setAdding:It,shellMode:P,handsFree:!P&&(h===void 0||C!==void 0)}),[r,f,k,M,st,mt,Q,h,C,P]),ut=D.writeTextAttachment;return i(fn,{value:Et,children:i("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:v("div",{className:"relative",children:[rt&&i("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:rt}),v(Uo,{attachmentPolicy:yt,value:d,revision:a.current.revision,onValueChange:S,onSubmittedClear:()=>{a.current={text:"",revision:a.current.revision+1},_(a.current)},attachments:A,onAttachmentsChange:(o)=>z(r.id,()=>o),children:[X&&i(ho,{bashMode:l!==void 0,handleRef:u,commands:r.commands,searchFiles:At,onMention:Q,onSearchError:B,forcedOpen:J,onForcedOpenChange:it,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),v(Mo,{"data-shell-mode":P||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:Ot.join(","),onError:Ct,onSubmit:dt,onSubmitAsync:dt,onSubmitError:B,canSubmit:()=>f&&!M&&!K&&!q&&(!P||!W&&d.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[xt,v(Eo,{className:"px-3 pt-3 pb-0 empty:hidden",children:[K&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),i(Vo,{mentions:g,onRemove:(o)=>H((c)=>c.filter((x)=>x!==o))}),i(fo,{children:(o)=>Le(o)?i(ko,{data:o,sessionId:r.id}):i(go,{data:o,t:p})})]}),v(Ao,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(o)=>{if(!j.text||u.current?.isComposing()||o.nativeEvent.isComposing||o.nativeEvent.keyCode===229||o.shiftKey||o.ctrlKey||o.altKey||o.metaKey||o.target!==u.current?.getTextarea())return;if(o.key==="Tab")o.preventDefault(),o.stopPropagation(),S(j.text)},children:[P&&i("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),i(ln,{className:"min-h-10 bg-transparent text-sm font-normal",ref:u,rows:2,onKeyDown:Tt,bashMode:l!==void 0,disabled:!k,onPasteCapture:ut?(o)=>Vt(o,r.id,p("composer.pastedTextFilename"),ut):void 0,placeholder:P?"! command":j.text||gt||(W?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),i(Lo,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:v("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[v("div",{className:"flex min-w-0 items-center gap-[5px]",children:[i(Dt,{className:"text-foreground",disabled:!k}),ht,X&&v(_t,{children:[i(No,{textareaRef:u,menuOpen:J,onOpenChange:it,disabled:!f||r.commands.length===0}),i(_o,{disabled:!f||P,onSelect:(o)=>{S(`${d}${d&&!/\s$/.test(d)?" ":""}${o} `),u.current?.getTextarea()?.focus()}}),i(Zt,{sessionId:r.id,options:r.configOptions,disabled:!f})]})]}),v(Ro,{className:"w-full min-w-0 items-center justify-end gap-1",children:[X&&i(Ut,{session:r}),T??i(zt,{...U,sessionId:r.id,options:r.configOptions,disabled:!f}),ft,i(Io,{active:W,sending:M||ot||K,ready:f&&!q&&(!P||!W&&d.slice(1).trim().length>0),hasMentions:g.length>0,onStop:Mt})]})]})})]})]})]})})})}
2
+ export{Ht};
@@ -0,0 +1,2 @@
1
+ import{c}from"./chunk-k7y6dqf2.js";import{a,o}from"./chunk-d1pc0mrb.js";import{k,m,u,Q}from"./chunk-xhtpqc8p.js";import{w,ee,eo}from"./chunk-6hxa1n8n.js";import{Ve}from"./chunk-v5wqxqrh.js";import{A,W}from"./chunk-c2a0x69n.js";import{ue,te}from"./chunk-maa70rv4.js";import{closestCorners as fe,DndContext as Ce,KeyboardSensor as ye,PointerSensor as Se,useSensor as X,useSensors as De}from"@dnd-kit/core";import{SortableContext as Y,sortableKeyboardCoordinates as we,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 ve,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 R}from"react";import{Button as v}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as oe,DialogContent as ne,DialogDescription as ie,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 s,Fragment as ze}from"react/jsx-runtime";function Te({collectionId:l,sessionId:y,children:x}){let{attributes:N,listeners:I,setNodeRef:i,transform:g,transition:f,isDragging:M}=ae({id:JSON.stringify([l,y]),data:{type:"session",collectionId:l,sessionId:y}});return e("div",{ref:i,style:{transform:ce.Transform.toString(g),transition:f},className:G("w-full min-w-0",M&&"opacity-50"),...N,...I,role:"group",children:x})}function Be({collection:l,children:y,onEdit:x,onConfirm:N,onNewChat:I}){let{t:i}=w(),g=te(),f=ee(),{attributes:M,listeners:p,setNodeRef:h,transform:P,transition:T,isDragging:z}=ae({id:l.id,disabled:{draggable:l.id===A,droppable:!1},data:{type:"collection"}});return e("div",{ref:h,style:{transform:ce.Transform.toString(P),transition:T},className:G("w-full min-w-0",z&&"opacity-50"),children:e(Q,{open:!l.collapsed,onOpenChange:(d)=>f(g({type:"collapse",id:l.id,collapsed:!d})),label:W(l,i),count:l.sessionIds.length,leading:l.id===A?e(be,{className:"size-3.5"}):e(Ve,{emoji:l.emoji,onChange:(d)=>f(g({type:"emoji",id:l.id,emoji:d}))}),wrapHeader:(d)=>e("div",{...M,...p,role:"group",children:d}),actions:s(Ee,{children:[e(Re,{onClick:(d)=>d.stopPropagation(),onPointerDown:(d)=>d.stopPropagation(),render:e(v,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:W(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:s(Le,{children:[l.id!==A&&s(H,{onClick:x,children:[e(he,{}),i("collection.rename")]}),s(H,{onClick:I,children:[e(de,{}),i("collection.newChat")]}),s(H,{onClick:()=>N("clear"),children:[e(ve,{}),i("collection.clearCollection")]}),l.id!==A&&s(H,{variant:"destructive",onClick:()=>N("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 sr({renderRow:l,onSelect:y,onNewChat:x,Scroll:N=He}){let I=w(),{t:i}=I,g=te(),f=ee(),M=a(),{collections:p,order:h}=ue(),P=o((t)=>t.sessionList),T=o((t)=>t.archivedSessions),z=o((t)=>t.sessionListLoaded),d=o((t)=>t.sessionListError),F=Me(()=>new Map([...T,...P].map((t)=>[t.sessionId,t])),[T,P]),U=I.isMac??eo(),[S,E]=R(null),[L,K]=R(""),[_,O]=R(""),[D,B]=R(null),[C,q]=R(!1),pe=De(X(Se,{activationConstraint:{distance:5}}),X(ye,{coordinateGetter:we})),j=h.flatMap((t)=>p[t].collapsed?[]:p[t].sessionIds.flatMap((n)=>{let r=F.get(n);return r&&!r.archived?[r]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(U?!n.metaKey||n.ctrlKey:!n.ctrlKey||n.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(n.target instanceof HTMLElement&&(n.target.isContentEditable||n.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let r=Number(n.key)-1;if(!Number.isInteger(r)||r<0||r>8||!j[r])return;n.preventDefault(),y(j[r])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[j,U,y]);let ge=({active:t,over:n})=>{if(n===null)return;let r=t.data.current,b=n.data.current;if(r?.type==="session"&&b!==void 0){let V=b.type==="session"?String(b.collectionId):String(n.id);f(g({type:"move",sourceCollectionId:String(r.collectionId),collectionId:V,sessionId:String(r.sessionId),index:b.type==="session"?p[V].sessionIds.indexOf(String(b.sessionId)):void 0}))}else if(r?.type==="collection"&&b?.type==="collection"&&String(n.id)!==A)f(g({type:"reorder",id:String(t.id),index:h.indexOf(String(n.id))}))},J=(t,n)=>{q(!0),f(t.then(n).finally(()=>q(!1)))};return s(ze,{children:[e(N,{children:s(k,{children:[s(u,{className:G(c,"font-normal"),onClick:()=>{E("new"),K(""),O("")},children:[e(m,{children:e(de,{})}),e("span",{children:i("collection.newCollection")})]}),d&&s("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:d}),e(v,{variant:"ghost",onClick:()=>f(M.listSessions({reset:!0})),children:i("collection.retry")})]}),e(Ce,{sensors:pe,collisionDetection:fe,onDragEnd:ge,children:e(Y,{items:h,strategy:Z,children:e(k,{children:h.map((t)=>e(Be,{collection:p[t],onNewChat:()=>x(t),onEdit:()=>{E(t),K(p[t].name),O(p[t].emoji??"")},onConfirm:(n)=>B({id:t,type:n}),children:e(Y,{items:p[t].sessionIds.map((n)=>JSON.stringify([t,n])),strategy:Z,children:p[t].sessionIds.map((n)=>{let r=F.get(n);if(r?.archived)return null;if(!r)return z?s("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(m,{children:e(Ne,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(v,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>f(g({type:"remove",sessionId:n,collectionId:t})),children:e(me,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(r,()=>{},t)},n)})})},t))})})})]})}),e(oe,{open:S!==null,onOpenChange:(t)=>{if(!t&&!C)E(null)},children:s(ne,{children:[s(re,{children:[e(se,{children:i(S==="new"?"collection.newCollection":"collection.rename")}),e(ie,{children:i("collection.collectionName")})]}),s("form",{onSubmit:(t)=>{if(t.preventDefault(),S===null||!L.trim()||C)return;let n=S==="new"?`collection-${crypto.randomUUID()}`:S;J(g([S==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:_}]),()=>E(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>K(t.target.value),disabled:C}),S!=="new"&&e(Ve,{emoji:_,onChange:O}),s(le,{children:[e(v,{type:"button",variant:"outline",disabled:C,onClick:()=>E(null),children:i("collection.cancel")}),e(v,{type:"submit",disabled:C||!L.trim(),children:i("collection.confirm")})]})]})]})}),e(oe,{open:D!==null,onOpenChange:(t)=>{if(!t&&!C)B(null)},children:s(ne,{children:[s(re,{children:[e(se,{children:i(D?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ie,{children:i("collection.confirmCollectionChange",{name:D===null?"":W(p[D.id],i)})})]}),s(le,{children:[e(v,{variant:"outline",disabled:C,onClick:()=>B(null),children:i("collection.cancel")}),e(v,{disabled:C,onClick:()=>{if(D!==null)J(g({type:D.type,id:D.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
2
+ export{sr};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-t9djctkk.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Ur({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
- export{Ur};
1
+ import{e}from"./chunk-xecs5c6a.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Ar({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
+ export{Ar};