@alwith/module-chat 0.5.24 → 0.5.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/catalogs/alwith/models.json +1 -4
- package/assets/catalogs/custom/models.json +16 -61
- package/assets/catalogs/custom/sources.json +16 -74
- package/assets/catalogs/deepseek/models.json +2 -7
- package/assets/catalogs/openrouter/models.json +6 -22
- package/assets/catalogs/qwen/models.json +5 -19
- package/assets/catalogs/xai/models.json +3 -12
- 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-f5gsffbv.js → chunk-03x33m2h.js} +2 -2
- package/dist/chunk-04kcmpnb.js +2 -0
- package/dist/chunk-04xjj6q3.js +2 -0
- package/dist/{chunk-855w49k0.js → chunk-09zfz3ap.js} +2 -2
- package/dist/{chunk-qwfw4xpn.js → chunk-0kdemqjf.js} +2 -2
- package/dist/{chunk-95mynf7q.js → chunk-10emnq39.js} +2 -2
- package/dist/{chunk-vnsgjnp3.js → chunk-13yrk1nh.js} +2 -2
- package/dist/{chunk-1e0e41vw.js → chunk-1dbc0cfj.js} +1 -1
- package/dist/{chunk-kmdag4vy.js → chunk-1zh28e39.js} +2 -2
- package/dist/{chunk-fmjez7xp.js → chunk-22tg663v.js} +2 -2
- package/dist/{chunk-nj9y0bwb.js → chunk-2ac213n3.js} +2 -2
- package/dist/{chunk-wm0jty6e.js → chunk-2apyrry0.js} +2 -2
- package/dist/{chunk-99fh3f1v.js → chunk-2djv6s3a.js} +2 -2
- package/dist/{chunk-3bsk6xcf.js → chunk-2dvryx1q.js} +2 -2
- package/dist/{chunk-pz0v5f2k.js → chunk-2qgz3m2a.js} +2 -2
- package/dist/{chunk-ttqy9d4r.js → chunk-2x9mxyxr.js} +1 -1
- package/dist/chunk-3f3y9t21.js +2 -0
- package/dist/{chunk-8hf11jas.js → chunk-3jwbx8ch.js} +2 -2
- package/dist/{chunk-4r7j0ymq.js → chunk-3mfdf7f8.js} +2 -2
- package/dist/{chunk-ypk1gwzc.js → chunk-3p9g44yz.js} +5 -5
- package/dist/{chunk-tgskd2p2.js → chunk-3xh0e0ya.js} +2 -2
- package/dist/{chunk-vt6cyes7.js → chunk-46phvpzh.js} +2 -2
- package/dist/{chunk-gsfgdnfp.js → chunk-4jghs8rf.js} +2 -2
- package/dist/{chunk-jgd6dcgy.js → chunk-4qp43adx.js} +2 -2
- package/dist/{chunk-pbf73n1s.js → chunk-4vk86bbk.js} +2 -2
- package/dist/{chunk-0wa9yjg3.js → chunk-5c5z2b48.js} +2 -2
- package/dist/chunk-5dkj3ntx.js +5 -0
- package/dist/{chunk-5ap6fvrp.js → chunk-6fefnp6e.js} +1 -1
- package/dist/{chunk-36m8zstj.js → chunk-6g7btgsr.js} +2 -2
- package/dist/{chunk-drhzcs6e.js → chunk-6rgyckw8.js} +2 -2
- package/dist/{chunk-1kbxsxft.js → chunk-6t98jn94.js} +2 -2
- package/dist/chunk-708232f3.js +2 -0
- package/dist/{chunk-jxntqarp.js → chunk-725wv6ca.js} +2 -2
- package/dist/{chunk-ececn091.js → chunk-730x182s.js} +1 -1
- package/dist/{chunk-azfmr99x.js → chunk-77cd8tev.js} +2 -2
- package/dist/{chunk-rbv1scqm.js → chunk-7a668qzy.js} +2 -2
- package/dist/{chunk-qdg5zphd.js → chunk-7appp9ad.js} +1 -1
- package/dist/{chunk-2rkrmpa7.js → chunk-81paw5rb.js} +2 -2
- package/dist/{chunk-mvs2dzyt.js → chunk-81r1geaz.js} +2 -2
- package/dist/{chunk-yg3xhn5m.js → chunk-8xdak312.js} +2 -2
- package/dist/{chunk-k7ye738q.js → chunk-8zrfdjy4.js} +2 -2
- package/dist/chunk-99ftqpgg.js +4 -0
- package/dist/{chunk-sqjgh9e2.js → chunk-9geb2z3g.js} +3 -3
- package/dist/{chunk-pmkk6e5x.js → chunk-a15vdarc.js} +2 -2
- package/dist/{chunk-qmzb07jg.js → chunk-a3tbf7mx.js} +2 -2
- package/dist/{chunk-g44hhdha.js → chunk-a5htm58g.js} +2 -2
- package/dist/chunk-a90z5e8w.js +2 -0
- package/dist/{chunk-60neqgfx.js → chunk-ab0err7k.js} +2 -2
- package/dist/{chunk-6t5war9h.js → chunk-ap6sr2c6.js} +2 -2
- package/dist/{chunk-r19q0w11.js → chunk-awfvvmjt.js} +2 -2
- package/dist/{chunk-ckyat78p.js → chunk-b1rvs016.js} +2 -2
- package/dist/{chunk-x3y5htkt.js → chunk-b6nbarjg.js} +2 -2
- package/dist/{chunk-mnzqtg7h.js → chunk-b7z51agd.js} +1 -1
- package/dist/{chunk-qd1z91fm.js → chunk-bfcswk98.js} +2 -2
- package/dist/{chunk-b12v22de.js → chunk-btdrvsgy.js} +1 -1
- package/dist/{chunk-3yxjh7b1.js → chunk-ce3wg766.js} +2 -2
- package/dist/{chunk-988sgbn9.js → chunk-ch5v5zsw.js} +2 -2
- package/dist/{chunk-3s94ekrs.js → chunk-chq163r8.js} +2 -2
- package/dist/{chunk-agqnt7xq.js → chunk-cpe2b276.js} +2 -2
- package/dist/{chunk-pwjz3yxb.js → chunk-crx8p5zx.js} +2 -2
- package/dist/{chunk-x2jd9bpn.js → chunk-d3j5904d.js} +3 -3
- package/dist/{chunk-3e6wcamp.js → chunk-dfcks9g4.js} +2 -2
- package/dist/{chunk-j322kgxf.js → chunk-dwn6bx69.js} +2 -2
- package/dist/{chunk-btanfat4.js → chunk-e7j7mnmz.js} +1 -1
- package/dist/{chunk-jhzs9ab0.js → chunk-ef99py8a.js} +2 -2
- package/dist/{chunk-f1x483c9.js → chunk-epq42kf9.js} +2 -2
- package/dist/{chunk-bg03czcx.js → chunk-f06zyvek.js} +2 -2
- package/dist/{chunk-kc56dhwd.js → chunk-f7ggbprz.js} +2 -2
- package/dist/chunk-fbq107z8.js +2 -0
- package/dist/{chunk-rjw63t34.js → chunk-fgk4f0jq.js} +2 -2
- package/dist/chunk-fprj3wy4.js +2 -0
- package/dist/{chunk-ddv00vjf.js → chunk-g9gktxv9.js} +2 -2
- package/dist/{chunk-qtp1xer1.js → chunk-gjvpthp9.js} +1 -1
- package/dist/{chunk-dte0n4kf.js → chunk-h09ez7fc.js} +2 -2
- package/dist/{chunk-cqnqwa54.js → chunk-h1f8wgyb.js} +2 -2
- package/dist/{chunk-hdw3mwmb.js → chunk-h9m4z5dk.js} +3 -3
- package/dist/{chunk-74qvpvzv.js → chunk-hf3t1bxh.js} +2 -2
- package/dist/{chunk-ar4a6nyv.js → chunk-hk66xnxp.js} +1 -1
- package/dist/{chunk-4bb6dzzs.js → chunk-hsp0skqs.js} +1 -1
- package/dist/{chunk-3cssygmg.js → chunk-htzd730z.js} +2 -2
- package/dist/{chunk-vfhxerxt.js → chunk-hza92pfj.js} +2 -2
- package/dist/chunk-j2y4wx1h.js +2 -0
- package/dist/{chunk-n2e3a7n4.js → chunk-jkbss7sb.js} +1 -1
- package/dist/{chunk-cw76pj9b.js → chunk-jnc6b9r3.js} +2 -2
- package/dist/{chunk-1vf83jdk.js → chunk-jsabvejp.js} +2 -2
- package/dist/{chunk-1rg3nab3.js → chunk-jst7n5r4.js} +1 -1
- package/dist/chunk-k0dnnn77.js +2 -0
- package/dist/{chunk-j0m35s05.js → chunk-k1vkc88d.js} +1 -1
- package/dist/{chunk-m0834n5y.js → chunk-k2gwmccn.js} +2 -2
- package/dist/{chunk-h9v3pks1.js → chunk-kpp4v1hs.js} +1 -1
- package/dist/{chunk-tpbqg729.js → chunk-mahpnk66.js} +1 -1
- package/dist/chunk-mttcvwhx.js +2 -0
- package/dist/{chunk-8dbx6g7q.js → chunk-mzpdh336.js} +1 -1
- package/dist/{chunk-wb8sf2ww.js → chunk-n432m43g.js} +2 -2
- package/dist/{chunk-z3nybrbb.js → chunk-n8yww1mr.js} +2 -2
- package/dist/{chunk-7k64wn19.js → chunk-nh0s0y35.js} +3 -3
- package/dist/{chunk-7170hbdr.js → chunk-nn72eqzh.js} +2 -2
- package/dist/{chunk-509kwzxq.js → chunk-nr3spt0n.js} +2 -2
- package/dist/{chunk-f2w2sct6.js → chunk-nsb0d92p.js} +1 -1
- package/dist/{chunk-a4apcx3e.js → chunk-nv3z0brr.js} +3 -3
- package/dist/chunk-p272qmbv.js +2 -0
- package/dist/{chunk-acb8t4jt.js → chunk-p3hxcpfy.js} +2 -2
- package/dist/{chunk-apyfztsv.js → chunk-p58e9z34.js} +2 -2
- package/dist/{chunk-9j9rx57q.js → chunk-pp2qkwk7.js} +2 -2
- package/dist/{chunk-t6vcdf4j.js → chunk-pqphdgp6.js} +1 -1
- package/dist/{chunk-pprt7ntb.js → chunk-pv5g85k0.js} +4 -4
- package/dist/chunk-pzmeeawh.js +2 -0
- package/dist/chunk-q0fhp33b.js +2 -0
- package/dist/{chunk-f1gj3yzt.js → chunk-qn2jfxff.js} +2 -2
- package/dist/chunk-qn4zvgc9.js +2 -0
- package/dist/{chunk-6trv0snh.js → chunk-qqqcqvrv.js} +2 -2
- package/dist/{chunk-mj7094yh.js → chunk-rezwwmw7.js} +2 -2
- package/dist/chunk-rnrs0cqn.js +2 -0
- package/dist/{chunk-9tn2n7xv.js → chunk-rp39j6ed.js} +1 -1
- package/dist/{chunk-wgrmjfyp.js → chunk-rsp574n3.js} +2 -2
- package/dist/{chunk-g2qcyqc6.js → chunk-rvh3nbvm.js} +2 -2
- package/dist/chunk-s2w7e9pg.js +2 -0
- package/dist/{chunk-4a46cpnm.js → chunk-s7yzvpmc.js} +3 -3
- package/dist/{chunk-pzjag1mt.js → chunk-sdf73s05.js} +3 -3
- package/dist/chunk-sjg8df4m.js +2 -0
- package/dist/{chunk-bnbc6q4p.js → chunk-t2z4venp.js} +3 -3
- package/dist/{chunk-9tp0z23q.js → chunk-tpwdaz8k.js} +2 -2
- package/dist/chunk-v0p94epn.js +2 -0
- package/dist/{chunk-wvry7t79.js → chunk-vgrjqwbq.js} +2 -2
- package/dist/{chunk-48fj5m0p.js → chunk-vr0dfq9w.js} +2 -2
- package/dist/{chunk-1qyxrh0n.js → chunk-w233xc7k.js} +3 -3
- package/dist/{chunk-ddk8v2g9.js → chunk-w8qn76a1.js} +3 -3
- package/dist/{chunk-3vkkmyjm.js → chunk-wgta9nfd.js} +2 -2
- package/dist/{chunk-yakar0e2.js → chunk-wnn9r2r6.js} +2 -2
- package/dist/chunk-wsbh4n9e.js +2 -0
- package/dist/{chunk-g2zznfan.js → chunk-wtf1eyzy.js} +1 -1
- package/dist/{chunk-76a04a6j.js → chunk-x2nemdjf.js} +2 -2
- package/dist/chunk-x5swmb1j.js +2 -0
- package/dist/chunk-x68b6rmk.js +2 -0
- package/dist/{chunk-0pzyavch.js → chunk-xdvbb3av.js} +2 -2
- package/dist/chunk-y1mqx60y.js +2 -0
- package/dist/{chunk-5a6xc345.js → chunk-y7ngqt59.js} +2 -2
- package/dist/{chunk-3ka3bt0t.js → chunk-yez26qfc.js} +2 -2
- package/dist/chunk-ymy8d3hp.js +4 -0
- package/dist/{chunk-swpy2b9a.js → chunk-z1aqmqgc.js} +2 -2
- package/dist/{chunk-mz8a6292.js → chunk-zacep5bq.js} +2 -2
- package/dist/{chunk-jm6zxy9h.js → chunk-zyvvk8b2.js} +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/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/effort-slider.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.d.ts +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.d.ts +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.d.ts +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.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.d.ts +3 -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.d.ts +3 -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.d.ts +3 -0
- package/dist/conversation/composer/prompt-history.js +1 -0
- 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.d.ts +3 -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/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/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/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/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/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/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-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/use-activity-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/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/package.json +3 -3
- package/rust/permissions/schemas/schema.json +11 -40
- package/dist/chunk-0p6y2t9b.js +0 -2
- package/dist/chunk-1mn2t6ga.js +0 -2
- package/dist/chunk-6dbswsek.js +0 -2
- package/dist/chunk-7absxkjt.js +0 -2
- package/dist/chunk-7z4gtfkd.js +0 -2
- package/dist/chunk-b13pahat.js +0 -2
- package/dist/chunk-bmey8et5.js +0 -2
- package/dist/chunk-c32z3wjq.js +0 -2
- package/dist/chunk-d8q2qv1m.js +0 -2
- package/dist/chunk-dy92pv7q.js +0 -2
- package/dist/chunk-fnpf84rf.js +0 -4
- package/dist/chunk-hxtxrtpm.js +0 -2
- package/dist/chunk-jmb8r6aj.js +0 -2
- package/dist/chunk-jwt7q6yx.js +0 -4
- package/dist/chunk-kz1kjzmq.js +0 -2
- package/dist/chunk-m271yxxm.js +0 -2
- package/dist/chunk-n625g0h1.js +0 -2
- package/dist/chunk-nwtambg5.js +0 -2
- package/dist/chunk-pk2rvqd0.js +0 -2
- package/dist/chunk-q9zawfn1.js +0 -2
- package/dist/chunk-qn6ppn0r.js +0 -2
- package/dist/chunk-rr36dnn9.js +0 -2
- package/dist/chunk-z7sswh39.js +0 -2
- package/dist/chunk-zxp0mb14.js +0 -2
- /package/dist/{chunk-a1czzft3.js → chunk-py0zbgaj.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Mn}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{Mn}from"./chunk-nsb0d92p.js";import{Ei}from"./chunk-jnc6b9r3.js";import{Q}from"./chunk-zyvvk8b2.js";import{De,Oi}from"./chunk-qqqcqvrv.js";import{e}from"./chunk-k1vkc88d.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function Lr(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function Qt({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=Q(De,(r)=>r),w=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),y=s((r)=>u.sessionId===t?Mn(u.turns,r,u.terminals):[],[u,t]),S=s((r,i)=>Oi(t,r,i),[t]),b=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,g=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(Ei,{placement:"body",getViewport:w,findSourceMatches:y,revealTurn:S,prepareSource:b,subscribeOpen:g,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
|
|
2
|
+
export{Lr,Qt};
|
|
@@ -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 vi(i,e){return n??=new s,n.connect(i,e)}
|
|
2
|
+
export{vi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{Jn,
|
|
1
|
+
import{fe}from"./chunk-fprj3wy4.js";function Jn(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 me(r){return Jn(r).join(fe()?"":"+")}
|
|
2
|
+
export{Jn,me};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Nn(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function
|
|
2
|
-
export{Nn,
|
|
1
|
+
import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Nn(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Ai(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Nn(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
|
|
2
|
+
export{Nn,Ai};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{an}from"./chunk-0kdemqjf.js";import{mo}from"./chunk-n66yy1m1.js";import{We}from"./chunk-7a668qzy.js";import{autoUpdate as ot}from"@floating-ui/dom";import{cn as G}from"cn";import{BookOpenTextIcon as rt,FileIcon as st,StoreIcon as it}from"lucide-react";import{useCallback as lt,useEffect as d,useLayoutEffect as J,useMemo as X,useRef as Y,useState as v}from"react";import{createPortal as ut}from"react-dom";import{Button as Z}from"@nyssance/shadcn/vega/components/ui/button";import{Separator as at}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as m,jsxs as w,Fragment as ct}from"react/jsx-runtime";function po({handleRef:l,anchorRef:a,commands:T,searchFiles:u,onMention:_,onSearchError:B,fileSearchDebounceMs:C=0,bashMode:H=!1,forcedOpen:s=!1,onForcedOpenChange:p,emptyLabel:R,fileStatusLabels:E,morePlugins:M}){let A=We(),i=A.textInput.value,[j,z]=v(0),[g,D]=v(null),[x,h]=v(0),K=Y(null);d(()=>{let t=l.current?.getTextarea();if(!t)return;let e=()=>z(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[l]);let U=X(()=>H&&i.startsWith("!")?null:mo(i,j),[i,j,H]),o=U?.kind==="at"&&!u?null:U,P=`${o?.kind??"forced"}:${o?.query??""}:${s}`,[F,O]=v(P);if(F!==P)O(P),h(0);let L=Y(null);d(()=>{if(!s){L.current=null;return}if(L.current===null)L.current=i;else if(i!==L.current)p?.(!1)},[s,i,p]);let y=o?.kind==="at"?o.query:null;d(()=>{if(y===null||!u){D(null);return}let t=!0,e=()=>{u(y).then((r)=>{if(t)D({query:y,search:u,items:r})},(r)=>{if(t)D({query:y,search:u,items:[]}),B(r)})},n=C>0?window.setTimeout(e,C):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[y,u,C,B]);let f=X(()=>{if(o?.kind==="at")return g?.query===o.query&&g.search===u?g.items:[];if(o)return an(T,o.query);if(s)return an(T,"");return[]},[o,s,T,g,u]),[tt,q]=v(!1);d(()=>{let t=l.current?.getTextarea();if(!t)return;let e=()=>q(!0),n=()=>{if(q(!1),s)p?.(!1)};return q(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[l,s,p]),d(()=>{if(s)l.current?.getTextarea()?.focus()},[s,l]);let c=tt&&(o!==null?o.kind==="slash"||f.length>0||!!E:s);d(()=>{if(!c)return;K.current?.querySelector(`[data-idx="${x}"]`)?.scrollIntoView({block:"nearest"})},[x,c]);function V(t){let e=l.current?.getTextarea();if(!e)return;let n,r;if(o){let S=o.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,o.start)+S+i.slice(o.end),o.kind==="at")_?.(t.payload);r=o.start+S.length}else if(s)n=`${i.length===0||i.endsWith(`
|
|
2
|
+
`)?i:`${i}
|
|
3
|
+
`}/${t.payload} `,r=n.length,p?.(!1);else return;A.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}d(()=>{let t=l.current?.getTextarea();if(!t)return;let e=(n)=>{if(!c)return;if(l.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>f.length===0?0:Math.min(f.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=f[x];if(r)V(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)z(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else p?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[b,W]=v(null),[N,et]=v(null),I=lt(()=>{let t=a?.current;if(!t)return;let e=t.getBoundingClientRect();W({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[a]);if(J(()=>{if(!c){W(null);return}I()},[c,I]),J(()=>{let t=a?.current;if(!c||!t||!N)return;return ot(t,N,I,{animationFrame:!0})},[c,N,a,I]),!c||a&&!b)return null;let k=o?o.kind==="slash":s,nt=k?rt:st,Q=m("div",{ref:et,className:a?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:a&&b?{left:b.left,width:b.width,bottom:b.bottom}:void 0,children:w("div",{ref:K,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[w("div",{className:"max-h-72 overflow-y-auto",children:[f.length===0&&k&&m("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:R}),f.length===0&&!k&&E&&m("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:g?.query===y&&g.search===u?E.empty:E.loading}),f.map((t,e)=>w(Z,{type:"button",variant:"ghost",role:"option","aria-selected":e===x,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),V(t)},onMouseEnter:()=>h(e),className:G("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===x&&"bg-muted"),children:[m(nt,{className:G("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),m("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&m("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&M&&w(ct,{children:[m(at,{}),w(Z,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),p?.(!1),M.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[m(it,{"data-icon":"inline-start"}),M.label]})]})]})});return a?ut(Q,document.body):Q}
|
|
4
|
+
export{po};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{s,r,o}from"./chunk-
|
|
2
|
-
`));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),K(!0),f([...S])},children:[t(
|
|
3
|
-
export{
|
|
1
|
+
import{s,r,o}from"./chunk-3f3y9t21.js";import{Ne,te,q}from"./chunk-v0p94epn.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as de}from"cn";import{ArchiveIcon as ue,FolderIcon as U,ListFilterIcon as me,SearchIcon as pe,Trash2Icon as _}from"lucide-react";import{useEffect as he,useRef as fe,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ce}from"@nyssance/shadcn/vega/components/ui/input";import{Select as R,SelectContent as we,SelectItem as x,SelectTrigger as W,SelectValue as J}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as M}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as n}from"react/jsx-runtime";function X({className:u,...i}){return t(we,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:de("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function De({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function mr({Scroll:u=De}){let{t:i,i18n:A}=s(),m=r(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,Y]=d(""),[y,Z]=d("all"),[p,ee]=d("all"),[se,ie]=d(0),[z,F]=d(!0),[I,V]=d(null),[H,O]=d(null),[C,w]=d(!1),h=fe(!1),[D,f]=d(null),[G,b]=d(null),[ne,K]=d(!1);he(()=>{if(N!=="ready")return;let e=!1;F(!0),V(null);async function c(){try{await m.listArchived({reset:!0});let a=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(a.has(v))throw Error("Archive pagination returned a repeated cursor");a.add(v),await m.listArchived()}}catch(a){if(!e)V(E(a))}finally{if(!e)F(!1)}}return c(),()=>{e=!0}},[m,N,se]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!z&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ae=[...new Set(S.filter((e)=>l&&j(l,e).id!==q).map((e)=>l?j(l,e).id:e.cwd))].toSorted(),re=B.trim().toLocaleLowerCase(A.language),Q=S.filter((e)=>{let c=l?j(l,e).id:null,a=c===q;return L(e).toLocaleLowerCase(A.language).includes(re)&&(y==="all"||(y==="quick"?a:!a))&&(p==="all"||(p==="quick"?a:c===p))}),le=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function oe(e){if(h.current)return;h.current=!0,w(!0),O(null);try{await m.unarchive(e.sessionId)}catch(c){O(E(c))}finally{h.current=!1,w(!1)}}async function ce(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let a of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===a.sessionId))continue;try{await m.delete(a.sessionId)}catch(v){e.push(a),c.push(`${L(a)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
|
|
2
|
+
`));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),K(!0),f([...S])},children:[t(_,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(pe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ce,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>Y(e.target.value),className:"rounded-md ps-9"})]}),n(R,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Z(e)},children:[n(W,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(me,{"aria-hidden":"true"}),t(J,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(R,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");ee(e)},children:[n(W,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(U,{"aria-hidden":"true"}),t(J,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):te(p,l??void 0)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ae.map((e)=>t(x,{value:e,title:e,children:te(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):z?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(M,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:n(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>ie((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(ue,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):Q.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Ne(Q,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===q?void 0:e,children:[t(U,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===q?i("sessionList.archives.noProject"):te(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((a)=>n("article",{"aria-label":L(a),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(a),children:L(a)}),a.updatedAt!==null&&t("time",{dateTime:a.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:le.format(new Date(a.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),K(!1),f([a])},children:t(_,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void oe(a),children:i("sessionList.archives.unarchive")})]})]},a.sessionId))})]},e)),H&&t(P,{variant:"destructive",children:t(T,{children:H})})]})]}),t(ve,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ge,{showCloseButton:!C,children:[n(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(ne?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),G&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:G})}),n(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void ce(),children:[C&&t(M,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
|
+
export{mr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-k1vkc88d.js";import{St,_t}from"./chunk-yez26qfc.js";import{Be}from"./chunk-p58e9z34.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Zi({providers:n,store:l}){let{t:m}=e().host,d=St(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=Be(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await _t(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
|
|
2
|
+
export{Zi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d}from"./chunk-92xxp77d.js";import{cn as a}from"cn";import{motion as g}from"motion/react";import{jsx as i,jsxs as u}from"react/jsx-runtime";function no({active:t,expanded:r=!1,highlight:s=!0,className:o,...l}){return i("button",{type:"button","data-active":t?"":void 0,"aria-current":t?"page":void 0,className:a(s&&d,"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)] min-w-[var(--navigation-row-height)]":"size-[var(--navigation-row-height)]",o),...l})}function
|
|
2
|
-
export{no,
|
|
1
|
+
import{d}from"./chunk-92xxp77d.js";import{cn as a}from"cn";import{motion as g}from"motion/react";import{jsx as i,jsxs as u}from"react/jsx-runtime";function no({active:t,expanded:r=!1,highlight:s=!0,className:o,...l}){return i("button",{type:"button","data-active":t?"":void 0,"aria-current":t?"page":void 0,className:a(s&&d,"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)] min-w-[var(--navigation-row-height)]":"size-[var(--navigation-row-height)]",o),...l})}function ur({tabs:t,view:r,onViewChange:s,onReset:o,notifications:l,className:p}){return i("div",{className:a("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",p),children:i("div",{role:"tablist",className:`${d} bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-full flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]`,children:t.map((e)=>{let n=r===e.key;return u(no,{role:"tab",active:n,expanded:n,highlight:!1,"aria-selected":n,title:e.title,onClick:()=>s(e.key),onDoubleClick:o&&(()=>o(e.key)),className:a("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-4 [&_svg]:shrink-0",n?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[n&&i(g.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:"pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full bg-blue-500 motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:a("relative z-10 grid",n?"ms-2 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)})})})}
|
|
2
|
+
export{no,ur};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as M}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function E(a){return a.interface?.displayName??a.name}function I(a){let u={},n=new Map,l=new Map;for(let p of a.data){for(let o of p.skills)if(n.set(o.path,o),o.scope==="repo"){let m=u[p.cwd]??[];if(!m.includes(o.path))m.push(o.path);u[p.cwd]=m}for(let o of p.errors)l.set(o.path,o)}return{skills:[...n.values()],errors:[...l.values()],projects:u}}function v(a){let u=[];for(let n of a.marketplaces)for(let l of n.plugins)if(l.installed)u.push({plugin:l,marketplace:n});return u.toSorted((n,l)=>(l.plugin.installedAt??0)-(n.plugin.installedAt??0))}function Fn(a){let{plugin:u,marketplace:n}=a;return{installAttemptId:crypto.randomUUID(),pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function A(a){let{plugin:u,marketplace:n}=a;return{pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function
|
|
2
|
-
export{Fn,
|
|
1
|
+
import{createStore as M}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function E(a){return a.interface?.displayName??a.name}function I(a){let u={},n=new Map,l=new Map;for(let p of a.data){for(let o of p.skills)if(n.set(o.path,o),o.scope==="repo"){let m=u[p.cwd]??[];if(!m.includes(o.path))m.push(o.path);u[p.cwd]=m}for(let o of p.errors)l.set(o.path,o)}return{skills:[...n.values()],errors:[...l.values()],projects:u}}function v(a){let u=[];for(let n of a.marketplaces)for(let l of n.plugins)if(l.installed)u.push({plugin:l,marketplace:n});return u.toSorted((n,l)=>(l.plugin.installedAt??0)-(n.plugin.installedAt??0))}function Fn(a){let{plugin:u,marketplace:n}=a;return{installAttemptId:crypto.randomUUID(),pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function A(a){let{plugin:u,marketplace:n}=a;return{pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function dt(a,u){let n=u??{t:(e)=>e},l=(e,r)=>n.t(e,r),p=(e)=>n.notify?.(e),o=(e)=>{if(n.reportError)n.reportError(Error(e));else console.error(e)},m=null,b=null,d=(e)=>S.setState(e),P=()=>S.getState(),y=async(e=!1)=>{if(await P().refresh(void 0,{forceRefetch:e,background:!0}),P().error)throw Error(l("plugins.toast.syncError",{message:P().error}))},f=(e,r)=>d((s)=>{let t={...s.busyIds};if(r===null)delete t[e];else t[e]=r;return{busyIds:t}}),h=(e,r)=>d((s)=>{let t={...s.busyMarketplaces};if(r)t[e]=!0;else delete t[e];return{busyMarketplaces:t}}),w=M({loading:!1,loadedScope:null,upgrading:!1,error:null,cwds:[],marketplaces:[],marketplaceLoadErrors:[],featuredPluginIds:[],installed:[],skills:[],skillProjects:{},skillErrors:[],busyIds:{},busySkills:{},busyMarketplaces:{},refresh:(e=P().cwds,r={})=>{if(m={cwds:e,forceRefetch:r.forceRefetch===!0||m?.forceRefetch===!0},d({cwds:e,...!r.background?{loading:!0}:{}}),b)return b;return b=(async()=>{while(m){let s=m;m=null,d({error:null});try{let[t,i,g]=await Promise.all([a.listSkills(s.cwds,s.forceRefetch),a.listPlugins({...s.cwds.length>0?{cwds:s.cwds}:{},...s.forceRefetch?{forceRefetch:!0}:{}}),a.installedPlugins(s.cwds)]);if(m)continue;let c=I(t);d({loadedScope:JSON.stringify(s.cwds),skills:c.skills,skillProjects:c.projects,skillErrors:c.errors,marketplaces:i.marketplaces,marketplaceLoadErrors:i.marketplaceLoadErrors,featuredPluginIds:i.featuredPluginIds,installed:v(g)})}catch(t){if(!m)d({error:k(t)})}}})().finally(()=>{b=null,d({loading:!1})}),b},install:async(e)=>{if(e.plugin.id in P().busyIds)throw Error("Plugin operation already in progress");let r=E(e.plugin);f(e.plugin.id,"installing");try{let s=await a.installPlugin(Fn(e));return await y(),f(e.plugin.id,null),p(l("plugins.toast.installed",{pluginName:r})),s}catch(s){throw o(`${l("plugins.toast.installError")}: ${k(s)}`),s}finally{f(e.plugin.id,null)}},setPluginEnabled:async(e,r)=>{if(e.id in P().busyIds)return;f(e.id,"toggling");let s=(i)=>d((g)=>({installed:g.installed.map((c)=>c.plugin.id===e.id?{...c,plugin:{...c.plugin,enabled:i}}:c)}));s(r);let t=e.enabled;try{let i=e.source.type==="remote"?e.remotePluginId:void 0;if(i===null)throw Error("Remote plugin ID is missing");let g=await a.setPluginEnabled(e.id,r,i);t=g.enabled,s(g.enabled),await y();let c=P().installed.find((R)=>R.plugin.id===e.id);if(c)t=c.plugin.enabled;if(!c||t!==r)throw Error(l("plugins.toast.toggleNotApplied"));f(e.id,null),p(l(r?"plugins.toast.enabled":"plugins.toast.disabled",{pluginName:E(e)}))}catch(i){s(t),o(`${l("plugins.toast.toggleError")}: ${k(i)}`)}finally{f(e.id,null)}},uninstall:async(e)=>{if(e.id in P().busyIds)return;let r=E(e);f(e.id,"uninstalling");try{let s=e.source.type==="remote"?e.remotePluginId:e.id;if(!s)throw Error("Remote plugin ID is missing");if(await a.uninstallPlugin(s),await y(),P().installed.some((t)=>t.plugin.id===e.id))throw Error(l("plugins.toast.uninstallNotApplied"));f(e.id,null),p(l("plugins.toast.uninstalled",{pluginName:r}))}catch(s){o(`${l("plugins.toast.uninstallError")}: ${k(s)}`)}finally{f(e.id,null)}},readPlugin:async(e)=>(await a.readPlugin(A(e))).plugin,setSkillEnabled:async(e,r)=>{if(e.path in P().busySkills)return;d((t)=>({busySkills:{...t.busySkills,[e.path]:!0}})),d((t)=>({skills:t.skills.map((i)=>i.path===e.path?{...i,enabled:r}:i)}));let s=e.interface?.displayName??e.name;try{let t=await a.setSkillEnabled({path:e.path,enabled:r});if(d((i)=>({skills:i.skills.map((g)=>g.path===e.path?{...g,enabled:t.effectiveEnabled}:g)})),t.effectiveEnabled!==r){o(l("plugins.catalog.toggleNotApplied"));return}p(l(r?"plugins.skills.enabledToast":"plugins.skills.disabledToast",{skillName:s}))}catch(t){d((i)=>({skills:i.skills.map((g)=>g.path===e.path?{...g,enabled:e.enabled}:g)})),o(`${l("plugins.skills.toggleError")}: ${k(t)}`)}finally{d((t)=>{let i={...t.busySkills};return delete i[e.path],{busySkills:i}})}},addMarketplace:async(e)=>{let r=await a.addMarketplace(e);return await y(!0),p(r.alreadyAdded?l("plugins.marketplace.alreadyAdded",{marketplaceName:r.marketplaceName}):l("plugins.marketplace.added",{marketplaceName:r.marketplaceName})),r},removeMarketplace:async(e)=>{h(e,!0);try{await a.removeMarketplace(e),await y(),h(e,!1),p(l("plugins.marketplace.removed",{marketplaceName:e}))}catch(r){o(`${l("plugins.marketplace.removeError")}: ${k(r)}`)}finally{h(e,!1)}},upgradeMarketplace:async(e)=>{h(e,!0);try{let r=await a.upgradeMarketplaces(e);if(await y(!0),h(e,!1),r.errors.length>0)o(`${l("plugins.marketplace.upgradeError")}: ${r.errors.map((s)=>s.message).join("; ")}`);else p(l("plugins.marketplace.upgraded",{marketplaceName:e}))}catch(r){o(`${l("plugins.marketplace.upgradeError")}: ${k(r)}`)}finally{h(e,!1)}},upgradeAll:async()=>{if(P().upgrading)return;d({upgrading:!0});try{let e=await a.upgradeMarketplaces();if(await y(!0),d({upgrading:!1}),e.errors.length>0)o(l("plugins.marketplace.upgradeAllError"));else p(l("plugins.marketplace.upgradedAll"))}catch(e){o(`${l("plugins.marketplace.upgradeAllRequestError")}: ${k(e)}`)}finally{d({upgrading:!1})}}}),S=Object.assign(w,{bindHost:(e)=>{n=e}});return S}
|
|
2
|
+
export{Fn,dt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Lo,T}from"./chunk-7a668qzy.js";import{po}from"./chunk-99ftqpgg.js";import{xe}from"./chunk-s2w7e9pg.js";import{wo,ko,So,_o,Po,ne}from"./chunk-dwn6bx69.js";import{co,uo}from"./chunk-7appp9ad.js";import{rn}from"./chunk-ymy8d3hp.js";import{t,n}from"./chunk-zyvvk8b2.js";import{e}from"./chunk-k1vkc88d.js";import{pn}from"./chunk-p272qmbv.js";import{a,Ro,U,zt}from"./chunk-2dvryx1q.js";import{Bt}from"./chunk-ce3wg766.js";import{Ee,Ut}from"./chunk-2djv6s3a.js";import{Vt,$t}from"./chunk-04xjj6q3.js";import{Fo}from"./chunk-04kcmpnb.js";import{Ht}from"./chunk-fbq107z8.js";import{Ao}from"./chunk-ch5v5zsw.js";import{Kt}from"./chunk-j2y4wx1h.js";import{qt}from"./chunk-mttcvwhx.js";import{Ho}from"./chunk-5dkj3ntx.js";import{Co}from"./chunk-3xh0e0ya.js";import{bo}from"./chunk-rnrs0cqn.js";import{Ot}from"./chunk-qn4zvgc9.js";import{hasFuzzyFileSearch as Mt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as Ct}from"lucide-react";import{useCallback as O,useEffect as Et,useLayoutEffect as J,useMemo as Q,useRef as Y,useState as S}from"react";import{jsx as c,jsxs as w}from"react/jsx-runtime";var Rt=["image/png","image/jpeg","image/webp","image/gif"],Z=[];async function Nt(r){let d=await(await fetch(r.url)).blob();return new Promise((l,E)=>{let I=new FileReader;I.onerror=()=>E(I.error),I.onload=()=>{let L=I.result;l(L.slice(L.indexOf(",")+1))},I.readAsDataURL(d)})}function St(r){let{t:d}=t(),l=T();return c(ne,{"aria-label":d("composer.attachImage"),title:d("composer.attachImage"),onClick:()=>l.openFileDialog(),...r,children:c(Ct,{className:"size-4"})})}function Ft({session:r,onSubmit:d,onShellCommand:l,onHandOff:E,modelSelector:I,modelMenu:L,inputHeader:tt,actions:dt,children:ut,attachmentPolicy:ft,predictions:ht=!0,disabled:gt=!1,preparing:et=!1,allowPendingInput:xt=!1}){let{host:F,client:R}=e(),{t:p}=F,k=O((o)=>{if(F.reportError)F.reportError(o);else console.error(o)},[F]),[rt,D]=S(()=>({text:a.get(r.id)?.text??"",revision:0})),{text:P}=rt,[A,yt]=S(()=>a.get(r.id)?.attachments??Z),[u,z]=S(()=>a.get(r.id)?.mentions??[]),V=A.some((o)=>Ee(o)&&o.pastedText.status!=="ready"),[M,ot]=S(!1),[H,Pt]=S(!1),[X,nt]=S(!1),f=Y(null),at=Y(null),i=Y(rt),B=O((o)=>{at.current?.(),i.current={text:o,revision:i.current.revision+1},D(i.current)},[]),bt=Ho(r,B),it=Q(()=>({read:()=>{let m=f.current?.getTextarea(),g=m===null||m===void 0?[i.current.text.length,i.current.text.length]:[m.selectionStart,m.selectionEnd];return{target:r.id,...i.current,selection:g}},compareAndSet(m,g,C){if(m.target!==r.id||m.revision!==i.current.revision)return null;i.current={text:g,revision:i.current.revision+1},D(i.current);let x=f.current?.getTextarea();if(x!==null&&x!==void 0)x.value=g,x.setSelectionRange(C[0],C[1]);return{target:r.id,...i.current,selection:C}}}),[r.id]),_=Y(null),ct=O((o)=>(_.current=o,()=>{if(_.current===o)_.current=null}),[]),K=r.state!=="idle",b=l!==void 0&&P.startsWith("!"),h=!gt&&!et&&r.attached&&!r.restoring&&!r.readOnly,N=!r.readOnly&&(xt||h),W=qt(r,h&&!M&&!H&&!V&&!X,P.length>0||A.length>0||u.length>0,ht&&!b),mt=W.invalidate;J(()=>{a.set(r.id,{text:P,attachments:A,mentions:u,modelId:a.get(r.id)?.modelId??null})},[r.id,P,A,u]),J(()=>Ro(r.id,yt),[r.id]),J(()=>zt(r.id,(o)=>{if(!N||M)throw Error("The composer cannot take text now; try again later");if(P.length||A.length||u.length)throw Error("The composer already has a draft; send or clear it first");B(o)}),[r.id,N,M,P,A,u,B]);let st=n((o)=>Mt(o.agent)),vt=Q(()=>st&&h?async(o)=>Bt((await R.fuzzyFileSearch({query:o,roots:[r.cwd]})).files):void 0,[R,st,h,r.cwd]),q=O((o)=>{z((m)=>m.includes(o)?m:[...m,o])},[]);Et(()=>{f.current?.focus()},[]);let pt=O(async({text:o,files:m})=>{let g=l!==void 0&&o.startsWith("!")?o.slice(1):null;if(g!==null){if(g.trim().length===0)return;if(m.length||u.length)throw Error("Shell commands cannot include file references or attachments");if(r.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let C=o.trim();if(C.length===0&&m.length===0&&u.length===0)return;let x=_.current;ot(!0);let v=a.get(r.id),At=i.current.revision,j=null;try{let y=[];for(let s of u){let G={kind:"file",absPath:s};y.push({type:"resource_link",uri:Vt(G),name:$t(G)})}if(C.length>0)y.push({type:"text",text:C});for(let s of m)if(Ee(s)){if(s.pastedText.status!=="ready")throw Error("Text attachment is not ready");y.push({type:"resource_link",uri:s.url,name:s.filename??"pasted-text.txt"})}else y.push({type:"image",data:await Nt(s),mimeType:s.mediaType});if(i.current.revision===At&&a.get(r.id)===v)i.current={text:"",revision:i.current.revision+1},j=i.current.revision,D(i.current),z([]),U(r.id,()=>Z),a.set(r.id,{text:"",attachments:Z,mentions:[],modelId:v?.modelId??null}),f.current?.resetHeight();if(g!==null&&l)await l(g);else if(d)if(x===null)await d(y);else await d(y,(s)=>{if(x.signal.aborted||_.current!==x)return;x.accept(s),E?.(r.id,s)});else if(x===null)await R.prompt(r.id,y);else{let s=await R.prompt(r.id,y);x.accept(s)}mt();for(let s of v?.attachments??[])if(s.url.startsWith("blob:")&&!a.get(r.id)?.attachments.some((G)=>G.id===s.id))URL.revokeObjectURL(s.url)}catch(y){if(v&&j!==null&&i.current.revision===j&&a.get(r.id)?.attachments.length===0&&a.get(r.id)?.mentions.length===0)i.current={text:v.text,revision:j+1},D(i.current),z(v.mentions),a.set(r.id,v),U(r.id,()=>v.attachments);throw y}finally{ot(!1),f.current?.focus()}},[R,r.id,r.state,u,d,l,E,mt]),wt=()=>{R.cancel(r.id).catch(k)},It=O((o)=>{let m=o.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:xe})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});k(m)},[k,p]),Tt=Q(()=>({session:r,ready:h,inputReady:N,sending:M,textareaRef:f,draft:it,interruptRef:at,observeReceipts:ct,addMention:q,setAdding:Pt,shellMode:b,handsFree:!b&&(d===void 0||E!==void 0)}),[r,h,N,M,it,ct,q,d,E,b]),lt=F.writeTextAttachment;return c(pn,{value:Tt,children:c("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:w("div",{className:"relative",children:[tt&&c("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:tt}),w(Lo,{attachmentPolicy:ft,value:P,revision:i.current.revision,onValueChange:B,onSubmittedClear:()=>{i.current={text:"",revision:i.current.revision+1},D(i.current)},attachments:A,onAttachmentsChange:(o)=>U(r.id,()=>o),children:[c(po,{bashMode:l!==void 0,handleRef:f,commands:r.commands,searchFiles:vt,onMention:q,onSearchError:k,forcedOpen:X,onForcedOpenChange:nt,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),w(wo,{"data-shell-mode":b||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:Rt.join(","),onError:It,onSubmit:pt,onSubmitAsync:pt,onSubmitError:k,canSubmit:()=>h&&!M&&!H&&!V&&(!b||!K&&P.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[ut,w(So,{className:"px-3 pt-3 pb-0 empty:hidden",children:[H&&c("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),c(Fo,{mentions:u,onRemove:(o)=>z((m)=>m.filter((g)=>g!==o))}),c(uo,{children:(o)=>Ee(o)?c(Ao,{data:o,sessionId:r.id}):c(co,{data:o,t:p})})]}),w(ko,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(o)=>{if(!W.text||f.current?.isComposing()||o.nativeEvent.isComposing||o.nativeEvent.keyCode===229||o.shiftKey||o.ctrlKey||o.altKey||o.metaKey||o.target!==f.current?.getTextarea())return;if(o.key==="Tab")o.preventDefault(),o.stopPropagation(),B(W.text)},children:[b&&c("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),c(rn,{className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:bt,bashMode:l!==void 0,disabled:!N,onPasteCapture:lt?(o)=>Ut(o,r.id,p("composer.pastedTextFilename"),lt):void 0,placeholder:b?"! command":W.text||(K?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),c(_o,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:w("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[w("div",{className:"flex min-w-0 items-center gap-[5px]",children:[c(St,{className:"text-foreground",disabled:!N}),c(Co,{textareaRef:f,menuOpen:X,onOpenChange:nt,disabled:!h||r.commands.length===0}),c(Kt,{sessionId:r.id,options:r.configOptions,disabled:!h})]}),w(Po,{className:"w-full min-w-0 items-center justify-end gap-1",children:[c(Ot,{session:r}),I??c(Ht,{...L,sessionId:r.id,options:r.configOptions,disabled:!h}),dt,c(bo,{active:K,sending:M||et||H,ready:h&&!V&&(!b||!K&&P.slice(1).trim().length>0),hasMentions:u.length>0,onStop:wt})]})]})})]})]})]})})})}
|
|
2
|
+
export{Ft};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d}from"./chunk-92xxp77d.js";import{r,o}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{d}from"./chunk-92xxp77d.js";import{r,o}from"./chunk-3f3y9t21.js";import{b,_,p,W}from"./chunk-py0zbgaj.js";import{x,J,Qn}from"./chunk-tpwdaz8k.js";import{ze}from"./chunk-pqphdgp6.js";import{N,K}from"./chunk-22tg663v.js";import{de,X}from"./chunk-g9gktxv9.js";import{closestCorners as fe,DndContext as Ce,KeyboardSensor as ye,PointerSensor as Se,useSensor as Z,useSensors as De}from"@dnd-kit/core";import{SortableContext as ee,sortableKeyboardCoordinates as we,useSortable as ae,verticalListSortingStrategy as oe}from"@dnd-kit/sortable";import{CSS as ce}from"@dnd-kit/utilities";import{cn as F}from"cn";import{BrushCleaningIcon as ve,MessageSquareIcon as Ne,MoreHorizontalIcon as Ie,PencilIcon as he,PlusIcon as me,StarIcon as be,Trash2Icon as pe}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as R}from"react";import{Button as D}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as te,DialogContent as ne,DialogDescription as ie,DialogFooter as le,DialogHeader as re,DialogTitle as se}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as H,DropdownMenuTrigger as Re}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Pe}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a,Fragment as Ke}from"react/jsx-runtime";function Te({collectionId:l,sessionId:C,children:M}){let{attributes:w,listeners:v,setNodeRef:i,transform:u,transition:g,isDragging:E}=ae({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:ce.Transform.toString(u),transition:g},className:F("w-full min-w-0",E&&"opacity-50"),...w,...v,role:"group",children:M})}function Be({collection:l,children:C,onEdit:M,onConfirm:w,onNewChat:v}){let{t:i}=x(),u=X(),g=J(),{attributes:E,listeners:m,setNodeRef:I,transform:P,transition:T,isDragging:z}=ae({id:l.id,disabled:{draggable:l.id===N,droppable:!1},data:{type:"collection"}});return e("div",{ref:I,style:{transform:ce.Transform.toString(P),transition:T},className:F("w-full min-w-0",z&&"opacity-50"),children:e(W,{open:!l.collapsed,onOpenChange:(c)=>g(u({type:"collapse",id:l.id,collapsed:!c})),label:K(l,i),count:l.sessionIds.length,leading:l.id===N?e(be,{className:"size-3.5"}):e(ze,{emoji:l.emoji,onChange:(c)=>g(u({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...E,...m,role:"group",children:c}),actions:a(Ee,{children:[e(Re,{onClick:(c)=>c.stopPropagation(),onPointerDown:(c)=>c.stopPropagation(),render:e(D,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:K(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:a(Le,{children:[l.id!==N&&a(H,{onClick:M,children:[e(he,{}),i("collection.rename")]}),a(H,{onClick:v,children:[e(me,{}),i("collection.newChat")]}),a(H,{onClick:()=>w("clear"),children:[e(ve,{}),i("collection.clearCollection")]}),l.id!==N&&a(H,{variant:"destructive",onClick:()=>w("delete"),children:[e(pe,{}),i("collection.deleteCollection")]})]})})]}),children:C})})}function He({children:l}){return e("div",{className:"min-h-0 flex-1 overflow-y-auto ps-2 pe-0 pb-1",children:l})}function Ji({renderRow:l,onSelect:C,onNewChat:M,Scroll:w=He}){let v=x(),{t:i}=v,u=X(),g=J(),E=r(),{collections:m,order:I}=de(),P=o((t)=>t.sessionList),T=o((t)=>t.archivedSessions),z=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),U=Me(()=>new Map([...T,...P].map((t)=>[t.sessionId,t])),[T,P]),q=v.isMac??Qn(),[y,k]=R(null),[L,O]=R(""),[A,j]=R(""),[S,B]=R(null),[f,Q]=R(!1),ue=De(Z(Se,{activationConstraint:{distance:5}}),Z(ye,{coordinateGetter:we})),G=I.flatMap((t)=>m[t].collapsed?[]:m[t].sessionIds.flatMap((n)=>{let s=U.get(n);return s&&!s.archived?[s]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(q?!n.metaKey||n.ctrlKey:!n.ctrlKey||n.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(n.target instanceof HTMLElement&&(n.target.isContentEditable||n.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let s=Number(n.key)-1;if(!Number.isInteger(s)||s<0||s>8||!G[s])return;n.preventDefault(),C(G[s])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,q,C]);let ge=({active:t,over:n})=>{if(n===null)return;let s=t.data.current,h=n.data.current;if(s?.type==="session"&&h!==void 0){let Y=h.type==="session"?String(h.collectionId):String(n.id);g(u({type:"move",sourceCollectionId:String(s.collectionId),collectionId:Y,sessionId:String(s.sessionId),index:h.type==="session"?m[Y].sessionIds.indexOf(String(h.sessionId)):void 0}))}else if(s?.type==="collection"&&h?.type==="collection"&&String(n.id)!==N)g(u({type:"reorder",id:String(t.id),index:I.indexOf(String(n.id))}))},V=(t,n)=>{Q(!0),g(t.then(n).finally(()=>Q(!1)))};return a(Ke,{children:[e(w,{children:a(b,{children:[a(p,{className:F(d,"font-normal"),onClick:()=>{k("new"),O(""),j("")},children:[e(_,{children:e(me,{})}),e("span",{children:i("collection.newCollection")})]}),c&&a("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:c}),e(D,{variant:"ghost",onClick:()=>g(E.listSessions({reset:!0})),children:i("collection.retry")})]}),e(Ce,{sensors:ue,collisionDetection:fe,onDragEnd:ge,children:e(ee,{items:I,strategy:oe,children:e(b,{children:I.map((t)=>e(Be,{collection:m[t],onNewChat:()=>M(t),onEdit:()=>{k(t),O(m[t].name),j(m[t].emoji??"")},onConfirm:(n)=>B({id:t,type:n}),children:e(ee,{items:m[t].sessionIds.map((n)=>JSON.stringify([t,n])),strategy:oe,children:m[t].sessionIds.map((n)=>{let s=U.get(n);if(s?.archived)return null;if(!s)return z?a("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(_,{children:e(Ne,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(D,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>g(u({type:"remove",sessionId:n,collectionId:t})),children:e(pe,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(s,()=>{},t)},n)})})},t))})})})]})}),e(te,{open:y!==null,onOpenChange:(t)=>{if(!t&&!f)k(null)},children:a(ne,{children:[a(re,{children:[e(se,{children:i(y==="new"?"collection.newCollection":"collection.rename")}),e(ie,{children:i("collection.collectionName")})]}),a("form",{onSubmit:(t)=>{if(t.preventDefault(),y===null||!L.trim()||f)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;V(u([y==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:A}]),()=>k(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>O(t.target.value),disabled:f}),y!=="new"&&e(ze,{emoji:A,onChange:j}),a(le,{children:[e(D,{type:"button",variant:"outline",disabled:f,onClick:()=>k(null),children:i("collection.cancel")}),e(D,{type:"submit",disabled:f||!L.trim(),children:i("collection.confirm")})]})]})]})}),e(te,{open:S!==null,onOpenChange:(t)=>{if(!t&&!f)B(null)},children:a(ne,{children:[a(re,{children:[e(se,{children:i(S?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ie,{children:i("collection.confirmCollectionChange",{name:S===null?"":K(m[S.id],i)})})]}),a(le,{children:[e(D,{variant:"outline",disabled:f,onClick:()=>B(null),children:i("collection.cancel")}),e(D,{disabled:f,onClick:()=>{if(S!==null)V(u({type:S.type,id:S.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
|
|
2
|
+
export{Ji};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function tn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
|
|
2
|
+
export{tn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-k1vkc88d.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Fr({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
|
|
2
|
+
export{Fr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ln}from"./chunk-chq163r8.js";import{w}from"./chunk-btdrvsgy.js";import{cn as r}from"cn";import{ArrowUpRight as ue,ChevronUp as W,Loader2Icon as Z,Zap as q}from"lucide-react";import{Fragment as pe,useState as H}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 y,DropdownMenuItem as k,DropdownMenuLabel as L,DropdownMenuSeparator as u,DropdownMenuSub as C,DropdownMenuSubContent as T,DropdownMenuSubTrigger as O,DropdownMenuTrigger as X}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as ce}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 xo({value:c,onChange:ne,models:v,modelGroups:V,compactCatalog:t,effortPresentation:j="slider",unavailableEffort:N,providerMenu:h,header:g,className:B,condensed:z,stripLabelPrefix:_,showDescription:ae,showModelList:se=!0,loading:ie,switching:G,isLoading:oe,effortConfig:s,booleanOptions:f,onBooleanChange:R,selectOptions:te=[],t:m,...d}){let[le,de]=H(!1),[re,me]=H(!1),l=f?.find((n)=>n.id==="fast_mode"),I=t?f?.filter((n)=>n!==l):f,P=(n)=>_&&n.startsWith(_)?n.slice(_.length):n;if(ie)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(Z,{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:le,onOpenChange:de,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(W,{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,o)=>a(pe,{children:[o>0&&n.length>0&&e(u,{}),e(w,{value:h.value,onValueChange:h.onChange,options:n})]},o)),h.moreAction&&a(p,{children:[e(u,{}),a(k,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(ue,{className:"size-4"})]})]})]})]}),a(J,{open:re,onOpenChange:me,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",z&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,f?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(q,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",z&&"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,o)=>o.name.length>n.length?o.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(Z,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(W,{className:r("size-3 shrink-0",z&&"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]",t&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[t&&a(p,{children:[a(y,{"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(ln,{...s,disabled:d.disabled})}):a(C,{children:[a(O,{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(w,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):N?a(k,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:N.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:N.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:g?.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(q,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),g&&!t&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[g.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:g.name}),g.action]}),e(u,{})]}),a(y,{"data-model-menu-list":t?"":void 0,className:t?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[se&&(oe?e(k,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):v.length===0?e(k,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=v.filter((i)=>!i.more),o=v.filter((i)=>i.more),F=n.length>0&&o.length>0,M=(i,b)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:b?.noDescription?void 0:ae?i.description:void 0}),D=(i)=>{let b=v.find((S)=>S.api_id===i);if(b)ne(b)};if(t)return e(w,{value:c.api_id,onValueChange:D,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:v.map((i)=>M(i))});return a(p,{children:[V?V.map((i)=>{let b=i.models.filter((x)=>!x.more),S=i.models.filter((x)=>x.more),U=b.length>0&&S.length>0;return a(y,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(U?b:i.models).map((x)=>M(x))}),U&&a(C,{children:[e(O,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:S.map((x)=>M(x,{noDescription:!0}))})})]})]},i.id)}):e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(F?n:v).map((i)=>M(i))}),!V&&F&&a(C,{children:[e(O,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:o.map((i)=>M(i,{noDescription:!0}))})})]})]})})()),!t&&s&&a(p,{children:[e(u,{}),j==="menu"?a(C,{children:[a(O,{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(w,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(ln,{...s,disabled:d.disabled})]}),!t&&!s&&N&&a(p,{children:[e(u,{}),a(k,{disabled:!0,children:[e("span",{className:"flex-1",children:N.name}),e("span",{children:N.label})]})]}),te.map((n)=>a(y,{children:[e(u,{}),e(L,{children:n.name}),e(w,{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)=>t?a(K,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(o)=>R?.(n.id,o),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(ce,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(o)=>R?.(n.id,o)})]},n.id))]})]}),t&&g?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(y,{"data-model-menu-footer":!0,className:"shrink-0",children:g.action})]})]})]})]})}
|
|
2
|
+
export{xo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,rt}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{t,rt}from"./chunk-zyvvk8b2.js";import{isEmbeddedResource as B,isImage as h,isResourceLink as E}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as T,FileIcon as N,ImageOffIcon as L,LoaderCircleIcon as F}from"lucide-react";import{useState as y}from"react";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as o}from"react/jsx-runtime";function Er(e){let s=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))s=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(s)||"attachment"}catch(a){if(a instanceof URIError)return s||"attachment";throw a}}function U(e,s){let a=document.createElement("a");a.href=s,a.download=e,a.click()}function Z({block:e,generated:s=!1}){let a=t(),[p,d]=y(!1),[I,C]=y(null);if(E(e)){if(e.uri==="codex-image:unavailable")return o("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(L,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let c=Er(e.uri);return o(u,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(N,{}),o("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),o("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==c&&`${c} · `,e.mimeType??c.split(".").at(-1)?.toUpperCase()]})]})]})}if(!B(e)&&!h(e))return null;let i=h(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,r=Er(i.uri);if("text"in i)return o("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),o(u,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(N,{}),n("span",{className:"truncate",children:r})]})]});let l=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,f=i.mimeType?.toLowerCase().startsWith("image/")&&I!==l,{openImage:g,openImageGallery:w}=a,x=w?()=>w([{src:l,alt:r,uri:i.uri}],0):g&&(()=>g(l)),m=s&&f,R=async()=>{d(!0);try{if(a.saveFile)await a.saveFile(r,i.blob);else U(r,l)}catch(c){rt(a,c)}finally{d(!1)}},v=n("img",{src:l,alt:"",className:s?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>C(l)});return o("div",{className:m?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[f&&(x===void 0?v:n(u,{variant:"ghost",className:s?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:x,children:v})),o(u,{variant:m?"secondary":"link",size:m?"icon":"sm",className:m?"codex-generated-image-download":"max-w-full min-w-0",disabled:p,title:a.t("timeline.download",{name:r}),"aria-label":a.t("timeline.download",{name:r}),onClick:()=>{R()},children:[p?n(F,{className:"motion-safe:animate-spin"}):n(T,{}),!m&&n("span",{className:"truncate",children:r})]})]})}
|
|
2
|
+
export{Er,Z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l}from"./chunk-
|
|
1
|
+
import{l}from"./chunk-wtf1eyzy.js";import{L,R,F,D}from"./chunk-kpp4v1hs.js";import{Item as m}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function re({skills:o=!1}){let{t}=l();return a("div",{role:"status","aria-label":t(o?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(D,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((i)=>a(m,{size:"xs",className:"toolbox-row",children:[e(F,{children:e(s,{className:"size-10 rounded-xl"})}),a(R,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(L,{children:e(s,{className:"size-8 rounded-full"})})]},i))})]})}
|
|
2
2
|
export{re};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A}from"./chunk-2f9vjmxz.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function
|
|
2
|
-
export{
|
|
1
|
+
import{A}from"./chunk-2f9vjmxz.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function br({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(A,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(A,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
|
|
2
|
+
export{br};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DropdownMenuRadioGroup as
|
|
1
|
+
import{cn as l}from"cn";import{DropdownMenuRadioGroup as r,DropdownMenuRadioItem as s}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as a}from"react/jsx-runtime";function w({value:i,onValueChange:n,options:o,itemClassName:d}){return t(r,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(s,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:l("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
|
|
2
2
|
export{w};
|
|
@@ -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 Bt(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
|
|
2
|
+
export{Bt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{T}from"./chunk-7a668qzy.js";import{e}from"./chunk-k1vkc88d.js";import{Ke}from"./chunk-2djv6s3a.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ao({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=T(),{text:c,status:n}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(r,{type:"button",variant:"ghost",disabled:n!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:n==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(n==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),n==="error"&&a.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Ke(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
+
export{Ao};
|
|
@@ -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 ln({name:p,value:M,levels:h,disabled:c,onChange:P}){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}},f=100,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{ln};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
async function
|
|
2
|
-
export{
|
|
1
|
+
async function Mo(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
|
|
2
|
+
export{Mo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function yn(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
|
|
2
|
+
export{yn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d}from"./chunk-92xxp77d.js";import{b,p}from"./chunk-
|
|
2
|
-
`).toLowerCase()}))})),[a]),r=Q(()=>{let n=new Set(v);return m.map(({marketplace:x,entries:h})=>({marketplace:x,plugins:h.filter(({plugin:y,text:P})=>c===""?x.path!==null||n.has(y.id):P.includes(c)).map(({plugin:y})=>y)}))},[m,v,c]);return s(Z,{children:[r.map(({marketplace:n,plugins:x})=>e(ze,{marketplace:n,plugins:x,onOpen:u},JSON.stringify([n.name,n.path,c]))),r.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Te(){let{t}=l(),c=q(),u=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[v,m]=S(""),[r,n]=S(!1),[x,h]=S(!1),[y,P]=S(null),A=async()=>{let N=v.trim();if(!N||r)return;n(!0),P(null);try{await u({source:N}),m(""),h(!1)}catch(M){P(M instanceof Error?M.message:String(M))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(B,{}):e(le,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:x,onOpenChange:(N)=>{if(!r)h(N)},children:[s(be,{render:e(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c}),children:[e(U,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ke,{children:[e(ye,{children:t("plugins.marketplace.addTitle")}),e(Ne,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(N)=>{N.preventDefault(),A()},children:[e(De,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(W,{id:"marketplace-source",value:v,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(k,{type:"button",variant:"ghost",disabled:r,onClick:()=>h(!1),children:t("plugins.marketplace.addCancel")}),s(k,{type:"submit",disabled:r||v.trim()==="",children:[r&&e(B,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Ae({onOpen:t,query:c}){let u=q(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!u,v=ve(c.trim().toLowerCase());return e(f,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${E} flex flex-col gap-8`,children:[g.map((m)=>s("p",{className:"text-destructive px-2 text-xs",children:[m.marketplacePath,": ",m.message]},m.marketplacePath)),a?e(re,{}):e(Be,{query:v,onOpen:t})]})})}function
|
|
3
|
-
export{
|
|
1
|
+
import{d}from"./chunk-92xxp77d.js";import{b,p}from"./chunk-py0zbgaj.js";import{at}from"./chunk-bvgqsaey.js";import{Se,l,_e,Oe,i}from"./chunk-wtf1eyzy.js";import{L,R,Y,F,D,ce,ut}from"./chunk-kpp4v1hs.js";import{re}from"./chunk-b7z51agd.js";import{He}from"./chunk-p7dd93e5.js";import{f}from"./chunk-1k21j77z.js";import{ct,I}from"./chunk-vgrjqwbq.js";import{E,se}from"./chunk-tv0fwt2g.js";import{lt}from"./chunk-rp39j6ed.js";import{st}from"./chunk-1dbc0cfj.js";import{hasPluginStore as te}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as ae,BookOpenIcon as ne,CheckIcon as ie,CircleArrowUpIcon as le,MoreVerticalIcon as oe,PlusIcon as U,PuzzleIcon as de,RefreshCwIcon as me,SearchIcon as ue,Trash2Icon as pe,XIcon as ge}from"lucide-react";import{memo as fe,useDeferredValue as ve,useEffect as K,useMemo as Q,useState as S}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as xe,DialogContent as he,DialogDescription as Ne,DialogHeader as ke,DialogTitle as ye,DialogTrigger as be}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Pe,DropdownMenuContent as we,DropdownMenuItem as Ce,DropdownMenuTrigger as Ie}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as W}from"@nyssance/shadcn/vega/components/ui/input";import{Label as De}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as B}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as Z}from"react/jsx-runtime";function T(t){return t.interface?.displayName??t.name}function X(t){return t.interface?.shortDescription??""}function Me({plugin:t,marketplace:c}){let{t:u}=l(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((x)=>x.plugin.id===t.id)),v=i((n)=>n.install),m=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",r=u(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(ie,{className:"text-muted-foreground size-4 shrink-0","aria-label":r});return e(k,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||m,"aria-label":r,title:m?u("plugins.disabledReason.unknown"):r,onClick:()=>void v({plugin:t,marketplace:c}).catch(()=>{}),children:g?e(B,{"aria-hidden":"true"}):e(U,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Ee({plugin:t,marketplace:c,actions:u,onOpen:g}){let a=X(t),v=t.interface?.developerName,m=t.localVersion??t.version,r=[v,m?`v${m}`:null].filter(Boolean).join(" · ");return s(ce,{className:"toolbox-row relative",children:[e(k,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":T(t),onClick:()=>g({plugin:t,marketplace:c})}),e(F,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(I,{name:t.name})})}),s(R,{className:"pointer-events-none relative min-w-0",children:[e(ut,{className:"mb-0.5",children:T(t)}),e(Y,{className:"line-clamp-1",title:a,children:a||c.interface?.displayName||c.name}),r&&e(Y,{"data-toolbox-metadata":"",children:r})]}),e(L,{className:"relative w-8 shrink-0 justify-center",children:u})]})}function q(){return Oe((t)=>t.connection==="ready"&&te(t.agent))}var z=48;function ze({marketplace:t,plugins:c,onOpen:u}){let{t:g}=l(),a=i((n)=>n.removeMarketplace),[v,m]=S(0),r=Math.min(v,Math.max(0,Math.ceil(c.length/z)-1));if(c.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:c.length}),t.path!==null&&s(Pe,{children:[e(Ie,{render:e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(oe,{})}),e(we,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ce,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(pe,{className:"size-3.5"}),g("plugins.marketplace.remove")]})})]})]}),e(D,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:c.slice(r*z,(r+1)*z).map((n)=>e(Ee,{onOpen:u,plugin:n,marketplace:t,actions:e(Me,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),c.length>z&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(k,{variant:"outline",size:"sm",className:"h-9",disabled:r===0,onClick:()=>m(r-1),children:g("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",Math.ceil(c.length/z)]}),e(k,{variant:"outline",size:"sm",className:"h-9",disabled:(r+1)*z>=c.length,onClick:()=>m(r+1),children:g("plugins.nextPage")})]})]},t.name)}var Be=fe(function({query:c,onOpen:u}){let{t:g}=l(),a=i((n)=>n.marketplaces),v=i((n)=>n.featuredPluginIds),m=Q(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((x)=>({plugin:x,text:[x.name,T(x),X(x),x.interface?.developerName??"",...x.keywords].join(`
|
|
2
|
+
`).toLowerCase()}))})),[a]),r=Q(()=>{let n=new Set(v);return m.map(({marketplace:x,entries:h})=>({marketplace:x,plugins:h.filter(({plugin:y,text:P})=>c===""?x.path!==null||n.has(y.id):P.includes(c)).map(({plugin:y})=>y)}))},[m,v,c]);return s(Z,{children:[r.map(({marketplace:n,plugins:x})=>e(ze,{marketplace:n,plugins:x,onOpen:u},JSON.stringify([n.name,n.path,c]))),r.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Te(){let{t}=l(),c=q(),u=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[v,m]=S(""),[r,n]=S(!1),[x,h]=S(!1),[y,P]=S(null),A=async()=>{let N=v.trim();if(!N||r)return;n(!0),P(null);try{await u({source:N}),m(""),h(!1)}catch(M){P(M instanceof Error?M.message:String(M))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(B,{}):e(le,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:x,onOpenChange:(N)=>{if(!r)h(N)},children:[s(be,{render:e(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c}),children:[e(U,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ke,{children:[e(ye,{children:t("plugins.marketplace.addTitle")}),e(Ne,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(N)=>{N.preventDefault(),A()},children:[e(De,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(W,{id:"marketplace-source",value:v,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(k,{type:"button",variant:"ghost",disabled:r,onClick:()=>h(!1),children:t("plugins.marketplace.addCancel")}),s(k,{type:"submit",disabled:r||v.trim()==="",children:[r&&e(B,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Ae({onOpen:t,query:c}){let u=q(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!u,v=ve(c.trim().toLowerCase());return e(f,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${E} flex flex-col gap-8`,children:[g.map((m)=>s("p",{className:"text-destructive px-2 text-xs",children:[m.marketplacePath,": ",m.message]},m.marketplacePath)),a?e(re,{}):e(Be,{query:v,onOpen:t})]})})}function Bi({cwd:t,active:c,extensions:u,onOpenCatalog:g}){let{t:a}=l(),v=_e(),m=Se(v),r=i((o)=>o.refresh),n=i((o)=>o.loading),x=i((o)=>o.error),[h,y]=S("plugins"),[P,A]=S({plugins:"",skills:""}),N=h==="skills"?P.skills:P.plugins,M=(o)=>A((O)=>({...O,[h]:o})),ee=Oe((o)=>JSON.stringify([...new Set(o.sessionList.map((O)=>He(O.cwd,o.projectContext)).filter((O)=>O!==null))].toSorted())),H=JSON.stringify([...new Set([He(t,v.state.projectContext),...JSON.parse(ee)].filter((o)=>o!==null))].toSorted()),j=i((o)=>o.installed),V=a(h==="skills"?"plugins.skills.search":"plugins.search"),[w,G]=S(null),C=q();K(()=>{if(!c||!C)return;if(m.getState().loadedScope!==H)r(JSON.parse(H))},[c,C,r,H,m]),K(()=>{if(!C)return;return v.onSkillsChanged(()=>void r(void 0,{background:!0}))},[C,r,v]);let J=(o)=>{g?.(),y("plugins"),G(o)},_=(o)=>{g?.(),y(o),G(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(ct,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[u&&s(p,{className:`${d} h-8 gap-2 px-2`,active:u.active,onClick:u.onOpen,children:[e(ae,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((o)=>s(p,{className:`${d} h-8 gap-2 px-2`,active:!u?.active&&h===o&&w===null,onClick:()=>_(o),children:[o==="plugins"?e(de,{className:"size-4"}):e(ne,{className:"size-4"}),e("span",{children:a(`plugins.headings.${o}`)})]},o))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(f,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(b,{children:!C||n&&j.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(B,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):j.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):j.map((o)=>s(p,{title:T(o.plugin),className:`${d} gap-2 px-2`,active:!u?.active&&w?.plugin.id===o.plugin.id,onClick:()=>J(o),children:[e(I,{name:o.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:T(o.plugin)})]},o.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:u?.active?u.content:s(Z,{children:[w&&e(lt,{entry:w,onBack:()=>_("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(se,{children:e(at,{title:a(`plugins.headings.${h}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(ue,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(W,{className:"h-9 rounded-full ps-9 pe-9","aria-label":V,value:N,onChange:(o)=>M(o.target.value),placeholder:V}),N&&e(k,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>M(""),children:e(ge,{})})]}),e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void r(void 0,{forceRefetch:!0}),children:n?e(B,{}):e(me,{})}),h==="plugins"&&e(Te,{})]})})}),(h==="plugins"||x)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[h==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),x&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",x]}),e(k,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void r(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:h!=="plugins",className:h==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Ae,{query:P.plugins,onOpen:J})}),e("div",{hidden:h!=="skills",className:h==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(st,{query:P.skills,ready:C,onOpenPlugin:J})})]})]})]})})]})}
|
|
3
|
+
export{Bi};
|