@alwith/module-chat 0.6.22 → 0.6.25
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.
- package/README.md +1 -1
- package/dist/activity-host.js +1 -1
- package/dist/agent/client.d.ts +25 -9
- package/dist/agent/client.js +1 -1
- package/dist/agent/custom-model-effort.js +1 -1
- package/dist/agent/fork-title.js +1 -1
- package/dist/agent/image-request.js +1 -1
- package/dist/agent/image-tools.js +1 -1
- package/dist/agent/input-config.js +1 -1
- package/dist/agent/input-modes/chat.js +1 -1
- package/dist/agent/input-modes/execution-meta.js +1 -1
- package/dist/agent/input-modes/image-context.js +1 -1
- package/dist/agent/input-modes/image.js +1 -1
- package/dist/agent/input-modes/index.js +1 -1
- package/dist/agent/project-path.js +1 -1
- package/dist/agent/request-error.js +1 -1
- package/dist/agent/session-list-refresh.js +1 -1
- package/dist/app-reference.js +1 -1
- package/dist/application-tools.d.ts +4 -1
- package/dist/application-tools.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/chunk-0a7vp0ph.js +2 -0
- package/dist/{chunk-09w80wgb.js → chunk-0bv3tw1m.js} +2 -2
- package/dist/chunk-0j5z842s.js +4 -0
- package/dist/{chunk-x6cfmt4y.js → chunk-0jj029k8.js} +2 -2
- package/dist/{chunk-xvmmndhs.js → chunk-0s2zcz5f.js} +2 -2
- package/dist/{chunk-xdmjwqgf.js → chunk-113maskf.js} +2 -2
- package/dist/{chunk-shk5mmmw.js → chunk-18xfysvb.js} +2 -2
- package/dist/{chunk-dgh0750h.js → chunk-1d29gnb2.js} +2 -2
- package/dist/{chunk-pkkw0fxs.js → chunk-1gr60c40.js} +2 -2
- package/dist/{chunk-t3enrsnt.js → chunk-26w51q10.js} +2 -2
- package/dist/{chunk-ywwfzgm6.js → chunk-27gr882d.js} +2 -2
- package/dist/{chunk-jv117dry.js → chunk-2kbp0pbe.js} +2 -2
- package/dist/{chunk-2wdvcx76.js → chunk-2rbaebnr.js} +3 -3
- package/dist/chunk-2w4kyd2a.js +4 -0
- package/dist/chunk-2wfgbxet.js +3 -0
- package/dist/{chunk-2q20937h.js → chunk-2x5m7g33.js} +2 -2
- package/dist/chunk-3q2zdv9e.js +2 -0
- package/dist/{chunk-kawq8f1z.js → chunk-3q8vw3wb.js} +2 -2
- package/dist/{chunk-7ekex790.js → chunk-3qy743j9.js} +3 -3
- package/dist/{chunk-jg4c3zg4.js → chunk-3tvq6xr2.js} +2 -2
- package/dist/chunk-3zsqg6wr.js +3 -0
- package/dist/{chunk-p521krn5.js → chunk-44r55va6.js} +2 -2
- package/dist/chunk-4cr144a7.js +2 -0
- package/dist/{chunk-8zrmp6dw.js → chunk-4e622bdk.js} +3 -3
- package/dist/{chunk-6cxa2jrx.js → chunk-4gftpery.js} +2 -2
- package/dist/{chunk-76r5v06g.js → chunk-4t0f01ec.js} +2 -2
- package/dist/{chunk-05eftctr.js → chunk-4vayk46h.js} +2 -2
- package/dist/{chunk-m9s9etss.js → chunk-51x80v4h.js} +2 -2
- package/dist/{chunk-x785yg93.js → chunk-52wrk1mh.js} +2 -2
- package/dist/{chunk-69eysg08.js → chunk-5c42mfat.js} +2 -2
- package/dist/{chunk-6j2q7qvk.js → chunk-5m2ydb9j.js} +2 -2
- package/dist/chunk-621eg04b.js +2 -0
- package/dist/{chunk-7n1v87h0.js → chunk-64apxzn7.js} +2 -2
- package/dist/chunk-6bbtfd0j.js +2 -0
- package/dist/{chunk-vtw1zmyd.js → chunk-6f06hbsk.js} +2 -2
- package/dist/{chunk-ckdkm4n7.js → chunk-6p4gk1zy.js} +2 -2
- package/dist/chunk-6qxd4jg9.js +2 -0
- package/dist/{chunk-nm8245ze.js → chunk-6z3fgkkp.js} +2 -2
- package/dist/{chunk-127rz9fe.js → chunk-7jk8s061.js} +2 -2
- package/dist/{chunk-egw95b1p.js → chunk-7m83dwzq.js} +2 -2
- package/dist/{chunk-bm1x011j.js → chunk-7tw7rn0m.js} +2 -2
- package/dist/{chunk-qbt8ahwr.js → chunk-809b75k1.js} +2 -2
- package/dist/{chunk-xmr3vcp8.js → chunk-84p483n0.js} +2 -2
- package/dist/{chunk-nefts0rn.js → chunk-84zzf0ys.js} +2 -2
- package/dist/{chunk-mptke00a.js → chunk-88ysxbdh.js} +2 -2
- package/dist/{chunk-9ys14ex1.js → chunk-89j37t04.js} +3 -3
- package/dist/{chunk-gzf6kzm0.js → chunk-8f5w2tnp.js} +2 -2
- package/dist/{chunk-mfs0b15q.js → chunk-8hygfx41.js} +2 -2
- package/dist/chunk-8qszap2n.js +2 -0
- package/dist/{chunk-9q5a0kwf.js → chunk-91kpcajz.js} +2 -2
- package/dist/chunk-952vsa4r.js +4 -0
- package/dist/chunk-9w1vcmbd.js +2 -0
- package/dist/chunk-a6ns5agq.js +2 -0
- package/dist/{chunk-dps8nnde.js → chunk-ad53zbdb.js} +2 -2
- package/dist/chunk-an3nh155.js +2 -0
- package/dist/chunk-ar1bwfn3.js +2 -0
- package/dist/{chunk-2w0grrzz.js → chunk-arm9x6kc.js} +2 -2
- package/dist/chunk-ax7c2kam.js +2 -0
- package/dist/{chunk-ygjcmhng.js → chunk-b6sfe0k7.js} +2 -2
- package/dist/{chunk-m0rznqwx.js → chunk-bcdmjgab.js} +2 -2
- package/dist/{chunk-mvebg1n7.js → chunk-beccgzp9.js} +2 -2
- package/dist/{chunk-7e9s642q.js → chunk-bf7sgpzq.js} +2 -2
- package/dist/{chunk-6cks2gn2.js → chunk-bgnxw313.js} +2 -2
- package/dist/{chunk-w308wr7v.js → chunk-brv52tgj.js} +2 -2
- package/dist/chunk-bve6cykn.js +2 -0
- package/dist/chunk-bw1m6407.js +2 -0
- package/dist/{chunk-fdmtynmq.js → chunk-bw3bpr6m.js} +2 -2
- package/dist/chunk-byvw0vam.js +2 -0
- package/dist/chunk-c06k7g9n.js +2 -0
- package/dist/{chunk-10ar0368.js → chunk-c13rnm7b.js} +2 -2
- package/dist/chunk-c2ez86jz.js +2 -0
- package/dist/{chunk-1dkd8jt0.js → chunk-c2r7xpjf.js} +2 -2
- package/dist/{chunk-6hgcxkwd.js → chunk-cf85zhvf.js} +2 -2
- package/dist/{chunk-2gp33sx4.js → chunk-cq3j51m2.js} +2 -2
- package/dist/chunk-d06382wz.js +2 -0
- package/dist/chunk-d0nrbf80.js +2 -0
- package/dist/{chunk-acprqt2h.js → chunk-d0s10qy5.js} +2 -2
- package/dist/{chunk-nrk4aa7a.js → chunk-dba0ttve.js} +2 -2
- package/dist/{chunk-g98m1se7.js → chunk-dheg4bs2.js} +2 -2
- package/dist/{chunk-rv3gpjgk.js → chunk-dnrcx75n.js} +2 -2
- package/dist/{chunk-bbwxqt7p.js → chunk-dr5swvaa.js} +2 -2
- package/dist/{chunk-rr2cjfcz.js → chunk-dxwbgg69.js} +2 -2
- package/dist/{chunk-zr6xrady.js → chunk-e00dz09f.js} +2 -2
- package/dist/{chunk-zsbsypka.js → chunk-e13mpwt8.js} +2 -2
- package/dist/chunk-e1fzfaqj.js +2 -0
- package/dist/{chunk-ky2p8zyg.js → chunk-e3bpr3yx.js} +2 -2
- package/dist/chunk-e8p4wkbg.js +2 -0
- package/dist/{chunk-v77kjbkb.js → chunk-ee7a5gft.js} +2 -2
- package/dist/{chunk-4cnm37fs.js → chunk-er7ewrf2.js} +3 -3
- package/dist/{chunk-zq7p8m7g.js → chunk-ert67qk1.js} +2 -2
- package/dist/{chunk-q6f0e289.js → chunk-etvdqkvb.js} +2 -2
- package/dist/{chunk-b17rwepe.js → chunk-f54k9xxv.js} +2 -2
- package/dist/chunk-f7d0hs1y.js +2 -0
- package/dist/{chunk-jzqvhnq5.js → chunk-ftsnryz8.js} +2 -2
- package/dist/{chunk-5r5dc363.js → chunk-fwghjmd1.js} +2 -2
- package/dist/{chunk-nvh0e8y1.js → chunk-fyxetwxv.js} +2 -2
- package/dist/{chunk-3rew4bcf.js → chunk-g4qwh2sx.js} +2 -2
- package/dist/chunk-gdtpwbqn.js +1 -0
- package/dist/{chunk-29jan02g.js → chunk-gpv1dc5y.js} +2 -2
- package/dist/{chunk-z0z3xfn3.js → chunk-gttw4rmx.js} +3 -3
- package/dist/{chunk-dq7zxw47.js → chunk-gxb9n7g7.js} +4 -4
- package/dist/{chunk-yqjmqa0t.js → chunk-gxx5yh45.js} +2 -2
- package/dist/{chunk-fgec4g5x.js → chunk-h5mdgrq6.js} +2 -2
- package/dist/{chunk-cbx30sf1.js → chunk-h82jte5p.js} +2 -2
- package/dist/{chunk-yk72yvcd.js → chunk-ha9n1k24.js} +2 -2
- package/dist/{chunk-xtn9bw6a.js → chunk-hmy4snze.js} +2 -2
- package/dist/{chunk-8ysh4mx1.js → chunk-hyhp5ytm.js} +2 -2
- package/dist/{chunk-71fhan3p.js → chunk-j1frpcqd.js} +2 -2
- package/dist/{chunk-37p8zdb1.js → chunk-j2k2mc13.js} +2 -2
- package/dist/chunk-j5dqww4h.js +2 -0
- package/dist/{chunk-6qh7fvgs.js → chunk-ja7x2gvb.js} +3 -3
- package/dist/{chunk-7narmchf.js → chunk-jgqt7k0h.js} +2 -2
- package/dist/{chunk-pphkxw72.js → chunk-jn8b4qrh.js} +2 -2
- package/dist/{chunk-z90zckkv.js → chunk-jp4xjks0.js} +2 -2
- package/dist/chunk-jv327stj.js +2 -0
- package/dist/{chunk-2y13vckf.js → chunk-jy0jrht0.js} +2 -2
- package/dist/{chunk-00vd1yaz.js → chunk-jzbg0cx9.js} +2 -2
- package/dist/chunk-k2nbrerw.js +2 -0
- package/dist/{chunk-k86843av.js → chunk-k5nd3vyq.js} +2 -2
- package/dist/chunk-k7z0pgrt.js +2 -0
- package/dist/chunk-kbax1frf.js +2 -0
- package/dist/{chunk-gjdeaqy2.js → chunk-khs8cfkd.js} +2 -2
- package/dist/chunk-knxes674.js +2 -0
- package/dist/{chunk-96wvztgv.js → chunk-kvc3ghat.js} +2 -2
- package/dist/{chunk-mch9hd8q.js → chunk-m0r0v983.js} +5 -5
- package/dist/{chunk-yey8qz6h.js → chunk-m799f2x5.js} +2 -2
- package/dist/{chunk-eraepgrh.js → chunk-ma7thf1j.js} +2 -2
- package/dist/{chunk-m08yer2f.js → chunk-masqfje4.js} +2 -2
- package/dist/{chunk-kj3re492.js → chunk-mc21sg7m.js} +2 -2
- package/dist/{chunk-f7bn0nd2.js → chunk-mvnze5ts.js} +2 -2
- package/dist/{chunk-dav36sjv.js → chunk-myjsfbp6.js} +2 -2
- package/dist/chunk-n32wra9r.js +2 -0
- package/dist/{chunk-0k6zg9s1.js → chunk-n6erf29r.js} +2 -2
- package/dist/chunk-n7y094nf.js +2 -0
- package/dist/chunk-na6b1fpn.js +2 -0
- package/dist/{chunk-b1yfr8gv.js → chunk-ncgwbdmj.js} +2 -2
- package/dist/{chunk-vkfz61d6.js → chunk-ne4b53kn.js} +2 -2
- package/dist/chunk-nfwa8qkt.js +2 -0
- package/dist/{chunk-pae53dz2.js → chunk-npkk2gzs.js} +2 -2
- package/dist/{chunk-ws4qt1sc.js → chunk-nqt9gyz9.js} +2 -2
- package/dist/{chunk-d7kcgxa2.js → chunk-nrpgmawz.js} +2 -2
- package/dist/chunk-nwyem2d7.js +3 -0
- package/dist/{chunk-e8dzp9xe.js → chunk-p3gawvqr.js} +2 -2
- package/dist/{chunk-nase48et.js → chunk-pqz2471h.js} +2 -2
- package/dist/{chunk-rcfjwyt4.js → chunk-pw22g3k1.js} +2 -2
- package/dist/{chunk-k025mmnv.js → chunk-pxr5snwm.js} +2 -2
- package/dist/chunk-pxv38ttf.js +2 -0
- package/dist/chunk-q1kb5z75.js +2 -0
- package/dist/chunk-q7jm6srr.js +2 -0
- package/dist/chunk-q9b2wsdg.js +2 -0
- package/dist/{chunk-d4edqxgc.js → chunk-qk1yqepm.js} +2 -2
- package/dist/chunk-r940xwxq.js +2 -0
- package/dist/chunk-rd9cgt8p.js +2 -0
- package/dist/chunk-rragk2vb.js +2 -0
- package/dist/chunk-rv3k0kfr.js +2 -0
- package/dist/{chunk-2b7fjev1.js → chunk-ry7bxdb6.js} +2 -2
- package/dist/chunk-s1nfyggb.js +2 -0
- package/dist/chunk-sjb5stzq.js +2 -0
- package/dist/{chunk-xde2hdrb.js → chunk-sjm9p42x.js} +2 -2
- package/dist/chunk-sn3sk1j0.js +2 -0
- package/dist/{chunk-j8jn2p7q.js → chunk-snrbgnwn.js} +1 -1
- package/dist/chunk-sqkdenb0.js +3 -0
- package/dist/chunk-stse5bdv.js +2 -0
- package/dist/chunk-stv8pr4v.js +2 -0
- package/dist/{chunk-vxkkzs4m.js → chunk-swqbbw8q.js} +2 -2
- package/dist/{chunk-atdygnc5.js → chunk-sxz82jq3.js} +2 -2
- package/dist/chunk-tc80kegm.js +2 -0
- package/dist/chunk-tcg99k9e.js +2 -0
- package/dist/{chunk-xnj05nc3.js → chunk-tcp7c2s0.js} +3 -3
- package/dist/{chunk-9bk8tg2w.js → chunk-vev9q4t4.js} +3 -3
- package/dist/{chunk-cxd1bwe7.js → chunk-vfszr27e.js} +2 -2
- package/dist/{chunk-ehp3p3t5.js → chunk-vhxavb92.js} +2 -2
- package/dist/{chunk-y3e10q18.js → chunk-vnwt4f99.js} +2 -2
- package/dist/{chunk-322m8vk4.js → chunk-vyzq2pbd.js} +2 -2
- package/dist/chunk-w5q2ygsa.js +2 -0
- package/dist/{chunk-484wg46e.js → chunk-w63mha8c.js} +2 -2
- package/dist/{chunk-r9vjpafx.js → chunk-wk26bzjj.js} +3 -3
- package/dist/{chunk-q16yvbsg.js → chunk-wm6zdp7w.js} +2 -2
- package/dist/{chunk-2a6bv4xm.js → chunk-wpacvdsv.js} +2 -2
- package/dist/chunk-x1aw1r1v.js +2 -0
- package/dist/{chunk-8jqaahna.js → chunk-x2wcwpw3.js} +2 -2
- package/dist/{chunk-0y8pnj16.js → chunk-x49qjrbk.js} +2 -2
- package/dist/{chunk-wsz4dh6m.js → chunk-x8rfc6wc.js} +3 -3
- package/dist/{chunk-s5fk9ywy.js → chunk-xpfy5g6z.js} +2 -2
- package/dist/{chunk-vvpagkya.js → chunk-xqb4thy8.js} +2 -2
- package/dist/chunk-xvg3d2z6.js +7 -0
- package/dist/{chunk-xj2qfepx.js → chunk-xx7t8r87.js} +2 -2
- package/dist/{chunk-tp7329ny.js → chunk-y3mx5sf0.js} +2 -2
- package/dist/{chunk-pvdm1v6g.js → chunk-yj42tq3z.js} +2 -2
- package/dist/chunk-yn6a84c7.js +2 -0
- package/dist/{chunk-r67qt2tt.js → chunk-yq4wz4n8.js} +2 -2
- package/dist/{chunk-hhnxwgz5.js → chunk-yryg27yy.js} +2 -2
- package/dist/chunk-ytdhstqx.js +2 -0
- package/dist/{chunk-nbch7nw2.js → chunk-z107z7dt.js} +2 -2
- package/dist/{chunk-wjazfhrm.js → chunk-z6x70w62.js} +2 -2
- package/dist/{chunk-jwsgt0d9.js → chunk-z76as4dt.js} +2 -2
- package/dist/chunk-zft4afb8.js +2 -0
- package/dist/{chunk-8x33007g.js → chunk-zgqrv879.js} +3 -3
- package/dist/chunk-zj7kjjdj.js +2 -0
- package/dist/chunk-zq26pxze.js +2 -0
- package/dist/{chunk-ggad6492.js → chunk-zv3bm3np.js} +2 -2
- package/dist/{chunk-hb22jn2e.js → chunk-zxfx7psd.js} +2 -2
- package/dist/chunk-zxkpemh4.js +2 -0
- package/dist/{chunk-v3dp0ay9.js → chunk-zyn0ys4m.js} +2 -2
- package/dist/client.d.ts +1 -2
- package/dist/client.js +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/artifact-links.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/locales.js +1 -1
- package/dist/collections/model.js +1 -1
- package/dist/collections/store.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/inline-document.js +1 -1
- package/dist/composer/inline-dom.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-inline.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/app-mentions.js +1 -1
- package/dist/conversation/composer/apps-menu.js +1 -1
- package/dist/conversation/composer/composer-menu.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/config-options.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/prompt-history.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/connection-notice.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-search.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/diff-modal.js +1 -1
- package/dist/conversation/draft-project-picker.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/conversation/subagent-sessions.js +1 -1
- package/dist/conversation/subagent-tasks.js +1 -1
- package/dist/desktop/desktop-composer.js +1 -1
- package/dist/desktop/desktop.js +1 -1
- package/dist/desktop/draft-model-select.js +1 -1
- package/dist/desktop/load-image.js +1 -1
- package/dist/desktop/model-catalog.js +1 -1
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.js +1 -1
- package/dist/lib/app-reference.js +1 -1
- package/dist/lib/application-metadata.js +1 -1
- package/dist/lib/chat-path.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/file-url.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/lib/tool-artifacts.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mermaid/diagram.js +1 -1
- package/dist/mermaid/export.js +1 -1
- package/dist/mermaid/index.js +1 -1
- package/dist/mermaid/preview.js +1 -1
- package/dist/oauth/claude-login.js +1 -1
- package/dist/oauth.js +1 -1
- package/dist/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.d.ts +1 -1
- package/dist/plugins/host.js +1 -1
- package/dist/plugins/new-chat-directory.js +1 -1
- package/dist/plugins/pane.js +1 -1
- package/dist/plugins/panel-item.js +1 -1
- package/dist/plugins/plugin-detail-page.js +1 -1
- package/dist/plugins/plugin-icon.js +1 -1
- package/dist/plugins/plugin-icons.js +1 -1
- package/dist/plugins/plugins-page.js +1 -1
- package/dist/plugins/plugins.js +1 -1
- package/dist/plugins/read-skill-document.js +1 -1
- package/dist/plugins/skill-document.js +1 -1
- package/dist/plugins/skills-tab.js +1 -1
- package/dist/plugins/store.d.ts +1 -1
- package/dist/plugins/store.js +1 -1
- package/dist/plugins/toolbox-layout.js +1 -1
- package/dist/reference-projection.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/highlight.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/locales.js +1 -1
- package/dist/session-list/navigation-controls.js +1 -1
- package/dist/session-list/navigation-header.js +1 -1
- package/dist/session-list/navigation-store.js +1 -1
- package/dist/session-list/navigation-tabs.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/platform.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/shortcut-hint.js +1 -1
- package/dist/session-list/shortcut.js +1 -1
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-image-references.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/image-generation-progress.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/settings/codex-account-card.js +1 -1
- package/dist/settings/login-card.js +1 -1
- package/dist/settings/model-alias-settings.js +1 -1
- package/dist/settings/model-aliases.js +1 -1
- package/dist/settings/provider-logos.js +1 -1
- package/dist/settings/provider-section.js +1 -1
- package/dist/settings/providers-port.js +1 -1
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.js +1 -1
- package/native/darwin-arm64/artifact.json +1 -1
- package/native/darwin-arm64/libalwith_native_chat.dylib +0 -0
- package/native/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/package.json +2 -7
- package/dist/agent/application-client.d.ts +0 -30
- package/dist/agent/application-client.js +0 -1
- package/dist/chunk-03mdvw7w.js +0 -2
- package/dist/chunk-04778wzq.js +0 -2
- package/dist/chunk-0ppwk6y9.js +0 -2
- package/dist/chunk-0yngh0w6.js +0 -2
- package/dist/chunk-1fnfd1yv.js +0 -2
- package/dist/chunk-1jd0p7b8.js +0 -2
- package/dist/chunk-2jkv90n6.js +0 -2
- package/dist/chunk-3c9se1ha.js +0 -2
- package/dist/chunk-3zr6f9nd.js +0 -4
- package/dist/chunk-43s8pmw9.js +0 -2
- package/dist/chunk-4r8pqg1h.js +0 -2
- package/dist/chunk-52y91amb.js +0 -2
- package/dist/chunk-5s0k93vr.js +0 -3
- package/dist/chunk-6aj4cgfs.js +0 -2
- package/dist/chunk-723kazw5.js +0 -2
- package/dist/chunk-79qh74jn.js +0 -2
- package/dist/chunk-7kxa1krk.js +0 -2
- package/dist/chunk-7xszqjre.js +0 -2
- package/dist/chunk-8at6403h.js +0 -2
- package/dist/chunk-90mq5g5a.js +0 -1
- package/dist/chunk-aazp5pw2.js +0 -2
- package/dist/chunk-adnpp676.js +0 -3
- package/dist/chunk-b5afm26d.js +0 -2
- package/dist/chunk-bbpjhe4e.js +0 -2
- package/dist/chunk-br1vyrce.js +0 -2
- package/dist/chunk-cc8cg69z.js +0 -4
- package/dist/chunk-csw1rzrc.js +0 -2
- package/dist/chunk-fdqfbhwd.js +0 -2
- package/dist/chunk-fjr7n326.js +0 -2
- package/dist/chunk-fwk2ayca.js +0 -2
- package/dist/chunk-g9vjpmrq.js +0 -2
- package/dist/chunk-gh1jdr70.js +0 -2
- package/dist/chunk-j420zak2.js +0 -2
- package/dist/chunk-mz8tjgre.js +0 -2
- package/dist/chunk-n2gm013f.js +0 -2
- package/dist/chunk-na5pcj57.js +0 -2
- package/dist/chunk-nvv8aheh.js +0 -2
- package/dist/chunk-nxnzrbrc.js +0 -2
- package/dist/chunk-pwsqw3mx.js +0 -2
- package/dist/chunk-q2v4hre7.js +0 -2
- package/dist/chunk-qhes5k0g.js +0 -2
- package/dist/chunk-qhj8374f.js +0 -2
- package/dist/chunk-rnxbtzg9.js +0 -2
- package/dist/chunk-rpzv6g89.js +0 -2
- package/dist/chunk-rqck9w0f.js +0 -2
- package/dist/chunk-sm16wn9x.js +0 -2
- package/dist/chunk-swq34ay7.js +0 -2
- package/dist/chunk-t12xpbtp.js +0 -3
- package/dist/chunk-t4vfpx6a.js +0 -2
- package/dist/chunk-t6z3khr5.js +0 -2
- package/dist/chunk-tac30kkh.js +0 -2
- package/dist/chunk-tdw5wrey.js +0 -2
- package/dist/chunk-thxz5zm6.js +0 -2
- package/dist/chunk-tvfmbabv.js +0 -2
- package/dist/chunk-twrdy8cb.js +0 -2
- package/dist/chunk-tz1redf7.js +0 -3
- package/dist/chunk-tzr6phth.js +0 -2
- package/dist/chunk-v066qn38.js +0 -2
- package/dist/chunk-v2m44e5f.js +0 -2
- package/dist/chunk-x5cv0bfc.js +0 -4
- package/dist/chunk-xdrwsxqy.js +0 -2
- package/dist/chunk-xx0hs7b3.js +0 -2
- package/dist/chunk-yaxe4yd4.js +0 -2
- package/dist/chunk-yfnnrm9g.js +0 -7
- package/dist/chunk-zfsbhwe1.js +0 -2
- package/dist/import.d.ts +0 -1
- package/dist/import.js +0 -1
package/README.md
CHANGED
|
@@ -399,7 +399,7 @@ Use the matching request's error chain and proxy steps to identify the failing c
|
|
|
399
399
|
`stageEmojiData(directory)` from `@alwith/module-chat/stage` copies the bundled Emojibase data (`en`, `zh`) the collection emoji picker loads; serve it at the host's `emojibaseUrl` (U: `public/emojibase`).
|
|
400
400
|
|
|
401
401
|
|
|
402
|
-
Applications import protocol clients and session projections from `@alwith/module-chat/client
|
|
402
|
+
Applications import protocol clients and session projections from `@alwith/module-chat/client` and build-time `stageChatAdapter(directory, licenses)` from `@alwith/module-chat/stage`. The chat package owns the adapter dependency and resolves it relative to its own installation; applications must not declare it separately or reach into a hoisted `node_modules` path. Staging preserves the published adapter bytes and includes both license notices. Runtime remains responsible for process ownership.
|
|
403
403
|
|
|
404
404
|
### Application tools
|
|
405
405
|
|
package/dist/activity-host.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ws,c,O}from"./chunk-c13rnm7b.js";export{ws as ActivityHostProvider,O as ActivityMarkdown,c as useActivityHost};
|
package/dist/agent/client.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type * as acp from "@agentclientprotocol/sdk/experimental/v2/unstable";
|
|
2
2
|
import { type RuntimeClient, type SessionRunState } from "@alwith/api";
|
|
3
|
-
import { type CodexClientState, type ForkOptions, type ForkOrigin, type NewSessionOptions, type PendingAction, type PromptOptions, type ReplayScope, type Session, type SessionOperation, type SessionRequestOptions, type SessionSummary } from "@nyssance/codex-acp-v2/client";
|
|
4
|
-
import type
|
|
3
|
+
import { type Agent, type AgentRequest, type AppsInstalledParams, type ClientOptions as AdapterOptions, CodexClient as AdapterClient, type CodexClientState, type ForkOptions, type ForkOrigin, type NewSessionOptions, type PendingAction, type PromptOptions, type ReplayScope, type Session, type SessionOperation, type SessionRequestOptions, type SessionSummary } from "@nyssance/codex-acp-v2/client";
|
|
4
|
+
import { type ApplicationSessionOptions, type ApplicationTools } from "../application-tools";
|
|
5
5
|
import { type ImageSelection } from "../image";
|
|
6
|
-
import { ApplicationClient as CodexAcpClient, type ClientOptions as BaseClientOptions } from "./application-client";
|
|
7
6
|
import { type SessionInputConfig, type SessionInputConfigSnapshot } from "./input-config";
|
|
8
7
|
import { type InputMode } from "./input-modes";
|
|
9
8
|
export type { ForkOrigin, PendingAction };
|
|
@@ -21,7 +20,8 @@ export type Launch = {
|
|
|
21
20
|
engine: string;
|
|
22
21
|
[key: string]: unknown;
|
|
23
22
|
};
|
|
24
|
-
export type ClientOptions =
|
|
23
|
+
export type ClientOptions = AdapterOptions & {
|
|
24
|
+
applicationTools?: ApplicationTools;
|
|
25
25
|
resolveModel?: (model: string | null, purpose: "session" | "draft") => Promise<string | null>;
|
|
26
26
|
imageService?: {
|
|
27
27
|
inputMode: (sessionId: string) => Promise<InputMode>;
|
|
@@ -41,7 +41,9 @@ export type AppState = CodexClientState & {
|
|
|
41
41
|
sessionWindows: Record<string, DraftOwner>;
|
|
42
42
|
draftSessions: Record<string, DraftOwner>;
|
|
43
43
|
};
|
|
44
|
-
export declare class CodexClient extends
|
|
44
|
+
export declare class CodexClient extends AdapterClient<AppState> {
|
|
45
|
+
private readonly applicationRegistry;
|
|
46
|
+
private readonly toolSelection;
|
|
45
47
|
executeShell(sessionId: string, command: string): Promise<void>;
|
|
46
48
|
private readonly modelListeners;
|
|
47
49
|
private readonly confirmedModelListeners;
|
|
@@ -73,7 +75,7 @@ export declare class CodexClient extends CodexAcpClient<AppState> {
|
|
|
73
75
|
protected promptMeta(id: string, options: PromptOptions): Record<string, unknown> | undefined;
|
|
74
76
|
private readonly promptImages;
|
|
75
77
|
promptWithImages(id: string, prompt: acp.ContentBlock[], options?: PromptOptions): Promise<string>;
|
|
76
|
-
|
|
78
|
+
private applicationToolsFor;
|
|
77
79
|
private releaseImages;
|
|
78
80
|
protected onDisconnected(): void;
|
|
79
81
|
cancel(id: string): Promise<void>;
|
|
@@ -90,12 +92,26 @@ export declare class CodexClient extends CodexAcpClient<AppState> {
|
|
|
90
92
|
private replayWithEffort;
|
|
91
93
|
connect(): Promise<void>;
|
|
92
94
|
listProjectSessions(cwd: string): Promise<SessionSummary[]>;
|
|
93
|
-
newSession(cwd?: string, model?: string | null | NewSessionOptions, owner?: DraftOwner): Promise<string>;
|
|
95
|
+
newSession(cwd?: string, model?: string | null | (NewSessionOptions & ApplicationSessionOptions), owner?: DraftOwner): Promise<string>;
|
|
94
96
|
private createNativeSession;
|
|
95
|
-
open(id: string, cwd: string, owner?: DraftOwner |
|
|
97
|
+
open(id: string, cwd: string, owner?: DraftOwner | ApplicationSessionOptions): Promise<void>;
|
|
96
98
|
private replayForOwner;
|
|
97
|
-
protected requestContext(cwd: string, operation: SessionOperation, options: SessionRequestOptions): ReturnType<
|
|
99
|
+
protected requestContext(cwd: string, operation: SessionOperation, options: SessionRequestOptions): ReturnType<AdapterClient<AppState>["requestContext"]>;
|
|
98
100
|
private requestModelContext;
|
|
101
|
+
private requestToolContext;
|
|
102
|
+
protected acceptsPendingRequest(request: AgentRequest): boolean;
|
|
103
|
+
protected handleNotification(method: string, params: unknown): boolean;
|
|
104
|
+
protected handleAgentRequest(agent: Agent, request: AgentRequest): boolean;
|
|
105
|
+
installedApps(params?: AppsInstalledParams): Promise<{
|
|
106
|
+
apps: {
|
|
107
|
+
id: string;
|
|
108
|
+
runtimeName: string | null;
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
callable: boolean;
|
|
111
|
+
iconUrl?: string | null | undefined;
|
|
112
|
+
iconUrlDark?: string | null | undefined;
|
|
113
|
+
}[];
|
|
114
|
+
}>;
|
|
99
115
|
protected recoverReplay(id: string, cwd: string, error: unknown, scope: ReplayScope): Promise<boolean>;
|
|
100
116
|
markAccountModelsUnavailable(ids: readonly string[]): void;
|
|
101
117
|
resumeModel(id: string, model: string): Promise<void>;
|
package/dist/agent/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b,Ui}from"../chunk-kbax1frf.js";import"../chunk-ad53zbdb.js";import"../chunk-e13mpwt8.js";import"../chunk-q7jm6srr.js";import"../chunk-x8rfc6wc.js";import"../chunk-jn8b4qrh.js";import"../chunk-7tw7rn0m.js";import"../chunk-nrpgmawz.js";import"../chunk-bw3bpr6m.js";import"../chunk-621eg04b.js";import"../chunk-rd9cgt8p.js";import"../chunk-n6erf29r.js";import"../chunk-e1fzfaqj.js";import"../chunk-etvdqkvb.js";import"../chunk-6z3fgkkp.js";import"../chunk-rv3k0kfr.js";export{Ui as CodexClient,b as NATIVE_MODEL_GROUP};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ao}from"../chunk-e13mpwt8.js";export{ao as customModelEffort};
|
package/dist/agent/fork-title.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{En}from"../chunk-nrpgmawz.js";export{En as forkTitle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{zi,lo,Vi}from"../chunk-x8rfc6wc.js";export{zi as IMAGE_WORKFLOW_INSTRUCTIONS,Vi as imageGenerationPrompt,lo as imageRequestAspect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gi}from"../chunk-q7jm6srr.js";import"../chunk-x8rfc6wc.js";import"../chunk-n6erf29r.js";import"../chunk-6z3fgkkp.js";import"../chunk-rv3k0kfr.js";export{Gi as createImageTool};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ji,Nn}from"../chunk-jn8b4qrh.js";export{ji as parseInputConfig,Nn as parseInputSnapshot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{qi}from"../../chunk-e1fzfaqj.js";import"../../chunk-etvdqkvb.js";export{qi as chatInputMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{co}from"../../chunk-bw3bpr6m.js";export{co as executionMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xt}from"../../chunk-etvdqkvb.js";export{xt as imageApplicationContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fe}from"../../chunk-rd9cgt8p.js";import"../../chunk-n6erf29r.js";import"../../chunk-etvdqkvb.js";import"../../chunk-rv3k0kfr.js";export{fe as imageInputMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ot,Ge,va}from"../../chunk-621eg04b.js";import"../../chunk-rd9cgt8p.js";import"../../chunk-n6erf29r.js";import"../../chunk-e1fzfaqj.js";import"../../chunk-etvdqkvb.js";import"../../chunk-rv3k0kfr.js";export{Ge as inputModeDefinition,ot as isInputMode,va as resolveInputMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ks}from"../chunk-zv3bm3np.js";export{ks as macProjectPaths};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ge,An,ha}from"../chunk-7tw7rn0m.js";export{ha as explainRequestError,ge as isAuthenticationRequired,An as isModelSelectionRequired};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ss}from"../chunk-52wrk1mh.js";export{Ss as watchSessionList};
|
package/dist/app-reference.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{be}from"./chunk-7m83dwzq.js";import"./chunk-beccgzp9.js";import"./chunk-4vayk46h.js";export{be as AppReferenceBadge};
|
|
@@ -16,10 +16,13 @@ export type ApplicationTool = {
|
|
|
16
16
|
autoApprove?: (sessionId: string) => boolean;
|
|
17
17
|
execute: (input: unknown, context: ApplicationToolContext) => Promise<ApplicationToolResult> | ApplicationToolResult;
|
|
18
18
|
};
|
|
19
|
+
export type ApplicationSessionOptions = SessionRequestOptions & {
|
|
20
|
+
applicationTools?: readonly ApplicationTool[];
|
|
21
|
+
};
|
|
19
22
|
export type ApplicationToolSelection = {
|
|
20
23
|
cwd: string;
|
|
21
24
|
operation: SessionOperation;
|
|
22
|
-
options:
|
|
25
|
+
options: ApplicationSessionOptions;
|
|
23
26
|
};
|
|
24
27
|
export type ApplicationTools = readonly ApplicationTool[] | ((selection: ApplicationToolSelection) => readonly ApplicationTool[] | Promise<readonly ApplicationTool[]>);
|
|
25
28
|
export declare function defineApplicationTool<T>(tool: Omit<ApplicationTool, "execute"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Rn,Ln,po}from"./chunk-6z3fgkkp.js";export{po as ApplicationToolRegistry,Ln as applicationToolSet,Rn as defineApplicationTool};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bi,to,Ye,rn}from"../chunk-byvw0vam.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as A}from"cn";import{useCallback as T,useEffect as I,useLayoutEffect as L,useMemo as q,useRef as G,useState as C}from"react";import{createPortal as V}from"react-dom";import{Badge as W}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as H}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Input as M}from"@nyssance/shadcn/vega/components/ui/input";import{Label as O}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as K,RadioGroupItem as _}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Textarea as X}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as s,jsxs as d}from"react/jsx-runtime";var l="__other__";function de({current:n,total:U,anchorRef:x,t:u,onAccept:P,onDecline:Q}){let p=q(()=>n?bi(n.requestedSchema):[],[n]),[b,g]=C({}),S=G(null);I(()=>{if(n?.elicitationId===void 0)return;let e={};for(let{key:r,property:i}of p)if(!Ye(i)){let c=rn(i)[0];if(c)e[r]={selected:c.value}}g(e)},[n?.elicitationId,p]),I(()=>{if(n?.elicitationId!==void 0&&S.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")S.current.focus()},[n?.elicitationId]);let[w,R]=C(null),[k,z]=C(null),N=T(()=>{let e=x.current;if(!e)return;let r=e.getBoundingClientRect();if(r.width===0){let i=Math.min(640,window.innerWidth*0.9);R({left:(window.innerWidth-i)/2,width:i,bottom:24});return}R({left:r.left,width:r.width,bottom:window.innerHeight-r.bottom+20})},[x]);L(()=>{if(!n)return;let e=0,r=()=>{if(x.current){N();return}e=requestAnimationFrame(r)};return r(),()=>cancelAnimationFrame(e)},[n,N,x]),L(()=>{let e=x.current;if(!n||!e||!k)return;return j(e,k,N,{animationFrame:!0})},[n,k,x,N]);let y=q(()=>{if(!n)return!1;for(let{key:e,property:r}of p){let i=b[e];if(!i)return!1;if(Ye(r)){if(!i.selectedSet||i.selectedSet.size===0)return!1;if(i.selectedSet.has(l)&&!i.otherText?.trim())return!1}else{if(!i.selected)return!1;if(i.selected===l&&!i.otherText?.trim())return!1}}return!0},[n,p,b]),D=T(async()=>{if(!n)return;if(!y)return;let e={},r={};for(let{key:i,property:c}of p){let a=b[i];if(!a)continue;let f;if(Ye(c))e[i]=[...a.selectedSet??[]].map((m)=>m===l?(a.otherText??"").trim():m).filter(Boolean);else{let m=a.selected??"";if(e[i]=m===l?(a.otherText??"").trim():m,m!==l)f=rn(c).find((t)=>t.value===m)?.preview}let v=a.notes?.trim();if(f||v)r[i]={...f&&{preview:f},...v&&{notes:v}}}await P(n.elicitationId,e,r)},[n,p,b,y,P]),F=T(async()=>{if(n)await Q(n.elicitationId)},[n,Q]);if(!n||!w)return null;return V(d("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(e)=>{if(e.key==="Escape")e.preventDefault(),F()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:w.left,width:w.width,bottom:w.bottom,maxHeight:"70vh"},ref:(e)=>{S.current=e,z(e)},children:[d("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:u("askUserQuestion.title")}),U>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${U}`})]}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:p.map(({key:e,property:r},i)=>{let c=b[e],a=c?.selected,f=c?.selectedSet??new Set,v=rn(r),m=Ye(r);return d("div",{className:"space-y-2",children:[d("div",{className:"flex items-center gap-2",children:[s(W,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:to(r).title??e}),s("div",{className:"text-foreground text-sm font-medium",children:to(r).description})]}),m?d("div",{className:"space-y-1.5 ps-1",children:[v.map((t)=>d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(t.value),onCheckedChange:(o)=>{g((h)=>{let E=new Set(h[e]?.selectedSet??new Set);if(o)E.add(t.value);else E.delete(t.value);return{...h,[e]:{...h[e],selectedSet:E}}})}}),d("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs",children:t.description})]})]},t.value)),d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(l),onCheckedChange:(t)=>{g((o)=>{let h=new Set(o[e]?.selectedSet??new Set);if(t)h.add(l);else h.delete(l);return{...o,[e]:{...o[e],selectedSet:h}}})}}),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:u("askUserQuestion.other")})]}),f.has(l)&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}):d(K,{value:a??"",onValueChange:(t)=>g((o)=>({...o,[e]:{...o[e],selected:t}})),className:"space-y-1.5 ps-1",children:[v.map((t)=>{let o=`${i}:${t.value}`;return d("div",{className:A("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",a===t.value&&"bg-muted/60"),children:[s(_,{value:t.value,id:o}),d(O,{htmlFor:o,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:t.description})]})]},t.value)}),d("div",{className:A("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",a===l&&"bg-muted/60"),children:[s(_,{value:l,id:`${i}:other`,className:"mt-0.5"}),s(O,{htmlFor:`${i}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:u("askUserQuestion.other")})]}),a===l&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}),!m&&a&&a!==l&&(()=>{let t=v.find((o)=>o.value===a)?.preview;if(!t)return null;return s("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:t})})(),v.some((t)=>t.preview)&&s(X,{placeholder:u("askUserQuestion.notesPlaceholder"),value:c?.notes??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],notes:t.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},e)})})}),d("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(B,{variant:"ghost",size:"sm",onClick:()=>void F(),children:u("askUserQuestion.cancel")}),s(B,{size:"sm",disabled:!y,onClick:()=>void D(),children:u("askUserQuestion.submit")})]})]}),document.body)}export{de as ChoiceElicitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bi,to,Ye,rn}from"../chunk-byvw0vam.js";export{bi as elicitationFields,to as elicitationLabels,rn as elicitationOptions,Ye as isMultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aa,_i,ja,$a}from"../chunk-q9b2wsdg.js";export{aa as PERMISSION_KIND_GROUP_ORDER,ja as isAllowKind,$a as isAlwaysKind,_i as sortPermissionOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ki}from"../chunk-0s2zcz5f.js";import"../chunk-q9b2wsdg.js";export{ki as PermissionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Pa,la,Ia,Pi}from"../chunk-809b75k1.js";export{Pi as SchemaElicitationForm,Pa as elicitationFields,la as initialValues,Ia as isAnswered};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Si}from"../chunk-x2wcwpw3.js";export{Si as UrlElicitationCard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{M}from"./chunk-pxv38ttf.js";import{o}from"./chunk-rragk2vb.js";import{At}from"./chunk-zj7kjjdj.js";import{x,ee}from"./chunk-w5q2ygsa.js";import{e}from"./chunk-n32wra9r.js";import{oo}from"./chunk-mvnze5ts.js";import{ChevronDownIcon as A,ChevronRightIcon as G,GitBranchIcon as X,Loader2Icon as F,SquareIcon as Y}from"lucide-react";import{useCallback as Z,useEffect as ss,useId as J,useRef as L,useState as N}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as p,Fragment as ns}from"react/jsx-runtime";function no(s,l){let d=o((u)=>u.sessions),r=o((u)=>u.actions),[S,m]=N(()=>new Set);return(u)=>{let c=l?.(u)??null,a=oo(s.id,u,d,r,s);if(a.length===0)return c;let h=`${s.id}:${u.key}`;return{active:c?.active===!0||a.some((i)=>i.status==="running"||i.status==="requires_action"),defaultExpanded:c?.defaultExpanded===!0||S.has(h),content:p(ns,{children:[t(wi,{sessionId:s.id,turn:u,parent:s,tasks:a,onExpand:()=>m((i)=>i.has(h)?i:new Set([...i,h]))}),c?.content]})}}}function wi({sessionId:s,turn:l,parent:d,tasks:r,onExpand:S}){let{host:m}=e(),u=o((n)=>n.sessions),c=o((n)=>n.actions),a=r??oo(s,l,u,c,d),h=a.some((n)=>n.status==="running"),i=a.some((n)=>n.status==="running"||n.status==="requires_action"),[f,k]=M(`subagents:${s}:${l.key}`,i,!0),w=J();if(a.length===0)return null;let g=new Map;for(let n of a)g.set(n.status,(g.get(n.status)??0)+1);let v=[...g].map(([n,E])=>`${m.t(`subagents.${n}`)} ${E}`).join(" · ");return p("section",{"data-subagent-sessions":!0,"data-subagent-turn":l.key,"aria-label":m.t("subagents.group"),className:"my-2 min-w-0",children:[p(C,{variant:"ghost",size:"sm",className:"text-muted-foreground h-auto min-h-8 max-w-full justify-start gap-2 text-xs","aria-expanded":f,"aria-controls":w,onClick:()=>{if(!f)S?.();k(!f)},children:[f?t(A,{className:"size-3.5 shrink-0"}):t(G,{className:"size-3.5 shrink-0"}),h?t(F,{className:"size-3.5 shrink-0 motion-safe:animate-spin","aria-hidden":"true"}):t(X,{className:"size-3.5 shrink-0"}),p("span",{className:"shrink-0",children:[m.t("subagents.group")," · ",a.length]}),t("span",{className:"truncate",role:"status",children:v})]}),t("div",{id:w,hidden:!f,className:"border-border ms-3 min-w-0 border-s ps-2",children:a.map((n)=>t(es,{task:n,cwd:d?.cwd??u[s]?.cwd??"",visible:f,stateKey:`${s}:${l.key}:${n.key}`,onRead:()=>{S?.(),k(!0)}},n.key))})]})}function O(s,l){if(!l)return s;let d=new Map(s.items.map((r)=>[`${r.kind}:${r.id}`,r]));for(let r of l.items)d.set(`${r.kind}:${r.id}`,r);return{...s,...l,items:[...d.values()]}}function es({task:s,cwd:l,stateKey:d,visible:r,onRead:S}){let{client:m,host:u}=e(),{t:c}=u,a=s.session,h=o((b)=>b.connection==="ready"),[i,f]=M(`subagent:${d}`,!1),[k,w]=N(!1),[g,v]=N(null),[n,E]=N(null),[I,Q]=N(null),[R,P]=N(!1),B=L(!1),_=L(!1),j=J(),q=a&&x(a.configOptions,"model"),z=s.title??c("subagents.untitled"),W=n?O(n,a):a,U=h&&a?.attached&&a.subagent?.capabilities?.cancel!=null&&(s.status==="running"||s.status==="requires_action"),H=s.threadId,D=a?.cwd??l,T=Z(async(b)=>{if(!m.readSubagentHistory||H===null||B.current)return;_.current=!0,B.current=!0,P(!0),v(null);try{let y=await m.readSubagentHistory(H,D,b);E((K)=>K===null?y.session:O(y.session,K)),Q(y.cursor)}catch(y){v(y instanceof Error?y.message:String(y))}finally{B.current=!1,P(!1)}},[m,H,D]);ss(()=>{if(r&&i&&!_.current)T(null)},[r,i,T]);let V=async()=>{if(!a)throw Error("A live child session is required for cancellation");w(!0),v(null);try{await m.cancel(a.id)}catch(b){v(b instanceof Error?b.message:String(b))}finally{w(!1)}};return p("section",{"aria-label":z,className:"min-w-0",children:[p("div",{className:"flex min-w-0 items-center gap-1",children:[p(C,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start gap-2","aria-label":`${z} · ${c(`subagents.${s.status}`)}`,"aria-expanded":i,"aria-controls":j,onClick:()=>{if(!i)S();f(!i)},children:[i?t(A,{className:"size-3.5 shrink-0"}):t(G,{className:"size-3.5 shrink-0"}),t("span",{className:"truncate",children:z}),t("span",{className:"text-muted-foreground ms-auto shrink-0 text-xs",role:"status",children:c(`subagents.${s.status}`)})]}),U&&t(C,{variant:"ghost",size:"icon-sm",disabled:k,"aria-label":c("subagents.cancel",{name:z}),onClick:()=>{V()},children:k?t(F,{className:"size-3.5 animate-spin"}):t(Y,{className:"size-3.5"})})]}),g&&!i&&t("p",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:g}),p("div",{id:j,hidden:!i,className:"min-w-0 ps-4",children:[(s.description||q)&&p("div",{className:"text-muted-foreground flex min-w-0 items-center gap-2 px-2 py-1 text-xs",children:[t("span",{className:"min-w-0 flex-1 truncate",title:s.description??void 0,children:s.description}),q&&t("span",{className:"shrink-0",children:ee(q)})]}),g&&p("div",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:[g," ",s.threadId&&t(C,{variant:"ghost",size:"sm",onClick:()=>{T(n===null?null:I)},children:c("timeline.retry")})]}),R&&t("p",{role:"status",className:"text-muted-foreground px-2 py-2 text-xs",children:c("timeline.loadingEarlier")}),I&&t(C,{variant:"ghost",size:"sm",disabled:R,onClick:()=>{T(I)},children:c("timeline.loadEarlier")}),r&&i&&(W&&W.items.length>0?t("div",{className:"flex max-h-72 min-h-0 flex-col",children:t(ts,{session:W})}):!R&&!g&&t("p",{className:"text-muted-foreground px-2 py-3 text-xs",children:c("subagents.noMessages")}))]})]})}function ts({session:s}){let{client:l,host:d}=e(),r=no(s);return t(At,{session:s,client:l,host:d,turnWork:r})}
|
|
2
|
+
export{no,wi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{u}from"./chunk-stv8pr4v.js";import{cn as o}from"cn";import{motion as v}from"motion/react";import{jsx as i,jsxs as g}from"react/jsx-runtime";function ut({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&u,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function Vs({tabs:n,view:r,onViewChange:s,onReset:a,notifications:l,trailing:p,className:d}){return g("div",{className:o("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",d),children:[i("div",{role:"tablist",className:"bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-52 flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]",children:n.map((e)=>{let t=r===e.key;return g(ut,{role:"tab",active:t,expanded:t,highlight:!1,"aria-selected":t,title:e.title,onClick:()=>s(e.key),onDoubleClick:a&&(()=>a(e.key)),className:o("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-[18px] [&_svg]:shrink-0",t?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[t&&i(v.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-destructive pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:o("relative z-10 grid",t?"ms-1.5 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})}),p!=null&&i("div",{className:"ms-auto flex shrink-0 items-center gap-0.5",children:p})]})}
|
|
2
|
+
export{ut,Vs};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Zn}from"./chunk-beccgzp9.js";import{be}from"./chunk-7m83dwzq.js";import{rs}from"./chunk-27gr882d.js";import{w,Ut}from"./chunk-q1kb5z75.js";import{t}from"./chunk-rragk2vb.js";import{bs,Cs}from"./chunk-masqfje4.js";import{D}from"./chunk-4gftpery.js";import{xe}from"./chunk-ert67qk1.js";import{isEmbeddedResource as g,isImage as x,isResourceLink as R,isText as h}from"@nyssance/codex-acp-v2/client";import{memo as v}from"react";import{jsx as i,jsxs as y}from"react/jsx-runtime";var is=v(function({item:n,messageTime:f,skillNames:u=[]}){let p=t(),r=Cs(n._meta),m=r?r.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
|
+
${e.text}`).join(`
|
|
3
|
+
`):xe(n),l=n.content.filter(x),d=new Set(Ut(m).map((e)=>e.id)),o=new Map,a=n.content.filter((e)=>{if(R(e)){let s=w(e.uri);if(s!==null){if(!d.has(s))o.set(s,{id:s,name:e.title??e.name});return!1}return!0}return g(e)}),c=r??n.content.filter(h).map((e)=>{let s=bs(e._meta);return s?{question:s.question,text:s.answer}:{text:e.text}});if(m.length===0&&l.length===0&&a.length===0&&o.size===0)return null;return y("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":n.id,children:[a.length>0&&i("div",{className:"codex-user-mentions",children:a.map((e,s)=>i(D,{block:e},`${n.id}:${s}`))}),i(Zn,{value:{names:u,icon:p.skillIcon},children:i(rs,{host:p,message:n,text:m,textParts:c.some((e)=>("question"in e))?c:void 0,applicationReferences:o.size>0?i("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:[...o.values()].map((e)=>i(be,{app:e},e.id))}):void 0,images:l,mentions:[],messageTime:f})})]})});
|
|
4
|
+
export{is};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{t}from"./chunk-rragk2vb.js";import{xn}from"./chunk-ax7c2kam.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Ni({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:xn(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:xn(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
|
|
2
|
+
export{Ni};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{_i}from"./chunk-q9b2wsdg.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as _,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as h,useId as T,useLayoutEffect as N,useRef as S,useState as p}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as f}from"react/jsx-runtime";var U={allow_once:{icon:_},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function ki({requestId:u,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,v]=p(0),[s,x]=p(null),[l,A]=p(null),g=S(null),c=_i(D);h(()=>{v(0)},[u]),h(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)g.current?.focus()},[u,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);x({left:(window.innerWidth-o)/2,width:o,bottom:24});return}x({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(N(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[u,n,d]),N(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=f("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border flex min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[i("div",{"data-permission-header":!0,className:"shrink-0 px-3 pt-2",children:f("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}`})]})}),i("div",{"data-permission-content":!0,className:"min-h-0 flex-1 overflow-auto overscroll-contain px-3 pb-2",children:P}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:g,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),v((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:"border-border shrink-0 border-t outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??_,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return f("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{ki};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ce}from"./chunk-dr5swvaa.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=Ce();function Do(f,m){let i=new Set;for(let e of m){if(e.kind!=="tool"||e.status!=="completed")continue;let o=e.content.filter(u);if(!o.some((n)=>c(n.content)))continue;o.forEach((n,a)=>{if(c(n.content))i.add(`${e.id}:${a}`);if(!s(n.content))return;let r;try{r=JSON.parse(n.content.text)}catch(t){if(t instanceof SyntaxError)return;throw t}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let t of r.images)if(t!==null&&typeof t==="object"&&typeof t.reference==="string")i.add(t.reference)})}if(i.size===0)return f;return f.map((e)=>{if(!s(e)||!e.text.includes("!["))return e;let o=d.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let a=0;return n.tokens.map((t)=>(a+=t.raw.length,t.type==="image"&&i.has(t.href)?"":t.raw)).join("")+n.raw.slice(a)}).join("");return o===e.text?e:{...e,text:o}}).filter((e)=>!s(e)||e.text.trim().length>0)}
|
|
2
|
+
export{Do};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{So}from"./chunk-h82jte5p.js";import{hr}from"./chunk-yj42tq3z.js";import{y}from"./chunk-rragk2vb.js";import{at,ns}from"./chunk-sjm9p42x.js";import{e}from"./chunk-n32wra9r.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function sa(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function an({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=y(at,(r)=>r),w=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),S=s((r)=>u.sessionId===t?So(u.turns,r,u.terminals):[],[u,t]),b=s((r,i)=>ns(t,r,i),[t]),g=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,E=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(hr,{placement:"body",getViewport:w,findSourceMatches:S,revealTurn:b,prepareSource:g,subscribeOpen:E,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
|
|
2
|
+
export{sa,an};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Xo=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<defs>
|
|
3
3
|
<linearGradient id="plugin-agent-mode-paint0_linear_1_1034" x1="30.0398" y1="40.0728" x2="11.3112" y2="-1.39757" gradientUnits="userSpaceOnUse">
|
|
4
4
|
<stop stop-color="#2BBFFF"/>
|
|
@@ -1286,4 +1286,4 @@ var qr=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
|
1286
1286
|
</symbol>
|
|
1287
1287
|
</svg>
|
|
1288
1288
|
`;
|
|
1289
|
-
export{
|
|
1289
|
+
export{Xo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{L}from"./chunk-3tvq6xr2.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function er({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(L,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
|
|
2
|
+
export{er};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function Ft({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{Ft};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ss}from"./chunk-dxwbgg69.js";import{CheckIcon as M,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 v(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 N({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[u,m]=f(!1),[l,b]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=()=>{if(r.scrollHeight===0){m(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");m(r.scrollHeight>A*x+1)};d();let t=new ResizeObserver(d);return t.observe(r),()=>t.disconnect()},[]),k(()=>{if(!u||l)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=new Map,t=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let y=g.target;if(!d.has(y))continue;v(y,g.isIntersecting&&g.intersectionRatio>=1,d.get(y))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let i of d.keys()){if(r.contains(i))continue;t?.unobserve(i),d.delete(i)}for(let i of r.querySelectorAll(L)){if(d.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");d.set(i,g),v(i,t===null&&R(i,r),g),t?.observe(i)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{t?.disconnect(),C.disconnect();for(let[i,g]of d)v(i,!0,g)}},[u,l]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:u&&!l?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),u&&!l&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),u&&p("button",{type:"button","aria-expanded":l,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:l?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:l?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function Go({text:n,label:o,host:s}){let[a,c]=f(!1),[u,m]=f(null),l=async()=>{c(!1),m(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(b){m(String(b)),s?.onCopyError?.(b)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:u??o,onClick:()=>void l(),children:a?e(M,{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(ss,{src:c,alt:"",onClose:()=>a(!1)})]})}function rs({message:n,text:o,textParts:s,applicationReferences:a,mentions:c,images:u,messageTime:m,host:l,bubbleStyle:b}){let{t:r,openImage:d}=l;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:[c.length>0&&e("div",{className:"codex-user-mentions",children:c.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))}),u.length>0&&e("div",{className:"codex-user-images",children:u.map((t)=>e(S,{image:t,openImage:d},`${t.mimeType}:${t.data}`))}),(o.length>0||a)&&e(h,{children:p("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:b,children:[a,s?s.map((t,x)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(N,{text:t.text,host:l}):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})]})},x)):e(N,{text:o,host:l})]})}),p("div",{className:"codex-user-actions",children:[e(Go,{text:o,label:r("actions.copy"),host:l}),m&&e("span",{className:"codex-user-time",title:m.full,children:m.short})]})]})})}
|
|
2
|
+
export{Go,rs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Xo}from"./chunk-1d29gnb2.js";import{jsx as o}from"react/jsx-runtime";function $t(){return o("svg",{"aria-hidden":"true",focusable:"false",width:0,height:0,className:"pointer-events-none absolute",dangerouslySetInnerHTML:{__html:Xo}})}var n=["agent-mode","application-window","audiowave","bar-chart","block-stack-skills","book-open","briefcase","bubble-on-bubble","checkmark-circle","code","compass","components-window","credit-card","csv","document","docx","exclamationmark-bubble","figma-document","figure-text-document","file-video","flash","folder","game-controller","globe","heart","heart-bubble","heart-text-clipboard","hierarchy","jpg-document","kettlebell","ladybug","lightbulb","lightning-bolt","magnifingglass","map","mappin","microphone","ms-word-document","newspaper","paperclip","pdf-document","pencil","phone","photo","png-document","pointer","ppt-document","pptx","puzzle","radar","shield","shopping-bag","skill-creator","skill-installer","star-app","star-bookmark","template-creator","terminal","text-bubble-figure","text-document","text-document-lock","text-note-pointer","triangle-vercel","xls-document-excel","xlsx"];function Jo(t){let e=0;for(let r of t)e=(e*31+r.charCodeAt(0))%997;return`#plugin-${n[e%n.length]}`}function B({name:t,className:e="size-6 shrink-0"}){return o("svg",{"aria-hidden":"true",focusable:"false",width:36,height:36,viewBox:"0 0 36 36",className:e,children:o("use",{href:Jo(t)})})}
|
|
2
|
+
export{$t,Jo,B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-tac30kkh.js";import{An}from"./chunk-6j2q7qvk.js";import{D,Dt,se,Hn}from"./chunk-1dkd8jt0.js";import{Fn,He}from"./chunk-yey8qz6h.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function Qr({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ys({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=He(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(D[0]?.id??""),[F,B]=y(0),[U,A]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(D[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await Fn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=D.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||E)return;k(D[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(An,{bridge:d})]}),C&&t(Qr,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(Jr,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),D.map((o)=>t("div",{hidden:x!==o.id,children:t(Yr,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t($o,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t($o,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function Jr({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[D.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function Xr({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(Xr,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function Yr({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(se(s,d?.region)?.id),[U,A]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),z=Hn(s,F),K=F!==se(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(se(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?se(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:se(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function $o({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
1
|
+
import{e}from"./chunk-n32wra9r.js";import{Qt}from"./chunk-5m2ydb9j.js";import{R,Ct,se,Fn}from"./chunk-c2r7xpjf.js";import{In,Ue}from"./chunk-m799f2x5.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function ai({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(F,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(F,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ws({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=Ue(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(R[0]?.id??""),[K,U]=y(0),[z,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},E=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(R[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},B=async()=>{p("retry");try{let o=await In(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=R.find((o)=>o.id===x)??null,A=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||A)return;k(R[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Qt,{bridge:d})]}),C&&t(ai,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(F,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void B(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(li,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),R.map((o)=>t("div",{hidden:x!==o.id,children:t(di,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:z[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Yn,{provider:o,revision:c.revision,busy:b!==null,testResult:z[o.id],onTest:()=>I(o.id),onRemove:()=>E(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Yn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},K)})]})})]})}function li({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[R.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(F,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(F,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function ci({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(ci,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(F,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(F,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function di({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[K,U]=y(se(s,d?.region)?.id),[z,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),E=Fn(s,K),B=K!==se(s,x.saved?.region)?.id,P=z.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!B&&!P)k({saved:d,revision:u}),U(se(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,B,P]);let A=!v&&(T!==""||B||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=K,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),U((g)=>g===G?se(s,D?.region)?.id:g),M((g)=>g===z?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...K===void 0?{}:{region:K},...P?{baseUrl:z.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:K,onValueChange:(a)=>U(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),E!==null&&i(F,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(E)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&A)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(F,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:se(s,K)?.baseUrl??s.baseUrl,value:z,onChange:(a)=>M(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!A,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!A?S:void 0,children:i(F,{size:"sm",disabled:!A,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Yn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,K]=y(!1),[U,z]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
2
2
|
{ "label": "My Model", "api_id": "model-id" }
|
|
3
|
-
]`),[
|
|
4
|
-
export{
|
|
3
|
+
]`),[E,B]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),A=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),L=(m)=>{if(!m)try{J(Ct(I)),B(null)}catch(D){B(W(D));return}z(m)},G=async()=>{let m;try{m=Ct(I),B(null)}catch(g){B(W(g)),z(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[t(_,{htmlFor:A,children:n("provider.name")}),t(Z,{id:A,value:h,onChange:(m)=>c(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:o,children:n("provider.baseUrl")}),t(Z,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:r,children:n("provider.apiKey")}),i(H,{children:[t(q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>K((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(Q,{}),i(re,{open:U,onOpenChange:L,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(F,{variant:"ghost",size:"sm"}),children:[n(U?"provider.previewModels":"provider.editModels"),t(te,{className:j("size-4",U&&"rotate-180")})]})]}),!U&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:M.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(O,{className:"gap-2","data-invalid":E!==null,children:[t(_,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":E!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),B(null)}}),t(de,{id:`${f}-description`,className:j("text-xs",E&&"text-destructive"),role:E?"alert":void 0,children:E??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(F,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void G(),children:[u&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
|
|
4
|
+
export{ai,Ws,li,ci,di,Yn};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{U}from"./chunk-4vayk46h.js";import{yo,m,_,jn,xo,_t}from"./chunk-ry7bxdb6.js";import{mr,ho,gr,vo}from"./chunk-tcp7c2s0.js";import{Pt,It,$n}from"./chunk-a6ns5agq.js";import{ve,g}from"./chunk-sxz82jq3.js";import{cn as J}from"cn";import{forwardRef as q,useImperativeHandle as z,useLayoutEffect as M,useRef as p}from"react";import{jsx as j}from"react/jsx-runtime";var O=(r,E)=>r.text===E.text&&JSON.stringify(r.apps)===JSON.stringify(E.apps),fo=q((r,E)=>{let I=ve(),L=g(),s=p(null),N=p(null),a=p(_(m({text:I.textInput.value,apps:r.applications}))),d=p({start:r.initialCaret??m(a.current).length,end:r.initialCaret??m(a.current).length}),h=p(r.initialUndo?[{...r.initialUndo,selection:{start:Math.max(0,(r.initialCaret??1)-1),end:Math.max(0,(r.initialCaret??1)-1)}}]:[]),S=p([]),H=p(""),R=p(r.skillIcon),b=p(!1),x=p(!1),P=p(null),c=p({props:r,controller:I,attachments:L});c.current={props:r,controller:I,attachments:L};let f=()=>{if(s.current&&document.activeElement===s.current)d.current=gr(s.current,a.current.apps,d.current);return d.current},w=()=>{let e=s.current;if(!e)return;let t={...d.current};e.focus(),d.current=t,vo(e,t)},T=()=>({...a.current,selection:f()}),D=(e,t)=>{if(!s.current)return;if(mr(s.current,e,c.current.props.skillNames,c.current.props.skillIcon),R.current=c.current.props.skillIcon,H.current=JSON.stringify(c.current.props.skillNames??[]),s.current.dataset.empty=String(e.text.length===0&&e.apps.length===0),d.current=t,document.activeElement===s.current)vo(s.current,t)},C=(e,t,n=!0,l=!0)=>{if(l&&!O(a.current,e)){if(h.current.push(P.current??T()),h.current.length>100)h.current.shift();S.current=[]}if(P.current=null,a.current=e,d.current=t,n)D(e,t);c.current.props.onApplicationsChange(e.apps),c.current.controller.textInput.setInput(e.text)},y=(e)=>{let t=f(),n=m(a.current),l=m(e),i=new Set([...n.slice(0,t.start),...n.slice(t.end)].flatMap((k)=>typeof k==="string"?[]:[k.id])),u=l.filter((k)=>typeof k==="string"||!i.has(k.id)),o=_([...n.slice(0,t.start),...u,...n.slice(t.end)]),B=t.start+u.length;C(o,{start:B,end:B})},A=(e)=>{let n=(e?h.current:S.current).pop();if(!n)return;(e?S.current:h.current).push(T()),C({text:n.text,apps:n.apps},n.selection,!0,!1)},v=()=>{if(!s.current)return;let e=_(ho(s.current,a.current.apps)),t=f();if(b.current)return;let n=$n(e.text),l=n===e.text?e:_(m({text:n,apps:e.apps}));C(l,t,n!==e.text)};M(()=>{let e=s.current;if(!e)throw Error("Inline prompt input is missing");Object.defineProperties(e,{value:{configurable:!0,get:()=>a.current.text,set:(i)=>{a.current=_(m({text:i,apps:a.current.apps})),D(a.current,d.current)}},selectionStart:{configurable:!0,get:()=>jn(m(a.current),f().start)},selectionEnd:{configurable:!0,get:()=>jn(m(a.current),f().end)},setSelectionRange:{configurable:!0,value:(i,u)=>{let o=m(a.current);d.current={start:xo(o,i),end:xo(o,u)},D(a.current,d.current),e.dispatchEvent(new Event("select"))}},disabled:{configurable:!0,get:()=>Boolean(c.current.props.disabled)},form:{configurable:!0,get:()=>e.closest("form")}}),N.current=e,D(a.current,d.current),w();let n=()=>{f()},l=(i)=>{if(c.current.props.disabled){i.preventDefault();return}if(b.current||i.isComposing)return;if(i.inputType==="historyUndo"||i.inputType==="historyRedo")i.preventDefault(),A(i.inputType==="historyUndo");else if(i.inputType==="insertParagraph"||i.inputType==="insertLineBreak")i.preventDefault(),y({text:`
|
|
2
|
+
`,apps:[]});else P.current=T()};return e.addEventListener("beforeinput",l),e.addEventListener("change",v),document.addEventListener("selectionchange",n),()=>{e.removeEventListener("beforeinput",l),e.removeEventListener("change",v),document.removeEventListener("selectionchange",n),N.current=null}},[]),M(()=>{if(b.current)return;let e=_(m({text:I.textInput.value,apps:r.applications}));if(O(e,a.current)&&H.current===JSON.stringify(r.skillNames??[])&&R.current===r.skillIcon)return;let t=f();a.current=e,D(e,t)},[I.textInput.value,r.applications,r.skillNames,r.skillIcon]),z(E,()=>({focus:w,getTextarea:()=>N.current,isComposing:()=>b.current||x.current,resetHeight:()=>{h.current=[],S.current=[]},insertInvocation:(e)=>{w(),y({text:`${e} `,apps:[]})},insertApplication:(e)=>{if(w(),a.current.apps.some((t)=>t.id===e.id))return;y({text:"",apps:[{...e,offset:0}]})}}),[]);let F=(e)=>{if(b.current||x.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;if(c.current.props.onKeyDown?.(e),e.defaultPrevented)return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")){e.preventDefault(),A(e.key.toLowerCase()==="z"&&!e.shiftKey);return}if(e.key==="Enter"){if(e.preventDefault(),e.shiftKey)y({text:`
|
|
3
|
+
`,apps:[]});else{let t=s.current?.closest("form"),n=t?.querySelector('button[type="submit"]');if(n&&!n.disabled)t?.requestSubmit(n)}return}if(e.key==="Backspace"||e.key==="Delete"){let t=f(),n=m(a.current);if(t.start!==t.end){e.preventDefault(),y({text:"",apps:[]});return}let l=jn(n,t.start),i=U(a.current.text,c.current.props.skillNames??[]).find((o)=>e.key==="Backspace"?o.end===l:o.start===l);if(i){e.preventDefault();let o=t.start-(e.key==="Backspace"?i.name.length:0);C(_([...n.slice(0,o),...n.slice(o+i.name.length)]),{start:o,end:o});return}let u=e.key==="Backspace"?t.start-1:t.start;if(u>=0&&u<n.length&&typeof n[u]!=="string")e.preventDefault(),C(_([...n.slice(0,u),...n.slice(u+1)]),{start:u,end:u});else if(e.key==="Backspace"&&n.length===0){let o=c.current.attachments.files.at(-1);if(o)e.preventDefault(),c.current.attachments.remove(o.id)}}if(e.key.length===1&&e.key.charCodeAt(0)<32)e.preventDefault()},K=(e)=>{let t=f();if(t.start===t.end)return;let n=m(a.current).slice(t.start,t.end),l=_(n);if(e.preventDefault(),e.clipboardData.setData("text/plain",n.map((i)=>typeof i==="string"?i:`${i.name} `).join("")),e.clipboardData.setData(yo,JSON.stringify({version:1,...l})),e.type==="cut"&&!r.disabled)y({text:"",apps:[]})};return j("div",{ref:s,role:"textbox","aria-multiline":"true","aria-label":r["aria-label"],"aria-disabled":r.disabled||void 0,contentEditable:!r.disabled,suppressContentEditableWarning:!0,"data-chat-input":!0,"data-inline-input":!0,"data-placeholder":r.placeholder,"data-empty":a.current.text.length===0&&a.current.apps.length===0,className:J("bg-chat-input-bg data-[empty=true]:before:text-chat-input-placeholder relative max-h-(--chat-input-max-height) min-w-0 flex-1 overflow-y-auto p-0 pe-2.5 leading-(--chat-input-line-height) break-words whitespace-pre-wrap outline-none data-[empty=true]:before:pointer-events-none data-[empty=true]:before:absolute data-[empty=true]:before:content-[attr(data-placeholder)]",r.className),onInput:v,onKeyDown:F,onCompositionStart:()=>{P.current=T(),b.current=!0,x.current=!1},onCompositionEnd:()=>{b.current=!1,v(),x.current=!0,requestAnimationFrame(()=>{x.current=!1})},onPasteCapture:(e)=>r.onPasteCapture?.(e),onPaste:(e)=>{if(e.defaultPrevented||r.disabled)return;let{imageFiles:t,sawNonImageFile:n}=Pt(e.clipboardData.items);if(e.preventDefault(),t.length){L.add(t);return}if(n&&!It(e.clipboardData.items))return;y(_t(e.clipboardData)??{text:$n(e.clipboardData.getData("text/plain")),apps:[]})},onCopy:K,onCut:K,onDrop:(e)=>{e.preventDefault()}})});fo.displayName="PromptInputInline";
|
|
4
|
+
export{fo};
|