@alwith/module-chat 0.6.6 → 0.6.7
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/dist/activity-host.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-9ff3htdp.js → chunk-0d8j19ff.js} +2 -2
- package/dist/{chunk-9k4f13c1.js → chunk-0ne9v3vr.js} +2 -2
- package/dist/{chunk-x9y02vxj.js → chunk-0q9y4dw0.js} +2 -2
- package/dist/{chunk-aywszahf.js → chunk-0wzxv15n.js} +2 -2
- package/dist/{chunk-maa70rv4.js → chunk-0xtdc07w.js} +2 -2
- package/dist/{chunk-9hskky1n.js → chunk-14d60z29.js} +2 -2
- package/dist/{chunk-5azv8vz6.js → chunk-1940kkcm.js} +2 -2
- package/dist/{chunk-kds0mh8r.js → chunk-197rc8qr.js} +2 -2
- package/dist/{chunk-t3nzqbgd.js → chunk-19xcrm2x.js} +2 -2
- package/dist/{chunk-1b2jsf2v.js → chunk-1xsfk3pf.js} +2 -2
- package/dist/{chunk-7xe2v72q.js → chunk-23b01zzq.js} +2 -2
- package/dist/{chunk-aarpb5np.js → chunk-28737pjc.js} +2 -2
- package/dist/chunk-2f8t38fg.js +2 -0
- package/dist/{chunk-m9mvh1gy.js → chunk-2g2ydnbw.js} +2 -2
- package/dist/{chunk-1j1kjnmr.js → chunk-3365b0ne.js} +2 -2
- package/dist/{chunk-yq55kqn1.js → chunk-36m8zstj.js} +2 -2
- package/dist/{chunk-g4frp0r0.js → chunk-382tg8fq.js} +2 -2
- package/dist/{chunk-bjfcyfp5.js → chunk-3axrv16v.js} +2 -2
- package/dist/{chunk-yd6ae6py.js → chunk-3jfkrwjq.js} +2 -2
- package/dist/{chunk-n757ykt3.js → chunk-3n6qcrpw.js} +2 -2
- package/dist/{chunk-az434tgy.js → chunk-3wv9dsht.js} +2 -2
- package/dist/{chunk-gyps0vc5.js → chunk-3yqs97b3.js} +4 -4
- package/dist/{chunk-esnnbm10.js → chunk-47zq7h2n.js} +2 -2
- package/dist/{chunk-cm5rcd9q.js → chunk-4ezp99mv.js} +2 -2
- package/dist/{chunk-rch4xpj1.js → chunk-4ryn6szh.js} +2 -2
- package/dist/chunk-5akfmr5g.js +2 -0
- package/dist/{chunk-5vh4z4yp.js → chunk-5nj4s3yr.js} +2 -2
- package/dist/chunk-5p4kx6nx.js +2 -0
- package/dist/{chunk-n32f04qm.js → chunk-5tfyyc5a.js} +2 -2
- package/dist/{chunk-db0g8rr1.js → chunk-67t9pyqt.js} +2 -2
- package/dist/chunk-6h3yegwm.js +2 -0
- package/dist/{chunk-3mrdv5yq.js → chunk-6sbyy3f4.js} +2 -2
- package/dist/{chunk-w6wsxsqe.js → chunk-73099pzj.js} +2 -2
- package/dist/{chunk-zte40ebb.js → chunk-782289vj.js} +3 -3
- package/dist/{chunk-8wdkc41j.js → chunk-7n2gvnvs.js} +2 -2
- package/dist/{chunk-6d5c94rn.js → chunk-7phr0tnr.js} +2 -2
- package/dist/{chunk-7jx2k96e.js → chunk-85vqfa42.js} +2 -2
- package/dist/chunk-8c0f9agv.js +2 -0
- package/dist/chunk-8ckxhxqq.js +2 -0
- package/dist/{chunk-35z0nr4v.js → chunk-8x6gswg0.js} +2 -2
- package/dist/{chunk-6zcjn8ra.js → chunk-9c8j12m0.js} +2 -2
- package/dist/{chunk-x4qnkn8f.js → chunk-9fxfprgs.js} +2 -2
- package/dist/chunk-9gnce8bk.js +2 -0
- package/dist/{chunk-67x8znmk.js → chunk-9npcs7m3.js} +2 -2
- package/dist/chunk-a59zda76.js +2 -0
- package/dist/{chunk-rmcavyfy.js → chunk-as95eeg6.js} +2 -2
- package/dist/{chunk-gww5s2qx.js → chunk-b5wvtzdr.js} +2 -2
- package/dist/{chunk-bb1y2fy7.js → chunk-b701cxvn.js} +2 -2
- package/dist/{chunk-yf39xswe.js → chunk-b935g3j2.js} +2 -2
- package/dist/{chunk-3aadhvbj.js → chunk-bdsqfsmw.js} +2 -2
- package/dist/{chunk-bydgccyt.js → chunk-bj6eyqv2.js} +2 -2
- package/dist/{chunk-yr6ar090.js → chunk-bj7hfsbz.js} +1 -1
- package/dist/{chunk-6wv99fdt.js → chunk-bypzxwxt.js} +2 -2
- package/dist/{chunk-6wtrmxev.js → chunk-c843be1k.js} +3 -3
- package/dist/{chunk-6pwy0ncf.js → chunk-cawd39p2.js} +2 -2
- package/dist/{chunk-07srtfz3.js → chunk-cpn28aqq.js} +2 -2
- package/dist/{chunk-s3q7p41q.js → chunk-cvtkr08t.js} +2 -2
- package/dist/{chunk-7eq01k20.js → chunk-d1petgqq.js} +3 -3
- package/dist/{chunk-4xjzvwg4.js → chunk-d9c5361b.js} +2 -2
- package/dist/{chunk-9c8cyz7r.js → chunk-dfa9098c.js} +2 -2
- package/dist/{chunk-601kr76a.js → chunk-dzbshq7w.js} +2 -2
- package/dist/{chunk-mmm1rq2a.js → chunk-e159yyzf.js} +2 -2
- package/dist/{chunk-kgmyaenb.js → chunk-e8349nct.js} +2 -2
- package/dist/{chunk-be7ja8gh.js → chunk-ea6cx4zd.js} +3 -3
- package/dist/{chunk-4z9h6pyg.js → chunk-eaps0vme.js} +2 -2
- package/dist/{chunk-xhtpqc8p.js → chunk-ebvemv72.js} +2 -2
- package/dist/{chunk-sw76wk22.js → chunk-expcd42p.js} +3 -3
- package/dist/{chunk-brqgdzhr.js → chunk-eyqnxv1e.js} +2 -2
- package/dist/{chunk-wnsk4tw5.js → chunk-fd3p9rqe.js} +2 -2
- package/dist/{chunk-b5ywqwnr.js → chunk-fm2z743r.js} +2 -2
- package/dist/{chunk-yjk5a037.js → chunk-fwjdx5an.js} +2 -2
- package/dist/{chunk-d67ypca2.js → chunk-fytmxmdj.js} +2 -2
- package/dist/chunk-g8nphzck.js +2 -0
- package/dist/{chunk-9n028hnr.js → chunk-gbsqs904.js} +2 -2
- package/dist/{chunk-e32gcfck.js → chunk-gkvc394d.js} +2 -2
- package/dist/{chunk-tmkt2vsc.js → chunk-hd2kda2r.js} +2 -2
- package/dist/{chunk-abjr18n6.js → chunk-heqqsp62.js} +3 -3
- package/dist/{chunk-dj8e2ymr.js → chunk-hgar92ae.js} +2 -2
- package/dist/{chunk-5d2q0dtq.js → chunk-hq54ncad.js} +3 -3
- package/dist/{chunk-fkpmrb5t.js → chunk-hx3mqvkw.js} +2 -2
- package/dist/{chunk-wyjzpncq.js → chunk-hy5ansma.js} +2 -2
- package/dist/{chunk-nk266xxm.js → chunk-j8vz3m75.js} +2 -2
- package/dist/{chunk-t6c5ytp3.js → chunk-j9x200w4.js} +2 -2
- package/dist/{chunk-7zcr1wzv.js → chunk-jahh3cp4.js} +2 -2
- package/dist/{chunk-d61hz52g.js → chunk-jhhvtcp8.js} +2 -2
- package/dist/chunk-jkyepwr1.js +2 -0
- package/dist/{chunk-9gtfjqsq.js → chunk-jnsxjybz.js} +2 -2
- package/dist/{chunk-40hfefy2.js → chunk-jphjekr9.js} +2 -2
- package/dist/{chunk-3ynyx94d.js → chunk-jtxcskjs.js} +2 -2
- package/dist/{chunk-npsgbfh2.js → chunk-kjdjp3jp.js} +2 -2
- package/dist/{chunk-k8xqzrg6.js → chunk-kxyckd4b.js} +2 -2
- package/dist/{chunk-are6wrf3.js → chunk-m6wwrjjq.js} +2 -2
- package/dist/{chunk-c4dk6j2h.js → chunk-me3wzsyg.js} +2 -2
- package/dist/{chunk-p0egvanw.js → chunk-mg2js52j.js} +2 -2
- package/dist/{chunk-7vfagc6m.js → chunk-mwre38v3.js} +3 -3
- package/dist/{chunk-7bcm8mpx.js → chunk-my1tpky9.js} +2 -2
- package/dist/{chunk-8hen6y4t.js → chunk-n2bzp8tm.js} +2 -2
- package/dist/{chunk-9w4fg6bn.js → chunk-n3418t16.js} +2 -2
- package/dist/{chunk-v1t50zcv.js → chunk-n40p1vh6.js} +2 -2
- package/dist/{chunk-p5by0hbk.js → chunk-n9ar9a13.js} +2 -2
- package/dist/{chunk-n6dbc0md.js → chunk-nnfx4e2r.js} +2 -2
- package/dist/{chunk-6xhcs3g1.js → chunk-nsackhh2.js} +2 -2
- package/dist/{chunk-aq0evmbe.js → chunk-p0dmhkv6.js} +2 -2
- package/dist/{chunk-n9fwnebe.js → chunk-p0jeje65.js} +2 -2
- package/dist/{chunk-2bbspcb4.js → chunk-pbv2j86k.js} +2 -2
- package/dist/{chunk-nzn3wykb.js → chunk-pd8hv1z9.js} +2 -2
- package/dist/{chunk-pp9fngkx.js → chunk-pj2cv8fz.js} +2 -2
- package/dist/{chunk-v3jehrgj.js → chunk-pxh60cr0.js} +2 -2
- package/dist/{chunk-z6m3w919.js → chunk-q2c4s74c.js} +2 -2
- package/dist/{chunk-5mawv4gk.js → chunk-q7aqfe35.js} +2 -2
- package/dist/chunk-qdw6bkg1.js +2 -0
- package/dist/{chunk-qyp7c0j8.js → chunk-qhgn09vf.js} +1 -1
- package/dist/{chunk-7nb0qea6.js → chunk-qj1k56ag.js} +3 -3
- package/dist/{chunk-jv9pj7jk.js → chunk-qrdsdky0.js} +2 -2
- package/dist/{chunk-hq9cwadn.js → chunk-qs98a0nv.js} +2 -2
- package/dist/{chunk-c2a0x69n.js → chunk-r75kvhw0.js} +2 -2
- package/dist/{chunk-m33eg346.js → chunk-rcfykx93.js} +2 -2
- package/dist/{chunk-j35yaha3.js → chunk-rmhgmrdk.js} +2 -2
- package/dist/{chunk-r0v0wxn7.js → chunk-ryh1rjgt.js} +2 -2
- package/dist/{chunk-axybyhf3.js → chunk-rykrhmfm.js} +2 -2
- package/dist/{chunk-sfetr3m3.js → chunk-rz0a3frq.js} +2 -2
- package/dist/{chunk-ytk5mnhb.js → chunk-s751tfxa.js} +2 -2
- package/dist/{chunk-q5zcxq3k.js → chunk-s8w2vm5j.js} +2 -2
- package/dist/{chunk-4ykysnh7.js → chunk-sbd8f63t.js} +2 -2
- package/dist/{chunk-hp9h8njw.js → chunk-snd4q8wg.js} +2 -2
- package/dist/{chunk-9yrctk84.js → chunk-stcp2kyv.js} +2 -2
- package/dist/{chunk-hp1w7xrp.js → chunk-t5hxmkmk.js} +2 -2
- package/dist/{chunk-gha517v4.js → chunk-tv1frh1m.js} +2 -2
- package/dist/{chunk-ba6h2zzb.js → chunk-tv8k9r9m.js} +2 -2
- package/dist/{chunk-785vxjg2.js → chunk-tx6tcn2h.js} +3 -3
- package/dist/chunk-v07v13k1.js +2 -0
- package/dist/chunk-v2qd3fcr.js +2 -0
- package/dist/{chunk-vwzkw97t.js → chunk-v4krtt1x.js} +2 -2
- package/dist/{chunk-ezhzktjg.js → chunk-v7rxdd8y.js} +2 -2
- package/dist/{chunk-9dr62kb4.js → chunk-vn4sh2ka.js} +2 -2
- package/dist/{chunk-a45jg9xv.js → chunk-vngx7fht.js} +3 -3
- package/dist/{chunk-258cteg0.js → chunk-vssh28er.js} +3 -3
- package/dist/{chunk-zn9xn0pj.js → chunk-w2nh2etf.js} +2 -2
- package/dist/chunk-we4hjktj.js +2 -0
- package/dist/{chunk-teg61ef5.js → chunk-wj827bts.js} +2 -2
- package/dist/chunk-wmew350q.js +2 -0
- package/dist/{chunk-2arjqtvz.js → chunk-wttarxt9.js} +2 -2
- package/dist/{chunk-6ts5zv14.js → chunk-x3nfa92z.js} +3 -3
- package/dist/{chunk-ce3wg766.js → chunk-x52rbm87.js} +2 -2
- package/dist/{chunk-5jryxc3m.js → chunk-xb655337.js} +2 -2
- package/dist/{chunk-nx701kdw.js → chunk-xfgwp480.js} +2 -2
- package/dist/{chunk-hfzt777k.js → chunk-xrrsxjst.js} +2 -2
- package/dist/{chunk-hrgtpvkw.js → chunk-xv7xzr7h.js} +2 -2
- package/dist/{chunk-jvdqst2t.js → chunk-xzhxg3fn.js} +2 -2
- package/dist/{chunk-qznyjv2c.js → chunk-y0y9yzzc.js} +2 -2
- package/dist/{chunk-xvzz0xh6.js → chunk-ybmvk9bj.js} +2 -2
- package/dist/{chunk-yj19d0zm.js → chunk-yf4cr44n.js} +2 -2
- package/dist/{chunk-texzbmc2.js → chunk-z441gmv3.js} +2 -2
- package/dist/{chunk-4xp0q7vs.js → chunk-zth1sf5n.js} +3 -3
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.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/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/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/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-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.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.d.ts +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/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/code-highlighter.js +1 -1
- package/dist/lib/file-url.d.ts +1 -0
- package/dist/lib/file-url.js +1 -0
- 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/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/lib/tool-artifacts.js +1 -1
- package/dist/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.js +1 -1
- package/dist/plugins/new-chat-directory.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/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.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/host.js +1 -1
- package/dist/session-list/hover-info-card.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/platform.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-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/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/THIRD_PARTY_NOTICES.md +9 -8
- package/native/darwin-arm64/artifact.json +1 -1
- package/native/darwin-arm64/libalwith_native_chat.dylib +0 -0
- package/native/darwin-arm64/licenses/zeroize_derive-1.5.0/LICENSE-APACHE +202 -0
- package/native/darwin-arm64/licenses/zeroize_derive-1.5.0/LICENSE-MIT +25 -0
- package/native/win32-x64/THIRD_PARTY_NOTICES.md +9 -8
- package/native/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/native/win32-x64/licenses/zeroize_derive-1.5.0/LICENSE-APACHE +202 -0
- package/native/win32-x64/licenses/zeroize_derive-1.5.0/LICENSE-MIT +25 -0
- package/package.json +10 -10
- package/dist/chunk-753z0tkd.js +0 -2
- package/dist/chunk-g3snk3nb.js +0 -2
- package/dist/chunk-gjg213m6.js +0 -2
- package/dist/chunk-j6mkqhey.js +0 -2
- package/dist/chunk-mhnhkg65.js +0 -2
- package/dist/chunk-mz18hxbn.js +0 -2
- package/dist/chunk-p9ra3xxb.js +0 -2
- package/dist/chunk-qez4ygej.js +0 -2
- package/dist/chunk-stghje2t.js +0 -2
- package/dist/chunk-tjjqaf65.js +0 -2
- package/dist/chunk-txmxcpq4.js +0 -2
- package/dist/chunk-v7dyjpv3.js +0 -2
- package/dist/chunk-y7v0ghc9.js +0 -2
- package/dist/chunk-zr2a9z0m.js +0 -2
- /package/native/darwin-arm64/licenses/{cc-1.11.0 → cc-1.11.1}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{cc-1.11.0 → cc-1.11.1}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{inout-0.2.5 → inout-0.2.6}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{inout-0.2.5 → inout-0.2.6}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{lzma-rust2-0.24.0 → lzma-rust2-0.25.0}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{smallvec-1.16.4 → smallvec-1.16.5}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{smallvec-1.16.4 → smallvec-1.16.5}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{specta-2.0.0-rc.27 → specta-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{zip-9.3.0 → zip-9.4.2}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{cc-1.11.0 → cc-1.11.1}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{cc-1.11.0 → cc-1.11.1}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{inout-0.2.5 → inout-0.2.6}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{inout-0.2.5 → inout-0.2.6}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{lzma-rust2-0.24.0 → lzma-rust2-0.25.0}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{smallvec-1.16.4 → smallvec-1.16.5}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{smallvec-1.16.4 → smallvec-1.16.5}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{specta-2.0.0-rc.27 → specta-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{zip-9.3.0 → zip-9.4.2}/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P,
|
|
2
|
-
export{
|
|
1
|
+
import{P,Ln,Oi,Xt,Ui,Rn,Bi}from"./chunk-ea6cx4zd.js";import{t,_e,X,o}from"./chunk-73099pzj.js";import{ke}from"./chunk-m6wwrjjq.js";import{createStore as C}from"@alwith/api/client";import{isText as w,nativeTurnId as Q}from"@nyssance/codex-acp-v2/client";import{jsx as y}from"react/jsx-runtime";var b=C({entries:{}});function p(i,e){b.setState((n)=>({entries:{...n.entries,[i]:e}}))}function v(i,e){let n=Q(e),a=i.items.findLast((s)=>Q(s)!==null);return!e.replayed&&n!==null&&a!==void 0&&Q(a)===n}function E(i,e){for(let n of i.items){if(n.kind!=="user"||n.echo==="pending")continue;for(let a of[...Rn(n._meta),...n.content.filter(w).flatMap((s)=>Rn(s._meta))])if(a.questionItemId===e)return a.answer}return}function M({sessionId:i,item:e,question:n,index:a}){let s=_e(),{t:l}=t(),m=Ln(e.id,a),c=JSON.stringify([i,m]),u=X(b,(r)=>r.entries[c]),d=o((r)=>r.sessions[i]),k=o((r)=>r.connection==="ready"),f=u?.draft??Oi(n),x=d===void 0?u?.accepted:E(d,m)??u?.accepted,A=d!==void 0&&v(d,e),h=!d?.subagent&&k&&d?.attached&&!d.restoring&&!d.readOnly,g=x!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!A?"closed":!h?"unavailable":"pending",D=async()=>{if(b.getState().entries[c]?.pending||g!=="pending")return;let r=s.state.sessions[i];if(r===void 0||!v(r,e)||!r.attached||r.readOnly||r.restoring)return;let S=Xt(n,f);if(!S.trim())return;let q={questionItemId:m,question:n.title,answer:S};p(c,{draft:f,pending:!0});try{await s.prompt(i,[{type:"text",text:Ui(q),_meta:{codex:{questionReply:q}}}]),p(c,{draft:f,accepted:S})}catch(I){p(c,{draft:f,error:I instanceof Error?I.message:String(I)})}};if(g==="closed")return null;return y(Bi,{question:n,draft:f,status:g,answer:x,error:g==="pending"?u?.error:void 0,t:l,onChange:(r)=>p(c,{draft:r}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{D()}})}function Pn({sessionId:i,item:e}){let n=o((s)=>s.sessions[i]),a=P(e._meta);if(n===void 0||n.subagent!==void 0||n.readOnly||!v(n,e))return y(ke,{content:e.content.some((s)=>!w(s)||s.text.trim().length>0)?e.content:a.map((s)=>({type:"text",text:s.title})),messageId:e.id,streaming:!1});return y("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((s,l)=>y(M,{sessionId:i,item:e,question:s,index:l},Ln(e.id,l)))})}
|
|
2
|
+
export{Pn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as _,useRef as I,useState as q}from"react";import{jsx as z}from"react/jsx-runtime";var C=d(null),
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as _,useRef as I,useState as q}from"react";import{jsx as z}from"react/jsx-runtime";var C=d(null),mn=d(null);function ma(){return i(mn)}var gn=d(null);function ga(){return i(gn)}var Qe=d(null);function Ye(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Xe=()=>i(C);function fa(){let r=i(Qe);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(Qe);function Bo({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,attachments:y,onAttachmentsChange:U,children:D}){let L=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),S=A!==void 0,[B,G]=q(r),p=A??B,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let T=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,S)R?.(t);else G(t)},[S,R]),g=n(()=>P(""),[P]),x=y!==void 0,[J,K]=q([]),v=y??J,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)U?.(e);else K(e)},[x,U]),W=I(null),j=I(()=>{}),w=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let H=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:L(u),filename:u.name,size:u.size,lastModified:u.lastModified,...H===void 0?{}:{sourcePath:H}}})]})},[f,L,s]),O=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),M=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let E=n(()=>{j.current?.()},[]),b=_(()=>({files:v,add:w,remove:O,clear:M,openFileDialog:E,fileInputRef:W}),[v,w,O,M,E]),k=n((t,e)=>{W.current=t.current,j.current=e},[]),Q=_(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:T,clearSubmitted:c??g},attachments:b,__registerFileInput:k}),[p,P,g,T,c,b,k]);return z(C.Provider,{value:Q,children:z(Qe.Provider,{value:b,children:D})})}var fn=d(null);function N(){let r=X(),l=i(fn),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
+
export{mn,ma,gn,ga,Qe,Ye,Xe,fa,Bo,fn,N};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function
|
|
2
|
-
export{
|
|
1
|
+
import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function ii(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
|
|
2
|
+
export{ii};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function*Hn(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function ji(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of Hn(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
+
export{Hn,ji};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";function ct({title:t,badge:a,children:i}){return e("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[e("div",{className:"flex min-h-9 items-center gap-2",children:[r("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:t}),a]}),i]})}
|
|
2
|
+
export{ct};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ce}from"./chunk-qdw6bkg1.js";import{s,z,$t}from"./chunk-3wv9dsht.js";var Io=5000;function Re(t){return"pastedText"in t}function Ze(t,e,o){let i=(r,n)=>{for(let[a,x]of s){if(!x.attachments.some((p)=>p.id===e.id))continue;z(a,(p)=>p.map((d)=>d.id===e.id?{...e,url:n===void 0?"":Ce(n),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!s.get(t)?.attachments.some((r)=>r.id===e.id))return;i("pending"),$t(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>i("ready",r)).catch(()=>i("error")))}function jt(t,e,o,i){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((a)=>a.kind==="file"&&a.type.startsWith("image/")))return;let r=t.clipboardData.getData("text/plain");if(r.length<Io)return;t.preventDefault(),t.stopPropagation();let n={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};z(e,(a)=>[...a,n]),Ze(e,n,i)}
|
|
2
|
+
export{Io,Re,Ze,jt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{o}from"./chunk-73099pzj.js";import{e,f}from"./chunk-s751tfxa.js";import{QUICK_CHATS_GROUP as I,sessionGroup as z}from"@nyssance/codex-acp-v2/client";import{cn as j}from"cn";import{FolderClosedIcon as g,FolderPlusIcon as G,XIcon as x}from"lucide-react";import{useEffect as O,useMemo as R,useState as S}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as A,DropdownMenuContent as F,DropdownMenuGroup as T,DropdownMenuItem as k,DropdownMenuRadioGroup as B,DropdownMenuRadioItem as E,DropdownMenuSeparator as U,DropdownMenuTrigger as _}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as s,Fragment as H}from"react/jsx-runtime";function M(n){return n.replaceAll("\\","/").replace(/\/+$/,"").split("/").pop()||n}function Ur({cwd:n,onChange:u,preparing:b=!1,recentProjects:w}){let{host:i,client:p}=e(),{t:l}=i,v=o((r)=>r.projectContext),h=o((r)=>r.sessionList),y=R(()=>w??[...new Set([...h].toSorted((r,m)=>(m.updatedAt??"").localeCompare(r.updatedAt??"")).map((r)=>r.cwd))],[w,h]),[c,N]=S(null);O(()=>{if(!p.refreshProjectContext)return;let r=!0;return f(i,p.refreshProjectContext(!0).then((m)=>{if(r)N(m.chatDirectory)})),()=>{r=!1}},[i,p]);let D=[...n!==null?[n]:[],...y.filter((r)=>r!==n)].filter((r)=>r!==c&&(!v||z(v,{cwd:r}).id!==I)),a=n!==null&&n!==c,P=()=>{if(c===null)throw Error("The default draft directory is not ready");u(null)},d=i.chooseFolder;return s(A,{children:[s("div",{"aria-busy":b,className:j("chat-project-picker group/project inline-flex h-7 max-w-full min-w-0 items-center gap-1.5 rounded-full",a?"text-foreground ps-2":"text-foreground/65"),children:[a&&s(C,{variant:"ghost",size:"icon-xs",className:"relative size-4 rounded-full p-0 hover:bg-transparent dark:hover:bg-transparent","aria-label":l("conversation.draft.workOutsideProject"),title:l("conversation.draft.workOutsideProject"),disabled:c===null,onClick:P,children:[t(g,{className:"size-4 group-hover/project:opacity-0"}),t("span",{className:"bg-muted-foreground text-background absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/project:opacity-100",children:t(x,{className:"size-3"})})]}),s(_,{render:t(C,{variant:"ghost",size:"sm",className:j("h-7 min-w-0 shrink gap-1.5 rounded-full py-0 text-sm font-normal text-inherit hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent",a?"ps-0 pe-2":"px-2")}),children:[!a&&t(g,{className:"size-4"}),t("span",{className:"truncate",children:a?M(n):l("conversation.draft.selectProject")})]})]}),s(F,{side:"top",align:"start",className:"w-72 overflow-hidden",children:[D.length>0&&s(H,{children:[t("div",{className:"max-h-64 overflow-y-auto",children:t(B,{value:n??"",onValueChange:u,children:D.map((r)=>s(E,{value:r,title:r,closeOnClick:!0,children:[t(g,{}),t("span",{className:"truncate",children:M(r)})]},r))})}),(d!==void 0||a)&&t(U,{})]}),(d!==void 0||a)&&s(T,{children:[d&&s(k,{onClick:()=>{f(i,d(n).then((r)=>{if(r!==null)u(r)}))},children:[t(G,{}),l("conversation.draft.newProject")]}),c!==null&&a&&s(k,{onClick:P,children:[t(x,{}),l("conversation.draft.workOutsideProject")]})]})]})]})}
|
|
2
|
+
export{Ur};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ji}from"./chunk-5akfmr5g.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Dn(t,r,e={}){let o=r.trim();if(o.length===0)return[];return ji(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
|
|
2
|
+
export{Dn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ExternalLinkIcon as d}from"lucide-react";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as c,CardContent as s,CardDescription as p,CardFooter as C,CardHeader as m,CardTitle as v}from"@nyssance/shadcn/vega/components/ui/card";import{jsx as a,jsxs as e}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{ExternalLinkIcon as d}from"lucide-react";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as c,CardContent as s,CardDescription as p,CardFooter as C,CardHeader as m,CardTitle as v}from"@nyssance/shadcn/vega/components/ui/card";import{jsx as a,jsxs as e}from"react/jsx-runtime";function Ko({message:r,url:t,t:i,onOpen:l,onRespond:o}){return e(c,{size:"sm",children:[e(m,{children:[a(p,{children:i("approval.needed")}),a(v,{children:r})]}),a(s,{children:e("div",{className:"flex flex-col gap-3",children:[e(n,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),e(C,{className:"flex flex-wrap gap-2",children:[a(n,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(n,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
|
|
2
|
+
export{Ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Wi}from"./chunk-wj827bts.js";import{createContext as s,useContext as l,useSyncExternalStore as m}from"react";import{jsx as r}from"react/jsx-runtime";var c=s(null),u=s(null);function Se({host:e,client:n,children:i}){return r(Wi,{host:e,children:r(c,{value:e,children:r(u,{value:n,children:i})})})}function t(){let e=l(c);if(e===null)throw Error("Timeline host is missing");return e}function _e(){let e=l(u);if(e===null)throw Error("Timeline client is missing");return e}function X(e,n){return m((i)=>e.subscribe(i),()=>n(e.getState()),()=>n(e.getState()))}function o(e){let n=_e();return X(n.store,e)}function lt(e,n){if(e.reportError)e.reportError(n);else console.error(n)}
|
|
2
|
+
export{Se,t,_e,X,o,lt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-ytk5mnhb.js";import{ht}from"./chunk-aywszahf.js";import{B,Ge,q,wt}from"./chunk-07srtfz3.js";import{bt,Ct}from"./chunk-wyjzpncq.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as se,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 ee}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 X}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}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 Z(){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 zn({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[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(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function er({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=Ct(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(B[0]?.id??""),[F,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(B[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 bt(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=B.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(B[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(ht,{bridge:d})]}),C&&t(zn,{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(Vn,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),B.map((o)=>t("div",{hidden:x!==o.id,children:t($n,{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(tn,{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(tn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function Vn({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:[B.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{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(te,{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 te({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 jn({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(jn,{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 $n({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,U]=y(q(s,d?.region)?.id),[z,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),E=wt(s,F),K=F!==q(s,x.saved?.region)?.id,P=z.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),U(q(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let A=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=F,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?q(s,D?.region)?.id:g),M((g)=>g===z?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...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:F,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(X,{}),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(R,{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(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{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:q(s,F)?.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(R,{size:"sm",disabled:!A,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function tn({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),[U,z]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
1
|
+
import{e}from"./chunk-s751tfxa.js";import{vt}from"./chunk-0wzxv15n.js";import{B,ze,q,kt}from"./chunk-cpn28aqq.js";import{Ct,wt}from"./chunk-hy5ansma.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as se,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 ee}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 X}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}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 Z(){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 zn({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[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(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function tr({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=wt(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(B[0]?.id??""),[F,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(B[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 Ct(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=B.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(B[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(vt,{bridge:d})]}),C&&t(zn,{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(Vn,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),B.map((o)=>t("div",{hidden:x!==o.id,children:t($n,{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(tn,{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(tn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function Vn({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:[B.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{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(te,{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 te({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 jn({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(jn,{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 $n({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,U]=y(q(s,d?.region)?.id),[z,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),E=kt(s,F),K=F!==q(s,x.saved?.region)?.id,P=z.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),U(q(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let A=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=F,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?q(s,D?.region)?.id:g),M((g)=>g===z?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...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:F,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(X,{}),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(R,{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(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{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:q(s,F)?.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(R,{size:"sm",disabled:!A,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function tn({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),[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
|
-
]`),[E,K]=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(
|
|
4
|
-
export{zn,
|
|
3
|
+
]`),[E,K]=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(ze(I)),K(null)}catch(D){K(W(D));return}z(m)},G=async()=>{let m;try{m=ze(I),K(null)}catch(g){K(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(X,{}),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(ee,{id:A,value:h,onChange:(m)=>c(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:o,children:n("provider.baseUrl")}),t(ee,{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:()=>F((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(X,{}),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(R,{variant:"ghost",size:"sm"}),children:[n(U?"provider.previewModels":"provider.editModels"),t(se,{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),K(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(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void G(),children:[u&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
|
|
4
|
+
export{zn,tr,Vn,jn,$n,tn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P}from"./chunk-
|
|
2
|
-
export{sa,
|
|
1
|
+
import{P}from"./chunk-ea6cx4zd.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function sa(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function Ei(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=P(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(P(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function Li(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!sa(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(An),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function An(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function re(t){return A(t.content)}function at(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function En(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Ri(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function Fi(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function Di(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!Fi(t,e[n-1],o))break;n--}return e[n]?.key}function Hi(t,e,n){let o=n,s=n;while(o>0&&Fi(t,e[o-1],e[o]))o--;while(s+1<e.length&&Fi(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
|
|
2
|
+
export{sa,Ei,Li,An,re,at,En,Ri,Fi,Di,Hi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function
|
|
2
|
-
export{
|
|
1
|
+
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function un(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function ko(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=un(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
|
|
2
|
+
export{un,ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{d}from"./chunk-wj827bts.js";import{b}from"./chunk-57p1s7hy.js";import{isContentEntry as k,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as s,jsxs as y}from"react/jsx-runtime";function He(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let n=[];for(let[r,c]of e.content.entries()){if(!k(c))continue;let i=c.content;if(N(i))n.push({key:`${e.id}:${r}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(w(i))n.push({key:`${e.id}:${r}`,path:i.uri,alt:i.name})}if(n.length)return n;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:n,openImageGallery:a,openImage:r,t:c}=d(),[i,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,l=JSON.parse(f);g({});for(let o of l)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&n?n(o.path):Promise.reject(Error("Image loading is unavailable"))).then((u)=>{if(t)g((p)=>({...p,[o.key]:{src:u}}))},()=>{if(t)g((u)=>({...u,[o.key]:{error:!0}}))});return()=>{t=!1}},[f,n,v]);let I=e.flatMap((t)=>{let l=i[t.key];return l&&"src"in l?[{src:l.src,alt:t.alt}]:[]});return s("div",{className:"codex-image-thumbnails",children:e.map((t,l)=>{let o=i[t.key];if(!o)return s("div",{className:"codex-image-thumbnail",role:"status","aria-label":c("stream.codex.imageLoading"),children:s(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":c("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:s(R,{"aria-hidden":"true"})},t.key);return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,l).filter((u)=>{let p=i[u.key];return p&&"src"in p}).length;if(a)a(I,m);else r?.(o.src)},children:s("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function ui({blocks:e}){let{t:n}=d(),a=e.flatMap(T),[r,c]=b(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":r,onClick:()=>c((i)=>!i),children:[y("span",{className:"codex-activity-label",children:[s(S,{className:"codex-activity-icon","aria-hidden":"true"}),s("span",{className:"codex-activity-leading",children:n("stream.codex.viewedImages",{count:a.length})})]}),s(C,{className:r?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),r&&s(E,{images:a})]})}
|
|
2
|
+
export{He,ui};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var Br={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Wo(e){return[...e].toSorted((o,n)=>(Br[o.kind]??99)-(Br[n.kind]??99))}function ha(e){return e==="allow_once"||e==="allow_always"}function va(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
+
export{Br,Wo,ha,va};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Uo}from"./chunk-eyqnxv1e.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function Oo(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Uo(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
|
|
2
|
+
export{Oo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as o,useContext as n,useEffect as r}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as o,useContext as n,useEffect as r}from"react";var uo=o(null);function S(t){let e=n(uo);r(()=>{if(t&&e!==null)return e()},[t,e])}
|
|
2
|
+
export{uo,S};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as l,useSyncExternalStore as d}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as l,useSyncExternalStore as d}from"react";var Ge="chat.modelAliases",c={},r="gateway:alwith-managed-litellm:";function o(e){if(e===void 0)return c;if(typeof e!=="object"||e===null||Array.isArray(e)||Object.entries(e).some(([t,n])=>!t.startsWith(r)||t.length===r.length||typeof n!=="string"||!n.trim()||n.length>100))throw Error("Invalid model aliases");return e}function xt(e){let t=l((n)=>e.subscribe((s)=>{if(s.includes(Ge))n()}),[e]);return d(t,()=>o(e.get(Ge)))}async function bt(e,t,n){if(!t.startsWith(r)||t.length===r.length)throw Error("Invalid ALwith model ID");let s=await e.read(),i={...o(s.values[Ge])},a=n.trim();if(a)i[t]=a;else delete i[t];o(i),await e.write({action:"update",expectedRevision:s.revision,changes:{[Ge]:i}})}
|
|
2
|
+
export{Ge,xt,bt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function Wr(e,n){if(e.type||!n.type)return e;let i=n.type.split("/")[1],o=i!==void 0&&i!==""?`pasted-${Date.now()}.${i==="jpeg"?"jpg":i}`:"";return new File([e],e.name||o||`pasted-${Date.now()}`,{type:n.type})}function xo(e){let n=[],i=!1;for(let o of e){if(o.kind!=="file")continue;let t=o.getAsFile();if(!t)continue;if(!(t.type||o.type).startsWith("image/")){i=!0;continue}n.push(Wr(t,o))}return{imageFiles:n,sawNonImageFile:i}}function bo(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Zr(e){return e.replace(s,"")}function Rr(e,n){let i=0;for(let o=0;o<n;o++){let t=e.charCodeAt(o);if(t>=0&&t<=8||t===11||t===12||t>=14&&t<=31||t===127)i++}return i}function Ut(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=Zr(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-Rr(n,i)),r=Math.max(0,o-Rr(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
|
|
2
|
+
export{Wr,xo,bo,Zr,Rr,Ut};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function At({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function E({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
|
|
2
|
+
export{At,E};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,a,n,p}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{r,a,n,p}from"./chunk-s8w2vm5j.js";import{L}from"./chunk-n2bzp8tm.js";import{k,Q,ye}from"./chunk-ebvemv72.js";import{he,G,oe}from"./chunk-xb655337.js";import{lo}from"./chunk-2g2ydnbw.js";import{me}from"./chunk-h4r8cx37.js";import{pe}from"./chunk-19xcrm2x.js";import{ge}from"./chunk-0ne9v3vr.js";import{Et}from"./chunk-j9x200w4.js";import{ao}from"./chunk-me3wzsyg.js";import{ActivityIcon as E}from"lucide-react";import{useEffect as K,useMemo as P}from"react";import{Kbd as M}from"@nyssance/shadcn/vega/components/ui/kbd";import{jsx as c,jsxs as D,Fragment as q}from"react/jsx-runtime";function H(o,d){return o.find((l)=>l.sessionId===d.sessionId)??{sessionId:d.sessionId,cwd:d.cwd,title:d.title||null,updatedAt:null,archived:!1}}function _r({selectedId:o,onSelect:d,isForeground:l,onOpen:w,accessory:R,rowActions:h}){let N=r(),{t:x}=N,m=n((t)=>t.runStates),v=n((t)=>t.drafts),u=n((t)=>t.sessionList),g=G((t)=>t.activityOrder),f=P(()=>g.flatMap((t)=>{let e=m[t];return e&&he({runStates:m,drafts:v},t)?[{sid:t,record:e,sessionRow:H(u,e)}]:[]}),[g,m,v,u]),b=P(()=>{let t=new Map;for(let e of f){let i=e.sid===o||l?.(e.sid)?"foreground":"background",S=t.get(i)??[];S.push(e),t.set(i,S)}return["foreground","background"].filter((e)=>t.has(e)||e==="background").map((e)=>({key:e,rows:t.get(e)??[]}))},[f,o,l]),y=G((t)=>t.activityCollapsedGroups),s=oe(),I=b.flatMap((t)=>t.key==="foreground"||!y.has(t.key)?t.rows:[]),A=(t)=>{if(w?.(t))return;d(t)},O=ao();K(()=>{let t=(e)=>{if(e.defaultPrevented||e.isComposing||e.repeat||!lo(e))return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;let i=Number(e.key);if(!Number.isInteger(i)||i<1||i>9)return;let S=I[i-1];if(!S)return;e.preventDefault(),A(S.sessionRow)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let C=(t)=>{let e=I.indexOf(t);return c(T,{sessionRow:t.sessionRow,state:t.record.state,interruption:t.record.interruption,active:t.sid===o,tasks:t.record.tasks,listeningPorts:t.record.listeningPorts,onOpen:()=>A(t.sessionRow),accessory:R?.(t.sid),actions:h?.(t.sessionRow),hint:e<9&&O?c(M,{children:ge(`CommandOrControl+${e+1}`)}):void 0},t.sid)};return c(k,{children:b.map((t)=>t.key==="foreground"?c(k,{children:t.rows.map(C)},t.key):c(Q,{open:!y.has(t.key),onOpenChange:(e)=>{let i=new Set(y);if(e)i.delete(t.key);else i.add(t.key);s({activityCollapsedGroups:i})},leading:c(E,{className:"text-muted-foreground size-3.5 shrink-0"}),label:x("sessionList.background"),count:t.rows.length,children:t.rows.map(C)},t.key))})}function T({sessionRow:o,state:d,interruption:l,active:w,tasks:R,listeningPorts:h,accessory:N,actions:x,onOpen:m,hint:v}){let u=r(),g=a(),{t:f}=u,b=o.title??f("sessionList.untitled"),y=Et(o.sessionId,d);return D(q,{children:[c(ye,{"data-session-id":o.sessionId,active:w,role:"button",tabIndex:0,hoverCard:c(pe,{sessionRow:o,actions:x}),onClick:m,onKeyDown:(s)=>{if(s.target!==s.currentTarget)return;if(s.key==="Enter"||s.key===" ")s.preventDefault(),m()},state:d,interruption:l,title:b,preview:y,listeningPorts:h,onOpenPort:u.openLink&&((s)=>u.openLink?.(`http://localhost:${s}`)),accessory:N,hint:v,actions:c(me,{title:f("sessionList.stop"),onStop:()=>p(u,g.stopSession(o.sessionId))})}),R.map((s)=>D("div",{className:"border-border/60 before:border-border/60 relative ms-4 flex min-h-7 items-center gap-2 border-s py-1 ps-4 pe-2 text-xs before:absolute before:start-0 before:top-3.5 before:w-2 before:border-t",children:[c(L,{state:"running"}),c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate leading-5",title:s.title,children:s.title})]},s.id))]})}
|
|
2
|
+
export{_r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,n}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{a,n}from"./chunk-s8w2vm5j.js";import{QUICK_CHATS_GROUP as m,sessionGroup as l}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function hr(i){let t=a(),e=n((s)=>s.projectContext),c=i===null?m:e?l(e,{cwd:t.projectPath(i)}).id:null,u=n((s)=>s.sessionList),d=n((s)=>s.connection),r=n((s)=>s.sessionListLoaded),o=n((s)=>s.sessionListError),f=()=>t.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(d==="ready"&&!r&&o===null)t.listSessions().catch(()=>{return})},[t,d,r,o]),{result:L(()=>{if(r&&e)return{status:"ready",sessionRows:u.filter((s)=>l(e,{...s,cwd:t.projectPath(s.cwd)}).id===c).toSorted((s,p)=>(p.updatedAt??"").localeCompare(s.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[t,u,r,o,c,e]),retry:f}}
|
|
2
|
+
export{hr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Co}from"./chunk-fd3p9rqe.js";import{N}from"./chunk-4ezp99mv.js";import{cn as v}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as b}from"react";import{Button as P}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as E,HoverCardContent as R,HoverCardTrigger as D}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as e,jsxs as r,Fragment as K}from"react/jsx-runtime";function F(t){return e(R,{align:"start",...t})}function fo({data:t,t:n,className:l,...m}){let c=N(),[u,f]=b(!1),[I,d]=b(1),C=z(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",A=a||(o?n("input.image"):n("input.attachment"));return L(()=>{if(!u)return;let p=0.1,h=(i)=>Math.min(10,Math.max(0.1,i)),g=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,y=s==="+"||s==="=",H=s==="-"||s==="_",x=s==="0";if(!y&&!H&&!x)return;i.preventDefault(),d((w)=>{if(x)return 1;if(y)return h(w+p);return h(w-p)})};return window.addEventListener("keydown",g,{passive:!1}),()=>window.removeEventListener("keydown",g)},[u]),r(K,{children:[r(E,{children:[e(D,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(P,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),f(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(k,{className:"size-3"})}),r(P,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(T,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),e(F,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e(Co,{containerRef:C,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:I,url:t.url})]})}function ho({children:t,className:n,...l}){let m=N();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(M,{children:t(c)},c.id))})}
|
|
2
|
+
export{fo,ho};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function bi(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Ci(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
|
|
2
|
+
export{bi,Ci};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Mt}from"./chunk-2f8t38fg.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function fr({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(Mt,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
|
|
2
|
+
export{fr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function sn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
|
|
2
|
+
export{sn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l}from"./chunk-
|
|
1
|
+
import{l}from"./chunk-wmew350q.js";import{D,H,O,U}from"./chunk-qhgn09vf.js";import{Item as m}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function ae({skills:o=!1}){let{t}=l();return a("div",{role:"status","aria-label":t(o?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(U,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((i)=>a(m,{size:"xs",className:"toolbox-row",children:[e(O,{children:e(s,{className:"size-10 rounded-xl"})}),a(H,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(D,{children:e(s,{className:"size-8 rounded-full"})})]},i))})]})}
|
|
2
2
|
export{ae};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function
|
|
2
|
-
export{
|
|
1
|
+
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Mi(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Nn(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{Mi,Nn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d,T}from"./chunk-
|
|
2
|
-
`),b=!t.streaming&&C.trim().length>0?o(
|
|
3
|
-
export{xa,
|
|
1
|
+
import{d,T}from"./chunk-wj827bts.js";import{V}from"./chunk-dzbshq7w.js";import{si}from"./chunk-hgar92ae.js";import{ie}from"./chunk-76a04a6j.js";import{di,ot}from"./chunk-vngx7fht.js";import{ci}from"./chunk-qj1k56ag.js";import{In}from"./chunk-3axrv16v.js";import{cn as M}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,w=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return v.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(T,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(T,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ie,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var E=new Set;function xa({message:t,isMostRecentTurn:n,hiddenTools:s=E,time:i,beforeCopy:r,afterCopy:c,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
|
|
2
|
+
`),b=!t.streaming&&C.trim().length>0?o(xn,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:c,time:i}):null,l=si(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),B=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&V(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(ot,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===B?b:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(bn,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(ci,{blocks:f}):y(f))})}function xn({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let c=d(),{t:u}=c;return g("div",{className:M("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(In,{text:t,label:u("actions.copy"),host:c}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=d();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function bn({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...c}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(di,{...c,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
|
|
3
|
+
export{xa,xn,bn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ho,be}from"./chunk-v2qd3fcr.js";import{Oo}from"./chunk-8x6gswg0.js";import{mn,gn,Qe,Xe,fn}from"./chunk-4ezp99mv.js";import{cn as P}from"cn";import{ArrowUpIcon as ge,Loader2Icon as ve,SquareIcon as he,XIcon as Pe}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as Ie,useRef as M,useState as ye}from"react";import{flushSync as xe}from"react-dom";import{InputGroup as Le,InputGroupAddon as ee,InputGroupButton as te}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as a,jsxs as Te}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Ao=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:re,globalDrop:C,syncHiddenInput:U,maxFiles:z,maxFileSize:H,onError:b,onSubmit:ne,children:oe,...se})=>{let s=Xe(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ae,D]=ye([]),c=l?s.attachments.files:ae,B=M(c);B.current=c;let ue=h(()=>{x.current?.click()},[]),O=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),W=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((i)=>O(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:W(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,W,O,z,H,b]),pe=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),G=l?s.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Ho(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${be}MB.`});return}}G(r)},[c,G,b]),j=l?s.attachments.remove:pe,N=l?s.attachments.clear:me,q=l?s.attachments.openFileDialog:ue;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(U&&x.current&&c.length===0)x.current.value=""},[c,U]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of B.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},X=Ie(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:j,clear:N,openFileDialog:q,fileInputRef:x}),[c,L,j,N,q]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let J=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Oo(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ne({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},de=(e)=>{e.preventDefault(),J(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)xe(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),K=a(gn.Provider,{value:()=>J(null),children:Te(mn.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:re,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(Le,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return l?a(Qe.Provider,{value:X,children:K}):a(fn.Provider,{value:X,children:K})};function Eo({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function Lo({className:u,...o}){return a(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Ro({className:u,...o}){return a(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Fo({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var R=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Do=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(ge,{className:"size-4"});if(d==="submitted")g=a(ve,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(he,{className:"size-3 fill-current"});else if(d==="error")g=a(Pe,{className:"size-4"});return a(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
|
|
2
|
+
export{Ao,Eo,Lo,Ro,Fo,R,Do};
|