@alwith/module-chat 0.6.7 → 0.6.9
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-hd2kda2r.js → chunk-02jpgxy7.js} +2 -2
- package/dist/{chunk-n9ar9a13.js → chunk-0eewkw7t.js} +2 -2
- package/dist/{chunk-rz0a3frq.js → chunk-0y1c3v1b.js} +1 -1
- package/dist/{chunk-q2c4s74c.js → chunk-18z4wmhb.js} +2 -2
- package/dist/{chunk-vn4sh2ka.js → chunk-1bfxezrb.js} +2 -2
- package/dist/{chunk-dzbshq7w.js → chunk-1fh3vvpe.js} +3 -3
- package/dist/{chunk-qs98a0nv.js → chunk-1zypzzje.js} +1 -1
- package/dist/{chunk-p0dmhkv6.js → chunk-24kpx8fg.js} +2 -2
- package/dist/{chunk-4ryn6szh.js → chunk-29jan02g.js} +2 -2
- package/dist/{chunk-as95eeg6.js → chunk-2kjbas8a.js} +2 -2
- package/dist/{chunk-5nj4s3yr.js → chunk-2kz2z86n.js} +2 -2
- package/dist/chunk-2tc8kgsa.js +2 -0
- package/dist/{chunk-wj827bts.js → chunk-32s8dn1a.js} +2 -2
- package/dist/{chunk-rykrhmfm.js → chunk-36mdfph1.js} +2 -2
- package/dist/{chunk-ebvemv72.js → chunk-3m59n5gr.js} +2 -2
- package/dist/chunk-3twka9f7.js +2 -0
- package/dist/{chunk-v4krtt1x.js → chunk-3v39hqex.js} +2 -2
- package/dist/{chunk-r75kvhw0.js → chunk-3zwbr9xs.js} +2 -2
- package/dist/{chunk-dfa9098c.js → chunk-4cb0c8ae.js} +2 -2
- package/dist/{chunk-cvtkr08t.js → chunk-4j6gy4me.js} +2 -2
- package/dist/{chunk-bj6eyqv2.js → chunk-4nnyn9b2.js} +2 -2
- package/dist/{chunk-j9x200w4.js → chunk-5f5jfr40.js} +2 -2
- package/dist/{chunk-v7rxdd8y.js → chunk-5f889j6j.js} +2 -2
- package/dist/{chunk-d1petgqq.js → chunk-5t8zx5e4.js} +3 -3
- package/dist/{chunk-kjdjp3jp.js → chunk-5v8f2sbp.js} +2 -2
- package/dist/chunk-5yq8k08p.js +2 -0
- package/dist/{chunk-7n2gvnvs.js → chunk-658y6xth.js} +2 -2
- package/dist/{chunk-s751tfxa.js → chunk-6pnsagt4.js} +2 -2
- package/dist/{chunk-3n6qcrpw.js → chunk-6z36709h.js} +2 -2
- package/dist/{chunk-0d8j19ff.js → chunk-70bm3f7n.js} +2 -2
- package/dist/{chunk-n40p1vh6.js → chunk-70j4ee5r.js} +2 -2
- package/dist/{chunk-4ezp99mv.js → chunk-75ve01mr.js} +2 -2
- package/dist/{chunk-b701cxvn.js → chunk-7egc2evj.js} +2 -2
- package/dist/{chunk-tx6tcn2h.js → chunk-7jmqq7b5.js} +3 -3
- package/dist/{chunk-my1tpky9.js → chunk-7qwbxdyb.js} +2 -2
- package/dist/{chunk-9npcs7m3.js → chunk-7x150rqz.js} +2 -2
- package/dist/{chunk-19xcrm2x.js → chunk-80a1fdx8.js} +1 -1
- package/dist/{chunk-0wzxv15n.js → chunk-80r0jch1.js} +2 -2
- package/dist/{chunk-w2nh2etf.js → chunk-8428vfp3.js} +2 -2
- package/dist/{chunk-cpn28aqq.js → chunk-84gk74hf.js} +2 -2
- package/dist/{chunk-3yqs97b3.js → chunk-8504eft8.js} +3 -3
- package/dist/chunk-8689y4n5.js +2 -0
- package/dist/chunk-8an4t4kh.js +2 -0
- package/dist/{chunk-pxh60cr0.js → chunk-8d86yqzq.js} +2 -2
- package/dist/{chunk-hq54ncad.js → chunk-8rpen55z.js} +3 -3
- package/dist/{chunk-9c8j12m0.js → chunk-958qyr8g.js} +2 -2
- package/dist/{chunk-n3418t16.js → chunk-9e6rv193.js} +2 -2
- package/dist/{chunk-36m8zstj.js → chunk-9p1jvznr.js} +2 -2
- package/dist/chunk-9rt2pfsm.js +2 -0
- package/dist/{chunk-782289vj.js → chunk-9wk2xp6v.js} +3 -3
- package/dist/{chunk-s8w2vm5j.js → chunk-a8gzs651.js} +2 -2
- package/dist/{chunk-zth1sf5n.js → chunk-a8j61zs9.js} +2 -2
- package/dist/{chunk-xv7xzr7h.js → chunk-acnqnrqb.js} +2 -2
- package/dist/{chunk-c843be1k.js → chunk-ajjd22hb.js} +3 -3
- package/dist/{chunk-0ne9v3vr.js → chunk-akvpgx43.js} +2 -2
- package/dist/{chunk-hy5ansma.js → chunk-bpenajbp.js} +2 -2
- package/dist/{chunk-jnsxjybz.js → chunk-brfr0m5g.js} +2 -2
- package/dist/{chunk-6sbyy3f4.js → chunk-bt0t1pev.js} +2 -2
- package/dist/{chunk-8x6gswg0.js → chunk-bxmgvyfe.js} +2 -2
- package/dist/chunk-c47xfjk4.js +2 -0
- package/dist/{chunk-qrdsdky0.js → chunk-c61yvpy3.js} +2 -2
- package/dist/{chunk-xb655337.js → chunk-c7p3vpyx.js} +2 -2
- package/dist/{chunk-y0y9yzzc.js → chunk-ckhw0gr5.js} +2 -2
- package/dist/{chunk-we4hjktj.js → chunk-d0ta9y85.js} +2 -2
- package/dist/{chunk-rcfykx93.js → chunk-d9mmpjrr.js} +2 -2
- package/dist/{chunk-kxyckd4b.js → chunk-dz5ymd3t.js} +2 -2
- package/dist/{chunk-qj1k56ag.js → chunk-e0c8pmjc.js} +3 -3
- package/dist/{chunk-14d60z29.js → chunk-ek3v1g24.js} +2 -2
- package/dist/{chunk-j8vz3m75.js → chunk-eq7vpgn7.js} +2 -2
- package/dist/{chunk-x52rbm87.js → chunk-ewjh6s2b.js} +2 -2
- package/dist/{chunk-73099pzj.js → chunk-f1r8wh4e.js} +2 -2
- package/dist/{chunk-jahh3cp4.js → chunk-f2a9rqfz.js} +2 -2
- package/dist/{chunk-xfgwp480.js → chunk-fbmbc4wt.js} +2 -2
- package/dist/{chunk-x3nfa92z.js → chunk-fd8x014y.js} +2 -2
- package/dist/chunk-fgr2g610.js +3 -0
- package/dist/{chunk-nnfx4e2r.js → chunk-fnw16wjx.js} +2 -2
- package/dist/chunk-fqgz93sy.js +2 -0
- package/dist/{chunk-0q9y4dw0.js → chunk-fw2jj4hh.js} +2 -2
- package/dist/{chunk-wttarxt9.js → chunk-fzgra242.js} +2 -2
- package/dist/{chunk-jphjekr9.js → chunk-g0gq72z9.js} +2 -2
- package/dist/{chunk-wmew350q.js → chunk-g79y6q3f.js} +2 -2
- package/dist/{chunk-e8349nct.js → chunk-gfrzmgz4.js} +2 -2
- package/dist/{chunk-197rc8qr.js → chunk-gkp0e28t.js} +2 -2
- package/dist/{chunk-b935g3j2.js → chunk-grgq7twf.js} +2 -2
- package/dist/{chunk-m6wwrjjq.js → chunk-gwa7hbzr.js} +1 -1
- package/dist/{chunk-jtxcskjs.js → chunk-h4adycra.js} +2 -2
- package/dist/{chunk-heqqsp62.js → chunk-h9ywpga2.js} +3 -3
- package/dist/{chunk-pbv2j86k.js → chunk-ha2f2cwz.js} +2 -2
- package/dist/{chunk-bdsqfsmw.js → chunk-hbm3sgw7.js} +2 -2
- package/dist/{chunk-5p4kx6nx.js → chunk-hkjj3prp.js} +2 -2
- package/dist/{chunk-expcd42p.js → chunk-j18830g5.js} +2 -2
- package/dist/{chunk-23b01zzq.js → chunk-jg6r0ckn.js} +2 -2
- package/dist/{chunk-rmhgmrdk.js → chunk-jwzwz2wr.js} +2 -2
- package/dist/{chunk-ryh1rjgt.js → chunk-jxgtgpa9.js} +2 -2
- package/dist/{chunk-sbd8f63t.js → chunk-jzaxy8af.js} +2 -2
- package/dist/{chunk-p0jeje65.js → chunk-k10kbwqc.js} +2 -2
- package/dist/{chunk-67t9pyqt.js → chunk-kctrzc57.js} +2 -2
- package/dist/{chunk-xrrsxjst.js → chunk-kjt77brz.js} +2 -2
- package/dist/chunk-kmeccf75.js +2 -0
- package/dist/{chunk-ybmvk9bj.js → chunk-kxw57gdb.js} +2 -2
- package/dist/{chunk-2g2ydnbw.js → chunk-m1adrey8.js} +2 -2
- package/dist/{chunk-tv8k9r9m.js → chunk-m7wse5yk.js} +2 -2
- package/dist/{chunk-ea6cx4zd.js → chunk-n3d2mv93.js} +3 -3
- package/dist/{chunk-stcp2kyv.js → chunk-njre3ygs.js} +2 -2
- package/dist/{chunk-d9c5361b.js → chunk-nm4dtceb.js} +2 -2
- package/dist/{chunk-jhhvtcp8.js → chunk-np76wm1k.js} +2 -2
- package/dist/{chunk-eyqnxv1e.js → chunk-nsy1ne51.js} +2 -2
- package/dist/{chunk-cawd39p2.js → chunk-p38vws4a.js} +2 -2
- package/dist/{chunk-xzhxg3fn.js → chunk-p5mfv6t6.js} +2 -2
- package/dist/{chunk-yf4cr44n.js → chunk-p6gwrqjp.js} +2 -2
- package/dist/{chunk-mg2js52j.js → chunk-pdrz9qs1.js} +2 -2
- package/dist/{chunk-mwre38v3.js → chunk-pks7f314.js} +5 -5
- package/dist/{chunk-fwjdx5an.js → chunk-pza08wvz.js} +2 -2
- package/dist/{chunk-0xtdc07w.js → chunk-q0bwkhpy.js} +2 -2
- package/dist/{chunk-nsackhh2.js → chunk-q5fn378d.js} +2 -2
- package/dist/{chunk-eaps0vme.js → chunk-q9h89nv1.js} +2 -2
- package/dist/{chunk-fytmxmdj.js → chunk-qm649qdv.js} +2 -2
- package/dist/{chunk-bj7hfsbz.js → chunk-rfahybr0.js} +1 -1
- package/dist/{chunk-gkvc394d.js → chunk-s4m2h876.js} +1 -1
- package/dist/chunk-s8xpf179.js +2 -0
- package/dist/{chunk-bypzxwxt.js → chunk-stqqrke0.js} +2 -2
- package/dist/{chunk-5tfyyc5a.js → chunk-stzsxdpp.js} +2 -2
- package/dist/{chunk-pd8hv1z9.js → chunk-t1zw5wrq.js} +2 -2
- package/dist/{chunk-t8n1ny7h.js → chunk-tptx1zs3.js} +2 -2
- package/dist/{chunk-q7aqfe35.js → chunk-tqz7csrk.js} +2 -2
- package/dist/{chunk-fm2z743r.js → chunk-v0mbfaqw.js} +2 -2
- package/dist/{chunk-e159yyzf.js → chunk-v5mb5c61.js} +2 -2
- package/dist/{chunk-9fxfprgs.js → chunk-vttgk30b.js} +2 -2
- package/dist/chunk-w65d6934.js +2 -0
- package/dist/chunk-w7p443ya.js +1 -0
- package/dist/{chunk-me3wzsyg.js → chunk-wbhxpwm7.js} +2 -2
- package/dist/chunk-wr5r2t2m.js +2 -0
- package/dist/{chunk-vngx7fht.js → chunk-wwq7d7qm.js} +1 -1
- package/dist/{chunk-382tg8fq.js → chunk-wyr7zv2j.js} +2 -2
- package/dist/{chunk-t5hxmkmk.js → chunk-x6yxbndc.js} +2 -2
- package/dist/{chunk-n2bzp8tm.js → chunk-xbqvb31f.js} +2 -2
- package/dist/{chunk-hgar92ae.js → chunk-xgcwrqpw.js} +2 -2
- package/dist/{chunk-7phr0tnr.js → chunk-xgyb00qq.js} +2 -2
- package/dist/{chunk-3wv9dsht.js → chunk-xrbydq2j.js} +2 -2
- package/dist/{chunk-fzfmg9pk.js → chunk-yftn8cw0.js} +2 -2
- package/dist/{chunk-pj2cv8fz.js → chunk-yfws137b.js} +2 -2
- package/dist/{chunk-85vqfa42.js → chunk-ym6h1x3a.js} +1 -1
- package/dist/{chunk-1xsfk3pf.js → chunk-yvr086m7.js} +2 -2
- package/dist/{chunk-fd3p9rqe.js → chunk-z5c4njqk.js} +2 -2
- package/dist/{chunk-28737pjc.js → chunk-zae7p9pm.js} +2 -2
- package/dist/{chunk-3axrv16v.js → chunk-zfag3ne0.js} +2 -2
- package/dist/{chunk-b5wvtzdr.js → chunk-zjevkw68.js} +2 -2
- package/dist/{chunk-3365b0ne.js → chunk-zk2hwm10.js} +2 -2
- package/dist/{chunk-47zq7h2n.js → chunk-zmbf0v0n.js} +2 -2
- package/dist/chunk-zqe4mjgy.js +2 -0
- 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/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.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/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/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/locales.d.ts +13 -0
- package/dist/locales.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/panel-item.js +1 -1
- package/dist/plugins/plugin-detail-page.js +1 -1
- package/dist/plugins/plugin-icon.js +1 -1
- package/dist/plugins/plugin-icons.js +1 -1
- package/dist/plugins/plugins-page.js +1 -1
- package/dist/plugins/plugins.js +1 -1
- package/dist/plugins/read-skill-document.js +1 -1
- package/dist/plugins/skill-document.js +1 -1
- package/dist/plugins/skills-tab.js +1 -1
- package/dist/plugins/store.js +1 -1
- package/dist/plugins/toolbox-layout.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.d.ts +5 -0
- 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/use-activity-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-image-references.d.ts +3 -0
- package/dist/session-timeline/assistant-image-references.js +1 -0
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/image-generation-progress.d.ts +4 -0
- package/dist/session-timeline/image-generation-progress.js +1 -0
- 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/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/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/package.json +2 -2
- package/dist/chunk-2f8t38fg.js +0 -2
- package/dist/chunk-5akfmr5g.js +0 -2
- package/dist/chunk-6h3yegwm.js +0 -2
- package/dist/chunk-8c0f9agv.js +0 -2
- package/dist/chunk-8ckxhxqq.js +0 -2
- package/dist/chunk-9gnce8bk.js +0 -2
- package/dist/chunk-a59zda76.js +0 -2
- package/dist/chunk-g8nphzck.js +0 -2
- package/dist/chunk-qhgn09vf.js +0 -1
- package/dist/chunk-v07v13k1.js +0 -2
- package/dist/chunk-v2qd3fcr.js +0 -2
- package/dist/chunk-vssh28er.js +0 -3
- package/dist/chunk-z441gmv3.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
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):`[
|
|
1
|
+
import{e}from"./chunk-6pnsagt4.js";import{Pt}from"./chunk-80r0jch1.js";import{B,Ge,q,xt}from"./chunk-84gk74hf.js";import{vt,yt}from"./chunk-bpenajbp.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 $n({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 ir({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=yt(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 vt(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(Pt,{bridge:d})]}),C&&t($n,{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(Kn,{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(Wn,{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(on,{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(on,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function Kn({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 qn({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(qn,{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 Wn({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=xt(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 on({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{
|
|
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(Ge(I)),K(null)}catch(D){K(W(D));return}z(m)},G=async()=>{let m;try{m=Ge(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{$n,ir,Kn,qn,Wn,on};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{S}from"./chunk-958qyr8g.js";import{createContext as m,useContext as c,useState as y,useSyncExternalStore as D}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as L,DialogContent as h,DialogDescription as w,DialogFooter as P,DialogHeader as H,DialogTitle as R}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var g=m(null),v=m(null),f=m(null);function Er({host:e,client:t,children:i}){let[s,l]=y(null);S(s!==null);let{t:u}=e;return o(g,{value:e,children:o(v,{value:t,children:d(f,{value:l,children:[i,o(L,{open:s!==null,onOpenChange:(x)=>!x&&l(null),children:d(h,{children:[d(H,{children:[o(R,{children:u("sessionList.deleteTitle")}),o(w,{children:u("sessionList.deleteDescription")})]}),d(P,{children:[o(C,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(C,{onClick:()=>{if(s)p(e,t.delete(s.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function r(){let e=c(g);if(e===null)throw Error("Session list host is missing");return e}function po(){return c(g)}function a(){let e=c(v);if(e===null)throw Error("Session list client is missing");return e}function Ft(){let e=c(f);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=a();return D((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function p(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
|
|
2
|
+
export{Er,r,po,a,Ft,n,p};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function
|
|
1
|
+
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function Xo(e){let t=0,i=0;for(let o of e.split(`
|
|
2
2
|
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function et({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
|
|
3
|
-
export{
|
|
3
|
+
export{Xo,et};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{T}from"./chunk-32s8dn1a.js";import{ie}from"./chunk-76a04a6j.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function vi({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(T,{text:t.content,streaming:!1})});if(!n(t))return null;return e(ie,{entries:t.entries})}
|
|
2
|
+
export{vi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d,T}from"./chunk-
|
|
2
|
-
`),b=!t.streaming&&C.trim().length>0?o(
|
|
3
|
-
export{
|
|
1
|
+
import{d,T}from"./chunk-32s8dn1a.js";import{V}from"./chunk-1fh3vvpe.js";import{ci}from"./chunk-xgcwrqpw.js";import{ie}from"./chunk-76a04a6j.js";import{di,ot}from"./chunk-wwq7d7qm.js";import{gi}from"./chunk-e0c8pmjc.js";import{Mn}from"./chunk-zfag3ne0.js";import{cn as M}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,w=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return v.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(T,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(T,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ie,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var E=new Set;function wa({message:t,isMostRecentTurn:n,hiddenTools:s=E,time:i,beforeCopy:r,afterCopy:c,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
|
|
2
|
+
`),b=!t.streaming&&C.trim().length>0?o(bn,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:c,time:i}):null,l=ci(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),B=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&V(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(ot,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===B?b:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Cn,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(gi,{blocks:f}):y(f))})}function bn({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let c=d(),{t:u}=c;return g("div",{className:M("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Mn,{text:t,label:u("actions.copy"),host:c}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=d();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Cn({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...c}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(di,{...c,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
|
|
3
|
+
export{wa,bn,Cn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{fe}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{fe}from"./chunk-m1adrey8.js";function co(r){let s=fe(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function ge(r){return co(r).join(fe()?"":"+")}
|
|
2
|
+
export{co,ge};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C,
|
|
2
|
-
export{
|
|
1
|
+
import{C,rn}from"./chunk-70bm3f7n.js";import{bt}from"./chunk-84gk74hf.js";import{useEffect as p,useRef as P,useState as u}from"react";var Zn="providers:changed",Qn="providers:managed-revoked",i=(e)=>e;function rr(){return{read:()=>i(C.providersRead()),save:(e,r,t)=>i(C.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(C.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(C.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>C.providersTest({providerId:e}),apply:()=>i(C.providersApply()),onChanged:(e)=>rn[Zn].listen((r)=>e(r.payload))}}function ar(){return{bind:(e)=>C.providersAccountBind({account:e}),refresh:(e,r)=>i(C.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await C.providersClearManaged()},onRevoked:(e)=>rn[Qn].listen((r)=>e(r.payload.sessionIds))}}async function vt(e){try{return await e.apply()}catch(r){if(!bt(r))throw r;return e.read()}}function yt(e,r=console.error){let[t,d]=u(null),a=P(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
|
|
2
|
+
export{Zn,Qn,rr,ar,vt,yt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
2
|
-
export{Le,
|
|
1
|
+
import{o}from"./chunk-f1r8wh4e.js";import{e}from"./chunk-6pnsagt4.js";import{g,K}from"./chunk-w0dfvr05.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=g(a.configOptions,"model");return t===void 0?void 0:K(t)}function Le(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=g(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(l?.inputTokens),k=f(l?.outputTokens),x=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||N+k+x+w,R=N+x,C=R>0?A.format(x/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(N)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(x)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],v=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Le(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var Gt=W(_);
|
|
2
|
+
export{Le,Gt};
|
|
@@ -1,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 Zo({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{Zo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Go}from"./chunk-nsy1ne51.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 Bo(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 Go(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{Bo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{n}from"./chunk-a8gzs651.js";import{he,G,oe}from"./chunk-c7p3vpyx.js";import{useEffect as S,useMemo as f}from"react";function hr(s){let c=G((i)=>i.activityOrder),a=n((i)=>{let o=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&he(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(o)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=G((i)=>i.activitySeen),r=oe();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,o])=>u.get(i)!==o)}
|
|
2
|
+
export{hr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
export{he,
|
|
1
|
+
import{a}from"./chunk-a8gzs651.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function he(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>he(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!he(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function cn(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Ir(t){u.get(t)?.set(v(t))}function G(t){let n=cn(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function oe(){return cn(a()).set}function Nr(){let t=G((e)=>e.view),n=oe();return[t,(e)=>n({view:e})]}
|
|
2
|
+
export{he,cn,Ir,G,oe,Nr};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{isText as f}from"@nyssance/codex-acp-v2/client";import{useRef as p}from"react";function
|
|
1
|
+
import{isText as f}from"@nyssance/codex-acp-v2/client";import{useRef as p}from"react";function To(l,c){let i=p(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==l.id||e.value!==n.value))i.current=null,e=null;let u=t.key==="ArrowUp";if(u?n.value.slice(0,n.selectionStart).includes(`
|
|
2
2
|
`):n.value.slice(n.selectionEnd).includes(`
|
|
3
3
|
`))return;if(!e){if(!u||n.value!=="")return;let s=l.items.flatMap((o)=>{if(o.kind!=="user")return[];let a=o.content.filter(f).map((d)=>d.text).join(`
|
|
4
4
|
`);return a.trim()?[a]:[]});if(!s.length)return;e={sessionId:l.id,entries:s,index:s.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(u?-1:1)));let r=e.entries[e.index]??"";if(e.value=r,c(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
|
|
5
|
-
export{
|
|
5
|
+
export{To};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function jn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function nn(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function Ne(t){return t.type==="array"}function ht(t){return(Ne(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
|
|
2
|
+
export{jn,nn,Ne,ht};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function mn({name:p,value:M,levels:h,disabled:c,onChange:P,trackWidth:f=100}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
|
|
2
|
+
export{mn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l,i}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{l,i}from"./chunk-g79y6q3f.js";import{F,D,J,H,O,se}from"./chunk-w7p443ya.js";import{ae}from"./chunk-rfahybr0.js";import{h}from"./chunk-9cqpn67f.js";import{de}from"./chunk-8d86yqzq.js";import{U,le}from"./chunk-yftn8cw0.js";import{CheckIcon as V,SparklesIcon as X,XIcon as _}from"lucide-react";import{useDeferredValue as K,useState as v}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as Q,DialogClose as R,DialogContent as W,DialogDescription as Y,DialogHeader as Z,DialogTitle as ee}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as te}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as ne}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ie}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as oe,TabsContent as re,TabsList as ce,TabsTrigger as pe}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function P({skill:c}){let{assetUrl:m}=l(),[u,s]=v(!1),o=c.interface?.iconSmall,b=o&&m?m(o):c.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:b&&!u?t("img",{src:b,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(X,{className:"text-muted-foreground size-6"})})}function me({skill:c}){let{t:m}=l(),u=i((o)=>o.setSkillEnabled),s=i((o)=>(c.path in o.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(ne,{className:"text-muted-foreground size-3.5"}),t(ie,{checked:c.enabled,disabled:s,"aria-label":`${m(c.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${c.interface?.displayName??c.name}`,onCheckedChange:(o)=>void u(c,o)})]})}function ut({query:c,ready:m,onOpenPlugin:u}){let{t:s}=l(),o=i((e)=>e.skills),b=i((e)=>e.skillErrors),j=i((e)=>e.loading)||!m,z=i((e)=>e.installed),M=i((e)=>e.skillProjects),[E,L]=v(null),[k,B]=v(!1),[G,C]=v(null),x=K(c.trim().toLowerCase()),r=o.find((e)=>e.path===G),N=z.find(({plugin:e})=>e.id===r?.pluginId),p=o.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(x)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),d=[...["user","system","admin"].flatMap((e)=>{let a=o.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(M).flatMap(([e,a])=>{if(!o.some((T)=>T.scope==="repo"&&a.includes(T.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],q=d.map((e)=>e.label);for(let e of d)if(e.path&&q.filter((a)=>a===e.label).length>1)e.label=e.path;let g=d.find((e)=>e.id===E)??d[0],w=g?p.filter((e)=>g.paths.has(e.path)):[],A=k||x?p:p.slice(0,6),I=(e)=>t(O,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(se,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(H,{className:"pointer-events-none relative translate-none! self-center!",children:t(P,{skill:a})}),n(D,{className:"pointer-events-none relative min-w-0",children:[t(te,{className:"block truncate",children:a.interface?.displayName??a.name}),t(J,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(F,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(V,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(h,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${U} space-y-8 pt-6`,children:[b.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),j?t(ae,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:p.length})})]}),p.length?I(A):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(x?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!x&&p.length>6&&t(y,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":k,onClick:()=>B((e)=>!e),children:k?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:p.length-6})})]}),g&&n(oe,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")L(e)},className:"gap-6",children:[t(ce,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:d.map((e)=>t(pe,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),d.map((e)=>t(re,{value:e.id,children:e.id===g.id&&(w.length?I(w):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(Q,{open:!!r,onOpenChange:(e)=>{if(!e)C(null)},children:t(W,{showCloseButton:!1,className:le,children:r&&n(S,{children:[t(de,{path:r.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(P,{skill:r}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(me,{skill:r}),e,t(R,{render:t(y,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(_,{})})]})]}),n(Z,{className:"gap-3",children:[t(ee,{className:"text-2xl leading-8 font-semibold break-words",children:r.interface?.displayName??r.name}),t(Y,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:r.description})]})]})},r.path),r.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),N?t(y,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(N)},children:N.plugin.interface?.displayName??N.plugin.name}):r.pluginId]})]})})})]})}
|
|
2
|
+
export{ut};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d}from"./chunk-
|
|
2
|
-
`).length}function
|
|
3
|
-
export{
|
|
1
|
+
import{d}from"./chunk-32s8dn1a.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
+
`).length}function ia(e){let c=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let a=u,f=a._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of a.changes){let i=c.get(n.path);if(i)i.additions+=l,i.deletions+=h;else c.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...c.values()]}function gi({blocks:e}){return s(_n,{files:ia(e)})}function _n({files:e,onOpen:c,renderPath:r,actions:u}){let{t:a,openLink:f}=d(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:a("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:a(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:a("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>c===void 0?f(t.path):c(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[a(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
+
export{ia,gi,_n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function
|
|
2
|
-
export{
|
|
1
|
+
class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function Ei(i,e){return n??=new s,n.connect(i,e)}
|
|
2
|
+
export{Ei};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t=new Map;var a=0;function
|
|
2
|
-
export{
|
|
1
|
+
var t=new Map;var a=0;function An(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=An(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Li(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
+
export{An,Li};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function
|
|
2
|
-
export{
|
|
1
|
+
function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function zt(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
|
|
2
|
+
export{zt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{Se,t,_e,X,o,
|
|
1
|
+
import{Qi}from"./chunk-32s8dn1a.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(Qi,{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 ct(e,n){if(e.reportError)e.reportError(n);else console.error(n)}
|
|
2
|
+
export{Se,t,_e,X,o,ct};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Gn}from"./chunk-tptx1zs3.js";import{jsx as o}from"react/jsx-runtime";function gt(){return o("svg",{"aria-hidden":"true",focusable:"false",width:0,height:0,className:"pointer-events-none absolute",dangerouslySetInnerHTML:{__html:Gn}})}var n=["agent-mode","application-window","audiowave","bar-chart","block-stack-skills","book-open","briefcase","bubble-on-bubble","checkmark-circle","code","compass","components-window","credit-card","csv","document","docx","exclamationmark-bubble","figma-document","figure-text-document","file-video","flash","folder","game-controller","globe","heart","heart-bubble","heart-text-clipboard","hierarchy","jpg-document","kettlebell","ladybug","lightbulb","lightning-bolt","magnifingglass","map","mappin","microphone","ms-word-document","newspaper","paperclip","pdf-document","pencil","phone","photo","png-document","pointer","ppt-document","pptx","puzzle","radar","shield","shopping-bag","skill-creator","skill-installer","star-app","star-bookmark","template-creator","terminal","text-bubble-figure","text-document","text-document-lock","text-note-pointer","triangle-vercel","xls-document-excel","xlsx"];function Bn(t){let e=0;for(let r of t)e=(e*31+r.charCodeAt(0))%997;return`#plugin-${n[e%n.length]}`}function M({name:t,className:e="size-6 shrink-0"}){return o("svg",{"aria-hidden":"true",focusable:"false",width:36,height:36,viewBox:"0 0 36 36",className:e,children:o("use",{href:Bn(t)})})}
|
|
2
|
+
export{gt,Bn,M};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c}from"./chunk-k7y6dqf2.js";import{cn as o}from"cn";import{motion as u}from"motion/react";import{jsx as i,jsxs as g}from"react/jsx-runtime";function We({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&c,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function
|
|
2
|
-
export{We,
|
|
1
|
+
import{c}from"./chunk-k7y6dqf2.js";import{cn as o}from"cn";import{motion as u}from"motion/react";import{jsx as i,jsxs as g}from"react/jsx-runtime";function We({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&c,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function Lr({tabs:n,view:r,onViewChange:s,onReset:a,notifications:l,trailing:p,className:d}){return g("div",{className:o("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",d),children:[i("div",{role:"tablist",className:"bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-52 flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]",children:n.map((e)=>{let t=r===e.key;return g(We,{role:"tab",active:t,expanded:t,highlight:!1,"aria-selected":t,title:e.title,onClick:()=>s(e.key),onDoubleClick:a&&(()=>a(e.key)),className:o("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-[18px] [&_svg]:shrink-0",t?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[t&&i(u.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-destructive pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:o("relative z-10 grid",t?"ms-1.5 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})}),p!=null&&i("div",{className:"ms-auto flex shrink-0 items-center gap-0.5",children:p})]})}
|
|
2
|
+
export{We,Lr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}function T({subject:t,requestTitle:n}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==n&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(et,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,n){let{host:s,client:r}=e();return(l)=>{try{if(n)n(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(
|
|
1
|
+
import{Qo}from"./chunk-qm649qdv.js";import{Wo}from"./chunk-x6yxbndc.js";import{Zo}from"./chunk-bt0t1pev.js";import{et}from"./chunk-a8j61zs9.js";import{o}from"./chunk-f1r8wh4e.js";import{e}from"./chunk-6pnsagt4.js";import{isContentEntry as f,isDiffEntry as g,isFormElicitation as x,isText as h,isToolCallSubject as b,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as a,jsxs as m}from"react/jsx-runtime";function Fe(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let n=t._meta?.codex;if(typeof n!=="object"||n===null)return null;let s=n.description;return typeof s==="string"?s:null}function A(t){let n=t.rawInput;if(typeof n!=="object"||n===null)return null;let s=n.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let n of t.content??[])if(g(n)&&n.patch&&n.patch.text.length>0)return n.patch.text;return null}function R(t){return(t.content??[]).filter(f).map((n)=>h(n.content)?n.content.text:"").filter((n)=>n.length>0).join(`
|
|
2
|
+
`)}function T({subject:t,requestTitle:n}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==n&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(et,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,n){let{host:s,client:r}=e();return(l)=>{try{if(n)n(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(Qo,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:n,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function Je({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=o((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(Wo,{requestId:t.id,schema:t.params.requestedSchema,message:i?.subagent?`${i.title??r.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:n,t:r.t,onRespond:l})}function we({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s);if(t.kind==="permission")return a(C,{action:t,total:n,onRespond:s});if(Fe(t))return a(Je,{action:t,total:n??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(Zo,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
3
|
export{Fe,Je,we};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{bn,Cn}from"./chunk-ajjd22hb.js";import{P}from"./chunk-n3d2mv93.js";import{nt}from"./chunk-jkyepwr1.js";import{Nn}from"./chunk-kxw57gdb.js";import{t}from"./chunk-f1r8wh4e.js";import{Ri,re,st,Di}from"./chunk-658y6xth.js";import{wn}from"./chunk-0y1c3v1b.js";import{ke}from"./chunk-gwa7hbzr.js";import{Sn}from"./chunk-fqgz93sy.js";import{In}from"./chunk-zmbf0v0n.js";import{mi}from"./chunk-pks7f314.js";import{fi}from"./chunk-8689y4n5.js";import{vi}from"./chunk-acnqnrqb.js";import{yi}from"./chunk-ha2f2cwz.js";import{Pn,Tn}from"./chunk-np76wm1k.js";import{it}from"./chunk-tv1frh1m.js";import{codexMessageError as q,codexTurnError as z,isContentEntry as le,isEmbeddedResource as Z,isImage as ee,isResourceLink as de,isText as ce,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{SparklesIcon as ue}from"lucide-react";import{Fragment as X,memo as pe,useEffect as fe,useState as ye}from"react";import{jsx as i,jsxs as m,Fragment as A}from"react/jsx-runtime";function Y(s){if(ee(s))return`${s.mimeType.toLowerCase()}:${s.data}`;if(Z(s)&&"blob"in s.resource&&s.resource.mimeType?.toLowerCase().startsWith("image/"))return`${s.resource.mimeType.toLowerCase()}:${s.resource.blob}`;return null}function he({item:s}){let{t:n}=t(),l=s.status==="in_progress",[o,g]=ye(()=>Date.now()-s.at>=1e4);return fe(()=>{if(!l)return;let a=Math.max(0,s.at+1e4-Date.now());if(g(a===0),a===0)return;let h=setTimeout(()=>g(!0),a);return()=>clearTimeout(h)},[s.id,s.at,l]),m("div",{className:"codex-context-compaction",children:[i(ue,{"aria-hidden":"true"}),i("span",{children:s.status==="completed"?n("stream.codex.contextCompacted"):s.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:s,entry:n,terminals:l,streaming:o,streamingThoughtId:g}){let{t:a}=t();switch(n.kind){case"activity":return i(wn,{sessionId:s,items:n.items,terminals:l,streamingThoughtId:g});case"text":return P(n.item._meta).length>0?i(In,{sessionId:s,item:n.item}):i(ke,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return i(vi,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(Pn,{children:[i("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&i("div",{children:n.item.error})]});return i(he,{item:n.item})}}function xe({sessionId:s,turn:n,terminals:l,active:o,blocked:g=!1,continued:a=!1,edits:h=n.edits,activityItems:M=n.items,workStartedAt:te=n.startedAt,isLast:F,error:k,interrupted:L,retry:G,retrying:p,extraWork:d=null,answerActions:O,footer:ne}){let{t:c}=t(),b=n.errors.map((e)=>{let r=q(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let E=G?.turnId===ge(e)?G:void 0;return i(Tn,{error:r,retry:E},`${e.id}:${E?.delaySeconds??"manual"}`)});if(F&&k!==null&&!n.errors.some((e)=>{let r=q(e);return r!==null&&r.stopReason===k.stopReason&&z(r).message===z(k).message}))b.push(i(Tn,{error:k},"current-run-error"));let x=b.length>0?i("div",{className:"codex-turn-errors",children:b}):null,C=n.items.filter(Nn);if(d===null&&C.length>0&&C.length===n.items.length)return m(A,{children:[i(wn,{sessionId:s,items:C,terminals:l,streamingThoughtId:null}),x]});let T=n.work,w=T.length>0&&T.every((e)=>e.kind==="compaction");if(d===null&&(Ri(n)||w&&n.final.length===0))return m(A,{children:[i("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),x]});let W=st(n),D=n.final.filter((e)=>P(e._meta).length===0).map((e)=>re({...e,content:Sn(e.content,n.items)})).join(`
|
|
2
|
+
`),I=o?null:it(n,"assistant"),B=n.items.filter((e)=>e.kind==="tool"&&(e.name==="image_generation"||e.name==="alwith_client_generate_image"||e.name==="generate_image"||e.name?.endsWith(".generate_image"))&&(e.status==="pending"||e.status==="in_progress")),H=new Set(n.final.flatMap((e)=>e.content.map(Y).filter((r)=>r!==null))),f=n.items.flatMap((e)=>{if(!nt(e))return[];return e.content.filter(le).flatMap((r,E)=>{let u=r.content,ae=ee(u),me=de(u)||Z(u)&&"blob"in u.resource;if(!ae&&!me)return[];let S=Y(u);if(S!==null){if(H.has(S))return[];H.add(S)}return[{key:`${e.id}:${E}`,block:u}]})}),K=n.final.some((e)=>P(e._meta).length===0&&e.content.some((r)=>!ce(r)||r.text.trim().length>0)),ie=B.length>0||f.length>0||w||K||n.final.some((e)=>P(e._meta).length>0),v=n.items.findIndex((e)=>n.final.includes(e)),R=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),Q=T.filter((e)=>v===-1||R(e)<v),se=T.filter((e)=>v!==-1&&R(e)>v),oe=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...se.map((e)=>({kind:"work",entry:e,index:R(e)}))].toSorted((e,r)=>e.index-r.index),V=!o&&!a&&(D.trim().length>0?i(bn,{text:D,isMostRecentTurn:F,time:I,afterCopy:O}):m("div",{className:"flex items-center gap-0.5",children:[O,I&&i("span",{className:"codex-user-time ms-1",title:I.full,children:I.short})]})),y=yi({...n,items:M},{running:o,blocked:g,retrying:p!==void 0}),j=y.kind==="reasoning"?y.ownerKey??null:null,J=y.kind==="thinking",_=Di({...n,items:M}),U=o&&!K||d?.active===!0;return m(A,{children:[i(Cn,{stateKey:JSON.stringify([s,n.replayed?"history":"live",n.key]),active:U,defaultExpanded:U||d?.defaultExpanded===!0||!n.replayed&&(L||W),..._,durationMs:d?.active?void 0:_.durationMs,startedAt:_.startedAt??te,loading:(J||y.kind==="working")&&n.work.length===0&&d===null,loadingLabel:y.kind==="working"?c("stream.codex.working"):void 0,work:[...a||w?[]:Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:o,streamingThoughtId:j},e.key)),...d===null?[]:[i(X,{children:d.content},"additional-work")]],answer:ie||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||w)&&Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),oe.map((e)=>{if(e.kind==="work")return i(N,{sessionId:s,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:j},e.entry.key);let r=e.item;return m(X,{children:[P(r._meta).length>0?i(In,{sessionId:s,item:r}):i(ke,{content:Sn(r.content,n.items),messageId:r.id,streaming:o}),r===n.final.at(-1)&&f.length===0&&V]},r.id)}),B.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":c(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[i("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&i(fi,{startedAt:e.at}),!o&&c("timeline.imageStopped")]})]},e.id)),f.length>0&&i("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:f.map((e)=>i(ke,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),(n.final.length===0||f.length>0)&&V]}):null,footer:m(A,{children:[J&&n.work.length>0&&i("div",{className:"codex-pending-message py-2",role:"status",children:i("span",{className:"codex-activity-running",children:c("message.thinking")})}),ne,h.length>0&&!o&&!a&&i(mi,{items:h}),L&&!W&&i("div",{className:"codex-interrupted-turn",role:"status",children:c("timeline.interrupted")}),!o&&x]})}),o&&p!==void 0&&i("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return e===void 0?c("timeline.capacityReconnecting"):c("timeline.capacityReconnectingProgress",{progress:e})})():p.message}),o&&x]})}var li=pe(xe);
|
|
3
|
+
export{li};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{mn}from"./chunk-d9mmpjrr.js";import{_}from"./chunk-4jh2wk80.js";import{cn as r}from"cn";import{ArrowUpRight as pe,ChevronUp as H,Loader2Icon as W,Zap as Z}from"lucide-react";import{Fragment as ce,useState as q}from"react";import{Button as A}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as J,DropdownMenuCheckboxItem as K,DropdownMenuContent as Q,DropdownMenuGroup as D,DropdownMenuItem as y,DropdownMenuLabel as L,DropdownMenuSeparator as u,DropdownMenuSub as S,DropdownMenuSubContent as T,DropdownMenuSubTrigger as C,DropdownMenuTrigger as X}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as he}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as Y,TooltipContent as E,TooltipTrigger as ee}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as e,jsxs as a,Fragment as p}from"react/jsx-runtime";function No({value:c,onChange:ne,models:x,modelGroups:O,compactCatalog:o,catalogHeight:ae="fixed",effortPresentation:j="slider",unavailableEffort:v,providerMenu:h,header:w,className:B,condensed:V,stripLabelPrefix:z,showDescription:se,showModelList:ie=!0,loading:oe,switching:G,isLoading:te,effortConfig:s,booleanOptions:k,onBooleanChange:R,selectOptions:le=[],t:m,...d}){let[de,re]=q(!1),[me,ue]=q(!1),l=k?.find((n)=>n.id==="fast_mode"),I=o?k?.filter((n)=>n!==l):k,P=(n)=>z&&n.startsWith(z)?n.slice(z.length):n;if(oe)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(A,{variant:"ghost",disabled:!0,className:r("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(W,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:m("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&a(J,{open:de,onOpenChange:re,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(A,{"data-testid":"provider-trigger",variant:"ghost",disabled:d.disabled,className:r("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,e(H,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(E,{children:m("model.switchProvider")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((n,t)=>a(ce,{children:[t>0&&n.length>0&&e(u,{}),e(_,{value:h.value,onValueChange:h.onChange,options:n})]},t)),h.moreAction&&a(p,{children:[e(u,{}),a(y,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(J,{open:me,onOpenChange:ue,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(A,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:r("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",V&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,k?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(Z,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",V&&"text-[11px]"),children:P(c.label)||m("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,t)=>t.name.length>n.length?t.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(W,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(H,{className:r("size-3 shrink-0",V&&"size-2.5")})]})})}),e(E,{children:m("model.switchModel")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:r("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",o&&"flex w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5",o&&(ae==="content"?"max-h-[min(350px,var(--available-height))]":"h-[350px]")),children:[o&&a(p,{children:[a(D,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(mn,{...s,disabled:d.disabled})}):a(S,{children:[a(C,{disabled:d.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(_,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):v?a(y,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:v.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:w?.name}),l&&e(K,{"aria-label":l.name,title:l.title??l.name,disabled:d.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>R?.(l.id,n),className:r("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(Z,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),w&&!o&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(u,{})]}),a(D,{"data-model-menu-list":o?"":void 0,className:o?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ie&&(te?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):x.length===0?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=x.filter((i)=>!i.more),t=x.filter((i)=>i.more),F=n.length>0&&t.length>0,N=(i,g)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:g?.noDescription?void 0:se?i.description:void 0}),M=(i)=>{let g=x.find((f)=>f.api_id===i);if(g)ne(g)};if(o)return e(_,{value:c.api_id,onValueChange:M,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((i)=>N(i))});return a(p,{children:[O?O.map((i)=>{let g=i.models.filter((b)=>!b.more),f=i.models.filter((b)=>b.more),U=g.length>0&&f.length>0;return a(D,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(_,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(U?g:i.models).map((b)=>N(b))}),U&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(_,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:f.map((b)=>N(b,{noDescription:!0}))})})]})]},i.id)}):e(_,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(F?n:x).map((i)=>N(i))}),!O&&F&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(_,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:t.map((i)=>N(i,{noDescription:!0}))})})]})]})})()),!o&&s&&a(p,{children:[e(u,{}),j==="menu"?a(S,{children:[a(C,{disabled:d.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(_,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(mn,{...s,disabled:d.disabled})]}),!o&&!s&&v&&a(p,{children:[e(u,{}),a(y,{disabled:!0,children:[e("span",{className:"flex-1",children:v.name}),e("span",{children:v.label})]})]}),le.map((n)=>a(D,{children:[e(u,{}),e(L,{children:n.name}),e(_,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),I&&I.length>0&&a(p,{children:[!s&&e(u,{}),I.map((n)=>o?a(K,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(t)=>R?.(n.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:r("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:r("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:r("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(he,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(t)=>R?.(n.id,t)})]},n.id))]})]}),o&&w?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(D,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
|
|
2
|
+
export{No};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{at}from"./chunk-stqqrke0.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=at();function Sn(f,m){let i=new Set;for(let e of m){if(e.kind!=="tool"||e.status!=="completed")continue;let o=e.content.filter(u);if(!o.some((n)=>c(n.content)))continue;o.forEach((n,a)=>{if(c(n.content))i.add(`${e.id}:${a}`);if(!s(n.content))return;let r;try{r=JSON.parse(n.content.text)}catch(t){if(t instanceof SyntaxError)return;throw t}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let t of r.images)if(t!==null&&typeof t==="object"&&typeof t.reference==="string")i.add(t.reference)})}if(i.size===0)return f;return f.map((e)=>{if(!s(e)||!e.text.includes("!["))return e;let o=d.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let a=0;return n.tokens.map((t)=>(a+=t.raw.length,t.type==="image"&&i.has(t.href)?"":t.raw)).join("")+n.raw.slice(a)}).join("");return o===e.text?e:{...e,text:o}}).filter((e)=>!s(e)||e.text.trim().length>0)}
|
|
2
|
+
export{Sn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function
|
|
2
|
-
export{
|
|
1
|
+
import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function Vt(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
|
|
2
|
+
export{Vt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c}from"./chunk-k7y6dqf2.js";import{r}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{c}from"./chunk-k7y6dqf2.js";import{r}from"./chunk-a8gzs651.js";import{m,u}from"./chunk-3m59n5gr.js";import{We}from"./chunk-fbmbc4wt.js";import{cn as s}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as p}from"lucide-react";import{DropdownMenu as d,DropdownMenuContent as g,DropdownMenuItem as f,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as L}from"react/jsx-runtime";function Mr({onCollapseAll:i}){let{t:n}=r();return L(d,{children:[o(w,{render:o(We,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(p,{})}),o(g,{align:"end",className:"w-52",children:o(f,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Ar({screen:i,onSwitch:n}){let{t:e}=r(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(u,{className:s(c,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(m,{children:i==="main"?o(a,{}):o(l,{})})})}
|
|
2
|
+
export{Mr,Ar};
|