@alwith/module-chat 0.6.25 → 0.6.26

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 (328) hide show
  1. package/README.md +26 -34
  2. package/dist/agent/client.js +1 -1
  3. package/dist/agent/custom-model-effort.js +1 -1
  4. package/dist/agent/image-request.js +1 -1
  5. package/dist/agent/image-tools.js +1 -1
  6. package/dist/agent/input-config.js +1 -1
  7. package/dist/agent/input-modes/execution-meta.js +1 -1
  8. package/dist/agent/input-modes/image.js +1 -1
  9. package/dist/agent/input-modes/index.js +1 -1
  10. package/dist/app-reference.js +1 -1
  11. package/dist/application-tools.d.ts +23 -12
  12. package/dist/application-tools.js +1 -1
  13. package/dist/approval/choice-elicitation-form.js +1 -1
  14. package/dist/approval/choice-schema.js +1 -1
  15. package/dist/approval/permission-options.js +1 -1
  16. package/dist/approval/permission-view.js +1 -1
  17. package/dist/approval/schema-elicitation-form.js +1 -1
  18. package/dist/approval/url-elicitation-card.js +1 -1
  19. package/dist/{chunk-mc21sg7m.js → chunk-0e5dx357.js} +1 -1
  20. package/dist/{chunk-arm9x6kc.js → chunk-0enb3f4n.js} +2 -2
  21. package/dist/{chunk-knxes674.js → chunk-0jg7hgp5.js} +2 -2
  22. package/dist/{chunk-27gr882d.js → chunk-0m4s668v.js} +2 -2
  23. package/dist/{chunk-cf85zhvf.js → chunk-16dyzkha.js} +1 -1
  24. package/dist/{chunk-dr5swvaa.js → chunk-18kdsdmy.js} +2 -2
  25. package/dist/{chunk-x2wcwpw3.js → chunk-1wr1ef9x.js} +2 -2
  26. package/dist/{chunk-zq26pxze.js → chunk-24y0mvqf.js} +2 -2
  27. package/dist/{chunk-q9b2wsdg.js → chunk-2bbdgf43.js} +2 -2
  28. package/dist/chunk-2f8s5gtn.js +2 -0
  29. package/dist/{chunk-tcg99k9e.js → chunk-2yvj9k42.js} +1 -1
  30. package/dist/{chunk-g4qwh2sx.js → chunk-30nre2gw.js} +1 -1
  31. package/dist/{chunk-sjb5stzq.js → chunk-317w17va.js} +2 -2
  32. package/dist/{chunk-2x5m7g33.js → chunk-3hsft68c.js} +1 -1
  33. package/dist/{chunk-vfszr27e.js → chunk-3nawfa7b.js} +2 -2
  34. package/dist/{chunk-d06382wz.js → chunk-3qedn07q.js} +2 -2
  35. package/dist/{chunk-c2r7xpjf.js → chunk-3z86hy2s.js} +2 -2
  36. package/dist/{chunk-5m2ydb9j.js → chunk-4a4awnss.js} +2 -2
  37. package/dist/{chunk-npkk2gzs.js → chunk-4d9sajzj.js} +2 -2
  38. package/dist/{chunk-1d29gnb2.js → chunk-4g1s7gdh.js} +2 -2
  39. package/dist/{chunk-x8rfc6wc.js → chunk-4sfxcw58.js} +3 -3
  40. package/dist/chunk-51xk5tw2.js +2 -0
  41. package/dist/chunk-53r6pr16.js +2 -0
  42. package/dist/{chunk-k7z0pgrt.js → chunk-55m88zbv.js} +2 -2
  43. package/dist/{chunk-kvc3ghat.js → chunk-5bhp61sd.js} +1 -1
  44. package/dist/chunk-5mjs63fv.js +2 -0
  45. package/dist/chunk-5x5n3b15.js +2 -0
  46. package/dist/{chunk-fyxetwxv.js → chunk-64cbt3ym.js} +2 -2
  47. package/dist/{chunk-mvnze5ts.js → chunk-6e84zbgs.js} +2 -2
  48. package/dist/{chunk-rd9cgt8p.js → chunk-6ym1a5wa.js} +1 -1
  49. package/dist/{chunk-ma7thf1j.js → chunk-747qe35q.js} +1 -1
  50. package/dist/{chunk-ry7bxdb6.js → chunk-75dr7tyz.js} +2 -2
  51. package/dist/{chunk-18xfysvb.js → chunk-7ng6qs9c.js} +1 -1
  52. package/dist/{chunk-6f06hbsk.js → chunk-7rtwekkz.js} +2 -2
  53. package/dist/{chunk-91kpcajz.js → chunk-7s7cevjh.js} +2 -2
  54. package/dist/chunk-7zww33h8.js +2 -0
  55. package/dist/{chunk-byvw0vam.js → chunk-81838qem.js} +2 -2
  56. package/dist/{chunk-ar1bwfn3.js → chunk-84ncszbf.js} +1 -1
  57. package/dist/{chunk-952vsa4r.js → chunk-8gt8yn8k.js} +2 -2
  58. package/dist/{chunk-hyhp5ytm.js → chunk-8wk3e4z7.js} +2 -2
  59. package/dist/{chunk-6bbtfd0j.js → chunk-94m77zyn.js} +1 -1
  60. package/dist/{chunk-d0s10qy5.js → chunk-95ywdfe0.js} +2 -2
  61. package/dist/chunk-9nbkggqn.js +2 -0
  62. package/dist/chunk-9neb2f30.js +2 -0
  63. package/dist/{chunk-a6ns5agq.js → chunk-9wc4emwt.js} +2 -2
  64. package/dist/chunk-a11wvd8e.js +2 -0
  65. package/dist/{chunk-n32wra9r.js → chunk-acf4sdp7.js} +2 -2
  66. package/dist/{chunk-89j37t04.js → chunk-ag2t01q7.js} +2 -2
  67. package/dist/{chunk-yn6a84c7.js → chunk-aht6f6tf.js} +2 -2
  68. package/dist/{chunk-x1aw1r1v.js → chunk-amf0m4tb.js} +2 -2
  69. package/dist/{chunk-e3bpr3yx.js → chunk-axvjn527.js} +2 -2
  70. package/dist/{chunk-4t0f01ec.js → chunk-b2n5sj31.js} +1 -1
  71. package/dist/chunk-bapn03er.js +2 -0
  72. package/dist/{chunk-jn8b4qrh.js → chunk-bbrx6m7n.js} +2 -2
  73. package/dist/{chunk-m799f2x5.js → chunk-bztkz3dz.js} +2 -2
  74. package/dist/{chunk-h82jte5p.js → chunk-bzzx1y15.js} +2 -2
  75. package/dist/{chunk-gttw4rmx.js → chunk-c22xq7a3.js} +2 -2
  76. package/dist/{chunk-tcp7c2s0.js → chunk-c7qzvt21.js} +3 -3
  77. package/dist/chunk-cans04tz.js +3 -0
  78. package/dist/{chunk-4gftpery.js → chunk-cgnzqmqd.js} +2 -2
  79. package/dist/{chunk-c2ez86jz.js → chunk-chn1mkv0.js} +1 -1
  80. package/dist/{chunk-z76as4dt.js → chunk-cp4wxmh5.js} +1 -1
  81. package/dist/chunk-cv0qbty5.js +3 -0
  82. package/dist/{chunk-0jj029k8.js → chunk-d582db8v.js} +2 -2
  83. package/dist/{chunk-pw22g3k1.js → chunk-d71nz1je.js} +2 -2
  84. package/dist/{chunk-jzbg0cx9.js → chunk-dd9k5bbt.js} +2 -2
  85. package/dist/{chunk-xvg3d2z6.js → chunk-dx5hh359.js} +2 -2
  86. package/dist/{chunk-7m83dwzq.js → chunk-e3nccytb.js} +1 -1
  87. package/dist/{chunk-ee7a5gft.js → chunk-e9nvbe3j.js} +1 -1
  88. package/dist/{chunk-zxfx7psd.js → chunk-ermc9p1p.js} +2 -2
  89. package/dist/{chunk-w63mha8c.js → chunk-erp1g3as.js} +2 -2
  90. package/dist/{chunk-jy0jrht0.js → chunk-exrd2xzz.js} +2 -2
  91. package/dist/{chunk-e13mpwt8.js → chunk-eynwjzqp.js} +2 -2
  92. package/dist/{chunk-zj7kjjdj.js → chunk-fnm2xznx.js} +1 -1
  93. package/dist/{chunk-j1frpcqd.js → chunk-fwb6tf7m.js} +2 -2
  94. package/dist/{chunk-3q2zdv9e.js → chunk-g1tbd3pd.js} +1 -1
  95. package/dist/{chunk-8f5w2tnp.js → chunk-g3y0r56h.js} +1 -1
  96. package/dist/{chunk-gxb9n7g7.js → chunk-gbsn1qep.js} +3 -3
  97. package/dist/{chunk-yq4wz4n8.js → chunk-gjtxked2.js} +2 -2
  98. package/dist/{chunk-n7y094nf.js → chunk-grfrfh7s.js} +1 -1
  99. package/dist/chunk-h1kvdf3t.js +2 -0
  100. package/dist/{chunk-wk26bzjj.js → chunk-h3mwzf3d.js} +2 -2
  101. package/dist/{chunk-bve6cykn.js → chunk-hd11bfmp.js} +2 -2
  102. package/dist/{chunk-5c42mfat.js → chunk-hf5bpahd.js} +1 -1
  103. package/dist/{chunk-m0r0v983.js → chunk-j2ffde9c.js} +2 -2
  104. package/dist/{chunk-z107z7dt.js → chunk-j4w2hbbe.js} +2 -2
  105. package/dist/{chunk-nfwa8qkt.js → chunk-j62heyzq.js} +1 -1
  106. package/dist/{chunk-snrbgnwn.js → chunk-j8zpjnf8.js} +2 -2
  107. package/dist/{chunk-er7ewrf2.js → chunk-jdwd4ta9.js} +3 -3
  108. package/dist/{chunk-3zsqg6wr.js → chunk-je27hf3t.js} +3 -3
  109. package/dist/{chunk-2rbaebnr.js → chunk-jmc7ddz8.js} +2 -2
  110. package/dist/{chunk-ja7x2gvb.js → chunk-jvy6p83k.js} +1 -1
  111. package/dist/{chunk-0a7vp0ph.js → chunk-knrc6kks.js} +2 -2
  112. package/dist/{chunk-8qszap2n.js → chunk-kqwfwck2.js} +1 -1
  113. package/dist/{chunk-beccgzp9.js → chunk-m2n6sxf8.js} +2 -2
  114. package/dist/{chunk-2kbp0pbe.js → chunk-m68t534g.js} +2 -2
  115. package/dist/{chunk-b6sfe0k7.js → chunk-ma6ycen5.js} +2 -2
  116. package/dist/{chunk-gxx5yh45.js → chunk-mckz9qv5.js} +1 -1
  117. package/dist/{chunk-xx7t8r87.js → chunk-mfmh7ztq.js} +2 -2
  118. package/dist/{chunk-bcdmjgab.js → chunk-n4wp3h3j.js} +1 -1
  119. package/dist/{chunk-j5dqww4h.js → chunk-njqan8zg.js} +1 -1
  120. package/dist/{chunk-xpfy5g6z.js → chunk-p96vgnxw.js} +1 -1
  121. package/dist/{chunk-r940xwxq.js → chunk-pebkk426.js} +2 -2
  122. package/dist/{chunk-9w1vcmbd.js → chunk-pg9gckmw.js} +2 -2
  123. package/dist/chunk-ps408sxd.js +2 -0
  124. package/dist/{chunk-809b75k1.js → chunk-q3s59jyn.js} +2 -2
  125. package/dist/{chunk-zgqrv879.js → chunk-qa9p0a64.js} +3 -3
  126. package/dist/{chunk-113maskf.js → chunk-qceex4vv.js} +2 -2
  127. package/dist/chunk-qkn0y5wx.js +2 -0
  128. package/dist/{chunk-nwyem2d7.js → chunk-qzerhkyb.js} +2 -2
  129. package/dist/{chunk-c06k7g9n.js → chunk-qzn6qtmy.js} +1 -1
  130. package/dist/{chunk-44r55va6.js → chunk-r5f77gtx.js} +2 -2
  131. package/dist/{chunk-6p4gk1zy.js → chunk-rkwq0grt.js} +2 -2
  132. package/dist/{chunk-hmy4snze.js → chunk-rn54592t.js} +1 -1
  133. package/dist/{chunk-sn3sk1j0.js → chunk-s8cj6aw6.js} +1 -1
  134. package/dist/{chunk-ert67qk1.js → chunk-syjt7y4v.js} +2 -2
  135. package/dist/{chunk-2wfgbxet.js → chunk-t9t53gsj.js} +1 -1
  136. package/dist/{chunk-sxz82jq3.js → chunk-tgnftxyb.js} +2 -2
  137. package/dist/{chunk-51x80v4h.js → chunk-tr0bmqn9.js} +2 -2
  138. package/dist/{chunk-f54k9xxv.js → chunk-v0wmy9b3.js} +1 -1
  139. package/dist/{chunk-0j5z842s.js → chunk-v2pa8yak.js} +2 -2
  140. package/dist/{chunk-wm6zdp7w.js → chunk-v32jvbgx.js} +1 -1
  141. package/dist/{chunk-myjsfbp6.js → chunk-v96vkrw2.js} +2 -2
  142. package/dist/{chunk-ad53zbdb.js → chunk-v9weanq6.js} +2 -2
  143. package/dist/{chunk-621eg04b.js → chunk-vd6eqshg.js} +1 -1
  144. package/dist/{chunk-0s2zcz5f.js → chunk-vdt7cp6c.js} +2 -2
  145. package/dist/{chunk-j2k2mc13.js → chunk-vmfhnkxj.js} +1 -1
  146. package/dist/{chunk-na6b1fpn.js → chunk-vqby71fp.js} +1 -1
  147. package/dist/{chunk-dnrcx75n.js → chunk-vzgn8exd.js} +1 -1
  148. package/dist/{chunk-vyzq2pbd.js → chunk-w562jf57.js} +1 -1
  149. package/dist/{chunk-yj42tq3z.js → chunk-w5zvy4ex.js} +1 -1
  150. package/dist/{chunk-3qy743j9.js → chunk-wde0m4pf.js} +3 -3
  151. package/dist/{chunk-khs8cfkd.js → chunk-why9g2kd.js} +1 -1
  152. package/dist/{chunk-vhxavb92.js → chunk-xe7ep70k.js} +1 -1
  153. package/dist/{chunk-cq3j51m2.js → chunk-xnbvdqnt.js} +2 -2
  154. package/dist/{chunk-7jk8s061.js → chunk-xwwjj45a.js} +2 -2
  155. package/dist/{chunk-q1kb5z75.js → chunk-y4tj08c1.js} +1 -1
  156. package/dist/chunk-y8gz9rsc.js +2 -0
  157. package/dist/{chunk-e8p4wkbg.js → chunk-y8yawx3d.js} +1 -1
  158. package/dist/{chunk-bw3bpr6m.js → chunk-ypdh88cj.js} +2 -2
  159. package/dist/{chunk-dba0ttve.js → chunk-z6dx6dnt.js} +1 -1
  160. package/dist/chunk-zm0j9nw3.js +2 -0
  161. package/dist/{chunk-2w4kyd2a.js → chunk-zw4ehzza.js} +3 -3
  162. package/dist/{chunk-vnwt4f99.js → chunk-zypgrbd9.js} +1 -1
  163. package/dist/chunk-zzz6kmh8.js +2 -0
  164. package/dist/client.d.ts +1 -1
  165. package/dist/client.js +1 -1
  166. package/dist/codex/activity-group.js +1 -1
  167. package/dist/codex/artifact-links.js +1 -1
  168. package/dist/codex/assistant-message.js +1 -1
  169. package/dist/codex/async-question-card.js +1 -1
  170. package/dist/codex/edited-files-card.js +1 -1
  171. package/dist/codex/image-view-activity.js +1 -1
  172. package/dist/codex/markdown-renderer.js +1 -1
  173. package/dist/codex/patch-view.js +1 -1
  174. package/dist/codex/timeline-virtualizer.js +1 -1
  175. package/dist/codex/user-message.js +1 -1
  176. package/dist/codex/virtualized-turn-list.js +1 -1
  177. package/dist/collections/collection-emoji.js +1 -1
  178. package/dist/collections/collection-menu.js +1 -1
  179. package/dist/collections/collection-panel.js +1 -1
  180. package/dist/collections/collections.js +1 -1
  181. package/dist/collections/host.js +1 -1
  182. package/dist/collections/store.js +1 -1
  183. package/dist/composer/completion-filter.js +1 -1
  184. package/dist/composer/completion-menu.js +1 -1
  185. package/dist/composer/effort-slider.js +1 -1
  186. package/dist/composer/inline-document.js +1 -1
  187. package/dist/composer/inline-dom.js +1 -1
  188. package/dist/composer/model-select.js +1 -1
  189. package/dist/composer/prompt-input-attachments.js +1 -1
  190. package/dist/composer/prompt-input-clipboard.js +1 -1
  191. package/dist/composer/prompt-input-context.js +1 -1
  192. package/dist/composer/prompt-input-inline.js +1 -1
  193. package/dist/composer/prompt-input-textarea.js +1 -1
  194. package/dist/composer/prompt-input.js +1 -1
  195. package/dist/conversation/action-card.js +1 -1
  196. package/dist/conversation/composer/app-mentions.js +1 -1
  197. package/dist/conversation/composer/apps-menu.js +1 -1
  198. package/dist/conversation/composer/composer-menu.js +1 -1
  199. package/dist/conversation/composer/composer.js +1 -1
  200. package/dist/conversation/composer/context.js +1 -1
  201. package/dist/conversation/composer/drafts.js +1 -1
  202. package/dist/conversation/composer/long-text.js +1 -1
  203. package/dist/conversation/composer/mention-chips.js +1 -1
  204. package/dist/conversation/composer/model-menu.js +1 -1
  205. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  206. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  207. package/dist/conversation/composer/prompt-history.js +1 -1
  208. package/dist/conversation/composer/slash-command-button.js +1 -1
  209. package/dist/conversation/composer/submit-button.js +1 -1
  210. package/dist/conversation/composer/usage-meter.js +1 -1
  211. package/dist/conversation/connection-notice.js +1 -1
  212. package/dist/conversation/context.js +1 -1
  213. package/dist/conversation/conversation-body.js +1 -1
  214. package/dist/conversation/conversation-search.js +1 -1
  215. package/dist/conversation/conversation-view.js +1 -1
  216. package/dist/conversation/conversation.js +1 -1
  217. package/dist/conversation/diff-modal.js +1 -1
  218. package/dist/conversation/draft-project-picker.js +1 -1
  219. package/dist/conversation/session-actions.js +1 -1
  220. package/dist/conversation/subagent-sessions.js +1 -1
  221. package/dist/conversation/subagent-tasks.js +1 -1
  222. package/dist/desktop/desktop-composer.js +1 -1
  223. package/dist/desktop/desktop.js +1 -1
  224. package/dist/desktop/draft-model-select.js +1 -1
  225. package/dist/desktop/load-image.js +1 -1
  226. package/dist/desktop/model-catalog.js +1 -1
  227. package/dist/desktop/model-recovery.js +1 -1
  228. package/dist/desktop/model-settings-action.js +1 -1
  229. package/dist/desktop/native-file-drop.js +1 -1
  230. package/dist/generated/commands.js +1 -1
  231. package/dist/image.d.ts +20 -21
  232. package/dist/image.js +1 -1
  233. package/dist/lib/app-reference.js +1 -1
  234. package/dist/lib/application-metadata.js +1 -1
  235. package/dist/lib/chat-path.js +1 -1
  236. package/dist/lib/fuzzy.js +1 -1
  237. package/dist/lib/markdown-parser.js +1 -1
  238. package/dist/lib/markdown-rules.js +1 -1
  239. package/dist/lib/model-name.js +1 -1
  240. package/dist/lib/streaming-markdown.js +1 -1
  241. package/dist/mermaid/diagram.js +1 -1
  242. package/dist/mermaid/export.js +1 -1
  243. package/dist/mermaid/index.js +1 -1
  244. package/dist/oauth/claude-login.js +1 -1
  245. package/dist/oauth.js +1 -1
  246. package/dist/plugins/catalog-skeleton.js +1 -1
  247. package/dist/plugins/host.js +1 -1
  248. package/dist/plugins/plugin-detail-page.js +1 -1
  249. package/dist/plugins/plugin-icon.js +1 -1
  250. package/dist/plugins/plugin-icons.js +1 -1
  251. package/dist/plugins/plugins-page.js +1 -1
  252. package/dist/plugins/plugins.js +1 -1
  253. package/dist/plugins/read-skill-document.js +1 -1
  254. package/dist/plugins/skill-document.js +1 -1
  255. package/dist/plugins/skills-tab.js +1 -1
  256. package/dist/plugins/store.js +1 -1
  257. package/dist/reference-projection.js +1 -1
  258. package/dist/search/chat-search.js +1 -1
  259. package/dist/search/codex-source-matches.js +1 -1
  260. package/dist/search/dom-matches.js +1 -1
  261. package/dist/search/literal-matches.js +1 -1
  262. package/dist/session-list/account-menu.js +1 -1
  263. package/dist/session-list/activity-list.js +1 -1
  264. package/dist/session-list/archived-sessions.js +1 -1
  265. package/dist/session-list/help-menu.js +1 -1
  266. package/dist/session-list/host.js +1 -1
  267. package/dist/session-list/navigation-controls.js +1 -1
  268. package/dist/session-list/navigation-header.js +1 -1
  269. package/dist/session-list/navigation-store.js +1 -1
  270. package/dist/session-list/navigation.js +1 -1
  271. package/dist/session-list/platform.js +1 -1
  272. package/dist/session-list/session-info-card.js +1 -1
  273. package/dist/session-list/session-list.js +1 -1
  274. package/dist/session-list/session-row.js +1 -1
  275. package/dist/session-list/session-state-dot.js +1 -1
  276. package/dist/session-list/session-state-menu.js +1 -1
  277. package/dist/session-list/shortcut-hint.js +1 -1
  278. package/dist/session-list/shortcut.js +1 -1
  279. package/dist/session-list/sidebar-overlay.js +1 -1
  280. package/dist/session-list/use-activity-notification.js +1 -1
  281. package/dist/session-list/use-activity-preview.js +1 -1
  282. package/dist/session-list/use-cmd-held.js +1 -1
  283. package/dist/session-list/use-project-sessions.js +1 -1
  284. package/dist/session-list/virtual-session-rows.js +1 -1
  285. package/dist/session-timeline/activity-group.js +1 -1
  286. package/dist/session-timeline/activity-projection.js +1 -1
  287. package/dist/session-timeline/assistant-content.js +1 -1
  288. package/dist/session-timeline/assistant-image-references.js +1 -1
  289. package/dist/session-timeline/assistant-turn.js +1 -1
  290. package/dist/session-timeline/async-questions.js +1 -1
  291. package/dist/session-timeline/edited-files-card.js +1 -1
  292. package/dist/session-timeline/host.js +1 -1
  293. package/dist/session-timeline/image-generation-progress.js +1 -1
  294. package/dist/session-timeline/navigation-rail.js +1 -1
  295. package/dist/session-timeline/resource-content.js +1 -1
  296. package/dist/session-timeline/session-timeline.js +1 -1
  297. package/dist/session-timeline/turn-error.js +1 -1
  298. package/dist/session-timeline/turns.js +1 -1
  299. package/dist/session-timeline/user-message.js +1 -1
  300. package/dist/settings/codex-account-card.js +1 -1
  301. package/dist/settings/login-card.js +1 -1
  302. package/dist/settings/model-alias-settings.js +1 -1
  303. package/dist/settings/provider-logos.js +1 -1
  304. package/dist/settings/provider-section.js +1 -1
  305. package/dist/settings/providers-port.js +1 -1
  306. package/dist/settings/providers.js +1 -1
  307. package/dist/settings/settings.js +1 -1
  308. package/native/win32-x64/alwith_native_chat.dll +0 -0
  309. package/native/win32-x64/artifact.json +1 -1
  310. package/package.json +4 -3
  311. package/dist/chunk-4cr144a7.js +0 -2
  312. package/dist/chunk-4e622bdk.js +0 -3
  313. package/dist/chunk-6qxd4jg9.js +0 -2
  314. package/dist/chunk-6z3fgkkp.js +0 -2
  315. package/dist/chunk-an3nh155.js +0 -2
  316. package/dist/chunk-bw1m6407.js +0 -2
  317. package/dist/chunk-d0nrbf80.js +0 -2
  318. package/dist/chunk-f7d0hs1y.js +0 -2
  319. package/dist/chunk-jv327stj.js +0 -2
  320. package/dist/chunk-kbax1frf.js +0 -2
  321. package/dist/chunk-n6erf29r.js +0 -2
  322. package/dist/chunk-q7jm6srr.js +0 -2
  323. package/dist/chunk-rragk2vb.js +0 -2
  324. package/dist/chunk-sqkdenb0.js +0 -3
  325. package/dist/chunk-stse5bdv.js +0 -2
  326. package/dist/chunk-tc80kegm.js +0 -2
  327. package/dist/chunk-ytdhstqx.js +0 -2
  328. package/dist/chunk-zxkpemh4.js +0 -2
@@ -1,2 +0,0 @@
1
- import{kt}from"./chunk-5c42mfat.js";import{o}from"./chunk-rragk2vb.js";import{e,C}from"./chunk-n32wra9r.js";import{Y,x,ee}from"./chunk-w5q2ygsa.js";import{isBooleanOption as U,isGroupedSelect as q,isSelectOption as A}from"@nyssance/codex-acp-v2/client";import{Zap as Z}from"lucide-react";import{memo as D,useRef as F}from"react";import{jsx as w}from"react/jsx-runtime";function H({sessionId:l,options:u,disabled:B,onModelChange:h,onConfigChange:b,defaultGroup:G={id:"models",name:"Models"},catalog:I=(c)=>c,headerAction:L}){let{host:c,client:N}=e(),{t:i}=c,P=o((n)=>Boolean(n.configPending[l])),p=F({sessionId:l,model:!0}),O=P&&(p.current.sessionId!==l||p.current.model),k=o((n)=>{let r=n.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=x(u,"model"),a=x(u,"thought_level"),v=u.filter((n)=>n.configId!=="collaboration_mode"&&(n.category==="model_config"||n.category!=="mode"&&n!==t&&n!==a)),_=v.filter(A),m=v.filter(U);if(!t&&!a&&_.length===0&&m.length===0)return null;let f=(n,r)=>{if(r===n.currentValue)return Promise.resolve();p.current={sessionId:l,model:n===t};let d=b?b(n.configId,r):N.setConfig(l,n.configId,r);return C(c,d),d},g=a?Y(a):[],z=g.reduce((n,r)=>r.name.length>=n.length?r.name:n,""),R=t?ee(t):i("composer.model"),S=(n)=>({api_id:n.value,label:n.name}),V=I(t&&q(t.options)?t.options.map((n)=>({id:n.groupId,name:n.name,models:n.options.map(S)})):[{...G,models:t?Y(t).map(S):[]}]),y=V.flatMap((n)=>n.models),M=y.find((n)=>n.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:R},s=m.find((n)=>n.configId==="fast_mode"||n.configId==="fast-mode");return w(kt,{disabled:B||O||k,switching:O,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:y,showModelList:Boolean(t),onChange:(n)=>{if(n.api_id===t?.currentValue)return;if(h)h(n.api_id);else if(t)f(t,n.api_id)},header:{name:t?.name??i("composer.model"),action:L},modelGroups:V,t:i,effortConfig:a&&g.length>0?{name:"Effort",value:a.currentValue,levels:g,sizer:z,onChange:(n)=>f(a,n)}:void 0,selectOptions:_.map((n)=>({id:n.configId,name:n.name,value:n.currentValue,options:Y(n).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>f(n,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:w(Z,{className:"size-4","aria-hidden":"true"})},...m.filter((n)=>n!==s).map((n)=>({id:n.configId,name:n.name,currentValue:n.currentValue}))],onBooleanChange:(n,r)=>{let d=n==="fast_mode"?s:m.find((E)=>E.configId===n);if(!d)throw Error(`Unknown boolean config: ${n}`);f(d,r)}})}var wn=D(H);
2
- export{wn};
@@ -1,2 +0,0 @@
1
- import{s,a,on,n,h}from"./chunk-ytdhstqx.js";import{G}from"./chunk-jp4xjks0.js";import{Re}from"./chunk-c2ez86jz.js";import{Ie}from"./chunk-nqt9gyz9.js";import{dt,Te}from"./chunk-na6b1fpn.js";import{hasRename as F}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as D,ArchiveRestoreIcon as x,GitForkIcon as A,PencilIcon as H,Trash2Icon as N}from"lucide-react";import{useRef as R,useState as y}from"react";import{jsx as o,jsxs as b,Fragment as C}from"react/jsx-runtime";function Qn({sessionRow:e,active:p,onSelect:m,onForked:v=m,onHoverCardOpenChange:c,actions:d}){let t=s(),{t:f,i18n:S}=t,k=a(),l=n((i)=>i.runStates[e.sessionId]),I=on(),u=()=>m(e);return o(Re,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:p,onClick:u,onKeyDown:(i)=>{if(i.key==="Enter"||i.key===" ")i.preventDefault(),u()},media:t.SessionMedia?o(t.SessionMedia,{sessionId:e.sessionId,state:l?.state}):void 0,state:l?.state,interruption:l?.interruption??null,title:e.title??f("sessionList.untitled"),onHoverCardOpenChange:c,hoverCard:o(B,{sessionRow:e,onDelete:()=>I(e),onForked:v,actions:d}),meta:e.updatedAt!==null?o("span",{className:"text-muted-foreground shrink-0 text-xs",children:dt(e.updatedAt,S.language)}):void 0,actions:l!=null?o(Ie,{title:f("sessionList.stop"),onStop:()=>h(t,k.stopSession(e.sessionId))}):void 0})}function B({sessionRow:e,onDelete:p,onForked:m,actions:v}){let c=s(),{t:d}=c,t=a(),f=n((r)=>F(r.agent)),S=n((r)=>r.connection==="ready"&&r.agent?.capabilities?.session?.fork!=null),[k,l]=y(!1),[I,u]=y(!1),i=R(!1);return o(Te,{sessionRow:e,renaming:k,onRename:(r)=>{if(l(!1),r!==null)h(c,t.renameSession(e.sessionId,r))},actions:b(C,{children:[f&&o(G,{icon:o(H,{}),label:d("sessionList.rename"),onClick:()=>l(!0)}),v,e.archived?o(G,{icon:o(x,{}),label:d("sessionList.unarchive"),onClick:()=>void h(c,t.unarchive(e.sessionId))}):b(C,{children:[o(G,{icon:o(A,{}),label:d("sessionList.fork"),disabled:!S||I,onClick:()=>{if(i.current)return;i.current=!0,u(!0),h(c,t.fork(e.sessionId,e.cwd).then((r)=>{let g=t.state.sessionList.find((L)=>L.sessionId===r);if(!g)throw Error("Forked chat is missing from the session list");m(g)}).finally(()=>{i.current=!1,u(!1)}))}}),o(G,{icon:o(D,{}),label:d("sessionList.archive"),onClick:()=>void h(c,t.archive(e.sessionId))})]}),o(G,{variant:"destructive",icon:o(N,{}),label:d("sessionList.delete"),onClick:p})]})})}
2
- export{Qn};
@@ -1,2 +0,0 @@
1
- import{o}from"./chunk-rragk2vb.js";import{Vn,e,C}from"./chunk-n32wra9r.js";import{Oe}from"./chunk-952vsa4r.js";import{dn}from"./chunk-f7d0hs1y.js";import{an}from"./chunk-18xfysvb.js";import{ln,cn}from"./chunk-er7ewrf2.js";import{sn}from"./chunk-ar1bwfn3.js";import{LockIcon as k,UnplugIcon as O}from"lucide-react";import{useMemo as S,useRef as M}from"react";import{Alert as x,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as P,EmptyDescription as z,EmptyHeader as B,EmptyTitle as I}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function ra({host:t,client:c,...s}){let m=S(()=>t.openDiff?t:{...t,openDiff:ln},[t]);return i(Vn,{host:m,client:c,children:[r(L,{...s}),!t.openDiff&&r(cn,{})]})}function L({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,recovery:E,welcome:R,children:T,rootRef:l,search:A=!0}){let{host:d,client:b}=e(),p=M(null),H=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),y=()=>C(d,b.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:H,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&r(an,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(x,{children:[r(O,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:y,children:n("conversation.reconnect")})})]})}),u?R??r(P,{className:"flex-1",children:i(B,{children:[r(I,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(z,{children:n("conversation.welcomeDescription")})]})}):r(dn,{session:t,timeline:m}),r(sn,{sessionId:t.id}),E??(t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(k,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Oe,{session:t}))]}),T]})}
2
- export{ra};
@@ -1,2 +0,0 @@
1
- import{o}from"./chunk-rragk2vb.js";import{At}from"./chunk-zj7kjjdj.js";import{e,C}from"./chunk-n32wra9r.js";import{no}from"./chunk-0a7vp0ph.js";import{Loader2Icon as v}from"lucide-react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as c,EmptyDescription as l,EmptyHeader as d,EmptyTitle as f}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function dn({session:t,timeline:s}){let{host:m,client:a}=e(),{t:n}=m,u=o((h)=>h.historyPages[t.id]?.cursor!=null),y=no(t,s?.turnWork),E=()=>C(m,a.open(t.id,t.cwd)),p=r(At,{...s,session:t,client:a,host:m,turnWork:y});if(t.restoring)return t.items.length===0?i("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[r(v,{className:"size-4 animate-spin","aria-hidden":"true"}),n("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return i(c,{className:"flex-1",children:[i(d,{children:[r(f,{children:n("conversation.reopen")}),r(l,{children:n("conversation.detached")})]}),r(x,{onClick:E,children:n("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!u)return r(c,{className:"flex-1",children:i(d,{children:[r(f,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(l,{className:"truncate font-mono",children:t.cwd})]})});return p}
2
- export{dn};
@@ -1,2 +0,0 @@
1
- import{createContext as t,useContext as o}from"react";var ro=t(null);function hn(){let e=o(ro);if(e===null)throw Error("Composer is missing");return e}
2
- export{ro,hn};
@@ -1,2 +0,0 @@
1
- import{Ln,po}from"./chunk-6z3fgkkp.js";import{$i,te}from"./chunk-n6erf29r.js";import{ao}from"./chunk-e13mpwt8.js";import{En}from"./chunk-nrpgmawz.js";import{zi,lo}from"./chunk-x8rfc6wc.js";import{Gi}from"./chunk-q7jm6srr.js";import{Nn}from"./chunk-jn8b4qrh.js";import{fe}from"./chunk-rd9cgt8p.js";import{ot,Ge}from"./chunk-621eg04b.js";import{co}from"./chunk-bw3bpr6m.js";import{Bi}from"./chunk-ad53zbdb.js";import{ge,An}from"./chunk-7tw7rn0m.js";import{CodexClient as M,configRevisionOf as O,isBooleanOption as S,isGroupedSelect as v,isImage as R,isSelectOption as g,mergeMeta as f,runStateSource as C}from"@nyssance/codex-acp-v2/client";var b={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function h(e){let t=e.find((s)=>s.category==="model"&&s.type==="select");return t?.type==="select"&&typeof t.currentValue==="string"?t.currentValue:null}class Ui extends M{applicationRegistry=new po((e)=>this.holds(e)?this.session(e):void 0);toolSelection;async executeShell(e,t){let s=this.session(e);if(!s.attached||s.restoring||s.readOnly||s.state!=="idle")throw Error("The session is not ready for a shell command");await this.codexCapabilities.executeShell(e,t),this.materializeDraft(e)}modelListeners=new Set;confirmedModelListeners=new Set;savedModels={main:null,chat:null};slotModels={main:null,chat:null};slotTargets={main:null,chat:null};slotVersions={main:0,chat:0};draftDirectoryIntents=new Map;draftOperations=new Map;gatewayModels=new Map;configOwners=new Map;openingOwners=new Map;schedulingConfig=new Set;replayRepairs=new Map;accountRevocations=new Map;accountRecoveries=new Map;resolveModelOption;constructor(e,t){let{applicationTools:s=[],resolveModel:i,imageService:n,...o}=t;super(e,o,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.toolSelection=s,this.resolveModelOption=i,this.imageService=n,this.imageTool=n?Gi(n,(a)=>this.imageRequests.get(a)):void 0}imageTool;imageService;inputModes=new Map;inputSelections=new Map;async readInputConfig(e){let t=this.live(),s=await t.request("_codex/session_input_config_get",{sessionId:e});if(t!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,s)}async writeInputConfig(e,t){let s=this.live(),i=await s.request("_codex/session_input_config_set",{sessionId:e,inputConfig:t});if(s!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,i)}acceptInputConfig(e,t){let s=Nn(t,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=s.inputConfig;if(i&&ot(i.mode)){if(Ge(i.mode).parseConfig(i.config),this.inputModes.set(e,i.mode),i.mode==="image")this.inputSelections.set(e,fe.parseConfig(i.config))}return s}imageRequests=new Map;prompt(e,t,s={}){if(!this.imageService)return super.prompt(e,t,s);if(!this.inputModes.has(e))return this.imageService.inputMode(e).then((i)=>(this.inputModes.set(e,i),this.prompt(e,t,s)));return Ge(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,t,{...s,meta:f(s.meta,{alwith:{imageIntent:null,applicationContext:Ge("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,t,s)})}promptImage(e,t,s){if(!this.imageService)throw Error("Image service is not connected");lo(s.meta?.alwith?.imageAspectRatio);let i=s.meta?.alwith?.imageSelection;if(i!==void 0)te(i);let n=i??this.inputSelections.get(e)??this.imageService.selection(),o={...this.session(e).state!=="idle"?this.imageRequests.get(e)?.selection??n:n};te(o);let a=crypto.randomUUID();return this.promptImages.set(a,new Map(t.flatMap((r,c)=>R(r)?[[`attachment:${c}`,`data:${r.mimeType};base64,${r.data}`]]:[]))),super.prompt(e,t,{...s,meta:f(s.meta,{alwith:{imageSelection:o,imageRequestId:a,applicationContext:fe.applicationContext(s.meta?.alwith?.imageIntent??"generate",zi),imageIntent:s.meta?.alwith?.imageIntent??"generate"}})}).finally(()=>this.promptImages.delete(a))}promptMeta(e,t){let s=t.meta?.alwith?.imageSelection;if(this.inputModes.get(e)==="image"&&s&&this.imageService&&(this.session(e).state==="idle"||!this.imageRequests.has(e))){let i=new Map($i(this.session(e)).map((o)=>[o.id,o.src]));for(let[o,a]of this.promptImages.get((t.meta?.alwith).imageRequestId)??[])i.set(o,a);let n=lo((t.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:s,references:i,...n?{aspect:n}:{}})}return co(super.promptMeta(e,t))}promptImages=new Map;promptWithImages(e,t,s={}){return this.prompt(e,t,{...s,meta:f({alwith:{imageIntent:"generate"}},s.meta)})}async applicationToolsFor(e){let t=typeof this.toolSelection==="function"?await this.toolSelection(e):this.toolSelection,s=e.options.meta?.alwith;return[...t,...e.options.applicationTools??[],...s?.nativeTools?.imageGeneration===!1&&this.imageTool?[this.imageTool]:[]]}releaseImages(e){this.imageRequests.delete(e)}onDisconnected(){for(let e of this.imageRequests.keys())this.releaseImages(e);this.promptImages.clear(),this.applicationRegistry.clear(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),this.applicationRegistry.cancel(e),await super.cancel(e)}async close(e){this.releaseImages(e),this.applicationRegistry.drop(e),await super.close(e)}async stopSession(e){this.releaseImages(e),this.applicationRegistry.drop(e);let t=this.state.draftSessions[e];if(t===void 0)return super.stopSession(e);await this.changeDraft([t],()=>this.state.draftSessions[e]?super.close(e):super.stopSession(e))}setApp(e){this.store.setState(e)}applyRunStates(e,t="event"){let s=this.state.runStates,i=e.map((n)=>{let o=s[n.sessionId];return o&&JSON.stringify(o)===JSON.stringify(n)?o:n});if(C(s)===t&&i.length===Object.keys(s).length&&i.every((n)=>n===s[n.sessionId]))return;super.applyRunStates(i,t)}enqueueSession(e,t,s=!0){let i=!s&&!this.schedulingConfig.has(e);return super.enqueueSession(e,()=>{let n=()=>{let r=this.holds(e)?h(this.session(e).configOptions):null;return t().then(async(c)=>{if(this.holds(e)&&h(this.session(e).configOptions)!==r)await this.normalizeCustomEffort(e,!0);return c})},o=()=>{let r=i?this.normalizeCustomEffort(e,!1):void 0;return r?r.then(n):n()},a=s?void 0:this.replayRepairs.get(e)?.promise;return a?a.then(o):o()},s)}customEffortChange(e,t,s=!1,i){if(!this.holds(e))return;let n=this.session(e);if(!n.attached||n.readOnly)return;let o=h(n.configOptions),a=ao(o);if(!a)return;let r=n.configOptions.find((p)=>p.category==="thought_level"&&g(p)),c,d;if(r&&g(r)){let p=v(r.options)?r.options.flatMap((l)=>l.options):r.options;if(r.currentValue===a.value||!t&&p.some((l)=>l.value===r.currentValue))return;if(!p.some((l)=>l.value===a.value))throw Error(`The model does not advertise its default effort: ${o}`);c=r.configId,d=!t&&i!==void 0&&p.some((l)=>l.value===i)?i:a.value}else{if(!a.hidden||!s||o===null)return;let p=n.configOptions.find((l)=>l.category==="model");if(!p)throw Error("The custom model has no model option");c=p.configId,d=o}return{configId:c,value:d}}normalizeCustomEffort(e,t,s=!1,i){let n=this.customEffortChange(e,t,s,i);return n?this.writeCustomEffort(e,n.configId,n.value):void 0}async writeCustomEffort(e,t,s){let i=this.live(),n=this.lifecycle.capture(e),o=await i.request("session/set_config_option",{sessionId:e,configId:t,type:"id",value:s});if(i!==this.agent||!this.lifecycle.isCurrent(n))throw Error("Effort configuration belongs to a retired session");this.publishSession({...this.session(e),configOptions:o.configOptions,configRevision:O(o)??this.session(e).configRevision})}async afterSessionCreated(e){await super.afterSessionCreated(e);try{await super.enqueueSession(e,async()=>this.normalizeCustomEffort(e,!0,!0),!1)}catch(t){try{await this.delete(e)}catch(s){throw AggregateError([t,s],"Failed to initialize and clean up the custom model session",{cause:s})}throw t}}replay(e,t,s){let i=this.replayRepairs.get(e);if(i?.cwd===t)return i.promise;let n=this.replayWithEffort(e,t,s);this.replayRepairs.set(e,{cwd:t,promise:n});let o=()=>{if(this.replayRepairs.get(e)?.promise===n)this.replayRepairs.delete(e)};return n.then(o,o),n}async replayWithEffort(e,t,s){let i=this.holds(e)?this.session(e).configOptions:[],n=i.find((a)=>a.category==="thought_level")?.currentValue;await super.replay(e,t,s);let o=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,h(i)===h(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(a){if(this.holds(e)&&this.lifecycle.isCurrent(o))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw a}}async connect(){if(await super.connect(),this.state.projectContext===null)await this.refreshProjectContext()}async listProjectSessions(e){await this.listSessions();let t=this.projectPath(e),s=this.sessionGroup({cwd:t}).id;return this.state.sessionList.filter((i)=>this.sessionGroup(i).id===s)}async newSession(e,t=null,s="main"){if(t!==null&&typeof t==="object")return super.newSession(e,t);let i=++this.slotVersions[s],n=await this.createNativeSession(e,await this.resolveModel(t),null);return this.activateSlot(s,n,i),n}async createNativeSession(e,t,s,i="chat"){let n=await super.newSession(e,{draft:s!==null,meta:f(y(t),this.imageService||s!==null?{alwith:{...this.imageService?{inputMode:i}:{},...s===null?{}:{draft:!0}}}:void 0)});if(s!==null)this.draftDirectoryIntents.set(n,e),this.setApp((o)=>({draftSessions:{...o.draftSessions,[n]:s}}));return this.noteModel(this.session(n)),n}async open(e,t,s="main"){if(typeof s!=="string")return super.open(e,t,s);if(s==="chat"&&this.imageService&&(this.inputModes.get(e)??await this.imageService.inputMode(e))==="image")throw Error("Image conversations must be opened in the main window");this.bindSlot(s,e),++this.slotVersions[s];let i=this.holds(e)?this.session(e):void 0;if(i?.attached&&(!this.imageService||this.inputModes.has(e))&&!i.restoring&&!i.readOnly&&!this.lifecycle.operations.busy(e)&&!this.replayRepairs.has(e)){this.followModel(s,i);return}await this.replayForOwner(e,t,s)}async replayForOwner(e,t,s){this.openingOwners.set(e,s);try{await this.replay(e,t)}finally{if(this.openingOwners.get(e)===s)this.openingOwners.delete(e)}}async requestContext(e,t,s){if(this.imageService){let i=t.kind==="resume"?t.sessionId:t.kind==="fork"?t.sourceSessionId:null,n=i===null?s.meta?.alwith?.inputMode??"chat":await this.imageService.inputMode(i),o=Ge(n),a=co(s.meta),r={...a?.alwith,nativeTools:o.nativeTools};delete r.tools;let c=await this.requestModelContext(e,t,{...s,meta:{...a,alwith:r}});return{...c,bind:async(d)=>{await c.bind?.(d),this.inputModes.set(d,n)}}}return this.requestModelContext(e,t,s)}async requestModelContext(e,t,s){if(t.kind!=="resume"||s.meta?.alwith?.model!==void 0)return this.requestToolContext(e,t,s);let i=t.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?h(n.configOptions):null)??this.gatewayModels.get(i)??null,a=await this.resolveModel(o),r=o===null?null:a;return this.requestToolContext(e,t,{...s,meta:f(y(r),s.meta)})}async requestToolContext(e,t,s){let i=(await this.applicationToolsFor({cwd:e,operation:t,options:s})).map((r)=>({...r,inputSchema:structuredClone(r.inputSchema)})),n=await super.requestContext(e,t,s),o=Ln(i),a=n._meta?.alwith;if(i.length&&a?.tools!==void 0)throw Error("Application tools must be registered through the client");return{...n,...i.length?{_meta:{...n._meta,alwith:{...a,tools:o}}}:{},bind:async(r)=>{await n.bind?.(r),this.applicationRegistry.bind(r,i,o.revision)}}}acceptsPendingRequest(e){return e.method!=="_alwith/tool/call"&&super.acceptsPendingRequest(e)}handleNotification(e,t){if(e==="$/cancel_request"&&this.applicationRegistry.withdraw(t?.requestId))return!0;return super.handleNotification(e,t)}handleAgentRequest(e,t){return this.applicationRegistry.handle(e,t)||super.handleAgentRequest(e,t)}async installedApps(e){let t=this.live(),s=await super.installedApps(e),i=await Bi((n,o)=>t.request(n,o),s.apps.map((n)=>n.id),e?.threadId);if(t!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:s.apps.map((n)=>({...n,...i.get(n.id)}))}}async recoverReplay(e,t,s,i){let n=ge(s);if(!n&&!An(s))return super.recoverReplay(e,t,s,i);try{await super.afterResume(e,t,i)}catch(o){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;this.setApp((a)=>({historyPages:{...a.historyPages,[e]:{cursor:null,loading:!1,error:o instanceof Error?o.message:String(o)}}}))}if(n){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:s.reason??s.message,data:s.data},meta:null}}),!0}if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.accountRevocations.set(e,(this.accountRevocations.get(e)??0)+1),this.setApp((o)=>({modelRecovery:{...o.modelRecovery,[e]:!0}})),this.publishSession({...this.session(e),cwd:t,attached:!1,restoring:!1,readOnly:!0}),!0}markAccountModelsUnavailable(e){this.setApp((t)=>({modelRecovery:{...t.modelRecovery,...Object.fromEntries(e.map((s)=>[s,!0]))}}));for(let t of e){if(this.accountRevocations.set(t,(this.accountRevocations.get(t)??0)+1),!this.holds(t))continue;this.publishSession({...this.session(t),attached:!1,readOnly:!0})}}async resumeModel(e,t){let s=this.session(e);if(!this.state.modelRecovery[e]&&(s.attached||!ge(s.error?.error)))throw Error("Model recovery is not required");if(!t)throw Error("Select a model before continuing");let i=this.accountRevocations.get(e)??0,n=await this.resolveModel(t);if(!n)throw Error("The selected provider connection or model is unavailable");if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");this.accountRecoveries.set(e,i);try{await this.replay(e,s.cwd,{meta:{alwith:{model:n,accountModelSelection:!0}}})}catch(a){if(this.holds(e)&&this.state.modelRecovery[e])this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!0});throw a}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((a)=>{let{[e]:r,...c}=a.modelRecovery;return{modelRecovery:c}}),this.confirmModel(this.state.sessionWindows[e]??"main",o)}setConfig(e,t,s,i="main"){this.configOwners.set(`${e}:${t}`,i),this.schedulingConfig.add(e);try{return super.setConfig(e,t,s)}finally{this.schedulingConfig.delete(e)}}onConfigChanged(e,t,s){super.onConfigChanged(e,t,s),this.noteModel(this.session(e));let i=this.configOwners.get(`${e}:${t}`)??"main";if(this.configOwners.delete(`${e}:${t}`),s.configOptions.some((n)=>n.configId===t&&n.category==="model"))this.confirmModel(i,this.session(e))}changeDraft(e,t){let s=Promise.allSettled(e.map((i)=>this.draftOperations.get(i)).filter((i)=>i!==void 0)).then(t);for(let i of e)this.draftOperations.set(i,s);return s}prepareDraft(e,t,s=null,i=!1,n="chat"){if(e==="chat"&&n!=="chat")throw Error("The floating chat only supports chat input");let o=++this.slotVersions[e];return this.changeDraft([e],async()=>{let a=t??(await this.refreshProjectContext(!0)).chatDirectory,r=Object.keys(this.state.draftSessions).find((l)=>this.state.draftSessions[l]===e);if(r)await this.lifecycle.admission.pending(r);let c=s??(r?h(this.session(r).configOptions):this.savedModels[e]??this.slotModels[e]),d=i?null:await this.resolveModel(c,s===null?"draft":"session");if(r&&(this.inputModes.get(r)??"chat")===n&&this.session(r).cwd===a&&(!this.draftDirectoryIntents.has(r)||this.draftDirectoryIntents.get(r)===t)&&!i&&!this.state.modelRecovery[r]&&(d===null?!h(this.session(r).configOptions)?.startsWith("gateway:"):h(this.session(r).configOptions)===d)){if(this.activateSlot(e,r,o),!this.session(r).attached)await this.replayForOwner(r,a,e);if(s!==null)this.confirmModel(e,this.session(r));return r}let p=await this.createNativeSession(t,d,e,n);try{if(r&&this.session(r).cwd===a)for(let l of this.session(r).configOptions){if(l.category==="model")continue;if(l.category==="thought_level"&&h(this.session(r).configOptions)!==h(this.session(p).configOptions)&&ao(h(this.session(p).configOptions))!==null)continue;let u=this.session(p).configOptions.find((w)=>w.configId===l.configId);if(!u||u.currentValue===l.currentValue)continue;if(S(l)&&S(u))await this.setConfig(p,l.configId,l.currentValue);else if(g(l)&&g(u)){if((v(u.options)?u.options.flatMap((m)=>m.options):u.options).some((m)=>m.value===l.currentValue))await this.setConfig(p,l.configId,l.currentValue)}}if(r)await this.deleteEmptyDraft(r)}catch(l){throw await this.deleteEmptyDraft(p),l}if(this.activateSlot(e,p,o),s!==null||i||c!==null&&c!==d)this.confirmModel(e,this.session(p));return p})}discardDraft(e){if(e!=="main"&&e!=="chat")return super.discardDraft(e);return this.changeDraft([e],async()=>{for(let[t,s]of Object.entries(this.state.draftSessions))if(s===e)await this.deleteEmptyDraft(t)})}transferDraft(e,t){return this.changeDraft(["main","chat"],async()=>{if(t==="chat"&&this.inputModes.get(e)==="image")throw Error("Image conversations must remain in the main window");if(!this.state.draftSessions[e]||this.state.draftSessions[e]===t)return;for(let[s,i]of Object.entries(this.state.draftSessions))if(i===t)await this.deleteEmptyDraft(s);this.setApp((s)=>s.draftSessions[e]?{draftSessions:{...s.draftSessions,[e]:t}}:{})})}deleteEmptyDraft(e){return this.enqueueSession(e,async()=>{if(!this.state.draftSessions[e])return;await this.delete(e),this.gatewayModels.delete(e)})}onDraftMaterialized(e){super.onDraftMaterialized(e),this.draftDirectoryIntents.delete(e),this.setApp((t)=>{let{[e]:s,...i}=t.draftSessions;return{draftSessions:i}}),this.noteModel(this.session(e))}onSessionDropped(e){this.applicationRegistry.drop(e),super.onSessionDropped(e),this.inputModes.delete(e),this.inputSelections.delete(e),this.draftDirectoryIntents.delete(e),this.gatewayModels.delete(e),this.accountRevocations.delete(e),this.accountRecoveries.delete(e),this.setApp((t)=>{let{[e]:s,...i}=t.draftSessions,{[e]:n,...o}=t.sessionWindows,{[e]:a,...r}=t.modelRecovery;return{draftSessions:i,sessionWindows:o,modelRecovery:r}})}fork(e,t,s){let i=typeof s==="object"?s:s===void 0?{}:{lastTurnId:s};return super.fork(e,t,i)}async forkInternal(e,t,s){let n=[...(await Promise.all([this.indexSessions(),this.indexSessions(void 0,!0)])).flat(),...this.state.sessionList,...this.state.archivedSessions],o=(this.holds(e)?this.session(e).title:null)??n.find((c)=>c.sessionId===e)?.title,a=await super.forkInternal(e,t,{...s,meta:f(y(this.gatewayModels.get(e)??null),s.meta)});await super.enqueueSession(a,async()=>this.normalizeCustomEffort(a,!1,!0),!1);let r=o??this.session(a).title;if(r)await this.renameSession(a,En(r,n.flatMap((c)=>c.title?[c.title]:[])));return a}onForked(e,t){super.onForked(e,t),this.noteModel(this.session(e))}onReplayed(e,t){super.onReplayed(e,t);let s=this.accountRevocations.get(e);if(s!==void 0&&this.accountRecoveries.get(e)!==s)this.markAccountModelsUnavailable([e]);this.noteModel(this.session(e))}setModelSelections(e){this.savedModels={...e},this.slotModels={...e}}onConfirmedModel(e){return this.confirmedModelListeners.add(e),()=>this.confirmedModelListeners.delete(e)}onSessionChanged(e){super.onSessionChanged(e);let t=this.accountRevocations.get(e.id);if(t!==void 0&&this.accountRecoveries.get(e.id)!==t&&(e.attached||!e.readOnly)){this.publishSession({...e,attached:!1,readOnly:!0});return}this.followModel("main",e),this.followModel("chat",e)}followModel(e,t){if(this.slotTargets[e]!==t.id||!t.attached||t.restoring)return;let s=h(t.configOptions);if(s!==null)this.slotModels[e]=s}activateSlot(e,t,s){if(this.slotVersions[e]!==s)return;this.bindSlot(e,t),this.followModel(e,this.session(t))}bindSlot(e,t){let s=e==="main"?"chat":"main";if(this.slotTargets[s]===t)this.slotTargets[s]=null,++this.slotVersions[s];this.slotTargets[e]=t,this.setApp((i)=>({sessionWindows:{...i.sessionWindows,[t]:e}}))}confirmModel(e,t){let s=h(t.configOptions);if(s===null)throw Error("Model selection did not return the current model");this.followModel(e,t),this.savedModels[e]=s;for(let i of this.confirmedModelListeners)i(e,s)}resolveModel(e,t="session"){return this.resolveModelOption?this.resolveModelOption(e,t):Promise.resolve(e)}onSessionModel(e){return this.modelListeners.add(e),()=>this.modelListeners.delete(e)}noteModel(e){let t=h(e.configOptions);if(t===null)return;let s=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(s&&g(s)){let o=(v(s.options)?s.options.find((a)=>a.groupId===b.id)?.options??[]:s.options.filter((a)=>!a.value.startsWith("gateway:"))).map((a)=>({id:a.value,label:a.name}));if(JSON.stringify(o)!==JSON.stringify(this.state.nativeModels))this.setApp({nativeModels:o})}let i=s!==void 0&&g(s)&&s.options.some((n)=>("groupId"in n)&&n.groupId!==b.id&&n.options.some((o)=>o.value===t));if(i)this.gatewayModels.set(e.id,t);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,t,i)}}
2
- export{b,Ui};
@@ -1,2 +0,0 @@
1
- import{Et}from"./chunk-rv3k0kfr.js";import{isContentEntry as m,isImage as d,isText as p}from"@nyssance/codex-acp-v2/client";var Ma="generate_image",Na=[{id:"MiniMax-H3-Image",label:"MiniMax H3 Image",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"MiniMax-H3-Image-Highspeed",label:"MiniMax H3 Image Highspeed",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"wham",label:"ChatGPT Images",provider:"chatgpt",sizes:["auto"],maxReferences:16},{id:"doubao-seedream-4-5-251128",label:"Seedream 4.5",provider:"seedream",sizes:["2K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-lite-260128",label:"Seedream 5.0 Lite",provider:"seedream",sizes:["2K","3K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-pro-260628",label:"Seedream 5.0 Pro",provider:"seedream",sizes:["1K","2K"],maxReferences:10}],Ka={model:"wham",size:"auto"},uo={version:1,revision:"images-v1",definitions:[{name:Ma,description:"Generate or edit images using the user's selected image model. Use this tool for image creation and editing. For edits, supply reference IDs returned by earlier calls or the current image request; do not read credentials or call image services yourself. Return the generated image to the user. The host controls model selection.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Complete image generation or editing instructions"},references:{type:"array",items:{type:"string"},description:"Image reference IDs supplied by the host or previous image results"}},required:["prompt"],additionalProperties:!1}}]};function $i(o){return o.items.flatMap((t)=>{if(!Et(t))return[];let r=t.rawInput,i={};for(let n of t.content.filter(m)){if(!p(n.content)||!n.content.text.startsWith("{"))continue;try{let e=JSON.parse(n.content.text);if(e&&typeof e==="object"&&"kind"in e&&e.kind==="alwith.image")i={..."model"in e&&typeof e.model==="string"?{model:e.model}:{},..."size"in e&&typeof e.size==="string"?{size:e.size}:{}}}catch(e){if(!(e instanceof SyntaxError))throw e}}return t.content.filter(m).flatMap((n,e)=>{if(!d(n.content))return[];let{mimeType:s,data:a}=n.content;return[{id:`${t.id}:${e}`,toolId:t.id,...i,...typeof r?.arguments?.prompt==="string"?{prompt:r.arguments.prompt}:{},mimeType:s,data:a,src:`data:${s};base64,${a}`}]})})}function te(o){let t=Na.find((r)=>r.id===o.model);if(!t||!t.sizes.includes(o.size))throw Error("Invalid image model or size");return t}function Wa(o,t,r){let i=te(o);if(i.provider!=="seedream")throw Error("Expected a Seedream model");if(r.length>i.maxReferences)throw Error(`This model accepts at most ${i.maxReferences} reference images`);return{model:i.id,prompt:t,size:o.size,response_format:"b64_json",watermark:!1,...r.length?{image:r}:{},...i.id==="doubao-seedream-4-5-251128"?{}:{output_format:"png"}}}
2
- export{Ma,Na,Ka,uo,$i,te,Wa};
@@ -1,2 +0,0 @@
1
- import{Rn}from"./chunk-6z3fgkkp.js";import{uo,te}from"./chunk-n6erf29r.js";import{Vi}from"./chunk-x8rfc6wc.js";function Gi(d,a){return Rn({...uo.definitions[0],revision:uo.revision,autoApprove:(i)=>a(i)!==void 0,parse(i){let e=i;if(!e||typeof e!=="object"||Array.isArray(e)||typeof e.prompt!=="string"||!e.prompt.trim()||Object.keys(e).some((n)=>n!=="prompt"&&n!=="references")||e.references!==void 0&&(!Array.isArray(e.references)||e.references.some((n)=>typeof n!=="string")))throw Error("Invalid image instructions or references");return{prompt:e.prompt,references:e.references}},async execute(i,{sessionId:e,toolCallId:n,signal:c,agent:l}){let t=a(e);if(!t)throw Error("Image request is no longer active");let g=i.references,m=(g??[...t.references.keys()].filter((r)=>r.startsWith("attachment:"))).map((r)=>{let s=t.references.get(r);if(!s)throw Error(`Unknown image reference: ${r}`);return s}),o=te(t.selection);if(m.length>o.maxReferences)throw Error(`This model supports ${o.maxReferences} references`);let f=Vi(i.prompt,t.aspect),p=o.provider==="chatgpt"?await l.request("_codex/images/generate",{prompt:f,images:m},{cancellationSignal:c}):await d.generateExternal(t.selection,f,m,c);if(c.throwIfAborted(),a(e)!==t)throw Error("Image request was cancelled or replaced");return p.images.forEach((r,s)=>t.references.set(`${String(n)}:${s+1}`,`data:${r.mimeType};base64,${r.data}`)),{success:!0,contentItems:[{type:"text",text:JSON.stringify({kind:"alwith.image",version:1,model:o.id,size:t.selection.size,displayed:!0,message:"The application already displays these images and provides downloads. Finish with the returned image reference; do not regenerate, echo image data or write files to deliver this result.",references:g??[],images:p.images.map((r,s)=>({reference:`${String(n)}:${s+1}`}))})},...p.images.map((r)=>({type:"image",...r}))]}}})}
2
- export{Gi};
@@ -1,2 +0,0 @@
1
- import{ws}from"./chunk-c13rnm7b.js";import{createContext as s,useContext as i,useSyncExternalStore as m}from"react";import{jsx as l}from"react/jsx-runtime";var u=s(null),c=s(null),$o=s(null);function ae(){return i($o)}function $e({host:e,client:n,children:r}){return l(ws,{host:e,children:l(u,{value:e,children:l(c,{value:n,children:r})})})}function t(){let e=i(u);if(e===null)throw Error("Timeline host is missing");return e}function qe(){let e=i(c);if(e===null)throw Error("Timeline client is missing");return e}function y(e,n){return m((r)=>e.subscribe(r),()=>n(e.getState()),()=>n(e.getState()))}function o(e){let n=qe();return y(n.store,e)}function qo(){return i(u)!==null}function le(e,n){if(e.reportError)e.reportError(n);else console.error(n)}
2
- export{$o,ae,$e,t,qe,y,o,qo,le};
@@ -1,3 +0,0 @@
1
- import{ki}from"./chunk-0s2zcz5f.js";import{Pi}from"./chunk-809b75k1.js";import{Si}from"./chunk-x2wcwpw3.js";import{vt}from"./chunk-gttw4rmx.js";import{o}from"./chunk-rragk2vb.js";import{e}from"./chunk-n32wra9r.js";import{isContentEntry as f,isDiffEntry as g,isFormElicitation as x,isText as h,isToolCallSubject as b,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as a,jsxs as m}from"react/jsx-runtime";function et(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let n=t._meta?.codex;if(typeof n!=="object"||n===null)return null;let s=n.description;return typeof s==="string"?s:null}function A(t){let n=t.rawInput;if(typeof n!=="object"||n===null)return null;let s=n.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let n of t.content??[])if(g(n)&&n.patch&&n.patch.text.length>0)return n.patch.text;return null}function R(t){return(t.content??[]).filter(f).map((n)=>h(n.content)?n.content.text:"").filter((n)=>n.length>0).join(`
2
- `)}function T({subject:t,requestTitle:n}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==n&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted max-h-80 overflow-auto overscroll-contain rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(vt,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,n){let{host:s,client:r}=e();return(l)=>{try{if(n)n(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(ki,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:n,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function ht({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=o((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(Pi,{requestId:t.id,schema:t.params.requestedSchema,message:i?.subagent?`${i.title??r.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:n,t:r.t,onRespond:l})}function Fe({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s);if(t.kind==="permission")return a(C,{action:t,total:n,onRespond:s});if(et(t))return a(ht,{action:t,total:n??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(Si,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
3
- export{et,ht,Fe};
@@ -1,2 +0,0 @@
1
- import{a,n}from"./chunk-ytdhstqx.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Wt(e,o){let s=a(),c=n((t)=>t.connection),r=n((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=n((t)=>v(t.sessions[e]?.items)),f=n((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||r)return;let t=!1,l,i=0,m=async()=>{try{let d=await s.activityReply(e);if(i=0,!t)y(d??void 0)}catch{i++}finally{if(!t&&(o==="running"||i>0&&i<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[s,e,c,f,r,o]),r?u:p??u}
2
- export{Wt};
@@ -1,2 +0,0 @@
1
- import{F,Wo,fs,Wn,hs,Zo,vs}from"./chunk-3qy743j9.js";import{t,qe,y,o}from"./chunk-rragk2vb.js";import{je}from"./chunk-vnwt4f99.js";import{createStore as E}from"@alwith/api/client";import{isText as k,nativeTurnId as b}from"@nyssance/codex-acp-v2/client";import{jsx as m}from"react/jsx-runtime";var v=E({entries:{}});function p(i,e){v.setState((n)=>({entries:{...n.entries,[i]:e}}))}function x(i,e){let n=b(e),a=i.items.findLast((s)=>b(s)!==null);return!e.replayed&&n!==null&&a!==void 0&&b(a)===n}function M(i,e){for(let n of i.items){if(n.kind!=="user"||n.echo==="pending")continue;for(let a of[...Zo(n._meta),...n.content.filter(k).flatMap((s)=>Zo(s._meta))])if(a.questionItemId===e)return a.answer}return}function O({sessionId:i,item:e,question:n,index:a}){let s=qe(),{t:l}=t(),S=Wo(e.id,a),c=JSON.stringify([i,S]),u=y(v,(r)=>r.entries[c]),d=o((r)=>r.sessions[i]),A=o((r)=>r.connection==="ready"),f=u?.draft??fs(n),q=d===void 0?u?.accepted:M(d,S)??u?.accepted,h=d!==void 0&&x(d,e),D=!d?.subagent&&A&&d?.attached&&!d.restoring&&!d.readOnly,g=q!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!h?"closed":!D?"unavailable":"pending",C=async()=>{if(v.getState().entries[c]?.pending||g!=="pending")return;let r=s.state.sessions[i];if(r===void 0||!x(r,e)||!r.attached||r.readOnly||r.restoring)return;let I=Wn(n,f);if(!I.trim())return;let w={questionItemId:S,question:n.title,answer:I};p(c,{draft:f,pending:!0});try{await s.prompt(i,[{type:"text",text:hs(w),_meta:{codex:{questionReply:w}}}]),p(c,{draft:f,accepted:I})}catch(Q){p(c,{draft:f,error:Q instanceof Error?Q.message:String(Q)})}};if(g==="closed")return null;return m(vs,{question:n,draft:f,status:g,answer:q,error:g==="pending"?u?.error:void 0,t:l,onChange:(r)=>p(c,{draft:r}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{C()}})}function Fo({sessionId:i,item:e}){let n=o((s)=>s.sessions[i]),a=F(e._meta);if(n===void 0||n.subagent!==void 0||n.readOnly||!x(n,e))return m(je,{content:e.content.some((s)=>!k(s)||s.text.trim().length>0)?e.content:a.map((s)=>({type:"text",text:s.title})),messageId:e.id,streaming:!1});return m("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((s,l)=>m(O,{sessionId:i,item:e,question:s,index:l},Wo(e.id,l)))})}
2
- export{Fo};
@@ -1,2 +0,0 @@
1
- import{E}from"./chunk-44r55va6.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as L,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function na({host:e,client:t,children:i}){let[r,l]=f(null);E(r!==null);let{t:u}=e;return o(S,{value:e,children:o(g,{value:t,children:d(C,{value:l,children:[i,o(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(P,{children:[o(H,{children:u("sessionList.deleteTitle")}),o(L,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[o(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function yi(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function on(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=a();return x((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
2
- export{na,s,yi,a,on,n,h};
@@ -1,2 +0,0 @@
1
- import{a,n}from"./chunk-ytdhstqx.js";import{QUICK_CHATS_GROUP as m,sessionGroup as l}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function Hs(i){let t=a(),e=n((s)=>s.projectContext),c=i===null?m:e?l(e,{cwd:t.projectPath(i)}).id:null,u=n((s)=>s.sessionList),d=n((s)=>s.connection),r=n((s)=>s.sessionListLoaded),o=n((s)=>s.sessionListError),f=()=>t.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(d==="ready"&&!r&&o===null)t.listSessions().catch(()=>{return})},[t,d,r,o]),{result:L(()=>{if(r&&e)return{status:"ready",sessionRows:u.filter((s)=>l(e,{...s,cwd:t.projectPath(s.cwd)}).id===c).toSorted((s,p)=>(p.updatedAt??"").localeCompare(s.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[t,u,r,o,c,e]),retry:f}}
2
- export{Hs};