@alwith/module-chat 0.6.20 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/application-client.js +1 -1
- package/dist/agent/client.js +1 -1
- package/dist/agent/custom-model-effort.js +1 -1
- package/dist/agent/fork-title.js +1 -1
- package/dist/agent/image-request.js +1 -1
- package/dist/agent/image-tools.js +1 -1
- package/dist/agent/input-config.js +1 -1
- package/dist/agent/input-modes/chat.js +1 -1
- package/dist/agent/input-modes/execution-meta.js +1 -1
- package/dist/agent/input-modes/image.js +1 -1
- package/dist/agent/input-modes/index.js +1 -1
- package/dist/agent/request-error.js +1 -1
- package/dist/app-reference.js +1 -1
- package/dist/application-tools.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/{chunk-wkrnbk0p.js → chunk-05zhvfrp.js} +2 -2
- package/dist/{chunk-3w6dv0nx.js → chunk-0faa9z99.js} +1 -1
- package/dist/{chunk-csfqkzmr.js → chunk-0n26qaxb.js} +3 -3
- package/dist/{chunk-6my4ybpw.js → chunk-0ne2mz2q.js} +2 -2
- package/dist/{chunk-hzhcajx1.js → chunk-0xshzqb6.js} +2 -2
- package/dist/{chunk-ztrfygh5.js → chunk-1e83qr49.js} +2 -2
- package/dist/{chunk-81jejgvs.js → chunk-1smyy9mt.js} +2 -2
- package/dist/{chunk-6dnb0t84.js → chunk-200zk66j.js} +2 -2
- package/dist/{chunk-swt6dntp.js → chunk-2fx3qhyb.js} +2 -2
- package/dist/{chunk-1a56svgj.js → chunk-2q1xxs3t.js} +2 -2
- package/dist/{chunk-tzczzqde.js → chunk-2qs1ss40.js} +2 -2
- package/dist/{chunk-7jk8s061.js → chunk-2sc2z6g5.js} +2 -2
- package/dist/{chunk-41yz7txv.js → chunk-36ttr22w.js} +2 -2
- package/dist/{chunk-e2qjbqq2.js → chunk-3a5sn0v8.js} +2 -2
- package/dist/{chunk-8kd74ng1.js → chunk-3ek4vddd.js} +2 -2
- package/dist/{chunk-2c2a1wvg.js → chunk-3mm1d99e.js} +1 -1
- package/dist/chunk-3vzbqfsh.js +2 -0
- package/dist/{chunk-nrzkzvr0.js → chunk-3z5zyra7.js} +2 -2
- package/dist/{chunk-ckjq6690.js → chunk-4dp24aja.js} +2 -2
- package/dist/{chunk-6ehhap9k.js → chunk-4gxpna3p.js} +2 -2
- package/dist/{chunk-2zy75522.js → chunk-4h9ee02f.js} +2 -2
- package/dist/{chunk-f6zpqrg3.js → chunk-4ntxjy8v.js} +2 -2
- package/dist/{chunk-s8djv2dy.js → chunk-50eym2q3.js} +3 -3
- package/dist/{chunk-2cfhvb3k.js → chunk-542c9tpr.js} +2 -2
- package/dist/chunk-5cf6ny70.js +2 -0
- package/dist/{chunk-p2tm6tv8.js → chunk-5d138vq3.js} +1 -1
- package/dist/{chunk-bcdw682e.js → chunk-5dgmqyg1.js} +2 -2
- package/dist/{chunk-8y706gz3.js → chunk-5kje89r8.js} +2 -2
- package/dist/{chunk-2easwd1n.js → chunk-5pmr5dby.js} +2 -2
- package/dist/{chunk-gy4h86mw.js → chunk-5pyvgshe.js} +2 -2
- package/dist/{chunk-fvwrc97h.js → chunk-5wqbhb7a.js} +1 -1
- package/dist/{chunk-tec9yhsm.js → chunk-5xe89qwh.js} +2 -2
- package/dist/{chunk-s6b28p84.js → chunk-5ygqjna0.js} +2 -2
- package/dist/{chunk-m944rgn9.js → chunk-689vpcc9.js} +1 -1
- package/dist/{chunk-s6y31dcb.js → chunk-6cjjwry2.js} +2 -2
- package/dist/{chunk-55ya3102.js → chunk-6e9wwjgv.js} +2 -2
- package/dist/{chunk-m8pkmbtf.js → chunk-6r5nzsw8.js} +2 -2
- package/dist/{chunk-rr9kc3n8.js → chunk-76c0cx40.js} +2 -2
- package/dist/{chunk-f89s462k.js → chunk-76smt4zv.js} +2 -2
- package/dist/{chunk-d8f6avcz.js → chunk-79pvfyd0.js} +2 -2
- package/dist/{chunk-1vtvcar6.js → chunk-7a70nd7e.js} +1 -1
- package/dist/chunk-7cab9zy0.js +2 -0
- package/dist/{chunk-npvcy4tw.js → chunk-7e86wygk.js} +2 -2
- package/dist/{chunk-a71j2n86.js → chunk-7s3f142h.js} +1 -1
- package/dist/{chunk-g61xf0ma.js → chunk-7v7wc7k5.js} +2 -2
- package/dist/{chunk-8q9hq3mg.js → chunk-7wd0kfqr.js} +2 -2
- package/dist/{chunk-ecdjjnbb.js → chunk-7wpcdwan.js} +1 -1
- package/dist/{chunk-3gnn1v68.js → chunk-7xvrsw7x.js} +2 -2
- package/dist/{chunk-xykmskka.js → chunk-81hv0s07.js} +2 -2
- package/dist/{chunk-gnctm097.js → chunk-81hxr15a.js} +2 -2
- package/dist/{chunk-3a3ecayr.js → chunk-859359n0.js} +2 -2
- package/dist/{chunk-bej9z041.js → chunk-8a0fd2f5.js} +2 -2
- package/dist/{chunk-78vckhxt.js → chunk-8ew2e3y7.js} +2 -2
- package/dist/{chunk-wxh1m3gg.js → chunk-8h4e3654.js} +2 -2
- package/dist/{chunk-wnydsth6.js → chunk-8rtjn0tg.js} +2 -2
- package/dist/{chunk-04c5k3qr.js → chunk-94gqvrk7.js} +2 -2
- package/dist/{chunk-fhjk81r9.js → chunk-9hjfc08t.js} +2 -2
- package/dist/chunk-9ts08sma.js +2 -0
- package/dist/{chunk-5aqqqsa3.js → chunk-9zgkpv8m.js} +1 -1
- package/dist/{chunk-6tj5e7fc.js → chunk-a8r3mggj.js} +2 -2
- package/dist/{chunk-mr2wcd24.js → chunk-ag8696fb.js} +1 -1
- package/dist/chunk-ayt0bzr9.js +2 -0
- package/dist/{chunk-easm0z49.js → chunk-az3g3a94.js} +2 -2
- package/dist/{chunk-38bpmgjd.js → chunk-bdrcreqs.js} +2 -2
- package/dist/{chunk-4p0zk3mj.js → chunk-bh0h7fz7.js} +2 -2
- package/dist/chunk-bsnmj69j.js +2 -0
- package/dist/{chunk-5hk3k14h.js → chunk-c092x92d.js} +2 -2
- package/dist/{chunk-gdavg2hq.js → chunk-ca4vetrh.js} +2 -2
- package/dist/{chunk-c0mpr4dh.js → chunk-capkej8s.js} +1 -1
- package/dist/{chunk-rh2yx0xq.js → chunk-cc6x7r61.js} +2 -2
- package/dist/{chunk-n6dqwdg5.js → chunk-cfpm71vd.js} +2 -2
- package/dist/{chunk-r8expjyy.js → chunk-cfx5s6fz.js} +3 -3
- package/dist/{chunk-933h9gnv.js → chunk-ck2ax5f6.js} +2 -2
- package/dist/{chunk-gawrkkbf.js → chunk-cn07a5nh.js} +2 -2
- package/dist/chunk-cq7bbgcg.js +2 -0
- package/dist/chunk-d29xbf16.js +2 -0
- package/dist/{chunk-5bmxngnx.js → chunk-dp1nnwk2.js} +1 -1
- package/dist/chunk-dpfjxym1.js +2 -0
- package/dist/{chunk-rx84h0c2.js → chunk-dtxc0x7y.js} +2 -2
- package/dist/{chunk-y8fmawc6.js → chunk-dypeezvv.js} +2 -2
- package/dist/{chunk-1hmt6w4w.js → chunk-e5mn6ern.js} +2 -2
- package/dist/{chunk-at75m9hq.js → chunk-e641842r.js} +2 -2
- package/dist/{chunk-abgdqy92.js → chunk-e6ya95ee.js} +2 -2
- package/dist/{chunk-t9e1sj53.js → chunk-exkacmay.js} +2 -2
- package/dist/{chunk-e7ndpy02.js → chunk-f1awp8vf.js} +2 -2
- package/dist/{chunk-bane0xc8.js → chunk-f7bn0nd2.js} +2 -2
- package/dist/{chunk-6xap6hvz.js → chunk-fe83mqnb.js} +2 -2
- package/dist/{chunk-k99r1r38.js → chunk-fn68kh69.js} +1 -1
- package/dist/{chunk-3tvct295.js → chunk-ft7k6n4g.js} +2 -2
- package/dist/{chunk-pdmayjan.js → chunk-g4devj8d.js} +2 -2
- package/dist/{chunk-56rx2rmj.js → chunk-g751pxzk.js} +2 -2
- package/dist/{chunk-n8v6cdq3.js → chunk-gak8579e.js} +2 -2
- package/dist/{chunk-16db8fh2.js → chunk-gec6q1jb.js} +2 -2
- package/dist/{chunk-gea1q14z.js → chunk-grxjvm9h.js} +2 -2
- package/dist/{chunk-38hvm5ca.js → chunk-h8r785ne.js} +2 -2
- package/dist/{chunk-8y60kexq.js → chunk-hcat58sr.js} +2 -2
- package/dist/{chunk-kh3af9mq.js → chunk-hgtbhvyh.js} +2 -2
- package/dist/{chunk-04frqm59.js → chunk-hp0eqd8x.js} +2 -2
- package/dist/{chunk-rkejggyx.js → chunk-j3g21ext.js} +2 -2
- package/dist/{chunk-qdcznn2t.js → chunk-j64839nf.js} +2 -2
- package/dist/{chunk-gvqvw7ms.js → chunk-jcyv1q0x.js} +2 -2
- package/dist/{chunk-x20dy83s.js → chunk-jj5y2js2.js} +3 -3
- package/dist/chunk-jjgwfpmp.js +2 -0
- package/dist/{chunk-5s85tvas.js → chunk-js3nhatr.js} +2 -2
- package/dist/{chunk-kztrgv9y.js → chunk-jw1c8r97.js} +2 -2
- package/dist/{chunk-kj3t4mqf.js → chunk-jydhbkm8.js} +2 -2
- package/dist/{chunk-9q6hz47j.js → chunk-kbfe7gqw.js} +2 -2
- package/dist/{chunk-1r4y3pfg.js → chunk-m6080rsp.js} +2 -2
- package/dist/{chunk-vhxr0c4c.js → chunk-m8tt5bf9.js} +2 -2
- package/dist/{chunk-q5qqhqw4.js → chunk-m9ttf96p.js} +2 -2
- package/dist/{chunk-r6ns1457.js → chunk-mbsmb8jn.js} +2 -2
- package/dist/{chunk-t9xkg3pk.js → chunk-mc40zb3c.js} +1 -1
- package/dist/{chunk-23r426sm.js → chunk-mc5668pn.js} +2 -2
- package/dist/{chunk-r8pm74zf.js → chunk-mgmv8kap.js} +2 -2
- package/dist/{chunk-jm6y0edw.js → chunk-mvd124vs.js} +2 -2
- package/dist/{chunk-evygj5ka.js → chunk-mwthxh95.js} +2 -2
- package/dist/{chunk-6c18ag8t.js → chunk-n9jaz2pd.js} +2 -2
- package/dist/{chunk-ecaedwda.js → chunk-nbaxn7jx.js} +2 -2
- package/dist/{chunk-ayhxrzsq.js → chunk-nhstvqjy.js} +2 -2
- package/dist/chunk-njwb0rbw.js +3 -0
- package/dist/{chunk-z1qcgb6b.js → chunk-nmtz0797.js} +3 -3
- package/dist/{chunk-2nb1475h.js → chunk-npev9ffr.js} +2 -2
- package/dist/{chunk-yc4cdg65.js → chunk-nvgnan7w.js} +2 -2
- package/dist/{chunk-n3sm0834.js → chunk-nypr6qtz.js} +2 -2
- package/dist/{chunk-rtbpfasb.js → chunk-pnh5t6pc.js} +2 -2
- package/dist/{chunk-cvx7r35k.js → chunk-pr36m3qx.js} +2 -2
- package/dist/{chunk-f4h84pav.js → chunk-q4nx04sy.js} +2 -2
- package/dist/chunk-q73jne25.js +2 -0
- package/dist/{chunk-df9aqj1m.js → chunk-qdyyvd2w.js} +1 -1
- package/dist/{chunk-62wxvxsg.js → chunk-qe4nwsn7.js} +1 -1
- package/dist/{chunk-jca8s47n.js → chunk-qghq84r4.js} +1 -1
- package/dist/{chunk-8ngg5vs4.js → chunk-qkv8wzq1.js} +3 -3
- package/dist/{chunk-3chhwwwy.js → chunk-qv23mh24.js} +2 -2
- package/dist/{chunk-bfwft1b8.js → chunk-qwet39v5.js} +2 -2
- package/dist/{chunk-2a4pq98d.js → chunk-qxssxzws.js} +1 -1
- package/dist/chunk-r3hsjwjn.js +2 -0
- package/dist/{chunk-29s4mnfw.js → chunk-r7paw6ba.js} +2 -2
- package/dist/{chunk-djd3sjp9.js → chunk-rff6c87z.js} +2 -2
- package/dist/{chunk-vgscp6dr.js → chunk-rn5bqc82.js} +3 -3
- package/dist/{chunk-kv1w4jx4.js → chunk-rqa21qrv.js} +2 -2
- package/dist/{chunk-dtgbgwby.js → chunk-rzxnxj25.js} +2 -2
- package/dist/{chunk-e7me5e6n.js → chunk-s0z838qq.js} +2 -2
- package/dist/{chunk-0rnh8mhs.js → chunk-s2k0g1hc.js} +2 -2
- package/dist/{chunk-7sp1yqfg.js → chunk-sdv06e2k.js} +1 -1
- package/dist/{chunk-6wkcqhkk.js → chunk-sjqhtpzr.js} +2 -2
- package/dist/{chunk-3hjcpcnv.js → chunk-stc4ctrx.js} +2 -2
- package/dist/{chunk-ggddhx5x.js → chunk-t3m57q06.js} +2 -2
- package/dist/{chunk-r6c9r5yy.js → chunk-tfj6v7y4.js} +1 -1
- package/dist/{chunk-q9mh8x4r.js → chunk-tsdb5jnj.js} +2 -2
- package/dist/{chunk-pk931bpm.js → chunk-tyka859b.js} +1 -1
- package/dist/{chunk-c1pvvk0x.js → chunk-v0h0jqej.js} +2 -2
- package/dist/{chunk-bv14x0e8.js → chunk-v581r9vt.js} +3 -3
- package/dist/{chunk-wjd2hpnd.js → chunk-v78f93yn.js} +2 -2
- package/dist/{chunk-1qjhvkg0.js → chunk-v9jqk03c.js} +2 -2
- package/dist/{chunk-1ycyexae.js → chunk-vsh9vh4s.js} +2 -2
- package/dist/{chunk-62qtrk0p.js → chunk-vx6shb4g.js} +2 -2
- package/dist/{chunk-1gv49jt9.js → chunk-w2xjhfm2.js} +3 -3
- package/dist/{chunk-ase4ejxz.js → chunk-w4bye56s.js} +2 -2
- package/dist/chunk-wd82qz3x.js +2 -0
- package/dist/{chunk-sjtfxn55.js → chunk-wdph90qk.js} +2 -2
- package/dist/{chunk-61awcdaq.js → chunk-wrfs7q9f.js} +4 -4
- package/dist/{chunk-ms0h8x63.js → chunk-wsyfhh7y.js} +2 -2
- package/dist/{chunk-2dm51ksz.js → chunk-wwj743gm.js} +2 -2
- package/dist/{chunk-hygvdjq6.js → chunk-wz6765xb.js} +2 -2
- package/dist/{chunk-f73x23f9.js → chunk-x4enakra.js} +2 -2
- package/dist/{chunk-q46z21zs.js → chunk-x621s275.js} +2 -2
- package/dist/{chunk-814h2ja2.js → chunk-x6m7zsg1.js} +3 -3
- package/dist/{chunk-nmd5x501.js → chunk-xadfbbwt.js} +2 -2
- package/dist/{chunk-g7cc7gdn.js → chunk-xdcp8tj9.js} +2 -2
- package/dist/{chunk-86821qec.js → chunk-xk0dt0es.js} +2 -2
- package/dist/{chunk-q9y0wjwp.js → chunk-xk306vq1.js} +2 -2
- package/dist/{chunk-v8x5atmn.js → chunk-xqpdvq05.js} +1 -1
- package/dist/{chunk-vvkp0jqa.js → chunk-xre7g1gy.js} +1 -1
- package/dist/chunk-xw6rsyvx.js +7 -0
- package/dist/{chunk-7ac4g54f.js → chunk-y93q3v30.js} +3 -3
- package/dist/{chunk-s2706gae.js → chunk-ymk7ampx.js} +1 -1
- package/dist/{chunk-ykz0h1r0.js → chunk-z8sheg2r.js} +2 -2
- package/dist/{chunk-86r89vrt.js → chunk-zm6b6zyr.js} +2 -2
- package/dist/{chunk-g8w06bdx.js → chunk-zsrjzx7g.js} +2 -2
- package/dist/{chunk-85tzkdsj.js → chunk-ztb6vjcg.js} +2 -2
- package/dist/{chunk-b4kh5nns.js → chunk-ztnq7bts.js} +2 -2
- package/dist/{chunk-s88eyv24.js → chunk-zwyd2bhy.js} +2 -2
- package/dist/{chunk-tj4b0s68.js → chunk-zz582m73.js} +2 -2
- package/dist/client.js +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/artifact-links.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.d.ts +1 -0
- 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/styles.css +26 -0
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/model.js +1 -1
- package/dist/collections/store.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/inline-document.js +1 -1
- package/dist/composer/inline-dom.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-inline.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/app-mentions.js +1 -1
- package/dist/conversation/composer/apps-menu.js +1 -1
- package/dist/conversation/composer/composer-menu.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/prompt-history.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/connection-notice.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-search.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/diff-modal.js +1 -1
- package/dist/conversation/draft-project-picker.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/conversation/subagent-sessions.js +1 -1
- package/dist/conversation/subagent-tasks.js +1 -1
- package/dist/desktop/desktop-composer.js +1 -1
- package/dist/desktop/desktop.js +1 -1
- package/dist/desktop/draft-model-select.js +1 -1
- package/dist/desktop/load-image.js +1 -1
- package/dist/desktop/model-catalog.js +1 -1
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.js +1 -1
- package/dist/lib/app-reference.js +1 -1
- package/dist/lib/application-metadata.js +1 -1
- package/dist/lib/chat-path.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/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/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/mermaid/diagram.js +1 -1
- package/dist/mermaid/export.js +1 -1
- package/dist/mermaid/index.js +1 -1
- package/dist/mermaid/preview.js +1 -1
- package/dist/oauth/claude-login.js +1 -1
- package/dist/oauth.js +1 -1
- package/dist/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.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/reference-projection.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/navigation-controls.js +1 -1
- package/dist/session-list/navigation-header.js +1 -1
- package/dist/session-list/navigation-store.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/platform.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/shortcut-hint.js +1 -1
- package/dist/session-list/shortcut.js +1 -1
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/use-activity-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-image-references.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/image-generation-progress.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/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.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3g9qb7vq.js +0 -2
- package/dist/chunk-ayademz2.js +0 -2
- package/dist/chunk-bydxp3zj.js +0 -7
- package/dist/chunk-c8wdf20g.js +0 -2
- package/dist/chunk-een4e2tr.js +0 -2
- package/dist/chunk-gyw21vnb.js +0 -2
- package/dist/chunk-jq6qs3s6.js +0 -2
- package/dist/chunk-k4xsxxy7.js +0 -2
- package/dist/chunk-mqpkm974.js +0 -2
- package/dist/chunk-qejm75d7.js +0 -2
- package/dist/chunk-tc3t2sgb.js +0 -3
- package/dist/chunk-tcs1a1hk.js +0 -2
- package/dist/chunk-v4qzxq4v.js +0 -2
- package/dist/chunk-x1mzrhtd.js +0 -2
- package/dist/chunk-y6p8xspr.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-abgdqy92.js";import{Wt}from"./chunk-gy4h86mw.js";import{A,xt,ie,_n}from"./chunk-38hvm5ca.js";import{bn,Ee}from"./chunk-3gnn1v68.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as se,EyeOffIcon as ne,PlusIcon as ge,ServerIcon as oe,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function oi({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ms({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=Ee(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(A[0]?.id??""),[F,B]=y(0),[U,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(A[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await bn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=A.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||E)return;k(A[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Wt,{bridge:d})]}),C&&t(oi,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(ii,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),A.map((o)=>t("div",{hidden:x!==o.id,children:t(si,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Yn,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Yn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function ii({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[A.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(oe,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function ri({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(ri,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function si({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(ie(s,d?.region)?.id),[U,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),z=_n(s,F),K=F!==ie(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(ie(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=F,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),B((g)=>g===G?ie(s,D?.region)?.id:g),M((g)=>g===U?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(se,{}):t(ne,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:ie(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>M(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Yn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
1
|
+
import{e}from"./chunk-e6ya95ee.js";import{Zt}from"./chunk-5pyvgshe.js";import{A,xt,ie,Pn}from"./chunk-h8r785ne.js";import{Cn,Ee}from"./chunk-7xvrsw7x.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as se,EyeOffIcon as ne,PlusIcon as ge,ServerIcon as oe,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function ii({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ms({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=Ee(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(A[0]?.id??""),[F,B]=y(0),[U,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(A[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await Cn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=A.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||E)return;k(A[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Zt,{bridge:d})]}),C&&t(ii,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(ri,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),A.map((o)=>t("div",{hidden:x!==o.id,children:t(ai,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(eo,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(eo,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function ri({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[A.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(oe,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function si({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(si,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function ai({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(ie(s,d?.region)?.id),[U,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),z=Pn(s,F),K=F!==ie(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(ie(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=F,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),B((g)=>g===G?ie(s,D?.region)?.id:g),M((g)=>g===U?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(se,{}):t(ne,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:ie(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>M(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function eo({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
2
2
|
{ "label": "My Model", "api_id": "model-id" }
|
|
3
3
|
]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),L=(m)=>{if(!m)try{J(xt(I)),K(null)}catch(D){K(W(D));return}U(m)},G=async()=>{let m;try{m=xt(I),K(null)}catch(g){K(W(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(oe,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[t(_,{htmlFor:E,children:n("provider.name")}),t(Z,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:o,children:n("provider.baseUrl")}),t(Z,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:r,children:n("provider.apiKey")}),i(H,{children:[t(q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(se,{}):t(ne,{})})})]})]})]}),t(Q,{}),i(re,{open:B,onOpenChange:L,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(te,{className:j("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:M.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(O,{className:"gap-2","data-invalid":z!==null,children:[t(_,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:j("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void G(),children:[u&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
|
|
4
|
-
export{
|
|
4
|
+
export{ii,Ms,ri,si,ai,eo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Zs={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function
|
|
2
|
-
export{Zs,
|
|
1
|
+
var Zs={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Xi(e){return[...e].toSorted((o,n)=>(Zs[o.kind]??99)-(Zs[n.kind]??99))}function qa(e){return e==="allow_once"||e==="allow_always"}function Ka(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
+
export{Zs,Xi,qa,Ka};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function
|
|
2
|
-
export{
|
|
1
|
+
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Vr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function il(){c()}function jr(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function $r(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Sa(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function rl(e,n,t,i,o,a){if(a==="none")return;_(o,[Sa(e,n,t,i,a)])}function Sa(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ua(t,i);return _a(e,n)}function Ua(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function _a(e,n){return y+Ba(e,n)}function sl(e,n){return D(_a(e,n))}function Ba(e,n){if(n<=l)return Ga(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Ga(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function al(){return r.context?.state}function ll(e){return g(e).ready}
|
|
2
|
+
export{Vr,il,jr,$r,rl,Sa,Ua,_a,sl,Ba,Ga,al,ll};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Xe,
|
|
2
|
-
export{
|
|
1
|
+
import{Xe,on}from"./chunk-gak8579e.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function Fi(o){if(o===null||o===void 0)return Xe();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function Us(o,{reportError:t=console.error}={}){let e=S(Xe()),r=async()=>{e.setState(Fi(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(on,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function Bs({store:o,children:t}){return w(f,{value:o,children:t})}function co(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function Te(o){let{store:t}=co(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function ue(){return co().dispatch}
|
|
2
|
+
export{Fi,Us,Bs,co,Te,ue};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Questionnaire as r}from"@shadcn/react/questionnaire";import{useEffect as N,useId as v,useRef as b}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Textarea as R}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as i,jsxs as c,Fragment as S}from"react/jsx-runtime";function p(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function D(e){if(!p(e)||!p(e.codex))return[];let n=e.codex,o=n.questions;if(n.delivery!=="async"||!Array.isArray(o))return[];if(!o.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((m)=>typeof m==="string"))))return[];return o}function
|
|
1
|
+
import{Questionnaire as r}from"@shadcn/react/questionnaire";import{useEffect as N,useId as v,useRef as b}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Textarea as R}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as i,jsxs as c,Fragment as S}from"react/jsx-runtime";function p(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function D(e){if(!p(e)||!p(e.codex))return[];let n=e.codex,o=n.questions;if(n.delivery!=="async"||!Array.isArray(o))return[];if(!o.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((m)=>typeof m==="string"))))return[];return o}function Do(e,n){return JSON.stringify(["request_user_input_async",e,n])}function qr(e){return{selected:e.options?.length?0:null,text:""}}function Kn(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function Kr(e){return`<send_user_message_question_reply>
|
|
2
2
|
${JSON.stringify([e])}
|
|
3
|
-
</send_user_message_question_reply>`}function
|
|
4
|
-
export{D,
|
|
3
|
+
</send_user_message_question_reply>`}function Fo(e){if(!p(e)||!p(e.codex))return[];let n=e.codex;return(Array.isArray(n.questionReplyParts)?n.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[n.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:m,answer:y})=>({questionItemId:t,question:m,answer:y}))}function Wr({question:e,draft:n,status:o,answer:t,error:m,onChange:y,onSubmit:x,onSkip:C,t:u}){let g=v(),h=b(!1),a=b(null);N(()=>()=>{if(a.current!==null)cancelAnimationFrame(a.current)},[]);let l=o==="pending",A=o==="answered"||o==="skipped",f=e.options??[],w=l&&Kn(e,n).trim().length>0,Q="flex cursor-pointer items-start gap-2 text-sm in-data-readonly:cursor-default in-data-readonly:opacity-50";return i("section",{"aria-labelledby":`${g}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:A?c(S,{children:[i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:e.title}),i("p",{className:"text-sm whitespace-pre-wrap",children:o==="answered"?t:u("asyncQuestion.skipped")})]}):c(r.Root,{items:f.length>0?[{name:"answer",choices:[...f.map((s,d)=>({value:String(d)})),{value:"other"}]}]:void 0,shortcuts:"letters",noValidate:!0,className:"flex min-w-0 flex-col gap-3",onSubmit:(s)=>{if(s.preventDefault(),w)x()},children:[c(r.Item,{name:"answer",className:"m-0 flex min-w-0 flex-col gap-3 border-0 p-0",children:[i(r.Title,{render:i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap"}),children:e.title}),f.length>0&&c(r.Choices,{className:"flex flex-col gap-2","aria-disabled":!l||void 0,"data-readonly":!l||void 0,children:[f.map((s,d)=>c(r.Choice,{value:String(d),checked:n.selected===d,onChange:()=>l&&y({...n,selected:d}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{className:"whitespace-pre-wrap",children:s})]},d)),c(r.Choice,{value:"other",checked:n.selected===null,onChange:()=>l&&y({...n,selected:null}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{children:u("asyncQuestion.other")})]})]}),i(r.Input,{render:i(R,{rows:1,className:"min-h-0 resize-none"}),onCompositionStart:()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null,h.current=!0},onCompositionEnd:()=>{if(h.current=!1,a.current!==null)cancelAnimationFrame(a.current);a.current=requestAnimationFrame(()=>{a.current=null})},onKeyDown:(s)=>{if(s.key==="Enter")s.stopPropagation();if(s.key!=="Enter"||s.shiftKey||s.altKey||s.ctrlKey||s.metaKey||h.current||a.current!==null||s.nativeEvent.isComposing||s.nativeEvent.keyCode===229)return;if(s.preventDefault(),l&&Kn(e,{...n,text:s.currentTarget.value}).trim().length>0)x()},"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:n.text,readOnly:!l,onChange:(s)=>y({selected:null,text:s.target.value})}),m&&i("p",{role:"alert",className:"text-destructive text-sm",children:m})]}),c("div",{className:"flex flex-wrap items-center gap-2",children:[i(r.Submit,{render:i(k,{size:"sm"}),disabled:!w,children:u(o==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),i(r.Skip,{render:i(k,{size:"sm",variant:"ghost"}),disabled:!l,onClick:C,children:u("asyncQuestion.skip")}),(o==="closed"||o==="unavailable")&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${o}`)})]})]})})}
|
|
4
|
+
export{D,Do,qr,Kn,Kr,Fo,Wr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function U(i,t){let e=new Set(t.map((n)=>n.startsWith("$")?n:`/${n}`));return[...i.matchAll(/[$/][^\s]+/g)].flatMap((n)=>e.has(n[0])&&(n.index===0||/[\s\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i[n.index-1]))?[{start:n.index,end:n.index+n[0].length,name:n[0],kind:n[0].startsWith("$")?"skill":"command"}]:[])}function za(i,t){return U(i,t).filter((e)=>e.kind==="skill").map(({start:e,end:n,name:r})=>({start:e,end:n,name:r}))}var Ht="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",
|
|
2
|
-
export{U,za,Ht,
|
|
1
|
+
function U(i,t){let e=new Set(t.map((n)=>n.startsWith("$")?n:`/${n}`));return[...i.matchAll(/[$/][^\s]+/g)].flatMap((n)=>e.has(n[0])&&(n.index===0||/[\s\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i[n.index-1]))?[{start:n.index,end:n.index+n[0].length,name:n[0],kind:n[0].startsWith("$")?"skill":"command"}]:[])}function za(i,t){return U(i,t).filter((e)=>e.kind==="skill").map(({start:e,end:n,name:r})=>({start:e,end:n,name:r}))}var Ht="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",ss={command:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9"}]],skill:[["path",{d:"M12 5v16"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"}]],app:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1"}]]};
|
|
2
|
+
export{U,za,Ht,ss};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{xs}from"./chunk-qxssxzws.js";import{Zo,$e,t,qe,o,le}from"./chunk-g4devj8d.js";import{Ni,ft,ao,Ri,Li}from"./chunk-stc4ctrx.js";import{gt}from"./chunk-rb4p3h5b.js";import{vi}from"./chunk-0n26qaxb.js";import{Oi}from"./chunk-js3nhatr.js";import{Ii,Ti}from"./chunk-cn07a5nh.js";import{ki,Si}from"./chunk-76c0cx40.js";import{hi}from"./chunk-5xe89qwh.js";import{Pi}from"./chunk-gec6q1jb.js";import{mi}from"./chunk-qkv8wzq1.js";import{codexExtensionCapabilities as ze,codexMessageError as Ve,codexRetryNotice as Be,codexTurnError as Oe,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Fe}from"lucide-react";import{useCallback as M,useEffect as H,useLayoutEffect as Te,useMemo as K,useRef as b,useState as U}from"react";import{flushSync as ye}from"react-dom";import{Button as Y}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as i,jsxs as E}from"react/jsx-runtime";var xe=24;function De(e){let f=Math.max(0,e.turnTopPx-xe),v=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),c=f-v;return{scrollTopPx:f,spacerPx:c>0?e.spacerPx+c:e.spacerPx}}function Ke({viewportRef:e,viewportProps:f,children:v}){return i("div",{ref:e,...f,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:v})}function Ue({sessionId:e,turnId:f,root:v,error:c,connected:S}){let z=b(null),V=qe(),{t:w}=t(),k=M(()=>{V.loadHistoryTurn(e,f).catch(()=>{})},[V,e,f]);return H(()=>{if(!v||!z.current||!S||c)return;let R=new IntersectionObserver((_)=>{if(_.some((g)=>g.isIntersecting))R.disconnect(),k()},{root:v,rootMargin:"800px 0px"});return R.observe(z.current),()=>R.disconnect()},[v,S,c,k]),i("div",{ref:z,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":f,"data-markdown-pending":!0,children:c?E("div",{className:"flex flex-col items-center gap-2",children:[i("p",{role:"alert",className:"text-destructive text-xs",children:c}),i(Y,{variant:"outline",size:"sm",onClick:k,disabled:!S,children:w("timeline.navigationRetry")})]}):E("div",{role:"status","aria-label":w("timeline.navigationLoading"),className:"space-y-3",children:[i("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),i("div",{className:"bg-muted h-3 w-4/5 rounded"}),i("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function _e(e,f){let v=b([]),c=b(null);if(c.current?.items!==e.items||c.current.state!==e.state||c.current.ended!==e.turnEndedAt||c.current.usage!==e.turnUsage||c.current.historyOrder!==f)c.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:f,turns:Ni(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function mt(e){return i($e,{host:e.host,client:e.client,children:i(Zo,{value:e.session.cwd,children:i(We,{...e})})})}function We({session:e,leading:f,afterTurn:v,turnWork:c,answerActions:S,turnFooter:z,renderUserMessage:V,insert:w,navigation:k,anchorNewTurn:R=!1,Viewport:_=Ke}){let g=qe(),L=t(),T=o((n)=>n.historyNavigation[e.id]),he=K(()=>e.commands.map((n)=>n.name),[e.commands]),m=_e(e,T?.turns),A=m.at(-1)?.key,be=Ri(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Oi(m,T),[m,T]),Z=K(()=>W.flatMap((n)=>n.turn===void 0?[]:[{...n.turn,key:n.turnKey}]),[W]),we=K(()=>k===void 0?[]:Ii(m,e.turnUsage,T),[k,m,e.turnUsage,T]),ee=w&&w.afterItemId!==null?m.findIndex((n)=>n.items.some((u)=>u.id===w.afterItemId)):-1,j=b(m);j.current=m;let[l,Re]=U(null),x=o((n)=>n.historyPages[e.id]),P=o((n)=>n.connection==="ready"),Se=o((n)=>ze(n.agent).sessionRetry),te=x!==void 0;H(()=>{if(P&&te&&!e.restoring)g.loadHistoryNavigation(e.id).catch(()=>{})},[g,P,te,e.id,e.restoring]);let[ke,Pe]=U(!1),q=b(null),[Ie,ne]=U(!1),re=b(0),X=b({key:A,running:y});X.current={key:A,running:y};let[ie,F]=U(0),I=b(0),N=b(null);I.current=ie;let Ne=M(()=>{if(N.current!==null)N.current.keepTop=!1},[]),{isFollowing:C,scrollToBottom:G,stopFollowing:B,schedulePin:oe,contentResized:ae,beginLocate:ue,cancelLocation:se}=Pi(l,y,Ne),ce=M(()=>{if(l===null||!y)return;let n=m.at(-1)?.key;if(n===void 0)return;let u=ue(!0),d=()=>u.isCurrent()&&X.current.running&&X.current.key===n,r=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!d())return;let a=l.querySelector(`[data-codex-turn="${CSS.escape(n)}"]`);if(a===null)return;let s=l.scrollTop+a.getBoundingClientRect().top-l.getBoundingClientRect().top,p=De({turnTopPx:s,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:I.current});N.current=p.spacerPx>0?{element:a,heightPx:a.getBoundingClientRect().height+p.spacerPx,keepTop:!0}:null,ye(()=>F(p.spacerPx)),requestAnimationFrame(()=>{if(d())u.finish(p.scrollTopPx)})})),h=q.current;if(h===null)return;h.scrollToKey(n,void 0,{align:"top"}).then(()=>{if(d())r()})},[ue,y,l,m]);Te(()=>{if(!R||y)return;se(),N.current=null,I.current=0,F(0)},[R,se,y]);let J=M(()=>{B(),g.loadOlderHistory(e.id).catch(()=>{})},[g,e.id,B]);H(()=>{if(l===null)return;let n=()=>{let u=l.scrollTop<600;if(Pe(u),u&&!T?.complete&&P&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)J()};return n(),l.addEventListener("scroll",n,{passive:!0}),()=>l.removeEventListener("scroll",n)},[P,x,C,J,l,e.restoring,T?.complete]),H(()=>{ki({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>Si(e.id),[e.id]);let He=M(async(n,u)=>{let d=++re.current;ne(!0);try{if(n.isLoaded===!1&&n.nativeTurnId!==void 0)await g.loadHistoryTurn(e.id,n.nativeTurnId),await new Promise((s)=>requestAnimationFrame(()=>s()));if(!u())return null;let r=j.current.find((s)=>s.user?.id===(n.messageId??n.id))??j.current.find((s)=>s.user!==null&&n.nativeTurnId!==void 0&&s.items.some((p)=>ge(p)===n.nativeTurnId));if(!r?.user)return null;let h=r.user.id,a=q.current;if(a===null)throw Error("Virtual timeline is not mounted");return await a.scrollToKey(r.key,(s)=>s.querySelector(`[data-content-search-unit-key="${CSS.escape(h)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(h)}"]`)}finally{if(re.current===d)ne(!1)}},[g,e.id]),Ee=M(async(n)=>{if(n.nativeTurnId!==void 0)await g.previewHistoryTurn(e.id,n.nativeTurnId)},[g,e.id]);H(()=>{if(l===null)return;let n=l.querySelector("[data-codex-timeline]");if(n===null)throw Error("Timeline content element is missing");let u=new ResizeObserver(()=>{let a=N.current,s=null;if(a!==null){let p=Math.max(0,a.heightPx-a.element.getBoundingClientRect().height);if(p!==I.current&&(p<I.current||a.keepTop)){if(I.current=p,ye(()=>F(p)),p===0)N.current=null}if(p>0&&a.keepTop)s=l.scrollTop+a.element.getBoundingClientRect().top-l.getBoundingClientRect().top-xe}ae(s)});u.observe(n),u.observe(l);let d=null,r=()=>{let a=A===void 0?null:n.querySelector(`[data-codex-turn="${CSS.escape(A)}"]`);if(a===d)return;if(d!==null)u.unobserve(d);if(d=a,d!==null)u.observe(d)};r();let h=new MutationObserver(r);return h.observe(n,{childList:!0,subtree:!0}),()=>{h.disconnect(),u.disconnect()}},[ae,A,l]),H(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let de=b(null);Te(()=>{if(l===null)return;let n=m.at(-1),u=de.current;if(de.current=n===void 0?null:{key:n.key,running:y},n===void 0||u===null||n.user===null||n.replayed)return;if(R){if(y&&e.turnEndedAt[n.user.id]===void 0&&(n.key!==u.key||!u.running))N.current=null,I.current=0,F(0),ce()}else if(n.key!==u.key)G()},[ce,R,y,G,l,e.turnEndedAt,m]);let Le=(n,u)=>{let d=n,r=d.turn;if(r===void 0){if(d.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return i(Ue,{sessionId:e.id,turnId:d.nativeTurnId,root:l,error:T?.turnErrors[d.nativeTurnId],connected:P&&!C&&!Ie})}let h=m.indexOf(r),a=r.key===be,s=Li(e,m,h),p=!a&&s.continued,D=r.key===A,O=r.errors.at(-1),me=O===void 0?null:Ve(O),Q=O===void 0?null:ge(O),Ae=!e.subagent&&D&&!a&&P&&Se&&e.attached&&!e.readOnly&&!e.restoring&&O===e.items.at(-1)&&me!==null&&Oe(me).kind==="overloaded"&&Q!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",fe=z?.(r)??null,pe=c?.(r)??null,Ce=pe!==null||r.work.length>0||r.final.length>0||r.errors.length>0||a||fe!==null||ft(r)||ao(r)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=r.user===null?null:gt(r);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":r.key,className:"flex flex-col gap-1.5",children:[r.user!==null&&(V===void 0?i(mi,{item:r.user,messageTime:ve,skillNames:he}):V(r.user,ve)),Ce&&i(vi,{sessionId:e.id,turn:r,terminals:e.terminals,active:a,blocked:e.state==="requires_action",continued:p,edits:s.edits,activityItems:s.items,workStartedAt:s.startedAt,isLast:D,error:e.error,retrying:a?Be(e._meta)??void 0:void 0,retry:Ae?{turnId:Q,delaySeconds:hi(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:ao(r)||!a&&D&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:S?.(r),footer:fe}),u===ee&&w?.node,v?.(r)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[i(_,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":L.t("timeline.label")},children:i("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:E("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[w&&ee===-1&&w.node,i(xs,{ref:q,entries:W,renderTurn:Le,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:f===void 0?void 0:i("div",{className:"pt-3",children:f})}),R&&i("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),i("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),i("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&i("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:i(Y,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{g.loadHistoryNavigation(e.id).catch(()=>{})},children:L.t("timeline.navigationRetry")})}),ke&&x?.cursor&&!T?.complete&&E("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[i(Y,{variant:"outline",size:"sm",disabled:!P||e.restoring||x.loading,onClick:J,children:x.loading?L.t("timeline.loadingEarlier"):L.t("timeline.loadEarlier")}),x.error&&i("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),k!==void 0&&i(Ti,{items:we,audio:k.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ee,onRevealError:(n)=>le(L,n),targetTopMarginPx:16},e.id),i("button",{type:"button",className:C?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:C?-1:void 0,onClick:G,"aria-label":L.t("timeline.scrollToBottom"),children:y?E("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[i("span",{className:"codex-wave-dot"}),i("span",{className:"codex-wave-dot"}),i("span",{className:"codex-wave-dot"})]}):i(Fe,{})})]})}
|
|
2
|
+
export{mt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ze}from"./chunk-sgbn37kz.js";import{H}from"./chunk-8hygfx41.js";import{cn as n}from"cn";import{Item as i,ItemActions as q,ItemContent as K,ItemDescription as
|
|
1
|
+
import{ze}from"./chunk-sgbn37kz.js";import{H}from"./chunk-8hygfx41.js";import{cn as n}from"cn";import{Item as i,ItemActions as q,ItemContent as K,ItemDescription as ce,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function _e({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(ze,"data-[active=true]:font-medium",e),...r})}function tn({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(H,{children:t})})}export{q,K,ce,W,Z,_e,tn};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ar}from"./chunk-86821qec.js";import{Mr}from"./chunk-n3sm0834.js";import{ns}from"./chunk-rx84h0c2.js";import{p,_,Ct}from"./chunk-qdcznn2t.js";import{Fe}from"./chunk-gyw21vnb.js";import{br,Cr,wr,kr,Sr}from"./chunk-8y706gz3.js";import{ir,rr}from"./chunk-g7cc7gdn.js";import{U}from"./chunk-2cfhvb3k.js";import{mo}from"./chunk-r8expjyy.js";import{fo}from"./chunk-1gv49jt9.js";import{o}from"./chunk-pdmayjan.js";import{e}from"./chunk-abgdqy92.js";import{uo,Vi}from"./chunk-e7ndpy02.js";import{co}from"./chunk-y6p8xspr.js";import{r,zi,J,mn}from"./chunk-dtgbgwby.js";import{cn}from"./chunk-rkejggyx.js";import{Ye,un}from"./chunk-81jejgvs.js";import{on,sn}from"./chunk-jq6qs3s6.js";import{Oi}from"./chunk-gdavg2hq.js";import{gn}from"./chunk-1hmt6w4w.js";import{Bi}from"./chunk-jm6y0edw.js";import{dn}from"./chunk-wjd2hpnd.js";import{an}from"./chunk-rtbpfasb.js";import{Hi}from"./chunk-x20dy83s.js";import{Ui}from"./chunk-23r426sm.js";import{fn}from"./chunk-2nb1475h.js";import{hasFuzzyFileSearch as Kt}from"@nyssance/codex-acp-v2/client";import{useCallback as w,useEffect as jt,useLayoutEffect as rt,useMemo as lt,useRef as N,useState as M}from"react";import{jsx as m,jsxs as R}from"react/jsx-runtime";var qt=["image/png","image/jpeg","image/webp","image/gif"],pt=[];async function Gt(n){let T=await(await fetch(n.url)).blob();return new Promise((I,S)=>{let E=new FileReader;E.onerror=()=>S(E.error),E.onload=()=>{let q=E.result;I(q.slice(q.indexOf(",")+1))},E.readAsDataURL(T)})}function Ne({session:n,onSubmit:T,onShellCommand:I,onHandOff:S,modelSelector:E,modelMenu:q,inputHeader:st,actions:Mt,leadingTools:Rt,agentControls:G=!0,placeholder:Et,children:Dt,attachmentPolicy:kt,predictions:Nt=!0,disabled:St=!1,preparing:mt=!1,allowPendingInput:Ft=!1}){let{host:F,client:O}=e(),{t:g}=F,B=w((t)=>{if(F.reportError)F.reportError(t);else console.error(t)},[F]),[dt,H]=M(()=>({text:r.get(n.id)?.text??"",revision:0})),{text:v}=dt,[C,Ot]=M(()=>r.get(n.id)?.attachments??pt),[y,Q]=M(()=>r.get(n.id)?.mentions??[]),[d,L]=M(()=>r.get(n.id)?.apps??[]),[ut,K]=M(()=>(r.get(n.id)?.apps?.length??0)>0||U(v,n.commands.map((t)=>t.name)).length>0),W=N(void 0),z=N(void 0);rt(()=>{if(d.length>0)K(!0)},[d.length]);let nt=C.some((t)=>Ye(t)&&t.pastedText.status!=="ready"),[D,ft]=M(!1),[Y,_t]=M(!1),[ot,Lt]=M(!1),it=N(null),f=N(null),ht=N(null),c=N(dt),P=w((t)=>{ht.current?.(),c.current={text:t,revision:c.current.revision+1},H(c.current)},[]),gt=w((t)=>{let i=f.current;if(i?.insertApplication){i.insertApplication(t);return}let a=c.current.text,u=i?.getTextarea()?.selectionStart??a.length;z.current={text:a,apps:[]},W.current=u+1,K(!0),P(a),L((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:u}])},[P]),Wt=w((t)=>{let i=f.current;if(i?.insertInvocation){i.insertInvocation(t);return}let a=c.current.text,u=i?.getTextarea(),l=u?.selectionStart??a.length,h=u?.selectionEnd??l,ct=`${a.slice(0,l)}${t} ${a.slice(h)}`;z.current={text:a,apps:[]},W.current=l+t.length+1,P(ct),K(!0)},[P]),xt=w(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),$t=Hi(n,P,L,d.length>0||y.length>0||C.length>0),yt=lt(()=>({read:()=>{let i=f.current?.getTextarea(),a=i===null||i===void 0?[c.current.text.length,c.current.text.length]:[i.selectionStart,i.selectionEnd];return{target:n.id,...c.current,selection:a}},compareAndSet(i,a,u){if(f.current?.isComposing())return null;if(i.target!==n.id||i.revision!==c.current.revision)return null;c.current={text:a,revision:c.current.revision+1},H(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=a,l.setSelectionRange(u[0],u[1]);return{target:n.id,...c.current,selection:u}}}),[n.id]),j=N(null),bt=w((t)=>(j.current=t,()=>{if(j.current===t)j.current=null}),[]),V=n.state!=="idle",x=I!==void 0&&d.length===0&&v.startsWith("!"),X=(ut||d.length>0)&&!x,b=!St&&!mt&&n.attached&&!n.restoring&&!n.readOnly,k=!n.readOnly&&(Ft||b),Z=an(n,b&&!D&&!Y&&!nt&&!ot,v.length>0||C.length>0||y.length>0||d.length>0,Nt&&!x),vt=Z.invalidate;rt(()=>{r.set(n.id,{text:v,attachments:C,mentions:y,...d.length>0?{apps:d}:{},modelId:r.get(n.id)?.modelId??null})},[n.id,v,C,y,d]),rt(()=>zi(n.id,Ot),[n.id]),rt(()=>mn(n.id,(t)=>{if(!k||D)throw Error("The composer cannot take text now; try again later");if(v.length||C.length||y.length||d.length)throw Error("The composer already has a draft; send or clear it first");P(t)}),[n.id,k,D,v,C,y,d,P]);let Pt=o((t)=>Kt(t.agent)),Ut=lt(()=>Pt&&b?async(t)=>cn((await O.fuzzyFileSearch({query:t,roots:[n.cwd],cancellationToken:null})).files):void 0,[O,Pt,b,n.cwd]),at=w((t)=>{Q((i)=>i.includes(t)?i:[...i,t])},[]);jt(()=>{f.current?.focus()},[]);let It=w(async({text:t,files:i})=>{let a=I!==void 0&&d.length===0&&t.startsWith("!")?t.slice(1):null;if(a!==null){if(a.trim().length===0)return;if(i.length||y.length||d.length)throw Error("Shell commands cannot include file references or attachments");if(n.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let u=t.trim();if(u.length===0&&i.length===0&&y.length===0&&d.length===0)return;let l=j.current;ft(!0);let h=r.get(n.id),ct=c.current.revision,tt=null;try{let A=d.map((s)=>({type:"resource_link",name:s.name,uri:`app://${s.id}`}));for(let s of y){let et={kind:"file",absPath:s};A.push({type:"resource_link",uri:on(et),name:sn(et)})}let Tt=ns(u,d);if(Tt.length>0)A.push({type:"text",text:Tt});for(let s of i)if(Ye(s)){if(s.pastedText.status!=="ready")throw Error("Text attachment is not ready");A.push({type:"resource_link",uri:s.url,name:s.filename??"pasted-text.txt"})}else A.push({type:"image",data:await Gt(s),mimeType:s.mediaType});if(c.current.revision===ct&&r.get(n.id)===h)c.current={text:"",revision:c.current.revision+1},tt=c.current.revision,H(c.current),Q([]),L([]),W.current=void 0,z.current=void 0,J(n.id,()=>pt),r.set(n.id,{text:"",attachments:pt,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(a!==null&&I)await I(a);else if(T)if(l===null)await T(A);else await T(A,(s)=>{if(l.signal.aborted||j.current!==l)return;l.accept(s),S?.(n.id,s)});else if(l===null)await O.prompt(n.id,A);else{let s=await O.prompt(n.id,A);l.accept(s)}vt();for(let s of h?.attachments??[])if(s.url.startsWith("blob:")&&!r.get(n.id)?.attachments.some((et)=>et.id===s.id))URL.revokeObjectURL(s.url)}catch(A){if(h&&tt!==null&&c.current.revision===tt&&r.get(n.id)?.attachments.length===0&&r.get(n.id)?.mentions.length===0&&!r.get(n.id)?.apps?.length)c.current={text:h.text,revision:tt+1},H(c.current),Q(h.mentions),L(h.apps??[]),r.set(n.id,h),J(n.id,()=>h.attachments);throw A}finally{ft(!1),f.current?.focus()}},[O,n.id,n.state,y,d,T,I,S,vt]),zt=()=>{O.cancel(n.id).catch(B)},Bt=w((t)=>{let i=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:Fe})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});B(i)},[B,g]),Ht=lt(()=>({session:n,ready:b,inputReady:k,sending:D,textareaRef:f,draft:yt,interruptRef:ht,observeReceipts:bt,addMention:at,setAdding:_t,shellMode:x,handsFree:!x&&(T===void 0||S!==void 0)}),[n,b,k,D,yt,bt,at,T,S,x]),At=F.writeTextAttachment,wt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:$t,bashMode:I!==void 0,disabled:!k,"aria-label":g("composer.placeholder"),placeholder:x?"! command":Z.text||Et||(V?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!X&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/"))){let i=Ct(t.clipboardData);if(i?.apps.length){t.preventDefault();let a=t.currentTarget,u=p(i),l=_([...a.value.slice(0,a.selectionStart).split(""),...u,...a.value.slice(a.selectionEnd).split("")]);z.current={text:v,apps:[]},W.current=a.selectionStart+u.length,K(!0),L(l.apps),P(l.text);return}}if(At)un(t,n.id,g("composer.pastedTextFilename"),At)}};return m(co,{value:Ht,children:m("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:R("div",{className:"relative",children:[st&&m("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:st}),m(Ar,{attachmentPolicy:kt,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},H(c.current)},attachments:C,onAttachmentsChange:(t)=>J(n.id,()=>t),children:R("div",{ref:it,className:"relative",children:[G&&!ot&&m(Mr,{bashMode:I!==void 0,handleRef:f,commands:n.commands,renderSlashMenu:(t)=>m(uo,{anchorRef:it,commands:n.commands,query:t.query,includeAttachment:!1,disabled:!k,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(i)=>t.replaceQuery(()=>Wt(i.startsWith("$")?i:`/${i}`)),onApp:(i)=>t.replaceQuery(()=>gt(i)),focusInput:xt}),searchFiles:Ut,onMention:at,onSearchError:B,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},X?"inline":"textarea"),R(br,{"data-shell-mode":x||void 0,bashMode:I!==void 0,globalDrop:!0,multiple:!0,accept:qt.join(","),onError:Bt,onSubmit:It,onSubmitAsync:It,onSubmitError:B,canSubmit:()=>b&&!D&&!Y&&!nt&&(!x||!V&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[Dt,R(wr,{className:"px-3 pt-3 pb-0 empty:hidden",children:[Y&&m("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),m(Oi,{mentions:y,onRemove:(t)=>Q((i)=>i.filter((a)=>a!==t))}),m(rr,{children:(t)=>Ye(t)?m(Bi,{data:t,sessionId:n.id}):m(ir,{data:t,t:g})})]}),R(Cr,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!Z.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab"||t.key==="ArrowRight")t.preventDefault(),t.stopPropagation(),P(Z.text)},children:[x&&m("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),X?m(mo,{...wt,skillIcon:F.skillIcon,skillNames:n.commands.map((t)=>t.name),applications:d,onApplicationsChange:L,initialCaret:W.current,initialUndo:z.current}):m(fo,{...wt,autoFocus:ut&&x})]}),m(kr,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:R("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[R("div",{className:"flex min-w-0 items-center gap-[5px]",children:[m(Vi,{anchorRef:it,commands:n.commands,disabled:!k,agentDisabled:!b||x,agentControls:G,open:ot,onOpenChange:Lt,focusInput:xt,onCommand:(t)=>{let i=c.current.text,a=i.length===0||i.endsWith(`
|
|
1
|
+
import{Er}from"./chunk-xk0dt0es.js";import{Nr}from"./chunk-nypr6qtz.js";import{os}from"./chunk-dtxc0x7y.js";import{p,_,Ct}from"./chunk-j64839nf.js";import{Fe}from"./chunk-ayt0bzr9.js";import{Cr,wr,kr,Sr,_r}from"./chunk-5kje89r8.js";import{rr,sr}from"./chunk-xdcp8tj9.js";import{U}from"./chunk-542c9tpr.js";import{go}from"./chunk-cfx5s6fz.js";import{ho}from"./chunk-w2xjhfm2.js";import{o}from"./chunk-g4devj8d.js";import{e}from"./chunk-e6ya95ee.js";import{po,ji}from"./chunk-f1awp8vf.js";import{uo}from"./chunk-jjgwfpmp.js";import{r,Vi,J,gn}from"./chunk-rzxnxj25.js";import{dn}from"./chunk-j3g21ext.js";import{Ye,pn}from"./chunk-1smyy9mt.js";import{rn,an}from"./chunk-q73jne25.js";import{Hi}from"./chunk-ca4vetrh.js";import{fn}from"./chunk-e5mn6ern.js";import{Gi}from"./chunk-mvd124vs.js";import{un}from"./chunk-v78f93yn.js";import{ln}from"./chunk-pnh5t6pc.js";import{Ui}from"./chunk-jj5y2js2.js";import{Bi}from"./chunk-mc5668pn.js";import{hn}from"./chunk-npev9ffr.js";import{hasFuzzyFileSearch as Kt}from"@nyssance/codex-acp-v2/client";import{useCallback as w,useEffect as jt,useLayoutEffect as rt,useMemo as lt,useRef as N,useState as M}from"react";import{jsx as m,jsxs as R}from"react/jsx-runtime";var qt=["image/png","image/jpeg","image/webp","image/gif"],pt=[];async function Gt(n){let T=await(await fetch(n.url)).blob();return new Promise((I,S)=>{let E=new FileReader;E.onerror=()=>S(E.error),E.onload=()=>{let q=E.result;I(q.slice(q.indexOf(",")+1))},E.readAsDataURL(T)})}function Ne({session:n,onSubmit:T,onShellCommand:I,onHandOff:S,modelSelector:E,modelMenu:q,inputHeader:st,actions:Mt,leadingTools:Rt,agentControls:G=!0,placeholder:Et,children:kt,attachmentPolicy:Dt,predictions:Nt=!0,disabled:St=!1,preparing:mt=!1,allowPendingInput:Ft=!1}){let{host:F,client:O}=e(),{t:g}=F,B=w((t)=>{if(F.reportError)F.reportError(t);else console.error(t)},[F]),[dt,H]=M(()=>({text:r.get(n.id)?.text??"",revision:0})),{text:v}=dt,[C,Ot]=M(()=>r.get(n.id)?.attachments??pt),[y,Q]=M(()=>r.get(n.id)?.mentions??[]),[d,L]=M(()=>r.get(n.id)?.apps??[]),[ut,K]=M(()=>(r.get(n.id)?.apps?.length??0)>0||U(v,n.commands.map((t)=>t.name)).length>0),W=N(void 0),z=N(void 0);rt(()=>{if(d.length>0)K(!0)},[d.length]);let nt=C.some((t)=>Ye(t)&&t.pastedText.status!=="ready"),[k,ft]=M(!1),[Y,_t]=M(!1),[ot,Lt]=M(!1),it=N(null),f=N(null),ht=N(null),c=N(dt),P=w((t)=>{ht.current?.(),c.current={text:t,revision:c.current.revision+1},H(c.current)},[]),gt=w((t)=>{let i=f.current;if(i?.insertApplication){i.insertApplication(t);return}let a=c.current.text,u=i?.getTextarea()?.selectionStart??a.length;z.current={text:a,apps:[]},W.current=u+1,K(!0),P(a),L((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:u}])},[P]),Wt=w((t)=>{let i=f.current;if(i?.insertInvocation){i.insertInvocation(t);return}let a=c.current.text,u=i?.getTextarea(),l=u?.selectionStart??a.length,h=u?.selectionEnd??l,ct=`${a.slice(0,l)}${t} ${a.slice(h)}`;z.current={text:a,apps:[]},W.current=l+t.length+1,P(ct),K(!0)},[P]),xt=w(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),$t=Ui(n,P,L,d.length>0||y.length>0||C.length>0),yt=lt(()=>({read:()=>{let i=f.current?.getTextarea(),a=i===null||i===void 0?[c.current.text.length,c.current.text.length]:[i.selectionStart,i.selectionEnd];return{target:n.id,...c.current,selection:a}},compareAndSet(i,a,u){if(f.current?.isComposing())return null;if(i.target!==n.id||i.revision!==c.current.revision)return null;c.current={text:a,revision:c.current.revision+1},H(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=a,l.setSelectionRange(u[0],u[1]);return{target:n.id,...c.current,selection:u}}}),[n.id]),j=N(null),bt=w((t)=>(j.current=t,()=>{if(j.current===t)j.current=null}),[]),V=n.state!=="idle",x=I!==void 0&&d.length===0&&v.startsWith("!"),X=(ut||d.length>0)&&!x,b=!St&&!mt&&n.attached&&!n.restoring&&!n.readOnly,D=!n.readOnly&&(Ft||b),Z=ln(n,b&&!k&&!Y&&!nt&&!ot,v.length>0||C.length>0||y.length>0||d.length>0,Nt&&!x),vt=Z.invalidate;rt(()=>{r.set(n.id,{text:v,attachments:C,mentions:y,...d.length>0?{apps:d}:{},modelId:r.get(n.id)?.modelId??null})},[n.id,v,C,y,d]),rt(()=>Vi(n.id,Ot),[n.id]),rt(()=>gn(n.id,(t)=>{if(!D||k)throw Error("The composer cannot take text now; try again later");if(v.length||C.length||y.length||d.length)throw Error("The composer already has a draft; send or clear it first");P(t)}),[n.id,D,k,v,C,y,d,P]);let Pt=o((t)=>Kt(t.agent)),Ut=lt(()=>Pt&&b?async(t)=>dn((await O.fuzzyFileSearch({query:t,roots:[n.cwd],cancellationToken:null})).files):void 0,[O,Pt,b,n.cwd]),at=w((t)=>{Q((i)=>i.includes(t)?i:[...i,t])},[]);jt(()=>{f.current?.focus()},[]);let It=w(async({text:t,files:i})=>{let a=I!==void 0&&d.length===0&&t.startsWith("!")?t.slice(1):null;if(a!==null){if(a.trim().length===0)return;if(i.length||y.length||d.length)throw Error("Shell commands cannot include file references or attachments");if(n.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let u=t.trim();if(u.length===0&&i.length===0&&y.length===0&&d.length===0)return;let l=j.current;ft(!0);let h=r.get(n.id),ct=c.current.revision,tt=null;try{let A=d.map((s)=>({type:"resource_link",name:s.name,uri:`app://${s.id}`}));for(let s of y){let et={kind:"file",absPath:s};A.push({type:"resource_link",uri:rn(et),name:an(et)})}let Tt=os(u,d);if(Tt.length>0)A.push({type:"text",text:Tt});for(let s of i)if(Ye(s)){if(s.pastedText.status!=="ready")throw Error("Text attachment is not ready");A.push({type:"resource_link",uri:s.url,name:s.filename??"pasted-text.txt"})}else A.push({type:"image",data:await Gt(s),mimeType:s.mediaType});if(c.current.revision===ct&&r.get(n.id)===h)c.current={text:"",revision:c.current.revision+1},tt=c.current.revision,H(c.current),Q([]),L([]),W.current=void 0,z.current=void 0,J(n.id,()=>pt),r.set(n.id,{text:"",attachments:pt,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(a!==null&&I)await I(a);else if(T)if(l===null)await T(A);else await T(A,(s)=>{if(l.signal.aborted||j.current!==l)return;l.accept(s),S?.(n.id,s)});else if(l===null)await O.prompt(n.id,A);else{let s=await O.prompt(n.id,A);l.accept(s)}vt();for(let s of h?.attachments??[])if(s.url.startsWith("blob:")&&!r.get(n.id)?.attachments.some((et)=>et.id===s.id))URL.revokeObjectURL(s.url)}catch(A){if(h&&tt!==null&&c.current.revision===tt&&r.get(n.id)?.attachments.length===0&&r.get(n.id)?.mentions.length===0&&!r.get(n.id)?.apps?.length)c.current={text:h.text,revision:tt+1},H(c.current),Q(h.mentions),L(h.apps??[]),r.set(n.id,h),J(n.id,()=>h.attachments);throw A}finally{ft(!1),f.current?.focus()}},[O,n.id,n.state,y,d,T,I,S,vt]),zt=()=>{O.cancel(n.id).catch(B)},Bt=w((t)=>{let i=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:Fe})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});B(i)},[B,g]),Ht=lt(()=>({session:n,ready:b,inputReady:D,sending:k,textareaRef:f,draft:yt,interruptRef:ht,observeReceipts:bt,addMention:at,setAdding:_t,shellMode:x,handsFree:!x&&(T===void 0||S!==void 0)}),[n,b,D,k,yt,bt,at,T,S,x]),At=F.writeTextAttachment,wt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:$t,bashMode:I!==void 0,disabled:!D,"aria-label":g("composer.placeholder"),placeholder:x?"! command":Z.text||Et||(V?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!X&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/"))){let i=Ct(t.clipboardData);if(i?.apps.length){t.preventDefault();let a=t.currentTarget,u=p(i),l=_([...a.value.slice(0,a.selectionStart).split(""),...u,...a.value.slice(a.selectionEnd).split("")]);z.current={text:v,apps:[]},W.current=a.selectionStart+u.length,K(!0),L(l.apps),P(l.text);return}}if(At)pn(t,n.id,g("composer.pastedTextFilename"),At)}};return m(uo,{value:Ht,children:m("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:R("div",{className:"relative",children:[st&&m("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:st}),m(Er,{attachmentPolicy:Dt,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},H(c.current)},attachments:C,onAttachmentsChange:(t)=>J(n.id,()=>t),children:R("div",{ref:it,className:"relative",children:[G&&!ot&&m(Nr,{bashMode:I!==void 0,handleRef:f,commands:n.commands,renderSlashMenu:(t)=>m(po,{anchorRef:it,commands:n.commands,query:t.query,includeAttachment:!1,disabled:!D,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(i)=>t.replaceQuery(()=>Wt(i.startsWith("$")?i:`/${i}`)),onApp:(i)=>t.replaceQuery(()=>gt(i)),focusInput:xt}),searchFiles:Ut,onMention:at,onSearchError:B,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},X?"inline":"textarea"),R(Cr,{"data-shell-mode":x||void 0,bashMode:I!==void 0,globalDrop:!0,multiple:!0,accept:qt.join(","),onError:Bt,onSubmit:It,onSubmitAsync:It,onSubmitError:B,canSubmit:()=>b&&!k&&!Y&&!nt&&(!x||!V&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[kt,R(kr,{className:"px-3 pt-3 pb-0 empty:hidden",children:[Y&&m("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),m(Hi,{mentions:y,onRemove:(t)=>Q((i)=>i.filter((a)=>a!==t))}),m(sr,{children:(t)=>Ye(t)?m(Gi,{data:t,sessionId:n.id}):m(rr,{data:t,t:g})})]}),R(wr,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!Z.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab"||t.key==="ArrowRight"||t.key==="Enter")t.preventDefault(),t.stopPropagation(),P(Z.text)},children:[x&&m("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),X?m(go,{...wt,skillIcon:F.skillIcon,skillNames:n.commands.map((t)=>t.name),applications:d,onApplicationsChange:L,initialCaret:W.current,initialUndo:z.current}):m(ho,{...wt,autoFocus:ut&&x})]}),m(Sr,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:R("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[R("div",{className:"flex min-w-0 items-center gap-[5px]",children:[m(ji,{anchorRef:it,commands:n.commands,disabled:!D,agentDisabled:!b||x,agentControls:G,open:ot,onOpenChange:Lt,focusInput:xt,onCommand:(t)=>{let i=c.current.text,a=i.length===0||i.endsWith(`
|
|
2
2
|
`)?i:`${i}
|
|
3
|
-
`,u=t.startsWith("$")?t:`/${t}`,l=`${a}${u} `;if(!X)z.current={text:i,apps:[]},W.current=l.length,K(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:gt}),Rt,G&&m(
|
|
3
|
+
`,u=t.startsWith("$")?t:`/${t}`,l=`${a}${u} `;if(!X)z.current={text:i,apps:[]},W.current=l.length,K(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:gt}),Rt,G&&m(un,{sessionId:n.id,options:n.configOptions,disabled:!b})]}),R(_r,{className:"w-full min-w-0 items-center justify-end gap-1",children:[G&&m(hn,{session:n}),E??m(fn,{...q,sessionId:n.id,options:n.configOptions,disabled:!b}),Mt,m(Bi,{active:V,sending:k||mt||Y,ready:b&&!nt&&(!x||!V&&v.slice(1).trim().length>0),hasMentions:y.length>0||d.length>0,onStop:zt})]})]})})]})]})})]})})})}
|
|
4
4
|
export{Ne};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Mr,Fe}from"./chunk-ayt0bzr9.js";import{Ir}from"./chunk-859359n0.js";import{Mo,No,Tt,Mt,Ao}from"./chunk-xk0dt0es.js";import{cn as P}from"cn";import{ArrowUpIcon as ge,Loader2Icon as be,SquareIcon as ve,XIcon as he}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as Pe,useRef as M,useState as Ie}from"react";import{flushSync as ye}from"react-dom";import{InputGroup as xe,InputGroupAddon as ee,InputGroupButton as te}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as a,jsxs as Le}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Cr=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:re,globalDrop:C,syncHiddenInput:U,maxFiles:H,maxFileSize:k,onError:b,onSubmit:ne,children:oe,...se})=>{let s=Mt(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),D=M(!1),[ae,N]=Ie([]),c=l?s.attachments.files:ae,B=M(c);B.current=c;let ue=h(()=>{x.current?.click()},[]),O=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),W=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((i)=>O(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>k?i.size<=k:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}N((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof H==="number"?Math.max(0,H-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:W(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,W,O,H,k,b]),pe=h((e)=>N((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>N((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),G=l?s.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Mr(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${Fe}MB.`});return}}G(r)},[c,G,b]),j=l?s.attachments.remove:pe,R=l?s.attachments.clear:me,q=l?s.attachments.openFileDialog:ue;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(U&&x.current&&c.length===0)x.current.value=""},[c,U]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of B.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},X=Pe(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:j,clear:R,openFileDialog:q,fileInputRef:x}),[c,L,j,R,q]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let J=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(D.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();R()};D.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Ir(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ne({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{D.current=!1}},de=(e)=>{e.preventDefault(),J(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)ye(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),K=a(No.Provider,{value:()=>J(null),children:Le(Mo.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:re,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(xe,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return l?a(Tt.Provider,{value:X,children:K}):a(Ao.Provider,{value:X,children:K})};function wr({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function kr({className:u,...o}){return a(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Sr({className:u,...o}){return a(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function _r({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var z=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Pr=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(ge,{className:"size-4"});if(d==="submitted")g=a(be,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(ve,{className:"size-3 fill-current"});else if(d==="error")g=a(he,{className:"size-4"});return a(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
|
|
2
|
+
export{Cr,wr,kr,Sr,_r,z,Pr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useId as a}from"react";import{jsx as l,jsxs as t}from"react/jsx-runtime";function Yi(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Claude"}),l("path",{fill:"#D97757",fillRule:"nonzero",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})]})}function In(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"DeepSeek"}),l("path",{fill:"#4D6BFE",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]})}function Tn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Grok"}),l("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})]})}function Mn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"OpenRouter"}),l("path",{d:"M2 7h3.5c1.6 0 2.6.5 3.6 1.7l3 3.6c1 1.2 2 1.7 3.6 1.7H20"}),l("path",{d:"M2 17h3.5c1.6 0 2.6-.5 3.6-1.7l3-3.6c1-1.2 2-1.7 3.6-1.7H20"}),l("path",{d:"M17.5 4.5L21 7l-3.5 2.5M17.5 14.5L21 17l-3.5 2.5"})]})}var r="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z";function Nn(e){let o=a().replaceAll(":","");return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Qwen"}),l("path",{d:r,fill:`url(#${o})`,fillRule:"nonzero"}),l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[l("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),l("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]})}function er(e){return l("svg",{viewBox:"-3 -3 30 30",fill:"currentColor",...e,children:l("path",{d:"M1.5 1.5h21v21h-7v-7h-7v-7h-7zM1.5 15.5h7v7h-7z"})})}function tr(e){return l("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:l("path",{d:"M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z"})})}function nr(e){let o=a();return t("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:[l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100.182%",y1:"50.057%",y2:"50.057%",children:[l("stop",{offset:"0%",stopColor:"#E2167E"}),l("stop",{offset:"100%",stopColor:"#FE603C"})]})}),l("path",{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z",fill:`url(#${o})`,fillRule:"nonzero"})]})}function or(e){return t("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:[l("path",{d:"M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z",fill:"#00E5E5"}),l("path",{d:"M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z",fill:"#006EFF"}),l("path",{d:"M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z",fill:"#006EFF"}),l("path",{d:"M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z",fill:"#00E5E5"})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{useId as a}from"react";import{jsx as l,jsxs as t}from"react/jsx-runtime";function er(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Claude"}),l("path",{fill:"#D97757",fillRule:"nonzero",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})]})}function Tn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"DeepSeek"}),l("path",{fill:"#4D6BFE",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]})}function Mn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Grok"}),l("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})]})}function Nn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"OpenRouter"}),l("path",{d:"M2 7h3.5c1.6 0 2.6.5 3.6 1.7l3 3.6c1 1.2 2 1.7 3.6 1.7H20"}),l("path",{d:"M2 17h3.5c1.6 0 2.6-.5 3.6-1.7l3-3.6c1-1.2 2-1.7 3.6-1.7H20"}),l("path",{d:"M17.5 4.5L21 7l-3.5 2.5M17.5 14.5L21 17l-3.5 2.5"})]})}var r="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z";function An(e){let o=a().replaceAll(":","");return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Qwen"}),l("path",{d:r,fill:`url(#${o})`,fillRule:"nonzero"}),l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[l("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),l("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]})}function tr(e){return l("svg",{viewBox:"-3 -3 30 30",fill:"currentColor",...e,children:l("path",{d:"M1.5 1.5h21v21h-7v-7h-7v-7h-7zM1.5 15.5h7v7h-7z"})})}function nr(e){return l("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:l("path",{d:"M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z"})})}function or(e){let o=a();return t("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:[l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100.182%",y1:"50.057%",y2:"50.057%",children:[l("stop",{offset:"0%",stopColor:"#E2167E"}),l("stop",{offset:"100%",stopColor:"#FE603C"})]})}),l("path",{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z",fill:`url(#${o})`,fillRule:"nonzero"})]})}function ir(e){return t("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:[l("path",{d:"M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z",fill:"#00E5E5"}),l("path",{d:"M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z",fill:"#006EFF"}),l("path",{d:"M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z",fill:"#006EFF"}),l("path",{d:"M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z",fill:"#00E5E5"})]})}
|
|
2
|
+
export{er,Tn,Mn,Nn,An,tr,nr,or,ir};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-e6ya95ee.js";import{we}from"./chunk-njwb0rbw.js";import{et}from"./chunk-npev9ffr.js";import{Qt}from"./chunk-3ek4vddd.js";import{format as f}from"date-fns";import{useState as y}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Skeleton as m}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as t,jsxs as u,Fragment as h}from"react/jsx-runtime";function Wt({label:o,window:a,t:l}){let n=a?100-Math.round(Math.min(100,Math.max(0,a.usedPercent))):0,i=a&&a.resetsAt!==null?l("usage.resetsAt",{time:f(new Date(a.resetsAt*1000),"yyyy/MM/dd HH:mm")}):null;return u("div",{className:"space-y-1.5","aria-busy":!a,children:[u("div",{className:"grid min-h-5 grid-cols-[3.5rem_minmax(0,1fr)_5rem] items-center gap-3",children:[a?t("span",{className:"text-sm",children:o}):t(m,{className:"h-4 w-10 motion-reduce:animate-none"}),a?t("div",{className:"bg-muted h-2 overflow-hidden rounded-full",role:"progressbar","aria-label":o,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:t("div",{className:"bg-primary h-full rounded-full",style:{width:`${n}%`}})}):t(m,{className:"h-2 rounded-full motion-reduce:animate-none"}),a?t("span",{className:"text-muted-foreground text-end text-xs tabular-nums",children:l("usage.remaining",{percent:n})}):t(m,{className:"h-4 w-14 justify-self-end motion-reduce:animate-none"})]}),t("div",{className:"text-muted-foreground flex min-h-4 items-center justify-end text-xs",children:a?i:t(m,{className:"h-3 w-32 motion-reduce:animate-none"})})]})}function li({account:o,disabled:a,onSignOut:l}){let{t:n}=e().host,i=o===void 0,r=o?.account.account??null,c=o===null?n("usage.accountUnavailable"):r===null?n("usage.notSignedIn"):r.type==="chatgpt"?[r.email,r.planType!=="unknown"?n(`usage.plan.${r.planType}`):null].filter(Boolean).join(" · "):r.type==="apiKey"?n("usage.apiKey"):n("usage.bedrock"),s=o?.rateLimits??null;return u("section",{"aria-busy":i,"aria-label":"Codex",className:"space-y-4",children:[u("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[i?t(m,{className:"h-4 w-40 max-w-[65%] motion-reduce:animate-none"}):t("span",{className:"min-w-0 text-sm break-words",children:c}),i?t(m,{className:"h-8 w-16 shrink-0 motion-reduce:animate-none"}):r!==null&&t(x,{variant:"outline",size:"sm",className:"shrink-0",disabled:a,onClick:l,children:n("connection.signOut")})]}),(i||r!==null)&&t("div",{className:"flex flex-col gap-4",children:i?t(Wt,{t:n}):s===null?t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")}):u(h,{children:[s.primary!==null&&t(Wt,{label:et(s.primary,n),window:s.primary,t:n}),s.secondary!==null&&t(Wt,{label:et(s.secondary,n),window:s.secondary,t:n}),s.primary===null&&s.secondary===null&&t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")})]})})]})}function Zt({bridge:o,className:a="rounded-xl border p-4"}){let{host:l}=e(),n=o.useSettingsAgent(),i=o.useSettingsAccount(),[r,c]=y(!1);return u("div",{className:a,children:[t(li,{account:i,disabled:n==null||r,onSignOut:()=>{c(!0),o.requestSignOut().catch((s)=>l.reportError?.(s)).finally(()=>c(!1))}}),i!=null&&!i.account.account&&n&&t(Qt,{methods:n.authMethods,signIn:o.requestSignIn}),n?.actions.map((s)=>t(we,{action:s,onRespond:(d,p)=>{o.requestActionResponse(d,p).catch((g)=>l.reportError?.(g))}},s.id))]})}
|
|
2
|
+
export{Wt,li,Zt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
1
|
+
import{o}from"./chunk-g4devj8d.js";import{kn,e,x}from"./chunk-e6ya95ee.js";import{Ne}from"./chunk-5dgmqyg1.js";import{Gt}from"./chunk-8a0fd2f5.js";import{zt}from"./chunk-hp0eqd8x.js";import{Vt,jt}from"./chunk-y93q3v30.js";import{$t}from"./chunk-94gqvrk7.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function _s({host:t,client:c,...s}){let m=O(()=>t.openDiff?t:{...t,openDiff:Vt},[t]);return i(kn,{host:m,client:c,children:[r(I,{...s}),!t.openDiff&&r(jt,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),y=()=>x(d,R.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&r(zt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:y,children:n("conversation.reconnect")})})]})}),u?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(Gt,{session:t,timeline:m}),r($t,{sessionId:t.id}),t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Ne,{session:t})]}),T]})}
|
|
2
2
|
export{_s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{codexMessageError as u,codexTurnError as i}from"@nyssance/codex-acp-v2/client";var a=[10,30,120,300];function
|
|
2
|
-
export{
|
|
1
|
+
import{codexMessageError as u,codexTurnError as i}from"@nyssance/codex-acp-v2/client";var a=[10,30,120,300];function hi(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||i(l).kind!=="overloaded")break;if(n++,o.user!==null)break}return a[n-1]??null}
|
|
2
|
+
export{hi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{be}from"./chunk-x4enakra.js";import{C}from"./chunk-dtxc0x7y.js";import{t,le}from"./chunk-g4devj8d.js";import{isEmbeddedResource as T,isImage as N,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as U,FileIcon as y,ImageOffIcon as z,LoaderCircleIcon as j}from"lucide-react";import{useState as I}from"react";import{Button as c}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function Wn(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function Bo(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function F({block:e,generated:r=!1}){let a=t(),[d,f]=I(!1),[R,B]=I(null);if(L(e)){let p=C(e.uri);if(p!==null)return n(be,{app:{id:p,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(z,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=Wn(e.uri);return s(c,{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(y,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!N(e))return null;let i=N(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=Wn(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(c,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(y,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:x}=a,v=x?()=>x([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else Bo(o,m)}catch(p){le(a,p)}finally{f(!1)}},h=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(v===void 0?h:n(c,{variant:"ghost",className:r?"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:v,children:h})),s(c,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(j,{className:"motion-safe:animate-spin"}):n(U,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
|
|
2
|
+
export{Wn,Bo,F};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
1
|
+
import{o}from"./chunk-g4devj8d.js";import{e,x}from"./chunk-e6ya95ee.js";import{QUICK_CHATS_GROUP as I,sessionGroup as z}from"@nyssance/codex-acp-v2/client";import{cn as P}from"cn";import{FolderClosedIcon as m,FolderPlusIcon as G,XIcon as j}from"lucide-react";import{useEffect as O,useMemo as R,useState as S}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as A,DropdownMenuContent as F,DropdownMenuGroup as T,DropdownMenuItem as k,DropdownMenuRadioGroup as B,DropdownMenuRadioItem as E,DropdownMenuSeparator as U,DropdownMenuTrigger as _}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as s,Fragment as H}from"react/jsx-runtime";function M(n){return n.replaceAll("\\","/").replace(/\/+$/,"").split("/").pop()||n}function Ss({cwd:n,onChange:u,preparing:b=!1,recentProjects:g}){let{host:i,client:p}=e(),{t:l}=i,w=o((r)=>r.projectContext),v=o((r)=>r.sessionList),y=R(()=>g??[...new Set([...v].toSorted((r,f)=>(f.updatedAt??"").localeCompare(r.updatedAt??"")).map((r)=>r.cwd))],[g,v]),[c,N]=S(null);O(()=>{if(!p.refreshProjectContext)return;let r=!0;return x(i,p.refreshProjectContext(!0).then((f)=>{if(r)N(f.chatDirectory)})),()=>{r=!1}},[i,p]);let h=[...n!==null?[n]:[],...y.filter((r)=>r!==n)].filter((r)=>r!==c&&(!w||z(w,{cwd:r}).id!==I)),a=n!==null&&n!==c,D=()=>{if(c===null)throw Error("The default draft directory is not ready");u(null)},d=i.chooseFolder;return s(A,{children:[s("div",{"aria-busy":b,className:P("chat-project-picker group/project inline-flex h-7 max-w-full min-w-0 items-center gap-1.5 rounded-full",a?"text-foreground ps-2":"text-foreground/65"),children:[a&&s(C,{variant:"ghost",size:"icon-xs",className:"relative size-4 rounded-full p-0 hover:bg-transparent dark:hover:bg-transparent","aria-label":l("conversation.draft.workOutsideProject"),title:l("conversation.draft.workOutsideProject"),disabled:c===null,onClick:D,children:[t(m,{className:"size-4 group-hover/project:opacity-0"}),t("span",{className:"bg-muted-foreground text-background absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/project:opacity-100",children:t(j,{className:"size-3"})})]}),s(_,{render:t(C,{variant:"ghost",size:"sm",className:P("h-7 min-w-0 shrink gap-1.5 rounded-full py-0 text-sm font-normal text-inherit hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent",a?"ps-0 pe-2":"px-2")}),children:[!a&&t(m,{className:"size-4"}),t("span",{className:"truncate",children:a?M(n):l("conversation.draft.selectProject")})]})]}),s(F,{side:"top",align:"start",className:"w-72 overflow-hidden",children:[h.length>0&&s(H,{children:[t("div",{className:"max-h-64 overflow-y-auto",children:t(B,{value:n??"",onValueChange:u,children:h.map((r)=>s(E,{value:r,title:r,closeOnClick:!0,children:[t(m,{}),t("span",{className:"truncate",children:M(r)})]},r))})}),(d!==void 0||a)&&t(U,{})]}),(d!==void 0||a)&&s(T,{children:[d&&s(k,{onClick:()=>{x(i,d(n).then((r)=>{if(r!==null)u(r)}))},children:[t(G,{}),l("conversation.draft.newProject")]}),c!==null&&a&&s(k,{onClick:D,children:[t(j,{}),l("conversation.draft.workOutsideProject")]})]})]})]})}
|
|
2
2
|
export{Ss};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function
|
|
2
|
-
export{
|
|
1
|
+
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function To(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function It(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=To(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
|
|
2
|
+
export{To,It};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Dt}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{Dt}from"./chunk-xw6rsyvx.js";import{d,Qe}from"./chunk-0faa9z99.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function di(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function ke({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Qe(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Qe(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Qe(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:di(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
|
|
2
|
+
export{di,ke};
|
|
@@ -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 Jr(i,e){return n??=new s,n.connect(i,e)}
|
|
2
|
+
export{Jr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as r}from"@alwith/api/client";var Je=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function
|
|
2
|
-
export{Je,
|
|
1
|
+
import{createStore as r}from"@alwith/api/client";var Je=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function ki(e){Je.setState({...e,terminals:e.terminals??{}})}function Si(e){if(Je.getState().sessionId===e)Je.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function _i(e,n,t){let i=Je.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
|
|
2
|
+
export{Je,ki,Si,_i};
|