@alwith/module-chat 0.6.28 → 0.6.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/catalogs/qwen/models.json +40 -0
- package/assets/provider-catalog.json +4 -0
- package/dist/activity-host.js +1 -1
- package/dist/agent/client.d.ts +1 -0
- package/dist/agent/client.js +1 -1
- package/dist/agent/custom-model-effort.js +1 -1
- package/dist/agent/fork-title.js +1 -1
- package/dist/agent/image-request.js +1 -1
- package/dist/agent/image-tools.js +1 -1
- package/dist/agent/input-config.js +1 -1
- package/dist/agent/input-modes/chat.js +1 -1
- package/dist/agent/input-modes/execution-meta.js +1 -1
- package/dist/agent/input-modes/image-context.js +1 -1
- package/dist/agent/input-modes/image.js +1 -1
- package/dist/agent/input-modes/index.js +1 -1
- package/dist/agent/project-path.js +1 -1
- package/dist/agent/request-error.js +1 -1
- package/dist/agent/session-list-refresh.js +1 -1
- package/dist/app-reference.js +1 -1
- package/dist/application-tools.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-cf7cw2tj.js → chunk-016v1nnv.js} +5 -5
- package/dist/{chunk-r7paw6ba.js → chunk-036wyz4n.js} +2 -2
- package/dist/{chunk-tftfggte.js → chunk-06mvwewp.js} +2 -2
- package/dist/chunk-0vtxfvdj.js +2 -0
- package/dist/{chunk-gnd32zkx.js → chunk-0zncrzar.js} +2 -2
- package/dist/{chunk-z4jv8svx.js → chunk-11kv54bx.js} +3 -3
- package/dist/{chunk-5dtpfpq5.js → chunk-12bfnfbk.js} +2 -2
- package/dist/{chunk-m8tt5bf9.js → chunk-15m908ph.js} +2 -2
- package/dist/{chunk-6cxvfwpe.js → chunk-18ea0dty.js} +2 -2
- package/dist/chunk-1h3f538q.js +2 -0
- package/dist/chunk-1jznzjzn.js +2 -0
- package/dist/{chunk-f4h84pav.js → chunk-1pnbntv2.js} +2 -2
- package/dist/{chunk-p83pk7ff.js → chunk-1y5zgya3.js} +2 -2
- package/dist/chunk-23r2z6bp.js +2 -0
- package/dist/{chunk-0fs2k5fe.js → chunk-2d4zb2ac.js} +2 -2
- package/dist/chunk-2qa3c571.js +2 -0
- package/dist/chunk-2w3c4tg8.js +2 -0
- package/dist/{chunk-rkks48gw.js → chunk-3915ad7f.js} +2 -2
- package/dist/{chunk-6yaxjcnj.js → chunk-3a8qwbgh.js} +3 -3
- package/dist/{chunk-smf7c649.js → chunk-3d3z6dam.js} +2 -2
- package/dist/{chunk-v9v1v41p.js → chunk-3dvxhfcr.js} +2 -2
- package/dist/chunk-3vdx0cme.js +2 -0
- package/dist/{chunk-7rgcj1w2.js → chunk-3y9az4b9.js} +2 -2
- package/dist/{chunk-jca8s47n.js → chunk-46bgwhx8.js} +2 -2
- package/dist/{chunk-r4nz54dh.js → chunk-4hasepkm.js} +2 -2
- package/dist/{chunk-ec4q4rw7.js → chunk-4vfrxhj4.js} +2 -2
- package/dist/{chunk-6pwssh9v.js → chunk-4z6gyvy3.js} +2 -2
- package/dist/{chunk-2zy75522.js → chunk-51s7qck0.js} +2 -2
- package/dist/{chunk-hyr8yww9.js → chunk-544g9fky.js} +2 -2
- package/dist/chunk-5e575zvm.js +2 -0
- package/dist/{chunk-c4awmmwt.js → chunk-5f7t16kj.js} +2 -2
- package/dist/{chunk-a4y4bsve.js → chunk-5fyxge7c.js} +2 -2
- package/dist/{chunk-tmec4by7.js → chunk-5hjk7xnq.js} +2 -2
- package/dist/{chunk-jz7dnk88.js → chunk-5jvpeww3.js} +2 -2
- package/dist/{chunk-38psn07c.js → chunk-5p53j8mf.js} +2 -2
- package/dist/{chunk-2sc2z6g5.js → chunk-5t2ge7gg.js} +2 -2
- package/dist/chunk-6ewv4vns.js +2 -0
- package/dist/chunk-6wsr59dr.js +2 -0
- package/dist/{chunk-ty2cd00p.js → chunk-6yx869ht.js} +2 -2
- package/dist/{chunk-ga265p00.js → chunk-704h27t9.js} +2 -2
- package/dist/{chunk-ckja1ppp.js → chunk-705j0x4q.js} +2 -2
- package/dist/{chunk-1ffpsz44.js → chunk-7a806p3q.js} +3 -3
- package/dist/{chunk-dzpbbys1.js → chunk-7d8xet8s.js} +2 -2
- package/dist/chunk-7gv27b1c.js +2 -0
- package/dist/{chunk-kj3a1k2q.js → chunk-7hfd7hnm.js} +2 -2
- package/dist/{chunk-6tj5e7fc.js → chunk-7k2z2nvy.js} +2 -2
- package/dist/{chunk-jggts370.js → chunk-7n3z2bay.js} +2 -2
- package/dist/{chunk-2fck5sy2.js → chunk-7r3k37ys.js} +2 -2
- package/dist/{chunk-7sr8weqn.js → chunk-7z1k4s4f.js} +2 -2
- package/dist/{chunk-jra2q5cx.js → chunk-82e3194f.js} +2 -2
- package/dist/{chunk-kk9dbwd1.js → chunk-84zzf0ys.js} +2 -2
- package/dist/{chunk-0xshzqb6.js → chunk-8q5zwkry.js} +2 -2
- package/dist/{chunk-phsvgv0f.js → chunk-8tnx3p86.js} +2 -2
- package/dist/{chunk-w1yrsbw1.js → chunk-8w5bt0nc.js} +2 -2
- package/dist/chunk-93bqj8az.js +2 -0
- package/dist/chunk-9dm7j0c9.js +4 -0
- package/dist/{chunk-ztm4agfw.js → chunk-9ecgnmtx.js} +3 -3
- package/dist/{chunk-jfrj2qg1.js → chunk-9h9vtcwk.js} +2 -2
- package/dist/{chunk-at75m9hq.js → chunk-9m36e0yq.js} +2 -2
- package/dist/{chunk-jg4c3zg4.js → chunk-9n8cds8p.js} +2 -2
- package/dist/{chunk-vbk36ptt.js → chunk-9pm3vzgx.js} +3 -3
- package/dist/{chunk-rncvy5pp.js → chunk-9qqxdv6f.js} +2 -2
- package/dist/{chunk-cpe6vtpe.js → chunk-a0qy1r02.js} +2 -2
- package/dist/{chunk-pqs039wv.js → chunk-a1wbf348.js} +4 -4
- package/dist/{chunk-n8mexbh4.js → chunk-abbpbnjj.js} +2 -2
- package/dist/{chunk-qqphgn9b.js → chunk-af0e5epn.js} +2 -2
- package/dist/{chunk-y8fmawc6.js → chunk-askwff3a.js} +3 -3
- package/dist/{chunk-2cfhvb3k.js → chunk-awrz081w.js} +2 -2
- package/dist/{chunk-zr8yk5np.js → chunk-ay699evt.js} +3 -3
- package/dist/chunk-b5g055qp.js +2 -0
- package/dist/{chunk-b2vtrd8n.js → chunk-b7ze9dje.js} +2 -2
- package/dist/{chunk-3r57tgvf.js → chunk-b89bzpce.js} +2 -2
- package/dist/{chunk-q46z21zs.js → chunk-bf7sgpzq.js} +2 -2
- package/dist/chunk-bnzpnsh1.js +4 -0
- package/dist/{chunk-064vpdm9.js → chunk-c3nn4h2q.js} +2 -2
- package/dist/chunk-c4mm4fzg.js +2 -0
- package/dist/{chunk-kqekfj3v.js → chunk-c4rptwfx.js} +3 -3
- package/dist/{chunk-jf2bxzee.js → chunk-c531krny.js} +3 -3
- package/dist/{chunk-r8pm74zf.js → chunk-cfj92m1y.js} +2 -2
- package/dist/{chunk-gzc704c3.js → chunk-chg6j0zg.js} +2 -2
- package/dist/{chunk-3qqd9x6x.js → chunk-cj99j82f.js} +2 -2
- package/dist/{chunk-dyks7e24.js → chunk-cjj5bxdb.js} +2 -2
- package/dist/{chunk-kvnbmt00.js → chunk-cr0pb6g0.js} +2 -2
- package/dist/{chunk-tghj342y.js → chunk-cy5kh1yr.js} +2 -2
- package/dist/chunk-d9q9qgm1.js +2 -0
- package/dist/{chunk-5vajeawb.js → chunk-djqexpgf.js} +2 -2
- package/dist/chunk-eb78ebxa.js +2 -0
- package/dist/{chunk-xk6f2raz.js → chunk-egbb5295.js} +2 -2
- package/dist/{chunk-q01vmp9m.js → chunk-enc99kvz.js} +2 -2
- package/dist/chunk-et3nrp9v.js +2 -0
- package/dist/{chunk-k44dkkpg.js → chunk-f84mdhkx.js} +2 -2
- package/dist/{chunk-7zafb413.js → chunk-f8bx4etj.js} +2 -2
- package/dist/chunk-fbrv2v3t.js +1 -0
- package/dist/chunk-fdfftrzj.js +5 -0
- package/dist/chunk-fer4r3b8.js +2 -0
- package/dist/{chunk-pxv38ttf.js → chunk-fpsn6fmf.js} +2 -2
- package/dist/chunk-fy8dmpv3.js +2 -0
- package/dist/{chunk-81hv0s07.js → chunk-ggxdrm0c.js} +2 -2
- package/dist/{chunk-r06hycq5.js → chunk-gh1rtwrb.js} +2 -2
- package/dist/{chunk-kfm1sz3q.js → chunk-h3geg09z.js} +2 -2
- package/dist/chunk-h4cx5xr4.js +4 -0
- package/dist/{chunk-q5qqhqw4.js → chunk-hj8nkk6a.js} +2 -2
- package/dist/chunk-hjbq9ez1.js +2 -0
- package/dist/{chunk-26w51q10.js → chunk-hpv8x22r.js} +2 -2
- package/dist/chunk-hwppy236.js +2 -0
- package/dist/chunk-hzcerz8j.js +2 -0
- package/dist/chunk-j29d8rts.js +2 -0
- package/dist/{chunk-6xap6hvz.js → chunk-j4w2hbbe.js} +2 -2
- package/dist/chunk-j9f4mh66.js +2 -0
- package/dist/{chunk-nzgjcp8w.js → chunk-jftxq3se.js} +2 -2
- package/dist/chunk-jfyz3rx6.js +2 -0
- package/dist/{chunk-s81m6yx7.js → chunk-jhaf3qtt.js} +2 -2
- package/dist/{chunk-2v531sbv.js → chunk-jnpkpe5t.js} +2 -2
- package/dist/chunk-jp2s1xsa.js +2 -0
- package/dist/chunk-jzarxwap.js +2 -0
- package/dist/chunk-k3h77wtz.js +2 -0
- package/dist/{chunk-ykz0h1r0.js → chunk-kagkszdc.js} +2 -2
- package/dist/{chunk-rt1c2p25.js → chunk-kdcde4s5.js} +2 -2
- package/dist/{chunk-8hygfx41.js → chunk-kv1v7kgn.js} +2 -2
- package/dist/{chunk-djd3sjp9.js → chunk-kvwyryw2.js} +2 -2
- package/dist/{chunk-pccwq2dd.js → chunk-kx9nnmwb.js} +3 -3
- package/dist/{chunk-nh56sb8e.js → chunk-ky3n1mza.js} +2 -2
- package/dist/chunk-ky4j58wz.js +2 -0
- package/dist/{chunk-ffs5nkt0.js → chunk-m6yg0dc9.js} +2 -2
- package/dist/{chunk-0aeq7qy7.js → chunk-m8243rnx.js} +2 -2
- package/dist/{chunk-9kz3pxt9.js → chunk-ma6ycen5.js} +2 -2
- package/dist/{chunk-rb4p3h5b.js → chunk-mahky9ad.js} +2 -2
- package/dist/chunk-mdzng667.js +2 -0
- package/dist/{chunk-vzm88w2r.js → chunk-mfmh7ztq.js} +2 -2
- package/dist/{chunk-t50b1s7h.js → chunk-mfrg4vze.js} +5 -5
- package/dist/chunk-mgs3dhdm.js +2 -0
- package/dist/chunk-mq32437t.js +2 -0
- package/dist/{chunk-e04g26qm.js → chunk-n8b9yg4q.js} +2 -2
- package/dist/{chunk-kj3t4mqf.js → chunk-n96z8etk.js} +2 -2
- package/dist/{chunk-ymgc4317.js → chunk-nec3tcjh.js} +2 -2
- package/dist/{chunk-hygvdjq6.js → chunk-nf7q3crw.js} +3 -3
- package/dist/{chunk-heqa4swe.js → chunk-nqt9gyz9.js} +2 -2
- package/dist/chunk-p0v9d7e1.js +2 -0
- package/dist/{chunk-gea1q14z.js → chunk-p6ffd8yn.js} +2 -2
- package/dist/{chunk-3a3ecayr.js → chunk-p9226dye.js} +2 -2
- package/dist/{chunk-9q6hz47j.js → chunk-p9x6rya1.js} +2 -2
- package/dist/{chunk-pk931bpm.js → chunk-pd5yrdg6.js} +1 -1
- package/dist/{chunk-evethx5n.js → chunk-pe79c1re.js} +2 -2
- package/dist/{chunk-vbbndjfd.js → chunk-pwk7epmy.js} +2 -2
- package/dist/{chunk-1gtmvxdr.js → chunk-py2q899w.js} +2 -2
- package/dist/chunk-pyqhwz2d.js +4 -0
- package/dist/{chunk-m8pkmbtf.js → chunk-q988bycf.js} +2 -2
- package/dist/chunk-qj87dxrr.js +2 -0
- package/dist/{chunk-tm5w5srq.js → chunk-qm0zd4wj.js} +2 -2
- package/dist/{chunk-ccxsf02q.js → chunk-qmx3t5he.js} +2 -2
- package/dist/chunk-qth2ames.js +2 -0
- package/dist/chunk-qyfkwznx.js +2 -0
- package/dist/{chunk-gds55pjg.js → chunk-r84xcy0d.js} +2 -2
- package/dist/{chunk-ms0h8x63.js → chunk-r8gfcyeb.js} +2 -2
- package/dist/chunk-rayhzb8p.js +2 -0
- package/dist/{chunk-tpdyjp90.js → chunk-re34mbpa.js} +2 -2
- package/dist/{chunk-ypgvt8ky.js → chunk-rfkgks0a.js} +2 -2
- package/dist/{chunk-tky568fy.js → chunk-rhptdqpp.js} +2 -2
- package/dist/chunk-rkqptd9w.js +2 -0
- package/dist/{chunk-r1sj7c91.js → chunk-rrzz41z1.js} +2 -2
- package/dist/{chunk-5hk14ksr.js → chunk-rsbced6k.js} +2 -2
- package/dist/{chunk-tj4b0s68.js → chunk-spqfmr4z.js} +2 -2
- package/dist/chunk-sqqa7t1n.js +3 -0
- package/dist/chunk-srqs8z90.js +2 -0
- package/dist/{chunk-kfgy61cg.js → chunk-srz8hnnx.js} +3 -3
- package/dist/chunk-t4twdrdg.js +2 -0
- package/dist/{chunk-sjqhtpzr.js → chunk-tftgnw1w.js} +2 -2
- package/dist/{chunk-aq1j5vqn.js → chunk-tszqev50.js} +2 -2
- package/dist/{chunk-17gs9pbn.js → chunk-tzb4b5ve.js} +2 -2
- package/dist/{chunk-snxpc6yr.js → chunk-v6x7x69b.js} +1 -1
- package/dist/chunk-v92wj4tv.js +2 -0
- package/dist/{chunk-78vckhxt.js → chunk-vcj2jfnz.js} +2 -2
- package/dist/{chunk-tzczzqde.js → chunk-vqqafkcx.js} +2 -2
- package/dist/{chunk-1fda3013.js → chunk-vsm89jmx.js} +2 -2
- package/dist/{chunk-s89p3zgn.js → chunk-w1h28vvd.js} +2 -2
- package/dist/{chunk-8v53bkyr.js → chunk-w2z3sxdq.js} +2 -2
- package/dist/{chunk-gvqvw7ms.js → chunk-wbjf9maj.js} +2 -2
- package/dist/{chunk-eavqh5fb.js → chunk-wbnmcagf.js} +3 -3
- package/dist/chunk-wg223rq3.js +2 -0
- package/dist/{chunk-0q22f9vw.js → chunk-wkbxdz82.js} +2 -2
- package/dist/chunk-wv6ntscn.js +2 -0
- package/dist/{chunk-cpy7x31t.js → chunk-wvm8srp7.js} +2 -2
- package/dist/chunk-x03z0hme.js +2 -0
- package/dist/chunk-x072jj4c.js +2 -0
- package/dist/{chunk-evsyhxz1.js → chunk-x4brdfv3.js} +2 -2
- package/dist/{chunk-ndfyste3.js → chunk-x4bzkzbt.js} +2 -2
- package/dist/{chunk-42ebtw00.js → chunk-xb6x221t.js} +2 -2
- package/dist/{chunk-n0q8e6sq.js → chunk-xckysrk7.js} +2 -2
- package/dist/{chunk-t9xkg3pk.js → chunk-xcx9g1wb.js} +2 -2
- package/dist/{chunk-38bpmgjd.js → chunk-xg6ayxsy.js} +2 -2
- package/dist/{chunk-mdf155e1.js → chunk-xxmzqazr.js} +2 -2
- package/dist/chunk-y3kn2w77.js +2 -0
- package/dist/{chunk-ayhxrzsq.js → chunk-y47sn7w2.js} +2 -2
- package/dist/{chunk-6bhfdsyz.js → chunk-yjm613ey.js} +2 -2
- package/dist/{chunk-tnzz1j83.js → chunk-ypdh88cj.js} +2 -2
- package/dist/{chunk-fqdtx7tp.js → chunk-yw927w3q.js} +2 -2
- package/dist/chunk-yx3eqj75.js +2 -0
- package/dist/{chunk-p79keq5q.js → chunk-z5n4zqeg.js} +2 -2
- package/dist/chunk-zdqjjwx0.js +2 -0
- package/dist/{chunk-k7h34p5z.js → chunk-zhf7403q.js} +2 -2
- package/dist/{chunk-3nbpd0jt.js → chunk-zmr5pwhd.js} +2 -2
- package/dist/{chunk-trxf8c70.js → chunk-znafsq0a.js} +2 -2
- package/dist/{chunk-xsn2g4kk.js → chunk-zwpv75f4.js} +2 -2
- package/dist/{chunk-rkejggyx.js → chunk-zyermn00.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/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/markdown.css +4 -0
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/locales.js +1 -1
- package/dist/collections/model.js +1 -1
- package/dist/collections/store.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/inline-document.js +1 -1
- package/dist/composer/inline-dom.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.d.ts +2 -0
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-inline.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/app-mentions.js +1 -1
- package/dist/conversation/composer/apps-menu.js +1 -1
- package/dist/conversation/composer/composer-menu.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/config-options.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/prompt-history.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/connection-notice.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-search.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/diff-modal.js +1 -1
- package/dist/conversation/draft-project-picker.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/conversation/subagent-sessions.js +1 -1
- package/dist/conversation/subagent-tasks.d.ts +1 -0
- package/dist/conversation/subagent-tasks.js +1 -1
- package/dist/desktop/desktop-composer.d.ts +3 -2
- 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.d.ts +2 -2
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.d.ts +4 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.js +1 -1
- package/dist/lib/app-reference.js +1 -1
- package/dist/lib/application-metadata.js +1 -1
- package/dist/lib/chat-path.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/file-url.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-parser.worker.js +58 -55
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/lib/tool-artifacts.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mermaid/diagram.js +1 -1
- package/dist/mermaid/export.js +1 -1
- package/dist/mermaid/index.js +1 -1
- package/dist/mermaid/preview.js +1 -1
- package/dist/oauth/claude-login.js +1 -1
- package/dist/oauth.js +1 -1
- package/dist/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.js +1 -1
- package/dist/plugins/locales.js +1 -1
- package/dist/plugins/new-chat-directory.js +1 -1
- package/dist/plugins/panel-item.js +1 -1
- package/dist/plugins/plugin-detail-page.js +1 -1
- package/dist/plugins/plugin-icon.js +1 -1
- package/dist/plugins/plugin-icons.js +1 -1
- package/dist/plugins/plugins-page.js +1 -1
- package/dist/plugins/plugins.js +1 -1
- package/dist/plugins/read-skill-document.js +1 -1
- package/dist/plugins/skill-document.js +1 -1
- package/dist/plugins/skills-tab.js +1 -1
- package/dist/plugins/store.js +1 -1
- package/dist/plugins/toolbox-layout.js +1 -1
- package/dist/reference-projection.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/highlight.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/locales.js +1 -1
- package/dist/session-list/navigation-controls.js +1 -1
- package/dist/session-list/navigation-header.js +1 -1
- package/dist/session-list/navigation-store.js +1 -1
- package/dist/session-list/navigation-tabs.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/platform.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/shortcut-hint.js +1 -1
- package/dist/session-list/shortcut.js +1 -1
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-image-references.js +1 -1
- package/dist/session-timeline/assistant-turn.d.ts +4 -0
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/image-generation-progress.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/settings/codex-account-card.js +1 -1
- package/dist/settings/login-card.js +1 -1
- package/dist/settings/model-alias-settings.js +1 -1
- package/dist/settings/model-aliases.js +1 -1
- package/dist/settings/provider-logos.js +1 -1
- package/dist/settings/provider-section.js +1 -1
- package/dist/settings/providers-port.js +1 -1
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.js +1 -1
- package/native/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-0fqp48tv.js +0 -2
- package/dist/chunk-1a56svgj.js +0 -2
- package/dist/chunk-2c2a1wvg.js +0 -2
- package/dist/chunk-2e1tg69n.js +0 -4
- package/dist/chunk-36ttr22w.js +0 -2
- package/dist/chunk-3kn94cpp.js +0 -2
- package/dist/chunk-4cbfgsg7.js +0 -2
- package/dist/chunk-5d138vq3.js +0 -1
- package/dist/chunk-5k4ec37x.js +0 -2
- package/dist/chunk-5mnjkjjr.js +0 -2
- package/dist/chunk-62kt6f1d.js +0 -2
- package/dist/chunk-6tr1bch8.js +0 -4
- package/dist/chunk-8qzq9yq1.js +0 -2
- package/dist/chunk-8y838se4.js +0 -2
- package/dist/chunk-a73hd95m.js +0 -4
- package/dist/chunk-aepfqfad.js +0 -2
- package/dist/chunk-agx111cv.js +0 -2
- package/dist/chunk-b30n56t8.js +0 -2
- package/dist/chunk-b42vv8f2.js +0 -2
- package/dist/chunk-b6p0y68h.js +0 -2
- package/dist/chunk-b8x98hyd.js +0 -2
- package/dist/chunk-bx11qvn9.js +0 -2
- package/dist/chunk-cvn9zbbc.js +0 -2
- package/dist/chunk-dd0f44xb.js +0 -2
- package/dist/chunk-dmq2fx7g.js +0 -2
- package/dist/chunk-dnh1e01b.js +0 -2
- package/dist/chunk-dpfjxym1.js +0 -2
- package/dist/chunk-e27d47yd.js +0 -2
- package/dist/chunk-ep9vq47f.js +0 -2
- package/dist/chunk-fjrghy92.js +0 -2
- package/dist/chunk-gya560n0.js +0 -2
- package/dist/chunk-gyw21vnb.js +0 -2
- package/dist/chunk-j8ehajmt.js +0 -2
- package/dist/chunk-mhzqhd85.js +0 -2
- package/dist/chunk-mz90kcyd.js +0 -2
- package/dist/chunk-mzd9qfmj.js +0 -2
- package/dist/chunk-ngvdcqmt.js +0 -3
- package/dist/chunk-p8cm3xw1.js +0 -2
- package/dist/chunk-q73jne25.js +0 -2
- package/dist/chunk-rerm6x2f.js +0 -2
- package/dist/chunk-sgbn37kz.js +0 -2
- package/dist/chunk-sy1rf5m0.js +0 -4
- package/dist/chunk-t7xbh36h.js +0 -2
- package/dist/chunk-tk66t919.js +0 -4
- package/dist/chunk-ty9sa6we.js +0 -2
- package/dist/chunk-v042t2he.js +0 -2
- package/dist/chunk-vnh0jnr4.js +0 -2
- package/dist/chunk-w368gk92.js +0 -2
- package/dist/chunk-x1mzrhtd.js +0 -2
- package/dist/chunk-xhbxpk0z.js +0 -2
- package/dist/chunk-y6p8xspr.js +0 -2
- package/dist/chunk-y85askf9.js +0 -2
- package/dist/chunk-yc47rq4m.js +0 -2
- package/dist/chunk-z6zsmpyz.js +0 -2
- package/dist/chunk-zpcd9w2t.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function
|
|
3
|
-
export{
|
|
1
|
+
import{_i,ft}from"./chunk-askwff3a.js";import{t,w}from"./chunk-rayhzb8p.js";import{createStore as d}from"@alwith/api/client";import{Dialog as f,DialogContent as p,DialogDescription as m,DialogHeader as u,DialogTitle as h}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function an(e){c.setState({request:{path:e.path,patch:xi(e.patch,e.path)}})}function xi(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
|
|
2
|
+
`,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function ln(){let{t:e,theme:a}=t(),n=w(c,(o)=>o.request),s=n===null?null:_i(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(ft,{patch:n.patch,theme:a})})]})})}
|
|
3
|
+
export{an,xi,ln};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ys}from"./chunk-v9v1v41p.js";import{Ko,$e,t,qe,n,le}from"./chunk-ty9sa6we.js";import{Ti,ft,so,Ai,Ei}from"./chunk-cvn9zbbc.js";import{gt}from"./chunk-rb4p3h5b.js";import{fi}from"./chunk-ngvdcqmt.js";import{Di}from"./chunk-b30n56t8.js";import{_i,Pi}from"./chunk-dzpbbys1.js";import{Ci,wi}from"./chunk-ty2cd00p.js";import{gi}from"./chunk-7rgcj1w2.js";import{Si}from"./chunk-fqdtx7tp.js";import{ui}from"./chunk-sy1rf5m0.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 o,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 o("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]),o("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:[o("p",{role:"alert",className:"text-destructive text-xs",children:c}),o(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:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("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:Ti(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function mt(e){return o($e,{host:e.host,client:e.client,children:o(Ko,{value:e.session.cwd,children:o(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=n((r)=>r.historyNavigation[e.id]),he=K(()=>e.commands.map((r)=>r.name),[e.commands]),m=_e(e,T?.turns),A=m.at(-1)?.key,be=Ai(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Di(m,T),[m,T]),Z=K(()=>W.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[W]),we=K(()=>k===void 0?[]:_i(m,e.turnUsage,T),[k,m,e.turnUsage,T]),ee=w&&w.afterItemId!==null?m.findIndex((r)=>r.items.some((u)=>u.id===w.afterItemId)):-1,j=b(m);j.current=m;let[l,Re]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),Se=n((r)=>ze(r.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}=Si(l,y,Ne),ce=M(()=>{if(l===null||!y)return;let r=m.at(-1)?.key;if(r===void 0)return;let u=ue(!0),d=()=>u.isCurrent()&&X.current.running&&X.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!d())return;let a=l.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);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(r,void 0,{align:"top"}).then(()=>{if(d())i()})},[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 r=()=>{let u=l.scrollTop<600;if(Pe(u),u&&!T?.complete&&P&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)J()};return r(),l.addEventListener("scroll",r,{passive:!0}),()=>l.removeEventListener("scroll",r)},[P,x,C,J,l,e.restoring,T?.complete]),H(()=>{Ci({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>wi(e.id),[e.id]);let He=M(async(r,u)=>{let d=++re.current;ne(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await g.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((s)=>requestAnimationFrame(()=>s()));if(!u())return null;let i=j.current.find((s)=>s.user?.id===(r.messageId??r.id))??j.current.find((s)=>s.user!==null&&r.nativeTurnId!==void 0&&s.items.some((p)=>ge(p)===r.nativeTurnId));if(!i?.user)return null;let h=i.user.id,a=q.current;if(a===null)throw Error("Virtual timeline is not mounted");return await a.scrollToKey(i.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(r)=>{if(r.nativeTurnId!==void 0)await g.previewHistoryTurn(e.id,r.nativeTurnId)},[g,e.id]);H(()=>{if(l===null)return;let r=l.querySelector("[data-codex-timeline]");if(r===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(r),u.observe(l);let d=null,i=()=>{let a=A===void 0?null:r.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)};i();let h=new MutationObserver(i);return h.observe(r,{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 r=m.at(-1),u=de.current;if(de.current=r===void 0?null:{key:r.key,running:y},r===void 0||u===null||r.user===null||r.replayed)return;if(R){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==u.key||!u.running))N.current=null,I.current=0,F(0),ce()}else if(r.key!==u.key)G()},[ce,R,y,G,l,e.turnEndedAt,m]);let Le=(r,u)=>{let d=r,i=d.turn;if(i===void 0){if(d.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return o(Ue,{sessionId:e.id,turnId:d.nativeTurnId,root:l,error:T?.turnErrors[d.nativeTurnId],connected:P&&!C&&!Ie})}let h=m.indexOf(i),a=i.key===be,s=Ei(e,m,h),p=!a&&s.continued,D=i.key===A,O=i.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?.(i)??null,pe=c?.(i)??null,Ce=pe!==null||i.work.length>0||i.final.length>0||i.errors.length>0||a||fe!==null||ft(i)||so(i)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=i.user===null?null:gt(i);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(V===void 0?o(ui,{item:i.user,messageTime:ve,skillNames:he}):V(i.user,ve)),Ce&&o(fi,{sessionId:e.id,turn:i,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:gi(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:so(i)||!a&&D&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:S?.(i),footer:fe}),u===ee&&w?.node,v?.(i)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(_,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":L.t("timeline.label")},children:o("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,o(ys,{ref:q,entries:W,renderTurn:Le,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:f===void 0?void 0:o("div",{className:"pt-3",children:f})}),R&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(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:[o(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&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),k!==void 0&&o(Pi,{items:we,audio:k.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ee,onRevealError:(r)=>le(L,r),targetTopMarginPx:16},e.id),o("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:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Fe,{})})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{xr}from"./chunk-3dvxhfcr.js";import{Vo,Ve,t,$e,n,ce}from"./chunk-rayhzb8p.js";import{as,Ot,Go,ds,us}from"./chunk-fy8dmpv3.js";import{Rt}from"./chunk-mahky9ad.js";import{Sr}from"./chunk-sqqa7t1n.js";import{Or}from"./chunk-3vdx0cme.js";import{Hr,Ur}from"./chunk-7d8xet8s.js";import{Yr,es}from"./chunk-6yx869ht.js";import{Dr}from"./chunk-3y9az4b9.js";import{Fr}from"./chunk-yw927w3q.js";import{os}from"./chunk-bnzpnsh1.js";import{codexExtensionCapabilities as ze,codexMessageError as Be,codexRetryNotice as Oe,codexTurnError as qe,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 o,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 o("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=$e(),{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]),o("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:[o("p",{role:"alert",className:"text-destructive text-xs",children:c}),o(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:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("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:as(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function Nt(e){return o(Ve,{host:e.host,client:e.client,children:o(Vo,{value:e.session.cwd,children:o(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=$e(),L=t(),T=n((r)=>r.historyNavigation[e.id]),he=K(()=>e.commands.map((r)=>r.name),[e.commands]),m=_e(e,T?.turns),A=m.at(-1)?.key,be=ds(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Or(m,T),[m,T]),Z=K(()=>W.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[W]),we=K(()=>k===void 0?[]:Hr(m,e.turnUsage,T),[k,m,e.turnUsage,T]),ee=w&&w.afterItemId!==null?m.findIndex((r)=>r.items.some((u)=>u.id===w.afterItemId)):-1,j=b(m);j.current=m;let[l,Re]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),Se=n((r)=>ze(r.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:le,beginLocate:ae,cancelLocation:ue}=Fr(l,y,Ne),se=M(()=>{if(l===null||!y)return;let r=m.at(-1)?.key;if(r===void 0)return;let u=ae(!0),d=()=>u.isCurrent()&&X.current.running&&X.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!d())return;let a=l.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);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(r,void 0,{align:"top"}).then(()=>{if(d())i()})},[ae,y,l,m]);Te(()=>{if(!R||y)return;ue(),N.current=null,I.current=0,F(0)},[R,ue,y]);let J=M(()=>{B(),g.loadOlderHistory(e.id).catch(()=>{})},[g,e.id,B]);H(()=>{if(l===null)return;let r=()=>{let u=l.scrollTop<600;if(Pe(u),u&&!T?.complete&&P&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)J()};return r(),l.addEventListener("scroll",r,{passive:!0}),()=>l.removeEventListener("scroll",r)},[P,x,C,J,l,e.restoring,T?.complete]),H(()=>{Yr({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>es(e.id),[e.id]);let He=M(async(r,u)=>{let d=++re.current;ne(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await g.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((s)=>requestAnimationFrame(()=>s()));if(!u())return null;let i=j.current.find((s)=>s.user?.id===(r.messageId??r.id))??j.current.find((s)=>s.user!==null&&r.nativeTurnId!==void 0&&s.items.some((p)=>ge(p)===r.nativeTurnId));if(!i?.user)return null;let h=i.user.id,a=q.current;if(a===null)throw Error("Virtual timeline is not mounted");return await a.scrollToKey(i.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(r)=>{if(r.nativeTurnId!==void 0)await g.previewHistoryTurn(e.id,r.nativeTurnId)},[g,e.id]);H(()=>{if(l===null)return;let r=l.querySelector("[data-codex-timeline]");if(r===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}le(s)});u.observe(r),u.observe(l);let d=null,i=()=>{let a=A===void 0?null:r.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)};i();let h=new MutationObserver(i);return h.observe(r,{childList:!0,subtree:!0}),()=>{h.disconnect(),u.disconnect()}},[le,A,l]),H(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let de=b(null);Te(()=>{if(l===null)return;let r=m.at(-1),u=de.current;if(de.current=r===void 0?null:{key:r.key,running:y},r===void 0||u===null||r.user===null||r.replayed)return;if(R){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==u.key||!u.running))N.current=null,I.current=0,F(0),se()}else if(r.key!==u.key)G()},[se,R,y,G,l,e.turnEndedAt,m]);let Le=(r,u)=>{let d=r,i=d.turn;if(i===void 0){if(d.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return o(Ue,{sessionId:e.id,turnId:d.nativeTurnId,root:l,error:T?.turnErrors[d.nativeTurnId],connected:P&&!C&&!Ie})}let h=m.indexOf(i),a=i.key===be,s=us(e,m,h),p=!a&&s.continued,D=i.key===A,O=i.errors.at(-1),me=O===void 0?null:Be(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&&qe(me).kind==="overloaded"&&Q!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",fe=z?.(i)??null,pe=c?.(i)??null,Ce=pe!==null||i.work.length>0||i.final.length>0||i.errors.length>0||a||fe!==null||Ot(i)||Go(i)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=i.user===null?null:Rt(i);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(V===void 0?o(os,{item:i.user,messageTime:ve,skillNames:he}):V(i.user,ve)),Ce&&o(Sr,{sessionId:e.id,turn:i,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?Oe(e._meta)??void 0:void 0,retry:Ae?{turnId:Q,delaySeconds:Dr(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:Go(i)||!a&&D&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:S?.(i),footer:fe}),u===ee&&w?.node,v?.(i)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(_,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":L.t("timeline.label")},children:o("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,o(xr,{ref:q,entries:W,renderTurn:Le,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:f===void 0?void 0:o("div",{className:"pt-3",children:f})}),R&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(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:[o(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&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),k!==void 0&&o(Ur,{items:we,audio:k.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ee,onRevealError:(r)=>ce(L,r),targetTopMarginPx:16},e.id),o("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:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Fe,{})})]})}
|
|
2
|
+
export{Nt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),xo=d(null);function el(){return i(xo)}var bo=d(null);function tl(){return i(bo)}var Pt=d(null);function he(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Tt=()=>i(C);function nl(){let r=i(Pt);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(Pt);function gr({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:A,attachmentPolicy:f,value:R,onValueChange:y,attachments:U,onAttachmentsChange:L,children:B}){let S=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),T=R!==void 0,[G,J]=z(r),p=R??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,T)y?.(t);else J(t)},[T,y]),h=n(()=>P(""),[P]),v=U!==void 0,[K,N]=z([]),x=U??K,b=I(x);b.current=x;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)L?.(e);else N(e)},[v,L]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:S(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[f,S,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),A?.()},[A,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(v)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[v]);let k=n(()=>{w.current?.()},[]),F=q(()=>({files:x,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[x,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:h,getRevision:W,clearSubmitted:c??h},attachments:F,__registerFileInput:H}),[p,P,h,W,c,F,H]);return D(C.Provider,{value:Q,children:D(Pt.Provider,{value:F,children:B})})}var Co=d(null);function g(){let r=X(),l=i(Co),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
+
export{xo,el,bo,tl,Pt,he,Tt,nl,gr,Co,g};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{vs}from"./chunk-z5n4zqeg.js";import{xe}from"./chunk-8tnx3p86.js";import{jo}from"./chunk-x4bzkzbt.js";import{C}from"./chunk-c4mm4fzg.js";import{Uo,Ft}from"./chunk-rsbced6k.js";import{le,$o}from"./chunk-rayhzb8p.js";import{Oo}from"./chunk-w1h28vvd.js";import{Kr,Wr}from"./chunk-mq32437t.js";import{jr}from"./chunk-q988bycf.js";import{Fo,qr}from"./chunk-5f7t16kj.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as y}from"entities";import de from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as be,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as w,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ie}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function T(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var Te=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,ve=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ye=/\uE200[^\uE201]*$/,Ce=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
|
|
2
2
|
`)?`${e}\`\`\``:`${e}
|
|
3
3
|
\`\`\``}function _(e,n){if(!e.includes(n)||Ne(e,n)%2===0)return e;let t=Le(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
|
|
4
4
|
`)||ne(r))return e;return`${e}${n}`}function $e(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function te(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Pe(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=te(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let l=d.toLowerCase();if(l.length>Ce&&!Me.has(l))return!1}return!0}function Se(e){let{path:n}=te(e);if($e(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ae(e){let n=e.match(H);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Pe(t)||Se(t)?e.replace(H,"$1"):`${e})`}function Fe(e){let n=e.replace(ye,"");if(n.length===0||n.includes("`")&&ne(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Ie(n))return{isCodeFenceOpen:!0,markdown:Re(n)};if(n.includes(")n=Ae(n);return n=_(n,"**"),n=_(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function He(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function O(e){return He(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function re(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))re(t.tokens);if(!O(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!O(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
|
|
5
|
-
`),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=
|
|
6
|
-
`,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,Te)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function
|
|
7
|
-
export{
|
|
5
|
+
`),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=Uo(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=T(),r=$o();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(Wr,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=T(),o=le();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=T(),i=w(null),[c,d]=h(null),[l,p]=h(null),[E,b]=h(!1);if(k(()=>{let f=jr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let x=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{b(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),b(!0),window.setTimeout(()=>b(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...x===null?{children:e}:{dangerouslySetInnerHTML:{__html:x}}})})]})}function De({code:e,language:n}){let t=T(),r=J(Y),o=$o();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Oo,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=w(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return T().preview?a(ie,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=T(),t=le(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Ft(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=w(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ie,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=w(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");de.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
|
|
6
|
+
`,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,Te)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function ae(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ae(r),s=t.get(o)??0;return t.set(o,s+1),se(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!jo(r))return null;return a(Ve,{src:r,alt:y(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function se(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(Kr))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(vs,{text:y(t.text),children:q(y(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=C(o);if(s!==null)return a(xe,{app:{id:s,name:y(t.text).replace(/^\$/,"")}},n);return jo(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function v(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?y(n.text):n.tokens.map(v).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(v).join("");case"list":return e.items.map(v).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(v).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},se(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=ae(I),A=f.get(R)??0;f.set(R,A+1);let F=v(I),ce={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,ce})},[n]),s=o.map((u)=>u.visibleText).join(""),i=w({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],b=c.generation+(d?0:1),x={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:b};if(r&&s.length>l)x.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=x}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:x.runs,generation:b},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=w(null),[o,s]=h(()=>Fo(n,t)),i=w(o!==null),[c,d]=h(null);if(k(()=>{let l=qr((p)=>{if(!i.current)i.current=!0,s(p);else be(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Lt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
|
|
7
|
+
export{Lt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ur}from"./chunk-hj8nkk6a.js";import{g}from"./chunk-a0qy1r02.js";import{cn as v}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as P}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as E,HoverCardContent as R,HoverCardTrigger as D}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as e,jsxs as r,Fragment as K}from"react/jsx-runtime";function F(t){return e(R,{align:"start",...t})}function cr({data:t,t:n,className:l,...m}){let c=g(),[u,f]=P(!1),[I,d]=P(1),C=z(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",A=a||(o?n("input.image"):n("input.attachment"));return L(()=>{if(!u)return;let p=0.1,h=(i)=>Math.min(10,Math.max(0.1,i)),y=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,x=s==="+"||s==="=",H=s==="-"||s==="_",w=s==="0";if(!x&&!H&&!w)return;i.preventDefault(),d((b)=>{if(w)return 1;if(x)return h(b+p);return h(b-p)})};return window.addEventListener("keydown",y,{passive:!1}),()=>window.removeEventListener("keydown",y)},[u]),r(K,{children:[r(E,{children:[e(D,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(N,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),f(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(k,{className:"size-3"})}),r(N,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(T,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),e(F,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e(ur,{containerRef:C,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:I,url:t.url})]})}function dr({children:t,className:n,...l}){let m=g();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(M,{children:t(c)},c.id))})}
|
|
2
|
+
export{cr,dr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{A}from"./chunk-1pnbntv2.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as L,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function ta({host:e,client:t,children:n}){let[r,l]=f(null);A(r!==null);let{t:u}=e;return i(S,{value:e,children:i(g,{value:t,children:d(C,{value:l,children:[n,i(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(P,{children:[i(H,{children:u("sessionList.deleteTitle")}),i(L,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[i(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),i(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function hi(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function nn(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function o(e){let t=a();return x((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
|
|
2
|
+
export{ta,s,hi,a,nn,o,h};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function
|
|
2
|
-
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function
|
|
3
|
-
export{
|
|
1
|
+
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function _i(e){let t=0,i=0;for(let o of e.split(`
|
|
2
|
+
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function ft({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
|
|
3
|
+
export{_i,ft};
|
|
@@ -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
|
|
2
|
-
export{U,
|
|
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 $a(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 Ut="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",ys={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,$a,Ut,ys};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{U,
|
|
1
|
+
import{U,Ut,ys}from"./chunk-awrz081w.js";import{m}from"./chunk-82e3194f.js";function f(o,d,r){let s=document.createElement("span");if(s.contentEditable="false",s.setAttribute("aria-label",o),s.className=Ut,r){let t=document.createElement("img");t.src=r,t.alt="",t.draggable=!1,t.setAttribute("aria-hidden","true"),t.className="size-3.5 shrink-0 self-center object-contain";let l=document.createElement("span");return l.textContent=o,s.append(t,l),s}let a=document.createElementNS("http://www.w3.org/2000/svg","svg");for(let[t,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))a.setAttribute(t,l);a.setAttribute("class","size-3.5 shrink-0 self-center");for(let[t,l]of ys[d]){let e=document.createElementNS("http://www.w3.org/2000/svg",t);for(let[i,c]of Object.entries(l))e.setAttribute(i,c);a.append(e)}let n=document.createElement("span");return n.textContent=o,s.append(a,n),s}function pr(o,d,r=[],s){let a=document.createDocumentFragment(),n="",t=()=>{let e=0;for(let i of U(n,r)){a.append(document.createTextNode(n.slice(e,i.start)));let c=f(i.name.slice(1),i.kind,i.kind==="skill"?s?.(i.name.slice(1)):void 0);if(i.kind==="skill")c.dataset.inlineSkill=i.name;else c.dataset.inlineCommand=i.name;a.append(c);let u=document.createElement("span");u.dataset.inlineAnchor="",u.textContent="",a.append(u),e=i.end}if(n.slice(e))a.append(document.createTextNode(n.slice(e)));n=""};for(let e of m(d)){if(typeof e==="string"){n+=e;continue}t();let i=f(e.name,"app");i.dataset.inlineApp=e.id,a.append(i);let c=document.createElement("span");c.dataset.inlineAnchor="",c.textContent="",a.append(c)}t();let l=document.createElement("br");l.dataset.inlineCaret="",a.append(l),o.replaceChildren(a)}function fo(o,d){let r=[],s=new Map(d.map((n)=>[n.id,n])),a=(n)=>{if(n.nodeType===Node.TEXT_NODE){r.push(...(n.textContent??"").split(""));return}if(n instanceof HTMLElement){if(n.hasAttribute("data-inline-caret"))return;if(n.hasAttribute("data-inline-anchor")){r.push(...(n.textContent??"").replace("","").split(""));return}let t=n.dataset.inlineSkill??n.dataset.inlineCommand;if(t!==void 0){r.push(...t.split(""));return}let l=n.dataset.inlineApp;if(l!==void 0){let i=s.get(l);if(i)r.push(i);return}if(n.tagName==="BR"){r.push(`
|
|
2
2
|
`);return}if((n.tagName==="DIV"||n.tagName==="P")&&r.length&&r.at(-1)!==`
|
|
3
3
|
`)r.push(`
|
|
4
|
-
`)}for(let t of n.childNodes)a(t)};for(let n of o.childNodes)a(n);return r}function
|
|
5
|
-
export{
|
|
4
|
+
`)}for(let t of n.childNodes)a(t)};for(let n of o.childNodes)a(n);return r}function mr(o,d,r){let s=window.getSelection();if(!s?.rangeCount)return r;let a=s.getRangeAt(0);if(!o.contains(a.startContainer)||!o.contains(a.endContainer))return r;let n=(t,l)=>{let e=document.createRange();return e.selectNodeContents(o),e.setEnd(t,l),fo(e.cloneContents(),d).length};return{start:n(a.startContainer,a.startOffset),end:n(a.endContainer,a.endOffset)}}function ho(o,d){let r=(n)=>{let t=Math.max(0,n);for(let[l,e]of[...o.childNodes].entries())if(e.nodeType===Node.TEXT_NODE){let i=e.textContent?.length??0;if(t<=i)return[e,t];t-=i}else if(e instanceof HTMLElement&&e.hasAttribute("data-inline-anchor")){let i=e.firstChild,c=(e.textContent??"").replace("","").length;if(i&&t<=c)return[i,t+(i.textContent?.startsWith("")?1:0)];t-=c}else if(e instanceof HTMLElement&&(e.dataset.inlineSkill!==void 0||e.dataset.inlineCommand!==void 0)){let i=(e.dataset.inlineSkill??e.dataset.inlineCommand).length;if(t<i)return[o,l];t-=i}else if(e instanceof HTMLElement&&e.dataset.inlineApp!==void 0){if(t===0)return[o,l];t--}else if(e instanceof HTMLElement&&e.tagName==="BR")return[o,l];return[o,o.childNodes.length]},s=document.createRange();s.setStart(...r(d.start)),s.setEnd(...r(d.end));let a=window.getSelection();a?.removeAllRanges(),a?.addRange(s)}
|
|
5
|
+
export{pr,fo,mr,ho};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{A}from"./chunk-1pnbntv2.js";import{s}from"./chunk-af0e5epn.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function Vs({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return A(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
|
|
2
|
+
export{Vs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ve}from"./chunk-rayhzb8p.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function Gn({host:o,client:n,children:t}){let s=a(()=>({host:o,client:n}),[o,n]);return r(Ve,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function b(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
|
|
2
|
+
export{Gn,e,b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function $r({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
|
|
2
|
+
export{$r};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Wn}from"./chunk-z5n4zqeg.js";import{xe}from"./chunk-8tnx3p86.js";import{is}from"./chunk-zwpv75f4.js";import{C,Ht}from"./chunk-c4mm4fzg.js";import{t}from"./chunk-rayhzb8p.js";import{xs,bs}from"./chunk-djqexpgf.js";import{L}from"./chunk-3915ad7f.js";import{ye}from"./chunk-fy8dmpv3.js";import{isEmbeddedResource as g,isImage as x,isResourceLink as R,isText as h}from"@nyssance/codex-acp-v2/client";import{memo as v}from"react";import{jsx as i,jsxs as y}from"react/jsx-runtime";var os=v(function({item:n,messageTime:f,skillNames:u=[]}){let p=t(),r=bs(n._meta),m=r?r.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
|
+
${e.text}`).join(`
|
|
3
|
+
`):ye(n),l=n.content.filter(x),d=new Set(Ht(m).map((e)=>e.id)),o=new Map,a=n.content.filter((e)=>{if(R(e)){let s=C(e.uri);if(s!==null){if(!d.has(s))o.set(s,{id:s,name:e.title??e.name});return!1}return!0}return g(e)}),c=r??n.content.filter(h).map((e)=>{let s=xs(e._meta);return s?{question:s.question,text:s.answer}:{text:e.text}});if(m.length===0&&l.length===0&&a.length===0&&o.size===0)return null;return y("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":n.id,children:[a.length>0&&i("div",{className:"codex-user-mentions",children:a.map((e,s)=>i(L,{block:e},`${n.id}:${s}`))}),i(Wn,{value:{names:u,icon:p.skillIcon},children:i(is,{host:p,message:n,text:m,textParts:c.some((e)=>("question"in e))?c:void 0,applicationReferences:o.size>0?i("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:[...o.values()].map((e)=>i(xe,{app:e},e.id))}):void 0,images:l,mentions:[],messageTime:f})})]})});
|
|
4
|
+
export{os};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{he}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{he}from"./chunk-a0qy1r02.js";import{H,rr}from"./chunk-93bqj8az.js";import{t}from"./chunk-rayhzb8p.js";import{cn as d}from"cn";import{SquareIcon as b}from"lucide-react";import{Kbd as f}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as h,TooltipContent as I,TooltipTrigger as T}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as o,jsxs as n,Fragment as P}from"react/jsx-runtime";var v=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Di({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=he(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(P,{children:[a&&o(H,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(b,{className:"size-3 fill-current"})}),o("div",{className:d(l&&"cursor-not-allowed"),children:n(h,{children:[o(T,{render:o(rr,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(I,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(f,{className:"shrink-0",children:v?"↩":"Enter"})]})]})})]})}
|
|
2
|
+
export{Di};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{be}from"./chunk-x4bzkzbt.js";function C(e){return/^app:\/\/([^/?#\s)]+)$/.exec(e)?.[1]??null}function Ht(e){if(!e.includes("app://"))return[];let n=be(),r=new Map;return n.walkTokens(n.lexer(e),(i)=>{if(i.type!=="link")return;let p=i,t=C(p.href);if(t!==null)r.set(t,{id:t,name:p.text.replace(/^\$/,"")})}),[...r.values()]}function Ia(e){return[...new Map(e.map((n)=>[n.id,n])).values()].map((n)=>`[$${n.name.replace(/[\\`*_[\]<>]/g,"\\$&")}](app://${n.id})`).join(" ")}function ps(e,n){return[Ia(n),e.trim()].filter(Boolean).join(" ")}function ms(e,n){let r=Ia(n);if(!r)return e;if(e===r)return"";return e.startsWith(`${r} `)?e.slice(r.length+1):e}
|
|
2
|
+
export{C,Ht,Ia,ps,ms};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c,
|
|
2
|
-
`),T=!t.streaming&&C.trim().length>0?o(
|
|
3
|
-
export{
|
|
1
|
+
import{c,F}from"./chunk-06mvwewp.js";import{oe}from"./chunk-nf7q3crw.js";import{_r}from"./chunk-xg6ayxsy.js";import{ve}from"./chunk-15m908ph.js";import{Ar,Et}from"./chunk-016v1nnv.js";import{Tr}from"./chunk-3a8qwbgh.js";import{Bo}from"./chunk-zwpv75f4.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(F,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ve,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function rl({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
|
|
2
|
+
`),T=!t.streaming&&C.trim().length>0?o(Io,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=_r(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&oe(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(Et,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Po,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(Tr,{blocks:f}):y(f))})}function Io({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Bo,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Po({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(Ar,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
|
|
3
|
+
export{rl,Io,Po};
|
|
@@ -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 qo(e,n){return JSON.stringify(["request_user_input_async",e,n])}function gs(e){return{selected:e.options?.length?0:null,text:""}}function Kn(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function fs(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 Ko(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 hs({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,qo,gs,Kn,fs,Ko,hs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ne}from"./chunk-d9q9qgm1.js";function oi(r){let s=Ne(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function Me(r){return oi(r).join(Ne()?"":"+")}
|
|
2
|
+
export{oi,Me};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{c}from"./chunk-06mvwewp.js";import{Xr}from"./chunk-rsbced6k.js";import{le}from"./chunk-rayhzb8p.js";import{T}from"./chunk-fpsn6fmf.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as v}from"react";import{jsx as r,jsxs as f}from"react/jsx-runtime";function it(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function E(e){let s=[];for(let[n,l]of e.content.entries()){if(!b(l))continue;let i=l.content;if(N(i))s.push({key:`${e.id}:${n}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(w(i))s.push({key:`${e.id}:${n}`,path:i.uri,alt:i.name})}if(s.length)return s;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function U({images:e}){let{loadImage:s,openImageGallery:a,openImage:n,t:l}=c(),i=le(),[g,y]=v({}),[x,I]=v(0),h=JSON.stringify(e);B(()=>{let t=!0,m=JSON.parse(h);y({});for(let o of m)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&s?s(Xr(o.path,i)):Promise.reject(Error("Image loading is unavailable"))).then((u)=>{if(t)y((p)=>({...p,[o.key]:{src:u}}))},()=>{if(t)y((u)=>({...u,[o.key]:{error:!0}}))});return()=>{t=!1}},[h,s,i,x]);let k=e.flatMap((t)=>{let m=g[t.key];return m&&"src"in m?[{src:m.src,alt:t.alt}]:[]});return r("div",{className:"codex-image-thumbnails",children:e.map((t,m)=>{let o=g[t.key];if(!o)return r("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:r(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return r("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>I((d)=>d+1),children:r(R,{"aria-hidden":"true"})},t.key);return r("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let d=e.slice(0,m).filter((u)=>{let p=g[u.key];return p&&"src"in p}).length;if(a)a(k,d);else n?.(o.src)},children:r("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function Rr({blocks:e}){let{t:s}=c(),a=e.flatMap(E),[n,l]=T(`image-view:${e[0].id}`,!1);return f("div",{className:"codex-activity-item",children:[f("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":n,onClick:()=>l((i)=>!i),children:[f("span",{className:"codex-activity-label",children:[r(S,{className:"codex-activity-icon","aria-hidden":"true"}),r("span",{className:"codex-activity-leading",children:s("stream.codex.viewedImages",{count:a.length})})]}),r(C,{className:n?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),n&&r(U,{images:a})]})}
|
|
2
|
+
export{it,Rr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{n}from"./chunk-rayhzb8p.js";import{Nt}from"./chunk-9qqxdv6f.js";import{e,b}from"./chunk-b89bzpce.js";import{to}from"./chunk-yx3eqj75.js";import{Loader2Icon as v}from"lucide-react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as c,EmptyDescription as l,EmptyHeader as d,EmptyTitle as f}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as o,jsxs as i}from"react/jsx-runtime";function cn({session:t,timeline:s}){let{host:m,client:a}=e(),{t:r}=m,u=n((h)=>h.historyPages[t.id]?.cursor!=null),y=to(t,s?.turnWork),E=()=>b(m,a.open(t.id,t.cwd)),p=o(Nt,{...s,session:t,client:a,host:m,turnWork:y});if(t.restoring)return t.items.length===0?i("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[o(v,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return i(c,{className:"flex-1",children:[i(d,{children:[o(f,{children:r("conversation.reopen")}),o(l,{children:r("conversation.detached")})]}),o(x,{onClick:E,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!u)return o(c,{className:"flex-1",children:i(d,{children:[o(f,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),o(l,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{cn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{En}from"./chunk-f84mdhkx.js";import{Vi,ne}from"./chunk-5hjk7xnq.js";import{Gi}from"./chunk-11kv54bx.js";function Ui(l,p){return En({...Vi,parse(s){let e=s;if(!e||typeof e!=="object"||Array.isArray(e)||typeof e.prompt!=="string"||!e.prompt.trim()||Object.keys(e).some((n)=>n!=="prompt"&&n!=="references")||e.references!==void 0&&(!Array.isArray(e.references)||e.references.some((n)=>typeof n!=="string")))throw Error("Invalid image instructions or references");return{prompt:e.prompt,references:e.references}},async execute(s,{sessionId:e,toolCallId:n,signal:a,agent:d}){let t=p(e);if(!t)throw Error("Image request is no longer active");let g=s.references,c=(g??[...t.references.keys()].filter((r)=>r.startsWith("attachment:"))).map((r)=>{let i=t.references.get(r);if(!i)throw Error(`Unknown image reference: ${r}`);return i}),o=ne(t.selection);if(c.length>o.maxReferences)throw Error(`This model supports ${o.maxReferences} references`);let f=Gi(s.prompt,t.aspect),m=o.provider==="chatgpt"?await d.request("_codex/images/generate",{prompt:f,images:c},{cancellationSignal:a}):await l.generateExternal(t.selection,f,c,a);if(a.throwIfAborted(),p(e)!==t)throw Error("Image request was cancelled or replaced");return m.images.forEach((r,i)=>t.references.set(`${String(n)}:${i+1}`,`data:${r.mimeType};base64,${r.data}`)),{content:[{type:"text",text:JSON.stringify({kind:"alwith.image",version:1,model:o.id,size:t.selection.size,displayed:!0,message:"The application already displays these images and provides downloads. Finish with the returned image reference; do not regenerate, echo image data or write files to deliver this result.",references:g??[],images:m.images.map((r,i)=>({reference:`${String(n)}:${i+1}`}))})},...m.images.map((r)=>({type:"image",...r}))]}}})}
|
|
2
|
+
export{Ui};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Yi}from"./chunk-rfkgks0a.js";import{e,b}from"./chunk-b89bzpce.js";import{Y,y}from"./chunk-rkqptd9w.js";import{createLucideIcon as v,HandIcon as k,ShieldAlertIcon as w,ShieldCheckIcon as a}from"lucide-react";import{memo as S}from"react";import{jsx as t}from"react/jsx-runtime";var O=v("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),d={"read-only":k,"workspace-write":a,agent:O,"agent-full-access":w},A={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function N({sessionId:u,options:m,disabled:g,onConfigChange:c}){let{host:l,client:f}=e(),{t:r}=l,s=y(m,"mode");if(!s)return null;let o=s.currentValue,p=Y(s).map((n)=>{let i=A[n.value];return i?{...n,name:r(`permissionModes.${i}.name`),description:r(`permissionModes.${i}.description`)}:n}),h=p.find((n)=>n.value===o),M=d[o]??a,I=(n)=>{if(n===o)return;b(l,c?c(s.configId,n):f.setConfig(u,s.configId,n))};return t(Yi,{value:o,warning:o==="agent-full-access",currentName:h?.name??o,icon:t(M,{className:"size-3.5 shrink-0"}),header:r("permissionModes.heading"),disabled:g,label:r("composer.switchPermissionMode"),onValueChange:I,options:p.map((n)=>{let i=d[n.value]??a,C=n.value==="agent-full-access";return{value:n.value,label:t("span",{"data-permission-warning":C?"":void 0,children:n.name}),description:n.description?t("span",{className:"whitespace-normal",children:n.description}):void 0,icon:t(i,{className:"size-3.5 shrink-0"})}})})}var kn=S(N);
|
|
2
|
+
export{kn};
|
|
@@ -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 mo(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 kt(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=mo(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{mo,kt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function xs(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function bs(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
|
|
2
|
+
export{xs,bs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-af0e5epn.js";import{Te,J,ue}from"./chunk-5jvpeww3.js";import{useEffect as S,useMemo as f}from"react";function Ts(s){let c=J((i)=>i.activityOrder),a=o((i)=>{let n=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&Te(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(n)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=J((i)=>i.activitySeen),r=ue();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,n])=>u.get(i)!==n)}
|
|
2
|
+
export{Ts};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var r=new Map,p=new Map,c=new Map;function
|
|
1
|
+
var r=new Map,p=new Map,c=new Map;function Ri(e,t){if(p.has(e))throw Error("An attachment writer is already registered for this session");return p.set(e,t),()=>{if(p.get(e)===t)p.delete(e)}}function X(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),p.get(e)?.(n)}function hn(e,t){c.set(e,t),t.finally(()=>{if(c.get(e)===t)c.delete(e)})}async function ma(e){for(;;){let n=r.get(e)?.attachments.flatMap((i)=>{let m=c.get(i.id);return m?[m]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let i=await fetch(n.url);if(!i.ok)throw Error("Cannot read draft image");let m=await i.blob(),f=await new Promise((l,g)=>{let s=new FileReader;s.onload=()=>l(s.result),s.onerror=()=>g(s.error),s.readAsDataURL(m)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function ga(e,t){if(t===null)r.delete(e);else r.set(e,t)}var a=new Map;function vn(e,t){if(a.has(e))throw Error("A composer is already registered for this session");return a.set(e,t),()=>{if(a.get(e)===t)a.delete(e)}}function fa(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=a.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}function ha(e,t){if(typeof t!=="string"||!t.trim())throw Error("The context is empty");let o=a.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e),i=n?.text?`${n.text}
|
|
2
2
|
|
|
3
3
|
${t}`:t;o(i,"append"),r.set(e,n?{...n,text:i}:{text:i,attachments:[],mentions:[],modelId:null})}
|
|
4
|
-
export{r,
|
|
4
|
+
export{r,Ri,X,hn,ma,ga,vn,fa,ha};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var
|
|
2
|
-
export{
|
|
1
|
+
import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var pt="group/trailing";function Ze({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function mt({content:n,actions:e,className:r}){if(n==null&&e==null)return null;return s("span",{className:i("group/swap relative flex min-h-5 min-w-5 shrink-0 items-center justify-end",r),children:[n!=null&&t("span",{className:i("flex items-center justify-end",e!=null&&"group-focus-within/trailing:hidden group-hover/trailing:hidden group-has-[[data-popup-open]]/swap:hidden"),children:n}),e!=null&&t("span",{className:"absolute inset-y-0 end-0 hidden w-max items-center justify-end gap-0.5 group-focus-within/trailing:flex group-hover/trailing:flex has-[[data-popup-open]]:flex",onClick:(a)=>a.stopPropagation(),onKeyDown:(a)=>a.stopPropagation(),children:e})]})}
|
|
2
|
+
export{pt,Ze,mt};
|