@alwith/module-chat 0.6.24 → 0.6.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -34
- package/dist/activity-host.js +1 -1
- package/dist/agent/client.d.ts +25 -9
- 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.d.ts +27 -13
- 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-n0q8e6sq.js → chunk-0bv3tw1m.js} +2 -2
- package/dist/{chunk-qvw0kyse.js → chunk-0e5dx357.js} +2 -2
- package/dist/{chunk-6cjjwry2.js → chunk-0enb3f4n.js} +2 -2
- package/dist/{chunk-t3m57q06.js → chunk-0jg7hgp5.js} +2 -2
- package/dist/{chunk-m6080rsp.js → chunk-0m4s668v.js} +2 -2
- package/dist/{chunk-7a70nd7e.js → chunk-16dyzkha.js} +2 -2
- package/dist/{chunk-g751pxzk.js → chunk-18kdsdmy.js} +2 -2
- package/dist/{chunk-ck2ax5f6.js → chunk-1gr60c40.js} +2 -2
- package/dist/{chunk-az3g3a94.js → chunk-1wr1ef9x.js} +2 -2
- package/dist/chunk-24y0mvqf.js +2 -0
- package/dist/chunk-2bbdgf43.js +2 -0
- package/dist/chunk-2f8s5gtn.js +2 -0
- package/dist/{chunk-znagg8v9.js → chunk-2yvj9k42.js} +2 -2
- package/dist/{chunk-7wpcdwan.js → chunk-30nre2gw.js} +2 -2
- package/dist/chunk-317w17va.js +2 -0
- package/dist/{chunk-mtn6vdf8.js → chunk-3hsft68c.js} +2 -2
- package/dist/{chunk-rqa21qrv.js → chunk-3nawfa7b.js} +2 -2
- package/dist/{chunk-dxsjz3re.js → chunk-3q8vw3wb.js} +2 -2
- package/dist/{chunk-a6ysp1fp.js → chunk-3qedn07q.js} +2 -2
- package/dist/{chunk-jg4c3zg4.js → chunk-3tvq6xr2.js} +2 -2
- package/dist/{chunk-h8r785ne.js → chunk-3z86hy2s.js} +2 -2
- package/dist/{chunk-1pb43y89.js → chunk-4a4awnss.js} +2 -2
- package/dist/{chunk-jydhbkm8.js → chunk-4d9sajzj.js} +2 -2
- package/dist/{chunk-8h4e3654.js → chunk-4g1s7gdh.js} +2 -2
- package/dist/{chunk-v581r9vt.js → chunk-4sfxcw58.js} +3 -3
- package/dist/{chunk-542c9tpr.js → chunk-4vayk46h.js} +2 -2
- package/dist/chunk-51xk5tw2.js +2 -0
- package/dist/{chunk-ymgc4317.js → chunk-52wrk1mh.js} +2 -2
- package/dist/chunk-53r6pr16.js +2 -0
- package/dist/{chunk-s05ftq29.js → chunk-55m88zbv.js} +2 -2
- package/dist/{chunk-79ayc6qy.js → chunk-5bhp61sd.js} +2 -2
- package/dist/chunk-5mjs63fv.js +2 -0
- package/dist/chunk-5x5n3b15.js +2 -0
- package/dist/{chunk-5xe89qwh.js → chunk-64apxzn7.js} +2 -2
- package/dist/{chunk-z8sheg2r.js → chunk-64cbt3ym.js} +2 -2
- package/dist/{chunk-bane0xc8.js → chunk-6e84zbgs.js} +2 -2
- package/dist/chunk-6ym1a5wa.js +2 -0
- package/dist/{chunk-7wd0kfqr.js → chunk-747qe35q.js} +2 -2
- package/dist/{chunk-11vn501z.js → chunk-75dr7tyz.js} +2 -2
- package/dist/{chunk-73541c5k.js → chunk-7ng6qs9c.js} +2 -2
- package/dist/{chunk-1e83qr49.js → chunk-7rtwekkz.js} +2 -2
- package/dist/{chunk-mfn37eme.js → chunk-7s7cevjh.js} +2 -2
- package/dist/{chunk-r7paw6ba.js → chunk-7tw7rn0m.js} +2 -2
- package/dist/chunk-7zww33h8.js +2 -0
- package/dist/chunk-81838qem.js +2 -0
- package/dist/chunk-84ncszbf.js +2 -0
- package/dist/{chunk-gec6q1jb.js → chunk-84p483n0.js} +2 -2
- package/dist/{chunk-kk9dbwd1.js → chunk-84zzf0ys.js} +2 -2
- package/dist/{chunk-8ew2e3y7.js → chunk-88ysxbdh.js} +2 -2
- package/dist/chunk-8gt8yn8k.js +4 -0
- package/dist/{chunk-zm6b6zyr.js → chunk-8wk3e4z7.js} +2 -2
- package/dist/chunk-94m77zyn.js +2 -0
- package/dist/{chunk-vx6shb4g.js → chunk-95ywdfe0.js} +2 -2
- package/dist/chunk-9nbkggqn.js +2 -0
- package/dist/chunk-9neb2f30.js +2 -0
- package/dist/chunk-9wc4emwt.js +2 -0
- package/dist/chunk-a11wvd8e.js +2 -0
- package/dist/chunk-acf4sdp7.js +2 -0
- package/dist/{chunk-0ne2mz2q.js → chunk-ag2t01q7.js} +3 -3
- package/dist/chunk-aht6f6tf.js +2 -0
- package/dist/chunk-amf0m4tb.js +2 -0
- package/dist/chunk-ax7c2kam.js +2 -0
- package/dist/{chunk-zwyd2bhy.js → chunk-axvjn527.js} +2 -2
- package/dist/{chunk-mc40zb3c.js → chunk-b2n5sj31.js} +2 -2
- package/dist/chunk-bapn03er.js +2 -0
- package/dist/{chunk-jw1c8r97.js → chunk-bbrx6m7n.js} +2 -2
- package/dist/{chunk-x621s275.js → chunk-bf7sgpzq.js} +2 -2
- package/dist/{chunk-81hv0s07.js → chunk-bgnxw313.js} +2 -2
- package/dist/{chunk-rff6c87z.js → chunk-brv52tgj.js} +2 -2
- package/dist/chunk-bztkz3dz.js +2 -0
- package/dist/{chunk-6tvq472s.js → chunk-bzzx1y15.js} +2 -2
- package/dist/{chunk-wf7kfk3p.js → chunk-c13rnm7b.js} +2 -2
- package/dist/{chunk-dypeezvv.js → chunk-c22xq7a3.js} +3 -3
- package/dist/{chunk-4fmn1kk4.js → chunk-c7qzvt21.js} +3 -3
- package/dist/chunk-cans04tz.js +3 -0
- package/dist/{chunk-geh3wyxw.js → chunk-cgnzqmqd.js} +2 -2
- package/dist/chunk-chn1mkv0.js +2 -0
- package/dist/{chunk-qdyyvd2w.js → chunk-cp4wxmh5.js} +2 -2
- package/dist/chunk-cv0qbty5.js +3 -0
- package/dist/{chunk-zzqbe5r0.js → chunk-d582db8v.js} +2 -2
- package/dist/{chunk-2cc8d35c.js → chunk-d71nz1je.js} +2 -2
- package/dist/{chunk-5pmr5dby.js → chunk-dd9k5bbt.js} +2 -2
- package/dist/{chunk-ffs5nkt0.js → chunk-dheg4bs2.js} +2 -2
- package/dist/{chunk-tknyjndw.js → chunk-dx5hh359.js} +3 -3
- package/dist/{chunk-zz582m73.js → chunk-dxwbgg69.js} +2 -2
- package/dist/{chunk-gak8579e.js → chunk-e00dz09f.js} +2 -2
- package/dist/chunk-e1fzfaqj.js +2 -0
- package/dist/{chunk-x4enakra.js → chunk-e3nccytb.js} +1 -1
- package/dist/{chunk-qxssxzws.js → chunk-e9nvbe3j.js} +2 -2
- package/dist/{chunk-mgmv8kap.js → chunk-ermc9p1p.js} +2 -2
- package/dist/{chunk-xadfbbwt.js → chunk-erp1g3as.js} +2 -2
- package/dist/{chunk-nh56sb8e.js → chunk-etvdqkvb.js} +2 -2
- package/dist/{chunk-zsrjzx7g.js → chunk-exrd2xzz.js} +2 -2
- package/dist/{chunk-mbsmb8jn.js → chunk-eynwjzqp.js} +2 -2
- package/dist/chunk-fnm2xznx.js +2 -0
- package/dist/{chunk-rb4p3h5b.js → chunk-ftsnryz8.js} +2 -2
- package/dist/{chunk-4ntxjy8v.js → chunk-fwb6tf7m.js} +2 -2
- package/dist/{chunk-0xshzqb6.js → chunk-fwghjmd1.js} +2 -2
- package/dist/chunk-g1tbd3pd.js +2 -0
- package/dist/{chunk-5kje89r8.js → chunk-g3y0r56h.js} +2 -2
- package/dist/{chunk-ym6jphs4.js → chunk-gbsn1qep.js} +3 -3
- package/dist/{chunk-5d138vq3.js → chunk-gdtpwbqn.js} +1 -1
- package/dist/{chunk-wsyfhh7y.js → chunk-gjtxked2.js} +2 -2
- package/dist/{chunk-js3nhatr.js → chunk-gpv1dc5y.js} +2 -2
- package/dist/{chunk-d5gt1x0n.js → chunk-grfrfh7s.js} +2 -2
- package/dist/chunk-h1kvdf3t.js +2 -0
- package/dist/{chunk-mdercwm8.js → chunk-h3mwzf3d.js} +3 -3
- package/dist/{chunk-4h9ee02f.js → chunk-h5mdgrq6.js} +2 -2
- package/dist/{chunk-bdrcreqs.js → chunk-ha9n1k24.js} +2 -2
- package/dist/chunk-hd11bfmp.js +2 -0
- package/dist/{chunk-tyka859b.js → chunk-hf5bpahd.js} +2 -2
- package/dist/{chunk-wyxa2tfm.js → chunk-j2ffde9c.js} +5 -5
- package/dist/{chunk-fe83mqnb.js → chunk-j4w2hbbe.js} +2 -2
- package/dist/chunk-j62heyzq.js +2 -0
- package/dist/{chunk-h0k80cxs.js → chunk-j8zpjnf8.js} +2 -2
- package/dist/{chunk-q7ka46hb.js → chunk-jdwd4ta9.js} +3 -3
- package/dist/{chunk-ww3f6z4x.js → chunk-je27hf3t.js} +3 -3
- package/dist/{chunk-q01vmp9m.js → chunk-jgqt7k0h.js} +2 -2
- package/dist/{chunk-csbv8m51.js → chunk-jmc7ddz8.js} +3 -3
- package/dist/{chunk-jcyv1q0x.js → chunk-jp4xjks0.js} +2 -2
- package/dist/{chunk-nypr6qtz.js → chunk-jvy6p83k.js} +3 -3
- package/dist/chunk-k2nbrerw.js +2 -0
- package/dist/{chunk-kj3a1k2q.js → chunk-k5nd3vyq.js} +2 -2
- package/dist/chunk-knrc6kks.js +2 -0
- package/dist/chunk-kqwfwck2.js +2 -0
- package/dist/{chunk-vsh9vh4s.js → chunk-m2n6sxf8.js} +2 -2
- package/dist/{chunk-3z5zyra7.js → chunk-m68t534g.js} +2 -2
- package/dist/{chunk-w4bye56s.js → chunk-ma6ycen5.js} +2 -2
- package/dist/{chunk-hcat58sr.js → chunk-masqfje4.js} +2 -2
- package/dist/chunk-mckz9qv5.js +2 -0
- package/dist/{chunk-79pvfyd0.js → chunk-mfmh7ztq.js} +2 -2
- package/dist/{chunk-d6ke5e80.js → chunk-n4wp3h3j.js} +2 -2
- package/dist/{chunk-6r5nzsw8.js → chunk-ncgwbdmj.js} +2 -2
- package/dist/{chunk-8v53bkyr.js → chunk-ne4b53kn.js} +2 -2
- package/dist/chunk-njqan8zg.js +2 -0
- package/dist/{chunk-heqa4swe.js → chunk-nqt9gyz9.js} +2 -2
- package/dist/{chunk-sjqhtpzr.js → chunk-nrpgmawz.js} +2 -2
- package/dist/{chunk-m9ttf96p.js → chunk-p3gawvqr.js} +2 -2
- package/dist/{chunk-et2pdaz7.js → chunk-p96vgnxw.js} +2 -2
- package/dist/{chunk-84eye2j0.js → chunk-pebkk426.js} +2 -2
- package/dist/chunk-pg9gckmw.js +2 -0
- package/dist/{chunk-e04g26qm.js → chunk-pqz2471h.js} +2 -2
- package/dist/chunk-ps408sxd.js +2 -0
- package/dist/{chunk-j3g21ext.js → chunk-pxr5snwm.js} +2 -2
- package/dist/{chunk-2fx3qhyb.js → chunk-q3s59jyn.js} +2 -2
- package/dist/{chunk-w2xjhfm2.js → chunk-qa9p0a64.js} +3 -3
- package/dist/{chunk-7v7wc7k5.js → chunk-qceex4vv.js} +2 -2
- package/dist/chunk-qkn0y5wx.js +2 -0
- package/dist/{chunk-76smt4zv.js → chunk-qzerhkyb.js} +3 -3
- package/dist/chunk-qzn6qtmy.js +2 -0
- package/dist/{chunk-q4nx04sy.js → chunk-r5f77gtx.js} +2 -2
- package/dist/{chunk-rzxnxj25.js → chunk-rkwq0grt.js} +2 -2
- package/dist/{chunk-qghq84r4.js → chunk-rn54592t.js} +2 -2
- package/dist/chunk-rv3k0kfr.js +2 -0
- package/dist/chunk-s1nfyggb.js +2 -0
- package/dist/chunk-s8cj6aw6.js +2 -0
- package/dist/{chunk-76c0cx40.js → chunk-sjm9p42x.js} +2 -2
- package/dist/chunk-stv8pr4v.js +2 -0
- package/dist/{chunk-m8tt5bf9.js → chunk-swqbbw8q.js} +2 -2
- package/dist/{chunk-stc4ctrx.js → chunk-syjt7y4v.js} +2 -2
- package/dist/chunk-t9t53gsj.js +3 -0
- package/dist/{chunk-xk0dt0es.js → chunk-tgnftxyb.js} +2 -2
- package/dist/{chunk-nhstvqjy.js → chunk-tr0bmqn9.js} +2 -2
- package/dist/{chunk-t686zwxk.js → chunk-v0wmy9b3.js} +2 -2
- package/dist/{chunk-vkj5fznh.js → chunk-v2pa8yak.js} +3 -3
- package/dist/{chunk-tctdn4kk.js → chunk-v32jvbgx.js} +2 -2
- package/dist/{chunk-6vdayg6w.js → chunk-v96vkrw2.js} +2 -2
- package/dist/{chunk-qv23mh24.js → chunk-v9weanq6.js} +2 -2
- package/dist/chunk-vd6eqshg.js +2 -0
- package/dist/{chunk-9ts08sma.js → chunk-vdt7cp6c.js} +2 -2
- package/dist/{chunk-wz6765xb.js → chunk-vev9q4t4.js} +3 -3
- package/dist/{chunk-whzs7yxf.js → chunk-vmfhnkxj.js} +2 -2
- package/dist/{chunk-7s3f142h.js → chunk-vqby71fp.js} +2 -2
- package/dist/chunk-vzgn8exd.js +2 -0
- package/dist/{chunk-e5m9kg1w.js → chunk-w562jf57.js} +2 -2
- package/dist/chunk-w5q2ygsa.js +2 -0
- package/dist/{chunk-bcnh0z8e.js → chunk-w5zvy4ex.js} +2 -2
- package/dist/{chunk-50eym2q3.js → chunk-wde0m4pf.js} +3 -3
- package/dist/{chunk-xdcp8tj9.js → chunk-why9g2kd.js} +2 -2
- package/dist/{chunk-whb8ttdy.js → chunk-wpacvdsv.js} +2 -2
- package/dist/{chunk-kbfe7gqw.js → chunk-x49qjrbk.js} +2 -2
- package/dist/{chunk-4r0ffb0s.js → chunk-xe7ep70k.js} +2 -2
- package/dist/{chunk-8mzbkjhk.js → chunk-xnbvdqnt.js} +2 -2
- package/dist/{chunk-e641842r.js → chunk-xqb4thy8.js} +2 -2
- package/dist/{chunk-2sc2z6g5.js → chunk-xwwjj45a.js} +2 -2
- package/dist/{chunk-2qs1ss40.js → chunk-y3mx5sf0.js} +2 -2
- package/dist/chunk-y4tj08c1.js +2 -0
- package/dist/chunk-y8gz9rsc.js +2 -0
- package/dist/{chunk-bfb8bpwc.js → chunk-y8yawx3d.js} +2 -2
- package/dist/{chunk-3a5sn0v8.js → chunk-ypdh88cj.js} +2 -2
- package/dist/{chunk-pnh5t6pc.js → chunk-yryg27yy.js} +2 -2
- package/dist/{chunk-1rwkdezk.js → chunk-z6dx6dnt.js} +2 -2
- package/dist/{chunk-859359n0.js → chunk-z6x70w62.js} +2 -2
- package/dist/chunk-zft4afb8.js +2 -0
- package/dist/chunk-zm0j9nw3.js +2 -0
- package/dist/{chunk-vbbndjfd.js → chunk-zv3bm3np.js} +2 -2
- package/dist/{chunk-3zae491f.js → chunk-zw4ehzza.js} +3 -3
- package/dist/{chunk-wwj743gm.js → chunk-zyn0ys4m.js} +2 -2
- package/dist/{chunk-6w8p1hwb.js → chunk-zypgrbd9.js} +2 -2
- package/dist/chunk-zzz6kmh8.js +2 -0
- package/dist/client.d.ts +2 -3
- package/dist/client.js +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/artifact-links.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/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.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.js +1 -1
- package/dist/desktop/desktop-composer.js +1 -1
- package/dist/desktop/desktop.js +1 -1
- package/dist/desktop/draft-model-select.js +1 -1
- package/dist/desktop/load-image.js +1 -1
- package/dist/desktop/model-catalog.js +1 -1
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.d.ts +20 -21
- 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-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/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/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/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.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 +4 -3
- package/dist/agent/application-client.d.ts +0 -30
- package/dist/agent/application-client.js +0 -1
- package/dist/chunk-0myf2ak0.js +0 -2
- package/dist/chunk-1smyy9mt.js +0 -2
- package/dist/chunk-2q1xxs3t.js +0 -2
- package/dist/chunk-36ttr22w.js +0 -2
- package/dist/chunk-3mm1d99e.js +0 -2
- package/dist/chunk-3qwtda21.js +0 -3
- package/dist/chunk-4gxpna3p.js +0 -2
- package/dist/chunk-5ryfm4ka.js +0 -4
- package/dist/chunk-7cab9zy0.js +0 -2
- package/dist/chunk-7xvrsw7x.js +0 -2
- package/dist/chunk-9hjfc08t.js +0 -2
- package/dist/chunk-a8r3mggj.js +0 -2
- package/dist/chunk-a9grdyep.js +0 -3
- package/dist/chunk-ayt0bzr9.js +0 -2
- package/dist/chunk-b42vv8f2.js +0 -2
- package/dist/chunk-b61qhh61.js +0 -2
- package/dist/chunk-bgav9cq2.js +0 -2
- package/dist/chunk-bh0h7fz7.js +0 -2
- package/dist/chunk-bshgrwe9.js +0 -2
- package/dist/chunk-bsnmj69j.js +0 -2
- package/dist/chunk-capkej8s.js +0 -2
- package/dist/chunk-cer4dxas.js +0 -2
- package/dist/chunk-cq7bbgcg.js +0 -2
- package/dist/chunk-d29xbf16.js +0 -2
- package/dist/chunk-dp1nnwk2.js +0 -2
- package/dist/chunk-dpfjxym1.js +0 -2
- package/dist/chunk-eqbp85f3.js +0 -2
- package/dist/chunk-f9z37ptq.js +0 -2
- package/dist/chunk-fn68kh69.js +0 -2
- package/dist/chunk-gkyvgjyx.js +0 -2
- package/dist/chunk-gpcsb4tg.js +0 -3
- package/dist/chunk-j2cdjycf.js +0 -2
- package/dist/chunk-jjgwfpmp.js +0 -2
- package/dist/chunk-mcrd86tx.js +0 -2
- package/dist/chunk-n9jaz2pd.js +0 -2
- package/dist/chunk-nbaxn7jx.js +0 -2
- package/dist/chunk-nvgnan7w.js +0 -2
- package/dist/chunk-p1tcxky2.js +0 -2
- package/dist/chunk-p811gdar.js +0 -2
- package/dist/chunk-p8cm3xw1.js +0 -2
- package/dist/chunk-pr36m3qx.js +0 -2
- package/dist/chunk-q73jne25.js +0 -2
- package/dist/chunk-qm2jq2bq.js +0 -2
- package/dist/chunk-qwet39v5.js +0 -2
- package/dist/chunk-r3hsjwjn.js +0 -2
- package/dist/chunk-rg8kj085.js +0 -2
- package/dist/chunk-s2k0g1hc.js +0 -2
- package/dist/chunk-s3j71dbh.js +0 -2
- package/dist/chunk-sdv06e2k.js +0 -2
- package/dist/chunk-sgbn37kz.js +0 -2
- package/dist/chunk-tfj6v7y4.js +0 -2
- package/dist/chunk-tsdb5jnj.js +0 -2
- package/dist/chunk-v3dq3hx2.js +0 -2
- package/dist/chunk-xk306vq1.js +0 -2
- package/dist/chunk-ymk7ampx.js +0 -2
- package/dist/chunk-zpqj0ka8.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var I={ar:{untitled:"دردشة جديدة",signOut:"تسجيل الخروج",help:"مساعدة",language:"اللغة",foreground:"المقدمة",background:"الخلفية",chats:"الدردشات",activity:"نشاط",quickChats:"دردشات سريعة",retry:"إعادة المحاولة",stop:"إيقاف",rename:"إعادة تسمية",fork:"إنشاء فرع",archive:"أرشفة",unarchive:"استعادة",delete:"حذف",deleteTitle:"حذف هذه الدردشة؟",deleteDescription:"ستُحذف هذه الدردشة نهائيًا. لا يمكن التراجع عن هذا الإجراء.",cancel:"إلغاء",archived:"مؤرشفة",filter:"تصفية",collapseAllGroups:"طي كل المجموعات",openLeading:"فتح الشاشة -1",backToMain:"العودة إلى الشاشة الرئيسية"},de:{untitled:"Neuer Chat",signOut:"Abmelden",help:"Hilfe",language:"Sprache",foreground:"Vordergrund",background:"Hintergrund",chats:"Chats",activity:"Aktivität",quickChats:"Schnelle Chats",retry:"Wiederholen",stop:"Stopp",rename:"Umbenennen",fork:"Verzweigen",archive:"Archivieren",unarchive:"Wiederherstellen",delete:"Löschen",deleteTitle:"Diesen Chat löschen?",deleteDescription:"Dieser Chat wird dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",archived:"Archiviert",filter:"Filtern",collapseAllGroups:"Alle Gruppen einklappen",openLeading:"Bildschirm -1 öffnen",backToMain:"Zurück zum Hauptbildschirm"},en:{states:{title:"Session status",requires_action:"Needs attention",running:"Running",done:"Unread",idle:"Idle",empty:"No sessions"},untitled:"New chat",signOut:"Sign out",help:"Help",language:"Language",foreground:"Foreground",background:"Background",chats:"Chats",activity:"Activity",quickChats:"Quick chats",showAll:"Show all",retry:"Retry",stop:"Stop",rename:"Rename",fork:"Fork",archive:"Archive",unarchive:"Restore",delete:"Delete",deleteTitle:"Delete this chat?",deleteDescription:"This chat will be permanently deleted. This cannot be undone.",cancel:"Cancel",archived:"Archived",archives:{title:"Archived chats",deleteAll:"Delete all",search:"Search archived chats",chatType:"Chat type",allChats:"All chats",quickChats:"Quick chats",projectChats:"Project chats",project:"Project",allProjects:"All projects",noProject:"No project",count:"{{count}} chats",updatedAt:"Last updated",connecting:"Connect to Codex to view archived chats.",loading:"Loading archived chats…",retry:"Retry",empty:"No archived chats",noResults:"No matching archived chats",deleteTitle:"Delete archived chats?",deleteAllDescription:"Permanently delete these {{count}} archived chats? This cannot be undone. Deleting all includes chats hidden by the current filters.",deleteDescription:"Permanently delete this archived chat? This cannot be undone.",unarchive:"Unarchive",confirmDelete:"Delete permanently"},filter:"Filter",collapseAllGroups:"Collapse all groups",openLeading:"Open -1 screen",backToMain:"Back to main screen"},es:{untitled:"Nuevo chat",signOut:"Cerrar sesión",help:"Ayuda",language:"Idioma",foreground:"Primer plano",background:"Fondo",chats:"Chats",activity:"Actividad",quickChats:"Chats rápidos",retry:"Reintentar",stop:"Detener",rename:"Renombrar",fork:"Crear rama",archive:"Archivar",unarchive:"Restaurar",delete:"Eliminar",deleteTitle:"¿Eliminar este chat?",deleteDescription:"Este chat se eliminará permanentemente. Esta acción no se puede deshacer.",cancel:"Cancelar",archived:"Archivados",filter:"Filtrar",collapseAllGroups:"Contraer todos los grupos",openLeading:"Abrir la pantalla -1",backToMain:"Volver a la pantalla principal"},fr:{untitled:"Nouveau chat",signOut:"Se déconnecter",help:"Aide",language:"Langue",foreground:"Premier plan",background:"Arrière-plan",chats:"Discussions",activity:"Activité",quickChats:"Discussions rapides",retry:"Réessayer",stop:"Arrêter",rename:"Renommer",fork:"Créer une branche",archive:"Archiver",unarchive:"Restaurer",delete:"Supprimer",deleteTitle:"Supprimer cette discussion ?",deleteDescription:"Cette discussion sera définitivement supprimée. Cette action est irréversible.",cancel:"Annuler",archived:"Archivées",filter:"Filtrer",collapseAllGroups:"Réduire tous les groupes",openLeading:"Ouvrir l’écran -1",backToMain:"Revenir à l’écran principal"},hi:{untitled:"नई चैट",signOut:"साइन आउट",help:"सहायता",language:"भाषा",foreground:"अग्रभूमि",background:"पृष्ठभूमि",chats:"चैट",activity:"गतिविधि",quickChats:"त्वरित चैट",retry:"फिर से कोशिश करें",stop:"रोकें",rename:"नाम बदलें",fork:"शाखा बनाएँ",archive:"संग्रहित करें",unarchive:"रीस्टोर करें",delete:"हटाएं",deleteTitle:"यह चैट हटाएँ?",deleteDescription:"यह चैट स्थायी रूप से हटा दी जाएगी। इसे पूर्ववत नहीं किया जा सकता।",cancel:"रद्द करें",archived:"संग्रहीत",filter:"फ़िल्टर",collapseAllGroups:"सभी समूह संक्षिप्त करें",openLeading:"-1 स्क्रीन खोलें",backToMain:"मुख्य स्क्रीन पर लौटें"},id:{untitled:"Obrolan baru",signOut:"Keluar",help:"Bantuan",language:"Bahasa",foreground:"Depan",background:"Latar",chats:"Obrolan",activity:"Aktivitas",quickChats:"Chat cepat",retry:"Coba lagi",stop:"Hentikan",rename:"Ganti nama",fork:"Buat cabang",archive:"Arsipkan",unarchive:"Pulihkan",delete:"Hapus",deleteTitle:"Hapus obrolan ini?",deleteDescription:"Obrolan ini akan dihapus permanen. Tindakan ini tidak dapat dibatalkan.",cancel:"Batal",archived:"Diarsipkan",filter:"Filter",collapseAllGroups:"Ciutkan semua grup",openLeading:"Buka layar -1",backToMain:"Kembali ke layar utama"},it:{untitled:"Nuova chat",signOut:"Esci",help:"Aiuto",language:"Lingua",foreground:"Primo piano",background:"Sfondo",chats:"Chat",activity:"Attività",quickChats:"Chat rapide",retry:"Riprova",stop:"Interrompi",rename:"Rinomina",fork:"Crea un ramo",archive:"Archivia",unarchive:"Ripristina",delete:"Elimina",deleteTitle:"Eliminare questa chat?",deleteDescription:"Questa chat verrà eliminata definitivamente. L’azione non può essere annullata.",cancel:"Annulla",archived:"Archiviate",filter:"Filtra",collapseAllGroups:"Comprimi tutti i gruppi",openLeading:"Apri la schermata -1",backToMain:"Torna alla schermata principale"},ja:{untitled:"新しいチャット",signOut:"サインアウト",help:"ヘルプ",language:"言語",foreground:"フォアグラウンド",background:"背景",chats:"チャット",activity:"アクティビティ",quickChats:"クイックチャット",retry:"再試行",stop:"停止",rename:"名前を変更",fork:"分岐を作成",archive:"アーカイブ",unarchive:"復元",delete:"削除",deleteTitle:"このチャットを削除しますか?",deleteDescription:"このチャットは完全に削除されます。この操作は取り消せません。",cancel:"キャンセル",archived:"アーカイブ済み",filter:"フィルター",collapseAllGroups:"すべてのグループを折りたたむ",openLeading:"-1 画面を開く",backToMain:"メイン画面に戻る"},ko:{untitled:"새 채팅",signOut:"로그아웃",help:"도움말",language:"언어",foreground:"포그라운드",background:"배경",chats:"채팅",activity:"활동",quickChats:"빠른 채팅",retry:"다시 시도",stop:"중지",rename:"이름 바꾸기",fork:"분기 만들기",archive:"보관",unarchive:"복원",delete:"삭제",deleteTitle:"이 채팅을 삭제할까요?",deleteDescription:"이 채팅은 영구적으로 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",cancel:"취소",archived:"보관됨",filter:"필터",collapseAllGroups:"모든 그룹 접기",openLeading:"-1 화면 열기",backToMain:"메인 화면으로 돌아가기"},"pt-BR":{untitled:"Novo chat",signOut:"Sair",help:"Ajuda",language:"Idioma",foreground:"Primeiro plano",background:"Fundo",chats:"Chats",activity:"Atividade",quickChats:"Chats rápidos",retry:"Tentar novamente",stop:"Parar",rename:"Renomear",fork:"Criar ramificação",archive:"Arquivar",unarchive:"Restaurar",delete:"Excluir",deleteTitle:"Excluir esta conversa?",deleteDescription:"Esta conversa será excluída permanentemente. Esta ação não pode ser desfeita.",cancel:"Cancelar",archived:"Arquivadas",filter:"Filtrar",collapseAllGroups:"Recolher todos os grupos",openLeading:"Abrir a tela -1",backToMain:"Voltar à tela principal"},ru:{untitled:"Новый чат",signOut:"Выйти",help:"Справка",language:"Язык",foreground:"Передний план",background:"Фон",chats:"Чаты",activity:"Активность",quickChats:"Быстрые чаты",retry:"Повторить",stop:"Остановить",rename:"Переименовать",fork:"Создать ветку",archive:"Архивировать",unarchive:"Восстановить",delete:"Удалить",deleteTitle:"Удалить этот чат?",deleteDescription:"Этот чат будет удалён навсегда. Это действие нельзя отменить.",cancel:"Отмена",archived:"В архиве",filter:"Фильтр",collapseAllGroups:"Свернуть все группы",openLeading:"Открыть экран -1",backToMain:"На главный экран"},"zh-CN":{states:{title:"会话状态",requires_action:"待处理",running:"运行中",done:"完成未读",idle:"空闲",empty:"暂无会话"},untitled:"新聊天",signOut:"退出登录",help:"帮助",language:"语言",foreground:"前台",background:"后台",chats:"聊天",activity:"活动",quickChats:"随聊",showAll:"展开显示",retry:"重试",stop:"停止",rename:"重命名",fork:"分叉",archive:"归档",unarchive:"恢复",delete:"删除",deleteTitle:"删除这个聊天?",deleteDescription:"该聊天将被永久删除。此操作不可撤销。",cancel:"取消",archived:"已归档",archives:{title:"已归档的聊天",deleteAll:"全部删除",search:"搜索已归档的聊天",chatType:"聊天类型",allChats:"全部聊天",quickChats:"快捷聊天",projectChats:"项目聊天",project:"项目",allProjects:"所有项目",noProject:"无项目",count:"{{count}} 个聊天",updatedAt:"最后更新时间",connecting:"连接 Codex 后查看已归档的聊天。",loading:"正在加载已归档的聊天…",retry:"重试",empty:"暂无已归档的聊天",noResults:"没有符合条件的已归档聊天",deleteTitle:"删除已归档的聊天?",deleteAllDescription:"永久删除这 {{count}} 个已归档的聊天?此操作无法撤销。全部删除包含被当前筛选条件隐藏的聊天。",deleteDescription:"永久删除这个已归档的聊天?此操作无法撤销。",unarchive:"取消归档",confirmDelete:"永久删除"},filter:"筛选",collapseAllGroups:"折叠全部分组",openLeading:"进入 -1 屏",backToMain:"返回主屏"}};
|
|
2
|
+
export{I};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
async function
|
|
2
|
-
export{
|
|
1
|
+
async function lr(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
|
|
2
|
+
export{lr};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{fr}from"./chunk-tgnftxyb.js";import{Xi}from"./chunk-jvy6p83k.js";import{ms}from"./chunk-y4tj08c1.js";import{m,_,_t}from"./chunk-75dr7tyz.js";import{Ve}from"./chunk-s1nfyggb.js";import{tr,nr,or,ir,rr}from"./chunk-g3y0r56h.js";import{dr,ur}from"./chunk-why9g2kd.js";import{U}from"./chunk-4vayk46h.js";import{go}from"./chunk-zw4ehzza.js";import{po}from"./chunk-qa9p0a64.js";import{n}from"./chunk-y8gz9rsc.js";import{e}from"./chunk-acf4sdp7.js";import{oo,Ri}from"./chunk-xnbvdqnt.js";import{io}from"./chunk-5x5n3b15.js";import{r,Ei,X,fn}from"./chunk-rkwq0grt.js";import{un}from"./chunk-pxr5snwm.js";import{tt,mn}from"./chunk-amf0m4tb.js";import{yn,bn}from"./chunk-ax7c2kam.js";import{Mi}from"./chunk-d582db8v.js";import{wn}from"./chunk-9nbkggqn.js";import{Ni}from"./chunk-d71nz1je.js";import{Cn}from"./chunk-grfrfh7s.js";import{pn}from"./chunk-yryg27yy.js";import{Ti}from"./chunk-h3mwzf3d.js";import{Li}from"./chunk-v96vkrw2.js";import{vn}from"./chunk-mckz9qv5.js";import{hasFuzzyFileSearch as jt}from"@nyssance/codex-acp-v2/client";import{useCallback as w,useEffect as qt,useLayoutEffect as nt,useMemo as pt,useRef as N,useState as M}from"react";import{jsx as s,jsxs as R}from"react/jsx-runtime";var Gt=["image/png","image/jpeg","image/webp","image/gif"],st=[];async function Qt(o){let T=await(await fetch(o.url)).blob();return new Promise((I,S)=>{let E=new FileReader;E.onerror=()=>S(E.error),E.onload=()=>{let q=E.result;I(q.slice(q.indexOf(",")+1))},E.readAsDataURL(T)})}function Oe({session:o,onSubmit:T,onShellCommand:I,onHandOff:S,modelSelector:E,modelMenu:q,inputHeader:mt,actions:Mt,leadingTools:Rt,agentControls:G=!0,placeholder:Et,children:kt,attachmentPolicy:Dt,predictions:Nt=!0,disabled:St=!1,preparing:dt=!1,allowPendingInput:Ft=!1}){let{host:F,client:O}=e(),{t:g}=F,B=w((t)=>{if(F.reportError)F.reportError(t);else console.error(t)},[F]),[ut,H]=M(()=>({text:r.get(o.id)?.text??"",revision:0})),{text:v}=ut,[C,Ot]=M(()=>r.get(o.id)?.attachments??st),[y,Q]=M(()=>r.get(o.id)?.mentions??[]),[d,L]=M(()=>r.get(o.id)?.apps??[]),[ft,K]=M(()=>(r.get(o.id)?.apps?.length??0)>0||U(v,o.commands.map((t)=>t.name)).length>0),W=N(void 0),z=N(void 0);nt(()=>{if(d.length>0)K(!0)},[d.length]);let ot=C.some((t)=>tt(t)&&t.pastedText.status!=="ready"),[k,ht]=M(!1),[Y,Lt]=M(!1),[it,Wt]=M(!1),at=N(null),f=N(null),gt=N(null),c=N(ut),P=w((t)=>{gt.current?.(),c.current={text:t,revision:c.current.revision+1},H(c.current)},[]),xt=w((t)=>{let i=f.current;if(i?.insertApplication){i.insertApplication(t);return}let a=c.current.text,u=i?.getTextarea()?.selectionStart??a.length;z.current={text:a,apps:[]},W.current=u+1,K(!0),P(a),L((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:u}])},[P]),$t=w((t)=>{let i=f.current;if(i?.insertInvocation){i.insertInvocation(t);return}let a=c.current.text,u=i?.getTextarea(),l=u?.selectionStart??a.length,h=u?.selectionEnd??l,lt=`${a.slice(0,l)}${t} ${a.slice(h)}`;z.current={text:a,apps:[]},W.current=l+t.length+1,P(lt),K(!0)},[P]),yt=w(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),Ut=Ti(o,P,L,d.length>0||y.length>0||C.length>0),bt=pt(()=>({read:()=>{let i=f.current?.getTextarea(),a=i===null||i===void 0?[c.current.text.length,c.current.text.length]:[i.selectionStart,i.selectionEnd];return{target:o.id,...c.current,selection:a}},compareAndSet(i,a,u){if(f.current?.isComposing())return null;if(i.target!==o.id||i.revision!==c.current.revision)return null;c.current={text:a,revision:c.current.revision+1},H(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=a,l.setSelectionRange(u[0],u[1]);return{target:o.id,...c.current,selection:u}}}),[o.id]),j=N(null),vt=w((t)=>(j.current=t,()=>{if(j.current===t)j.current=null}),[]),V=o.state!=="idle",x=I!==void 0&&d.length===0&&v.startsWith("!"),J=(ft||d.length>0)&&!x,b=!St&&!dt&&o.attached&&!o.restoring&&!o.readOnly,D=!o.readOnly&&(Ft||b),Z=pn(o,b&&!k&&!Y&&!ot&&!it,v.length>0||C.length>0||y.length>0||d.length>0,Nt&&!x),Pt=Z.invalidate;nt(()=>{r.set(o.id,{text:v,attachments:C,mentions:y,...d.length>0?{apps:d}:{},modelId:r.get(o.id)?.modelId??null})},[o.id,v,C,y,d]),nt(()=>Ei(o.id,Ot),[o.id]),nt(()=>fn(o.id,(t)=>{if(!D||k)throw Error("The composer cannot take text now; try again later");if(v.length||C.length||y.length||d.length)throw Error("The composer already has a draft; send or clear it first");P(t)}),[o.id,D,k,v,C,y,d,P]);let It=n((t)=>jt(t.agent)),zt=pt(()=>It&&b?async(t)=>un((await O.fuzzyFileSearch({query:t,roots:[o.cwd],cancellationToken:null})).files):void 0,[O,It,b,o.cwd]),ct=w((t)=>{Q((i)=>i.includes(t)?i:[...i,t])},[]);qt(()=>{f.current?.focus()},[]);let At=w(async({text:t,files:i})=>{let a=I!==void 0&&d.length===0&&t.startsWith("!")?t.slice(1):null;if(a!==null){if(a.trim().length===0)return;if(i.length||y.length||d.length)throw Error("Shell commands cannot include file references or attachments");if(o.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let u=t.trim();if(u.length===0&&i.length===0&&y.length===0&&d.length===0)return;let l=j.current;ht(!0);let h=r.get(o.id),lt=c.current.revision,et=null;try{let A=d.map((p)=>({type:"resource_link",name:p.name,uri:`app://${p.id}`}));for(let p of y){let rt={kind:"file",absPath:p};A.push({type:"resource_link",uri:yn(rt),name:bn(rt)})}let Ct=ms(u,d);if(Ct.length>0)A.push({type:"text",text:Ct});for(let p of i)if(tt(p)){if(p.pastedText.status!=="ready")throw Error("Text attachment is not ready");A.push({type:"resource_link",uri:p.url,name:p.filename??"pasted-text.txt"})}else A.push({type:"image",data:await Qt(p),mimeType:p.mediaType});if(c.current.revision===lt&&r.get(o.id)===h)c.current={text:"",revision:c.current.revision+1},et=c.current.revision,H(c.current),Q([]),L([]),W.current=void 0,z.current=void 0,X(o.id,()=>st),r.set(o.id,{text:"",attachments:st,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(a!==null&&I)await I(a);else if(T)if(l===null)await T(A);else await T(A,(p)=>{if(l.signal.aborted||j.current!==l)return;l.accept(p),S?.(o.id,p)});else if(l===null)await O.prompt(o.id,A);else{let p=await O.prompt(o.id,A);l.accept(p)}Pt();for(let p of h?.attachments??[])if(p.url.startsWith("blob:")&&!r.get(o.id)?.attachments.some((rt)=>rt.id===p.id))URL.revokeObjectURL(p.url)}catch(A){if(h&&et!==null&&c.current.revision===et&&r.get(o.id)?.attachments.length===0&&r.get(o.id)?.mentions.length===0&&!r.get(o.id)?.apps?.length)c.current={text:h.text,revision:et+1},H(c.current),Q(h.mentions),L(h.apps??[]),r.set(o.id,h),X(o.id,()=>h.attachments);throw A}finally{ht(!1),f.current?.focus()}},[O,o.id,o.state,y,d,T,I,S,Pt]),Bt=()=>{O.cancel(o.id).catch(B)},Ht=w((t)=>{let i=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:Ve})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});B(i)},[B,g]),Kt=pt(()=>({session:o,ready:b,inputReady:D,sending:k,textareaRef:f,draft:bt,interruptRef:gt,observeReceipts:vt,addMention:ct,setAdding:Lt,shellMode:x,handsFree:!x&&(T===void 0||S!==void 0)}),[o,b,D,k,bt,vt,ct,T,S,x]),wt=F.writeTextAttachment,Tt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:Ut,bashMode:I!==void 0,disabled:!D,"aria-label":g("composer.placeholder"),placeholder:x?"! command":Z.text||Et||(V?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!J&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/"))){let i=_t(t.clipboardData);if(i?.apps.length){t.preventDefault();let a=t.currentTarget,u=m(i),l=_([...a.value.slice(0,a.selectionStart).split(""),...u,...a.value.slice(a.selectionEnd).split("")]);z.current={text:v,apps:[]},W.current=a.selectionStart+u.length,K(!0),L(l.apps),P(l.text);return}}if(wt)mn(t,o.id,g("composer.pastedTextFilename"),wt)}};return s(io,{value:Kt,children:s("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:R("div",{className:"relative",children:[mt&&s("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:mt}),s(fr,{attachmentPolicy:Dt,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},H(c.current)},attachments:C,onAttachmentsChange:(t)=>X(o.id,()=>t),children:R("div",{ref:at,className:"relative",children:[G&&!it&&s(Xi,{bashMode:I!==void 0,handleRef:f,commands:o.commands,renderSlashMenu:(t)=>s(oo,{anchorRef:at,commands:o.commands,query:t.query,includeAttachment:!1,disabled:!D,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(i)=>t.replaceQuery(()=>$t(i.startsWith("$")?i:`/${i}`)),onApp:(i)=>t.replaceQuery(()=>xt(i)),focusInput:yt}),searchFiles:zt,onMention:ct,onSearchError:B,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},J?"inline":"textarea"),R(tr,{"data-shell-mode":x||void 0,bashMode:I!==void 0,globalDrop:!0,multiple:!0,accept:Gt.join(","),onError:Ht,onSubmit:At,onSubmitAsync:At,onSubmitError:B,canSubmit:()=>b&&!k&&!Y&&!ot&&(!x||!V&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[kt,R(or,{className:"px-3 pt-3 pb-0 empty:hidden",children:[Y&&s("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),s(Mi,{mentions:y,onRemove:(t)=>Q((i)=>i.filter((a)=>a!==t))}),s(ur,{children:(t)=>tt(t)?s(Ni,{data:t,sessionId:o.id}):s(dr,{data:t,t:g})})]}),R(nr,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!Z.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab"||t.key==="ArrowRight"||t.key==="Enter")t.preventDefault(),t.stopPropagation(),P(Z.text)},children:[x&&s("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),J?s(go,{...Tt,skillIcon:F.skillIcon,skillNames:o.commands.map((t)=>t.name),applications:d,onApplicationsChange:L,initialCaret:W.current,initialUndo:z.current}):s(po,{...Tt,autoFocus:ft&&x})]}),s(ir,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:R("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[R("div",{className:"flex min-w-0 items-center gap-[5px]",children:[s(Ri,{anchorRef:at,commands:o.commands,disabled:!D,agentDisabled:!b||x,agentControls:G,open:it,onOpenChange:Wt,focusInput:yt,onCommand:(t)=>{let i=c.current.text,a=i.length===0||i.endsWith(`
|
|
2
|
+
`)?i:`${i}
|
|
3
|
+
`,u=t.startsWith("$")?t:`/${t}`,l=`${a}${u} `;if(!J)z.current={text:i,apps:[]},W.current=l.length,K(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:xt}),Rt,G&&s(Cn,{sessionId:o.id,options:o.configOptions,disabled:!b})]}),R(rr,{className:"w-full min-w-0 items-center justify-end gap-1",children:[G&&s(vn,{session:o}),E??s(wn,{...q,sessionId:o.id,options:o.configOptions,disabled:!b}),Mt,s(Li,{active:V,sending:k||dt||Y,ready:b&&!ot&&(!x||!V&&v.slice(1).trim().length>0),hasMentions:y.length>0||d.length>0,onStop:Bt})]})]})})]})]})})]})})})}
|
|
4
|
+
export{Oe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t=new Map;var a=0;function
|
|
2
|
-
export{
|
|
1
|
+
var t=new Map;var a=0;function Fo(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Fo(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Kr(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
+
export{Fo,Kr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ge}from"./chunk-7tw7rn0m.js";import{b}from"./chunk-a11wvd8e.js";import{y}from"./chunk-y8gz9rsc.js";import{hn}from"./chunk-5x5n3b15.js";import{Oe}from"./chunk-8gt8yn8k.js";import{Pn}from"./chunk-bztkz3dz.js";import{Be}from"./chunk-pg9gckmw.js";import{ze}from"./chunk-vmfhnkxj.js";import{_n}from"./chunk-y8yawx3d.js";import{kn,Sn}from"./chunk-z6dx6dnt.js";import{jsx as t,jsxs as d,Fragment as f}from"react/jsx-runtime";var n;function C(){return n??=Pn(),n}function P(){let o=hn();return t(Sn,{sessionId:o.session.id,enabled:o.inputReady&&!o.sending&&!o.shellMode,onMention:o.addMention,onBusyChange:o.setAdding})}function ua({client:o,providers:m,catalog:i,shellCommands:p=!0,modelMenu:l,children:a,...s}){let{session:e}=s,c=y(o.store,(r)=>r.modelRecovery[e.id]??!1);return d(f,{children:[c&&!ge(e.error?.error)&&t(_n,{client:o,session:e,providers:m??C(),catalog:i},e.id),d(Oe,{modelMenu:l??{defaultGroup:b,catalog:(r)=>Be(r,i),headerAction:t(ze,{})},...s,attachmentPolicy:kn,onShellCommand:p?(r)=>o.executeShell(e.id,r):void 0,children:[t(P,{}),a]})]})}
|
|
2
|
+
export{ua};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function
|
|
2
|
-
export{
|
|
1
|
+
import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Ro(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Dr(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Ro(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
|
|
2
|
+
export{Ro,Dr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{kt}from"./chunk-hf5bpahd.js";import{n}from"./chunk-y8gz9rsc.js";import{e,C}from"./chunk-acf4sdp7.js";import{Y,x,ee}from"./chunk-w5q2ygsa.js";import{isBooleanOption as U,isGroupedSelect as q,isSelectOption as A}from"@nyssance/codex-acp-v2/client";import{Zap as Z}from"lucide-react";import{memo as D,useRef as F}from"react";import{jsx as w}from"react/jsx-runtime";function H({sessionId:l,options:u,disabled:B,onModelChange:h,onConfigChange:b,defaultGroup:G={id:"models",name:"Models"},catalog:I=(c)=>c,headerAction:L}){let{host:c,client:N}=e(),{t:i}=c,P=n((o)=>Boolean(o.configPending[l])),p=F({sessionId:l,model:!0}),O=P&&(p.current.sessionId!==l||p.current.model),k=n((o)=>{let r=o.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=x(u,"model"),a=x(u,"thought_level"),v=u.filter((o)=>o.configId!=="collaboration_mode"&&(o.category==="model_config"||o.category!=="mode"&&o!==t&&o!==a)),_=v.filter(A),m=v.filter(U);if(!t&&!a&&_.length===0&&m.length===0)return null;let f=(o,r)=>{if(r===o.currentValue)return Promise.resolve();p.current={sessionId:l,model:o===t};let d=b?b(o.configId,r):N.setConfig(l,o.configId,r);return C(c,d),d},g=a?Y(a):[],z=g.reduce((o,r)=>r.name.length>=o.length?r.name:o,""),R=t?ee(t):i("composer.model"),S=(o)=>({api_id:o.value,label:o.name}),V=I(t&&q(t.options)?t.options.map((o)=>({id:o.groupId,name:o.name,models:o.options.map(S)})):[{...G,models:t?Y(t).map(S):[]}]),y=V.flatMap((o)=>o.models),M=y.find((o)=>o.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:R},s=m.find((o)=>o.configId==="fast_mode"||o.configId==="fast-mode");return w(kt,{disabled:B||O||k,switching:O,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:y,showModelList:Boolean(t),onChange:(o)=>{if(o.api_id===t?.currentValue)return;if(h)h(o.api_id);else if(t)f(t,o.api_id)},header:{name:t?.name??i("composer.model"),action:L},modelGroups:V,t:i,effortConfig:a&&g.length>0?{name:"Effort",value:a.currentValue,levels:g,sizer:z,onChange:(o)=>f(a,o)}:void 0,selectOptions:_.map((o)=>({id:o.configId,name:o.name,value:o.currentValue,options:Y(o).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>f(o,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:w(Z,{className:"size-4","aria-hidden":"true"})},...m.filter((o)=>o!==s).map((o)=>({id:o.configId,name:o.name,currentValue:o.currentValue}))],onBooleanChange:(o,r)=>{let d=o==="fast_mode"?s:m.find((E)=>E.configId===o);if(!d)throw Error(`Unknown boolean config: ${o}`);f(d,r)}})}var wn=D(H);
|
|
2
|
+
export{wn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Et}from"./chunk-rv3k0kfr.js";import{isContentEntry as d,isImage as l,isText as p}from"@nyssance/codex-acp-v2/client";var Ma="generate_image",Na=[{id:"MiniMax-H3-Image",label:"MiniMax H3 Image",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"MiniMax-H3-Image-Highspeed",label:"MiniMax H3 Image Highspeed",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"wham",label:"ChatGPT Images",provider:"chatgpt",sizes:["auto"],maxReferences:16},{id:"doubao-seedream-4-5-251128",label:"Seedream 4.5",provider:"seedream",sizes:["2K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-lite-260128",label:"Seedream 5.0 Lite",provider:"seedream",sizes:["2K","3K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-pro-260628",label:"Seedream 5.0 Pro",provider:"seedream",sizes:["1K","2K"],maxReferences:10}],Ka={model:"wham",size:"auto"},ji={name:Ma,description:"Generate or edit images using the user's selected image model. Use this tool for image creation and editing. For edits, supply reference IDs returned by earlier calls or the current image request; do not read credentials or call image services yourself. Return the generated image to the user. The host controls model selection.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Complete image generation or editing instructions"},references:{type:"array",items:{type:"string"},description:"Image reference IDs supplied by the host or previous image results"}},required:["prompt"],additionalProperties:!1},annotations:{readOnlyHint:!0}};function c(o){let t=o.content.filter(d).map((i)=>i.content);if(t.length)return t;let r=o.rawOutput?.result;return Array.isArray(r?.content)?r.content:[]}function $i(o){return o.items.flatMap((t)=>{if(!Et(t))return[];let r=t.rawInput,i=c(t),s={};for(let n of i){if(!p(n)||!n.text.startsWith("{"))continue;try{let e=JSON.parse(n.text);if(e&&typeof e==="object"&&"kind"in e&&e.kind==="alwith.image")s={..."model"in e&&typeof e.model==="string"?{model:e.model}:{},..."size"in e&&typeof e.size==="string"?{size:e.size}:{}}}catch(e){if(!(e instanceof SyntaxError))throw e}}return i.flatMap((n,e)=>{if(!l(n))return[];let{mimeType:a,data:m}=n;return[{id:`${t.id}:${e}`,toolId:t.id,...s,...typeof r?.arguments?.prompt==="string"?{prompt:r.arguments.prompt}:{},mimeType:a,data:m,src:`data:${a};base64,${m}`}]})})}function te(o){let t=Na.find((r)=>r.id===o.model);if(!t||!t.sizes.includes(o.size))throw Error("Invalid image model or size");return t}function Wa(o,t,r){let i=te(o);if(i.provider!=="seedream")throw Error("Expected a Seedream model");if(r.length>i.maxReferences)throw Error(`This model accepts at most ${i.maxReferences} reference images`);return{model:i.id,prompt:t,size:o.size,response_format:"b64_json",watermark:!1,...r.length?{image:r}:{},...i.id==="doubao-seedream-4-5-251128"?{}:{output_format:"png"}}}
|
|
2
|
+
export{Ma,Na,Ka,ji,$i,te,Wa};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function Aa(e,n){if(e.type||!n.type)return e;let i=n.type.split("/")[1],o=i!==void 0&&i!==""?`pasted-${Date.now()}.${i==="jpeg"?"jpg":i}`:"";return new File([e],e.name||o||`pasted-${Date.now()}`,{type:n.type})}function Pt(e){let n=[],i=!1;for(let o of e){if(o.kind!=="file")continue;let t=o.getAsFile();if(!t)continue;if(!(t.type||o.type).startsWith("image/")){i=!0;continue}n.push(Aa(t,o))}return{imageFiles:n,sawNonImageFile:i}}function It(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function jn(e){return e.replace(s,"")}function Ca(e,n){let i=0;for(let o=0;o<n;o++){let t=e.charCodeAt(o);if(t>=0&&t<=8||t===11||t===12||t>=14&&t<=31||t===127)i++}return i}function $n(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=jn(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-Ca(n,i)),r=Math.max(0,o-Ca(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
|
|
2
|
+
export{Aa,Pt,It,jn,Ca,$n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{uo}from"./chunk-2f8s5gtn.js";import{$i,te}from"./chunk-9neb2f30.js";import{so}from"./chunk-eynwjzqp.js";import{En}from"./chunk-nrpgmawz.js";import{Gi,ao}from"./chunk-4sfxcw58.js";import{Bi}from"./chunk-ps408sxd.js";import{Nn}from"./chunk-bbrx6m7n.js";import{fe}from"./chunk-6ym1a5wa.js";import{ot,Ge}from"./chunk-vd6eqshg.js";import{lo}from"./chunk-ypdh88cj.js";import{Ui}from"./chunk-v9weanq6.js";import{ge,An}from"./chunk-7tw7rn0m.js";import{CodexClient as M,configRevisionOf as O,isBooleanOption as S,isGroupedSelect as v,isImage as R,isSelectOption as g,mergeMeta as f,runStateSource as I}from"@nyssance/codex-acp-v2/client";var b={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function d(e){let t=e.find((s)=>s.category==="model"&&s.type==="select");return t?.type==="select"&&typeof t.currentValue==="string"?t.currentValue:null}function C(e){let t=e["x-codex-turn-metadata"];if(typeof e.callId!=="string"||typeof t?.turn_id!=="string")throw Error("Codex tool call metadata is missing callId or turn_id");return{toolCallId:e.callId,turnId:t.turn_id}}class Hi extends M{applicationRegistry=new uo((e)=>this.holds(e)?this.session(e):void 0,C);toolSelection;async executeShell(e,t){let s=this.session(e);if(!s.attached||s.restoring||s.readOnly||s.state!=="idle")throw Error("The session is not ready for a shell command");await this.codexCapabilities.executeShell(e,t),this.materializeDraft(e)}modelListeners=new Set;confirmedModelListeners=new Set;savedModels={main:null,chat:null};slotModels={main:null,chat:null};slotTargets={main:null,chat:null};slotVersions={main:0,chat:0};draftDirectoryIntents=new Map;draftOperations=new Map;gatewayModels=new Map;configOwners=new Map;openingOwners=new Map;schedulingConfig=new Set;replayRepairs=new Map;accountRevocations=new Map;accountRecoveries=new Map;resolveModelOption;constructor(e,t){let{applicationTools:s=[],resolveModel:i,imageService:n,...o}=t;super(e,o,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.toolSelection=s,this.resolveModelOption=i,this.imageService=n,this.imageTool=n?Bi(n,(r)=>this.imageRequests.get(r)):void 0}imageTool;imageService;inputModes=new Map;inputSelections=new Map;async readInputConfig(e){let t=this.live(),s=await t.request("_codex/session_input_config_get",{sessionId:e});if(t!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,s)}async writeInputConfig(e,t){let s=this.live(),i=await s.request("_codex/session_input_config_set",{sessionId:e,inputConfig:t});if(s!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,i)}acceptInputConfig(e,t){let s=Nn(t,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=s.inputConfig;if(i&&ot(i.mode)){if(Ge(i.mode).parseConfig(i.config),this.inputModes.set(e,i.mode),i.mode==="image")this.inputSelections.set(e,fe.parseConfig(i.config))}return s}imageRequests=new Map;prompt(e,t,s={}){if(!this.imageService)return super.prompt(e,t,s);if(!this.inputModes.has(e))return this.imageService.inputMode(e).then((i)=>(this.inputModes.set(e,i),this.prompt(e,t,s)));return Ge(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,t,{...s,meta:f(s.meta,{alwith:{imageIntent:null,applicationContext:Ge("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,t,s)})}promptImage(e,t,s){if(!this.imageService)throw Error("Image service is not connected");ao(s.meta?.alwith?.imageAspectRatio);let i=s.meta?.alwith?.imageSelection;if(i!==void 0)te(i);let n=i??this.inputSelections.get(e)??this.imageService.selection(),o={...this.session(e).state!=="idle"?this.imageRequests.get(e)?.selection??n:n};te(o);let r=crypto.randomUUID();return this.promptImages.set(r,new Map(t.flatMap((a,c)=>R(a)?[[`attachment:${c}`,`data:${a.mimeType};base64,${a.data}`]]:[]))),super.prompt(e,t,{...s,meta:f(s.meta,{alwith:{imageSelection:o,imageRequestId:r,applicationContext:fe.applicationContext(s.meta?.alwith?.imageIntent??"generate",Gi),imageIntent:s.meta?.alwith?.imageIntent??"generate"}})}).finally(()=>this.promptImages.delete(r))}promptMeta(e,t){let s=t.meta?.alwith?.imageSelection;if(this.inputModes.get(e)==="image"&&s&&this.imageService&&(this.session(e).state==="idle"||!this.imageRequests.has(e))){let i=new Map($i(this.session(e)).map((o)=>[o.id,o.src]));for(let[o,r]of this.promptImages.get((t.meta?.alwith).imageRequestId)??[])i.set(o,r);let n=ao((t.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:s,references:i,...n?{aspect:n}:{}})}return lo(super.promptMeta(e,t))}promptImages=new Map;promptWithImages(e,t,s={}){return this.prompt(e,t,{...s,meta:f({alwith:{imageIntent:"generate"}},s.meta)})}async applicationToolsFor(e){let t=typeof this.toolSelection==="function"?await this.toolSelection(e):this.toolSelection,s=e.options.meta?.alwith;return[...t,...e.options.applicationTools??[],...s?.nativeTools?.imageGeneration===!1&&this.imageTool?[this.imageTool]:[]]}releaseImages(e){this.imageRequests.delete(e)}onDisconnected(){for(let e of this.imageRequests.keys())this.releaseImages(e);this.promptImages.clear(),this.applicationRegistry.clear(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),this.applicationRegistry.cancel(e),await super.cancel(e)}async close(e){this.releaseImages(e),this.applicationRegistry.drop(e),await super.close(e)}async stopSession(e){this.releaseImages(e),this.applicationRegistry.drop(e);let t=this.state.draftSessions[e];if(t===void 0)return super.stopSession(e);await this.changeDraft([t],()=>this.state.draftSessions[e]?super.close(e):super.stopSession(e))}setApp(e){this.store.setState(e)}applyRunStates(e,t="event"){let s=this.state.runStates,i=e.map((n)=>{let o=s[n.sessionId];return o&&JSON.stringify(o)===JSON.stringify(n)?o:n});if(I(s)===t&&i.length===Object.keys(s).length&&i.every((n)=>n===s[n.sessionId]))return;super.applyRunStates(i,t)}enqueueSession(e,t,s=!0){let i=!s&&!this.schedulingConfig.has(e);return super.enqueueSession(e,()=>{let n=()=>{let a=this.holds(e)?d(this.session(e).configOptions):null;return t().then(async(c)=>{if(this.holds(e)&&d(this.session(e).configOptions)!==a)await this.normalizeCustomEffort(e,!0);return c})},o=()=>{let a=i?this.normalizeCustomEffort(e,!1):void 0;return a?a.then(n):n()},r=s?void 0:this.replayRepairs.get(e)?.promise;return r?r.then(o):o()},s)}customEffortChange(e,t,s=!1,i){if(!this.holds(e))return;let n=this.session(e);if(!n.attached||n.readOnly)return;let o=d(n.configOptions),r=so(o);if(!r)return;let a=n.configOptions.find((p)=>p.category==="thought_level"&&g(p)),c,u;if(a&&g(a)){let p=v(a.options)?a.options.flatMap((l)=>l.options):a.options;if(a.currentValue===r.value||!t&&p.some((l)=>l.value===a.currentValue))return;if(!p.some((l)=>l.value===r.value))throw Error(`The model does not advertise its default effort: ${o}`);c=a.configId,u=!t&&i!==void 0&&p.some((l)=>l.value===i)?i:r.value}else{if(!r.hidden||!s||o===null)return;let p=n.configOptions.find((l)=>l.category==="model");if(!p)throw Error("The custom model has no model option");c=p.configId,u=o}return{configId:c,value:u}}normalizeCustomEffort(e,t,s=!1,i){let n=this.customEffortChange(e,t,s,i);return n?this.writeCustomEffort(e,n.configId,n.value):void 0}async writeCustomEffort(e,t,s){let i=this.live(),n=this.lifecycle.capture(e),o=await i.request("session/set_config_option",{sessionId:e,configId:t,type:"id",value:s});if(i!==this.agent||!this.lifecycle.isCurrent(n))throw Error("Effort configuration belongs to a retired session");this.publishSession({...this.session(e),configOptions:o.configOptions,configRevision:O(o)??this.session(e).configRevision})}async afterSessionCreated(e){await super.afterSessionCreated(e);try{await super.enqueueSession(e,async()=>this.normalizeCustomEffort(e,!0,!0),!1)}catch(t){try{await this.delete(e)}catch(s){throw AggregateError([t,s],"Failed to initialize and clean up the custom model session",{cause:s})}throw t}}replay(e,t,s){let i=this.replayRepairs.get(e);if(i?.cwd===t)return i.promise;let n=this.replayWithEffort(e,t,s);this.replayRepairs.set(e,{cwd:t,promise:n});let o=()=>{if(this.replayRepairs.get(e)?.promise===n)this.replayRepairs.delete(e)};return n.then(o,o),n}async replayWithEffort(e,t,s){let i=this.holds(e)?this.session(e).configOptions:[],n=i.find((r)=>r.category==="thought_level")?.currentValue;await super.replay(e,t,s);let o=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,d(i)===d(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(r){if(this.holds(e)&&this.lifecycle.isCurrent(o))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw r}}async connect(){if(await super.connect(),this.state.projectContext===null)await this.refreshProjectContext()}async listProjectSessions(e){await this.listSessions();let t=this.projectPath(e),s=this.sessionGroup({cwd:t}).id;return this.state.sessionList.filter((i)=>this.sessionGroup(i).id===s)}async newSession(e,t=null,s="main"){if(t!==null&&typeof t==="object")return super.newSession(e,t);let i=++this.slotVersions[s],n=await this.createNativeSession(e,await this.resolveModel(t),null);return this.activateSlot(s,n,i),n}async createNativeSession(e,t,s,i="chat"){let n=await super.newSession(e,{draft:s!==null,meta:f(y(t),this.imageService||s!==null?{alwith:{...this.imageService?{inputMode:i}:{},...s===null?{}:{draft:!0}}}:void 0)});if(s!==null)this.draftDirectoryIntents.set(n,e),this.setApp((o)=>({draftSessions:{...o.draftSessions,[n]:s}}));return this.noteModel(this.session(n)),n}async open(e,t,s="main"){if(typeof s!=="string")return super.open(e,t,s);if(s==="chat"&&this.imageService&&(this.inputModes.get(e)??await this.imageService.inputMode(e))==="image")throw Error("Image conversations must be opened in the main window");this.bindSlot(s,e),++this.slotVersions[s];let i=this.holds(e)?this.session(e):void 0;if(i?.attached&&(!this.imageService||this.inputModes.has(e))&&!i.restoring&&!i.readOnly&&!this.lifecycle.operations.busy(e)&&!this.replayRepairs.has(e)){this.followModel(s,i);return}await this.replayForOwner(e,t,s)}async replayForOwner(e,t,s){this.openingOwners.set(e,s);try{await this.replay(e,t)}finally{if(this.openingOwners.get(e)===s)this.openingOwners.delete(e)}}async requestContext(e,t,s){if(this.imageService){let i=t.kind==="resume"?t.sessionId:t.kind==="fork"?t.sourceSessionId:null,n=i===null?s.meta?.alwith?.inputMode??"chat":await this.imageService.inputMode(i),o=Ge(n),r=lo(s.meta),a={...r?.alwith,nativeTools:o.nativeTools},c=await this.requestModelContext(e,t,{...s,meta:{...r,alwith:a}});return{...c,bind:async(u)=>{await c.bind?.(u),this.inputModes.set(u,n)}}}return this.requestModelContext(e,t,s)}async requestModelContext(e,t,s){if(t.kind!=="resume"||s.meta?.alwith?.model!==void 0)return this.requestToolContext(e,t,s);let i=t.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?d(n.configOptions):null)??this.gatewayModels.get(i)??null,r=await this.resolveModel(o),a=o===null?null:r;return this.requestToolContext(e,t,{...s,meta:f(y(a),s.meta)})}async requestToolContext(e,t,s){let i=await this.applicationToolsFor({cwd:e,operation:t,options:s}),n=await super.requestContext(e,t,s);if(!i.length)return n;if(!this.state.agent?.capabilities?.session?.mcp?.acp)throw Error("The agent does not advertise capabilities.session.mcp.acp");let o=this.applicationRegistry.declare(i);return{...n,mcpServers:[...n.mcpServers??[],o],bind:async(r)=>{await n.bind?.(r),this.applicationRegistry.bind(o.serverId,r)}}}acceptsPendingRequest(e){return e.method!=="mcp/message"&&super.acceptsPendingRequest(e)}handleNotification(e,t){if(e==="$/cancel_request"&&this.applicationRegistry.withdraw(t?.requestId))return!0;return super.handleNotification(e,t)}handleAgentRequest(e,t){return this.applicationRegistry.handle(e,t)||super.handleAgentRequest(e,t)}async installedApps(e){let t=this.live(),s=await super.installedApps(e),i=await Ui((n,o)=>t.request(n,o),s.apps.map((n)=>n.id),e?.threadId);if(t!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:s.apps.map((n)=>({...n,...i.get(n.id)}))}}async recoverReplay(e,t,s,i){let n=ge(s);if(!n&&!An(s))return super.recoverReplay(e,t,s,i);try{await super.afterResume(e,t,i)}catch(o){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;this.setApp((r)=>({historyPages:{...r.historyPages,[e]:{cursor:null,loading:!1,error:o instanceof Error?o.message:String(o)}}}))}if(n){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:s.reason??s.message,data:s.data},meta:null}}),!0}if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.accountRevocations.set(e,(this.accountRevocations.get(e)??0)+1),this.setApp((o)=>({modelRecovery:{...o.modelRecovery,[e]:!0}})),this.publishSession({...this.session(e),cwd:t,attached:!1,restoring:!1,readOnly:!0}),!0}markAccountModelsUnavailable(e){this.setApp((t)=>({modelRecovery:{...t.modelRecovery,...Object.fromEntries(e.map((s)=>[s,!0]))}}));for(let t of e){if(this.accountRevocations.set(t,(this.accountRevocations.get(t)??0)+1),!this.holds(t))continue;this.publishSession({...this.session(t),attached:!1,readOnly:!0})}}async resumeModel(e,t){let s=this.session(e);if(!this.state.modelRecovery[e]&&(s.attached||!ge(s.error?.error)))throw Error("Model recovery is not required");if(!t)throw Error("Select a model before continuing");let i=this.accountRevocations.get(e)??0,n=await this.resolveModel(t);if(!n)throw Error("The selected provider connection or model is unavailable");if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");this.accountRecoveries.set(e,i);try{await this.replay(e,s.cwd,{meta:{alwith:{model:n,accountModelSelection:!0}}})}catch(r){if(this.holds(e)&&this.state.modelRecovery[e])this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!0});throw r}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((r)=>{let{[e]:a,...c}=r.modelRecovery;return{modelRecovery:c}}),this.confirmModel(this.state.sessionWindows[e]??"main",o)}setConfig(e,t,s,i="main"){this.configOwners.set(`${e}:${t}`,i),this.schedulingConfig.add(e);try{return super.setConfig(e,t,s)}finally{this.schedulingConfig.delete(e)}}onConfigChanged(e,t,s){super.onConfigChanged(e,t,s),this.noteModel(this.session(e));let i=this.configOwners.get(`${e}:${t}`)??"main";if(this.configOwners.delete(`${e}:${t}`),s.configOptions.some((n)=>n.configId===t&&n.category==="model"))this.confirmModel(i,this.session(e))}changeDraft(e,t){let s=Promise.allSettled(e.map((i)=>this.draftOperations.get(i)).filter((i)=>i!==void 0)).then(t);for(let i of e)this.draftOperations.set(i,s);return s}prepareDraft(e,t,s=null,i=!1,n="chat"){if(e==="chat"&&n!=="chat")throw Error("The floating chat only supports chat input");let o=++this.slotVersions[e];return this.changeDraft([e],async()=>{let r=t??(await this.refreshProjectContext(!0)).chatDirectory,a=Object.keys(this.state.draftSessions).find((l)=>this.state.draftSessions[l]===e);if(a)await this.lifecycle.admission.pending(a);let c=s??(a?d(this.session(a).configOptions):this.savedModels[e]??this.slotModels[e]),u=i?null:await this.resolveModel(c,s===null?"draft":"session");if(a&&(this.inputModes.get(a)??"chat")===n&&this.session(a).cwd===r&&(!this.draftDirectoryIntents.has(a)||this.draftDirectoryIntents.get(a)===t)&&!i&&!this.state.modelRecovery[a]&&(u===null?!d(this.session(a).configOptions)?.startsWith("gateway:"):d(this.session(a).configOptions)===u)){if(this.activateSlot(e,a,o),!this.session(a).attached)await this.replayForOwner(a,r,e);if(s!==null)this.confirmModel(e,this.session(a));return a}let p=await this.createNativeSession(t,u,e,n);try{if(a&&this.session(a).cwd===r)for(let l of this.session(a).configOptions){if(l.category==="model")continue;if(l.category==="thought_level"&&d(this.session(a).configOptions)!==d(this.session(p).configOptions)&&so(d(this.session(p).configOptions))!==null)continue;let h=this.session(p).configOptions.find((w)=>w.configId===l.configId);if(!h||h.currentValue===l.currentValue)continue;if(S(l)&&S(h))await this.setConfig(p,l.configId,l.currentValue);else if(g(l)&&g(h)){if((v(h.options)?h.options.flatMap((m)=>m.options):h.options).some((m)=>m.value===l.currentValue))await this.setConfig(p,l.configId,l.currentValue)}}if(a)await this.deleteEmptyDraft(a)}catch(l){throw await this.deleteEmptyDraft(p),l}if(this.activateSlot(e,p,o),s!==null||i||c!==null&&c!==u)this.confirmModel(e,this.session(p));return p})}discardDraft(e){if(e!=="main"&&e!=="chat")return super.discardDraft(e);return this.changeDraft([e],async()=>{for(let[t,s]of Object.entries(this.state.draftSessions))if(s===e)await this.deleteEmptyDraft(t)})}transferDraft(e,t){return this.changeDraft(["main","chat"],async()=>{if(t==="chat"&&this.inputModes.get(e)==="image")throw Error("Image conversations must remain in the main window");if(!this.state.draftSessions[e]||this.state.draftSessions[e]===t)return;for(let[s,i]of Object.entries(this.state.draftSessions))if(i===t)await this.deleteEmptyDraft(s);this.setApp((s)=>s.draftSessions[e]?{draftSessions:{...s.draftSessions,[e]:t}}:{})})}deleteEmptyDraft(e){return this.enqueueSession(e,async()=>{if(!this.state.draftSessions[e])return;await this.delete(e),this.gatewayModels.delete(e)})}onDraftMaterialized(e){super.onDraftMaterialized(e),this.draftDirectoryIntents.delete(e),this.setApp((t)=>{let{[e]:s,...i}=t.draftSessions;return{draftSessions:i}}),this.noteModel(this.session(e))}onSessionDropped(e){this.applicationRegistry.drop(e),super.onSessionDropped(e),this.inputModes.delete(e),this.inputSelections.delete(e),this.draftDirectoryIntents.delete(e),this.gatewayModels.delete(e),this.accountRevocations.delete(e),this.accountRecoveries.delete(e),this.setApp((t)=>{let{[e]:s,...i}=t.draftSessions,{[e]:n,...o}=t.sessionWindows,{[e]:r,...a}=t.modelRecovery;return{draftSessions:i,sessionWindows:o,modelRecovery:a}})}fork(e,t,s){let i=typeof s==="object"?s:s===void 0?{}:{lastTurnId:s};return super.fork(e,t,i)}async forkInternal(e,t,s){let n=[...(await Promise.all([this.indexSessions(),this.indexSessions(void 0,!0)])).flat(),...this.state.sessionList,...this.state.archivedSessions],o=(this.holds(e)?this.session(e).title:null)??n.find((c)=>c.sessionId===e)?.title,r=await super.forkInternal(e,t,{...s,meta:f(y(this.gatewayModels.get(e)??null),s.meta)});await super.enqueueSession(r,async()=>this.normalizeCustomEffort(r,!1,!0),!1);let a=o??this.session(r).title;if(a)await this.renameSession(r,En(a,n.flatMap((c)=>c.title?[c.title]:[])));return r}onForked(e,t){super.onForked(e,t),this.noteModel(this.session(e))}onReplayed(e,t){super.onReplayed(e,t);let s=this.accountRevocations.get(e);if(s!==void 0&&this.accountRecoveries.get(e)!==s)this.markAccountModelsUnavailable([e]);this.noteModel(this.session(e))}setModelSelections(e){this.savedModels={...e},this.slotModels={...e}}onConfirmedModel(e){return this.confirmedModelListeners.add(e),()=>this.confirmedModelListeners.delete(e)}onSessionChanged(e){super.onSessionChanged(e);let t=this.accountRevocations.get(e.id);if(t!==void 0&&this.accountRecoveries.get(e.id)!==t&&(e.attached||!e.readOnly)){this.publishSession({...e,attached:!1,readOnly:!0});return}this.followModel("main",e),this.followModel("chat",e)}followModel(e,t){if(this.slotTargets[e]!==t.id||!t.attached||t.restoring)return;let s=d(t.configOptions);if(s!==null)this.slotModels[e]=s}activateSlot(e,t,s){if(this.slotVersions[e]!==s)return;this.bindSlot(e,t),this.followModel(e,this.session(t))}bindSlot(e,t){let s=e==="main"?"chat":"main";if(this.slotTargets[s]===t)this.slotTargets[s]=null,++this.slotVersions[s];this.slotTargets[e]=t,this.setApp((i)=>({sessionWindows:{...i.sessionWindows,[t]:e}}))}confirmModel(e,t){let s=d(t.configOptions);if(s===null)throw Error("Model selection did not return the current model");this.followModel(e,t),this.savedModels[e]=s;for(let i of this.confirmedModelListeners)i(e,s)}resolveModel(e,t="session"){return this.resolveModelOption?this.resolveModelOption(e,t):Promise.resolve(e)}onSessionModel(e){return this.modelListeners.add(e),()=>this.modelListeners.delete(e)}noteModel(e){let t=d(e.configOptions);if(t===null)return;let s=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(s&&g(s)){let o=(v(s.options)?s.options.find((r)=>r.groupId===b.id)?.options??[]:s.options.filter((r)=>!r.value.startsWith("gateway:"))).map((r)=>({id:r.value,label:r.name}));if(JSON.stringify(o)!==JSON.stringify(this.state.nativeModels))this.setApp({nativeModels:o})}let i=s!==void 0&&g(s)&&s.options.some((n)=>("groupId"in n)&&n.groupId!==b.id&&n.options.some((o)=>o.value===t));if(i)this.gatewayModels.set(e.id,t);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,t,i)}}
|
|
2
|
+
export{b,Hi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$e}from"./chunk-y8gz9rsc.js";import{createContext as v,useContext as a,useMemo as l}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function zn({host:o,client:n,children:t}){let s=l(()=>({host:o,client:n}),[o,n]);return r($e,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=a(i);if(o===null)throw Error("Conversation host is missing");return o}function C(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
|
|
2
|
+
export{zn,e,C};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c}from"./chunk-
|
|
2
|
-
`).length}function
|
|
3
|
-
export{
|
|
1
|
+
import{c}from"./chunk-c13rnm7b.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
+
`).length}function Fa(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function Mr({blocks:e}){return s(No,{files:Fa(e)})}function No({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
+
export{Fa,Mr,No};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{vi}from"./chunk-5mjs63fv.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function ta({host:o,children:t}){return s(n,{value:o,children:t})}function A(){let o=i(n),e={...vi(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function fi(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function me(){let o=A();return(t)=>fi(o,t)}function hi(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
|
|
2
|
+
export{ta,A,fi,me,hi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{He}from"./chunk-dheg4bs2.js";import{r,X,gn}from"./chunk-rkwq0grt.js";var Ai=5000;function tt(t){return"pastedText"in t}function yt(t,e,p){let n=(a,o)=>{for(let[i,x]of r){if(!x.attachments.some((s)=>s.id===e.id))continue;X(i,(s)=>s.map((d)=>d.id===e.id?{...e,url:o===void 0?"":He(o),pastedText:{text:e.pastedText.text,status:a}}:d))}};if(!r.get(t)?.attachments.some((a)=>a.id===e.id))return;n("pending"),gn(e.id,p("pasted-text.txt",e.pastedText.text).then((a)=>n("ready",a)).catch(()=>n("error")))}function mn(t,e,p,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/")))return;let a=t.clipboardData.getData("text/plain");if(a.length<Ai)return;t.preventDefault(),t.stopPropagation();let o={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:p,url:"",pastedText:{text:a,status:"pending"}};X(e,(i)=>[...i,o]),yt(e,o,n)}
|
|
2
|
+
export{Ai,tt,yt,mn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{E}from"./chunk-r5f77gtx.js";import{s,h}from"./chunk-5mjs63fv.js";import{v,f}from"./chunk-chn1mkv0.js";import{GlobeIcon as I,LogOutIcon as G}from"lucide-react";import{useRef as R,useState as c}from"react";import{Avatar as k,AvatarFallback as T,AvatarImage as B}from"@nyssance/shadcn/vega/components/ui/avatar";import{DropdownMenu as H,DropdownMenuContent as U,DropdownMenuGroup as d,DropdownMenuItem as F,DropdownMenuLabel as j,DropdownMenuRadioGroup as z,DropdownMenuRadioItem as V,DropdownMenuSeparator as l,DropdownMenuSub as W,DropdownMenuSubContent as _,DropdownMenuSubTrigger as q,DropdownMenuTrigger as J}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as n}from"react/jsx-runtime";function Ns(e){return o(d,{...e})}function As(e){return o(l,{...e})}function ei({className:e,...r}){return o(F,{className:["h-[var(--navigation-row-height,30px)] py-0 [&_svg]:text-muted-foreground",e].filter(Boolean).join(" "),...r})}function Es({languages:e,value:r,onChange:i}){let a=s();return n(W,{children:[n(q,{className:"h-[var(--navigation-row-height,30px)] py-0",children:[o(I,{className:"text-muted-foreground"}),a.t("sessionList.language")]}),o(_,{children:o(z,{value:r,onValueChange:(t)=>void h(a,Promise.resolve(i(t))),children:e.map((t)=>o(V,{value:t.code,children:t.label},t.code))})})]})}function Rs({user:e,children:r,onSignOut:i,busy:a=!1}){let t=s(),{t:N}=t,[g,C]=c(!1),[L,m]=c(!1),M=R(null),[w,S]=c({width:0,offset:0}),O=(x)=>{if(x){let p=M.current,u=p?.closest("[data-sidebar-footer-row]");if(!p||!u)throw Error("AccountMenu must sit in a [data-sidebar-footer-row] row");let y=u.getBoundingClientRect(),A=p.getBoundingClientRect(),P=getComputedStyle(u).direction==="rtl";S({width:u.clientWidth,offset:P?y.right-A.right:A.left-y.left})}C(x)};E(g);let b=a||L,D=n(k,{className:"size-[18px] after:border-0",children:[o(B,{src:e.avatar??void 0,alt:""}),o(T,{className:"bg-primary text-primary-foreground text-xs",children:[...e.name].slice(0,2).join("").toLocaleUpperCase()})]});return n(H,{open:g,onOpenChange:O,children:[n(J,{ref:M,render:o(f,{disabled:b,className:"text-muted-foreground hover:bg-foreground/8 data-popup-open:bg-foreground/5 font-normal"}),children:[o(v,{children:D}),o("span",{className:"min-w-0 truncate",children:e.name})]}),n(U,{side:"top",align:"start",alignOffset:-w.offset,sideOffset:8,style:{width:w.width},children:[n(d,{children:[n(j,{className:"text-popover-foreground flex items-center gap-2 px-2 py-2 text-sm font-medium",children:[o(v,{children:D}),n("span",{className:"min-w-0 flex-1",children:[o("span",{className:"block truncate",children:e.name}),o("span",{className:"text-muted-foreground mt-0.5 block truncate text-xs font-normal",children:e.email})]})]}),o(l,{})]}),r,r!=null&&o(l,{}),o(d,{children:n(ei,{disabled:b,onClick:()=>{m(!0),h(t,i()).finally(()=>m(!1))},children:[o(G,{}),N("sessionList.signOut")]})})]})]})}
|
|
2
|
+
export{Ns,As,ei,Es,Rs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{z}from"./chunk-64cbt3ym.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function Os({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(z,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(z,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
|
|
2
|
+
export{Os};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n}from"./chunk-y8gz9rsc.js";import{e,C}from"./chunk-acf4sdp7.js";import{QUICK_CHATS_GROUP as I,sessionGroup as z}from"@nyssance/codex-acp-v2/client";import{cn as P}from"cn";import{FolderClosedIcon as m,FolderPlusIcon as G,XIcon as j}from"lucide-react";import{useEffect as O,useMemo as R,useState as S}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as A,DropdownMenuContent as F,DropdownMenuGroup as T,DropdownMenuItem as k,DropdownMenuRadioGroup as B,DropdownMenuRadioItem as E,DropdownMenuSeparator as U,DropdownMenuTrigger as _}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as r,jsxs as s,Fragment as H}from"react/jsx-runtime";function M(t){return t.replaceAll("\\","/").replace(/\/+$/,"").split("/").pop()||t}function oa({cwd:t,onChange:u,preparing:b=!1,recentProjects:g}){let{host:i,client:p}=e(),{t:l}=i,w=n((o)=>o.projectContext),v=n((o)=>o.sessionList),y=R(()=>g??[...new Set([...v].toSorted((o,f)=>(f.updatedAt??"").localeCompare(o.updatedAt??"")).map((o)=>o.cwd))],[g,v]),[c,N]=S(null);O(()=>{if(!p.refreshProjectContext)return;let o=!0;return C(i,p.refreshProjectContext(!0).then((f)=>{if(o)N(f.chatDirectory)})),()=>{o=!1}},[i,p]);let h=[...t!==null?[t]:[],...y.filter((o)=>o!==t)].filter((o)=>o!==c&&(!w||z(w,{cwd:o}).id!==I)),a=t!==null&&t!==c,D=()=>{if(c===null)throw Error("The default draft directory is not ready");u(null)},d=i.chooseFolder;return s(A,{children:[s("div",{"aria-busy":b,className:P("chat-project-picker group/project inline-flex h-7 max-w-full min-w-0 items-center gap-1.5 rounded-full",a?"text-foreground ps-2":"text-foreground/65"),children:[a&&s(x,{variant:"ghost",size:"icon-xs",className:"relative size-4 rounded-full p-0 hover:bg-transparent dark:hover:bg-transparent","aria-label":l("conversation.draft.workOutsideProject"),title:l("conversation.draft.workOutsideProject"),disabled:c===null,onClick:D,children:[r(m,{className:"size-4 group-hover/project:opacity-0"}),r("span",{className:"bg-muted-foreground text-background absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/project:opacity-100",children:r(j,{className:"size-3"})})]}),s(_,{render:r(x,{variant:"ghost",size:"sm",className:P("h-7 min-w-0 shrink gap-1.5 rounded-full py-0 text-sm font-normal text-inherit hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent",a?"ps-0 pe-2":"px-2")}),children:[!a&&r(m,{className:"size-4"}),r("span",{className:"truncate",children:a?M(t):l("conversation.draft.selectProject")})]})]}),s(F,{side:"top",align:"start",className:"w-72 overflow-hidden",children:[h.length>0&&s(H,{children:[r("div",{className:"max-h-64 overflow-y-auto",children:r(B,{value:t??"",onValueChange:u,children:h.map((o)=>s(E,{value:o,title:o,closeOnClick:!0,children:[r(m,{}),r("span",{className:"truncate",children:M(o)})]},o))})}),(d!==void 0||a)&&r(U,{})]}),(d!==void 0||a)&&s(T,{children:[d&&s(k,{onClick:()=>{C(i,d(t).then((o)=>{if(o!==null)u(o)}))},children:[r(G,{}),l("conversation.draft.newProject")]}),c!==null&&a&&s(k,{onClick:D,children:[r(j,{}),l("conversation.draft.workOutsideProject")]})]})]})]})}
|
|
2
|
+
export{oa};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function i(n,o=0){if(o>32)throw Error("Session input config is too deeply nested");if(n===null||typeof n==="string"||typeof n==="boolean")return n;if(typeof n==="number"&&Number.isFinite(n))return n;if(Array.isArray(n))return n.map((t)=>i(t,o+1));if(n&&typeof n==="object"&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null))return Object.fromEntries(Object.keys(n).toSorted().map((t)=>[t,i(n[t],o+1)]));throw Error("Session input config must contain only JSON values")}function
|
|
2
|
-
export{
|
|
1
|
+
function i(n,o=0){if(o>32)throw Error("Session input config is too deeply nested");if(n===null||typeof n==="string"||typeof n==="boolean")return n;if(typeof n==="number"&&Number.isFinite(n))return n;if(Array.isArray(n))return n.map((t)=>i(t,o+1));if(n&&typeof n==="object"&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null))return Object.fromEntries(Object.keys(n).toSorted().map((t)=>[t,i(n[t],o+1)]));throw Error("Session input config must contain only JSON values")}function Vi(n){if(!n||typeof n!=="object"||!("mode"in n)||typeof n.mode!=="string"||!n.mode.trim()||n.mode.length>128||/\p{Cc}/u.test(n.mode)||!("config"in n)||!n.config||typeof n.config!=="object"||Array.isArray(n.config))throw Error("Expected session input configuration with mode and config");let o=i(n.config),t={mode:n.mode,config:o};if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error("Session input config exceeds 64 KiB");return t}function Nn(n,o){if(!n||typeof n!=="object"||!("sessionId"in n)||n.sessionId!==o||!("revision"in n)||typeof n.revision!=="number"||!Number.isSafeInteger(n.revision)||n.revision<0||!("inputConfig"in n))throw Error("Invalid Codex session input snapshot");return{sessionId:o,revision:n.revision,inputConfig:n.inputConfig===null?null:Vi(n.inputConfig)}}
|
|
2
|
+
export{Vi,Nn};
|
|
@@ -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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as l,useSyncExternalStore as d}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as l,useSyncExternalStore as d}from"react";var pt="chat.modelAliases",c={},r="gateway:alwith-managed-litellm:";function o(e){if(e===void 0)return c;if(typeof e!=="object"||e===null||Array.isArray(e)||Object.entries(e).some(([t,n])=>!t.startsWith(r)||t.length===r.length||typeof n!=="string"||!n.trim()||n.length>100))throw Error("Invalid model aliases");return e}function Xt(e){let t=l((n)=>e.subscribe((s)=>{if(s.includes(pt))n()}),[e]);return d(t,()=>o(e.get(pt)))}async function Yt(e,t,n){if(!t.startsWith(r)||t.length===r.length)throw Error("Invalid ALwith model ID");let s=await e.read(),i={...o(s.values[pt])},a=n.trim();if(a)i[t]=a;else delete i[t];o(i),await e.write({action:"update",expectedRevision:s.revision,changes:{[pt]:i}})}
|
|
2
|
+
export{pt,Xt,Yt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ft}from"./chunk-26w51q10.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{Ft}from"./chunk-26w51q10.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function Qr({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Ft({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
|
|
2
|
+
export{Qr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p,ro}from"./chunk-4d9sajzj.js";import{Fn}from"./chunk-3z86hy2s.js";import{useEffect as P,useRef as u,useState as m}from"react";var Di="providers:changed",Fi="providers:managed-revoked",i=(e)=>e;function Pn(){return{read:()=>i(p.providersRead()),save:(e,r,t)=>i(p.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(p.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(p.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>p.providersTest({providerId:e}),apply:()=>i(p.providersApply()),onChanged:(e)=>ro[Di].listen((r)=>e(r.payload))}}function fa(){return{bind:(e)=>p.providersAccountBind({account:e}),refresh:(e,r)=>i(p.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await p.providersClearManaged()},onRevoked:(e)=>ro[Fi].listen((r)=>e(r.payload.sessionIds))}}async function In(e){try{return await e.apply()}catch(r){if(!Fn(r))throw r;return e.read()}}function Ue(e,r=console.error){let[t,d]=m(null),a=u(r);return a.current=r,P(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
|
|
2
|
+
export{Di,Fi,Pn,fa,In,Ue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{xr}from"./chunk-317w17va.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function ko(t,r,e={}){let o=r.trim();if(o.length===0)return[];return xr(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
|
|
2
|
+
export{ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as i,useContext as r}from"react";import{jsx as e}from"react/jsx-runtime";var n=i(null);function
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as i,useContext as r}from"react";import{jsx as e}from"react/jsx-runtime";var n=i(null);function ws({host:t,children:o}){return e(n.Provider,{value:t,children:o})}function c(){let t=r(n);if(t===null)throw Error("Activity host is missing");return t}function O(t){let{Markdown:o}=c();return e(o,{...t})}
|
|
2
|
+
export{ws,c,O};
|
|
@@ -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 Pi(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 vt({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{Pi,vt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{U,
|
|
1
|
+
import{U,Bt,xs}from"./chunk-4vayk46h.js";import{m}from"./chunk-75dr7tyz.js";function f(o,d,r){let s=document.createElement("span");if(s.contentEditable="false",s.setAttribute("aria-label",o),s.className=Bt,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 xs[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 mr(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 gr(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{mr,fo,gr,ho};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{wi}from"./chunk-vdt7cp6c.js";import{_i}from"./chunk-q3s59jyn.js";import{ki}from"./chunk-1wr1ef9x.js";import{vt}from"./chunk-c22xq7a3.js";import{n}from"./chunk-y8gz9rsc.js";import{e}from"./chunk-acf4sdp7.js";import{isContentEntry as b,isDiffEntry as w,isFormElicitation as C,isText as j,isToolCallSubject as f,isUrlElicitation as y}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as m}from"react/jsx-runtime";function et(t){return t.kind==="elicitation"&&C(t.params)}function R(t,o){if(!t.subject||!f(t.subject)||o===void 0)return t;let s={toolCallId:o.id,name:o.name,title:o.title,kind:o.toolKind,content:o.content,locations:o.locations,rawInput:o.rawInput},i=Object.fromEntries(Object.entries(t.subject.toolCall).filter(([,l])=>l!=null));return{...t,subject:{...t.subject,toolCall:{...s,...i}}}}function T(t){let o=t._meta?.codex;if(typeof o!=="object"||o===null)return null;let s=o.description;return typeof s==="string"?s:null}function A(t){let o=t.rawInput;if(typeof o!=="object"||o===null)return null;let s=o.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let o of t.content??[])if(w(o)&&o.patch&&o.patch.text.length>0)return o.patch.text;return null}function P(t){return(t.content??[]).filter(b).map((o)=>j(o.content)?o.content.text:"").filter((o)=>o.length>0).join(`
|
|
2
|
+
`)}function I({subject:t,requestTitle:o}){let{host:s}=e();if(!f(t))return null;let i=t.toolCall,l=A(i),r=v(i),u=P(i),d=s.toolTitle?.(i)??i.title;return m("div",{className:"flex flex-col gap-2",children:[d&&d!==o&&l===null&&c("div",{className:"text-sm font-medium",children:d}),l!==null&&m("pre",{className:"bg-muted max-h-80 overflow-auto overscroll-contain rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[c("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),r!==null&&c("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:c(vt,{patch:r,theme:s.theme})}),r===null&&l===null&&u.length>0&&c("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:u}),(i.locations??[]).length>0&&c("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(i.locations??[]).map((a)=>c("li",{className:"truncate font-mono",children:a.path},`${a.path}:${a.line??""}`))})]})}function g(t,o){let{host:s,client:i}=e();return(l)=>{try{if(o)o(t.id,l);else i.respond(t.id,l)}catch(r){if(s.reportError)s.reportError(r);else console.error(r)}}}function E({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=t.params.subject,u=r&&f(r)?r.toolCall.toolCallId:null,d=n((p)=>p.sessions[t.sessionId]?.items.find((h)=>h.kind==="tool"&&h.id===u)),a=R(t.params,d),x=i.permissionTitle?.(a)??a.title;return m(wi,{requestId:t.id,title:x,alwaysLabel:i.t("approval.always"),autoFocus:"if-idle",total:o,options:a.options.map((p)=>({...p,description:T(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[a.description&&c("div",{className:"text-muted-foreground mt-0.5 text-xs",children:a.description}),a.subject&&c(I,{subject:a.subject,requestTitle:x})]})}function ht({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=n((u)=>t.sessionId===null?void 0:u.sessions[t.sessionId]);return c(_i,{requestId:t.id,schema:t.params.requestedSchema,message:r?.subagent?`${r.title??i.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:o,t:i.t,onRespond:l})}function Fe({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s);if(t.kind==="permission")return c(E,{action:t,total:o,onRespond:s});if(et(t))return c(ht,{action:t,total:o??1,onRespond:s});let r=t.params;if(!y(r))throw Error("Unsupported elicitation mode");return c(ki,{message:r.message,url:r.url,t:i.t,onOpen:i.openLink,onRespond:(u)=>l(u==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
|
+
export{et,ht,Fe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{be}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{be}from"./chunk-e3nccytb.js";import{w}from"./chunk-y4tj08c1.js";import{t,le}from"./chunk-y8gz9rsc.js";import{isEmbeddedResource as T,isImage as y,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as F,FileIcon as I,ImageOffIcon as U,LoaderCircleIcon as z}from"lucide-react";import{useState as C}from"react";import{Button as c}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function qn(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function Vo(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function D({block:e,generated:r=!1}){let a=t(),[d,f]=C(!1),[R,B]=C(null);if(L(e)){let p=w(e.uri);if(p!==null)return n(be,{app:{id:p,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(U,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=qn(e.uri);return s(c,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(I,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!y(e))return null;let i=y(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=qn(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(c,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(I,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:x,openImageGallery:v}=a,h=v?()=>v([{src:m,alt:o,uri:i.uri}],0):x&&(()=>x(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else Vo(o,m)}catch(p){le(a,p)}finally{f(!1)}},N=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(h===void 0?N:n(c,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:h,children:N})),s(c,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(z,{className:"motion-safe:animate-spin"}):n(F,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
|
|
2
|
+
export{qn,Vo,D};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Le,u}from"./chunk-stv8pr4v.js";import{H}from"./chunk-8hygfx41.js";import{z}from"./chunk-64cbt3ym.js";import{E}from"./chunk-r5f77gtx.js";import{gt,Je,ft}from"./chunk-jgqt7k0h.js";import{PreviewCard as C}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as D}from"lucide-react";import{createContext as T,useContext as L,useLayoutEffect as M,useState as I}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as K}from"react/jsx-runtime";function N(o){if(o.as==="ul"){let{as:i,className:s,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",s),...a})}let{as:t,className:n,...r}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...r})}function v({className:o,...t}){return e("span",{"data-slot":"navigation-leading",className:p("flex size-6 shrink-0 items-center justify-center [&_.lucide]:size-3.5",o),...t})}function f({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function ie({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:b,headerChildren:g,wrapHeader:c,onHeaderClick:P,children:y}){let R=()=>{P?.(),t(!o)},x=p(gt,"relative flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),S=d(K,{children:[r!=null&&e(v,{children:r}),g??e(H,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(ft,{content:s!==void 0?e(Je,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:b})})]}),k=g==null?d("div",{"data-active":l?"":void 0,title:n,className:p(x,u),onClick:R,onKeyDown:(m)=>{if(m.target!==m.currentTarget)return;if(m.key!=="Enter"&&m.key!==" ")return;m.preventDefault(),R()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),S]}):e("div",{"data-active":l?"":void 0,className:x,children:S});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[c===void 0?k:c(k),o&&e(N,{className:"mt-0.5",children:y})]})}var _=T(()=>{}),G=T(()=>{});function tn(){return L(G)}function Ee(){return L(_)}function Re({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:b,preview:g,listeningPorts:c,onOpenPort:P,accessory:y,meta:R,hint:x,actions:S,className:k,...m}){let O=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(gt,Le,"group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(g||c!=null&&c.length>0)&&"h-auto min-h-[var(--navigation-row-height,30px)] py-2.5",k),...m,children:[e(v,{children:t!=null?e(z,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(H,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),b!=null&&e(H,{className:"text-muted-foreground text-xs",children:b}),g&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:g}),c!=null&&c.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:c.map((w)=>P?d("button",{type:"button",className:"underline",onPointerDown:(h)=>h.stopPropagation(),onKeyDown:(h)=>h.stopPropagation(),onClick:(h)=>{h.stopPropagation(),P(w)},children:[":",w]},w):d("span",{children:[":",w]},w))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(D,{className:"text-muted-foreground size-3"}),e(ft,{content:y!=null?e(Je,{children:y}):R??e(Je,{}),actions:S}),x!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:x})]})]});if(a==null)return O;return e(q,{row:O,onOpenChange:l,children:a})}function q({row:o,children:t,onOpenChange:n}){let[r,i]=I(!1),[s,a]=I(!1),l=r||s;return M(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(_.Provider,{value:a,children:e(G.Provider,{value:()=>{i(!1),a(!1)},children:e(j,{open:l,onOpenChange:i,trigger:o,children:t})})})}function j({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return E(o),d(C.Root,{open:o,onOpenChange:t,children:[e(C.Trigger,{render:n,delay:700,closeDelay:100}),e(C.Portal,{children:e(C.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(C.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
|
|
2
|
+
export{N,v,f,ie,tn,Ee,Re};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{mo,St}from"./chunk-0enb3f4n.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function it(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=mo(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Za(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return St(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
|
|
2
|
+
export{it,Za};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{t}from"./chunk-y8gz9rsc.js";import{Po,Io}from"./chunk-je27hf3t.js";import{F}from"./chunk-wde0m4pf.js";import{Et}from"./chunk-rv3k0kfr.js";import{Ro}from"./chunk-95ywdfe0.js";import{as,xe,Ht,cs}from"./chunk-syjt7y4v.js";import{Ao}from"./chunk-pebkk426.js";import{je}from"./chunk-zypgrbd9.js";import{Lo}from"./chunk-qceex4vv.js";import{Do}from"./chunk-zm0j9nw3.js";import{Tr}from"./chunk-j2ffde9c.js";import{Ir}from"./chunk-v0wmy9b3.js";import{os}from"./chunk-k2nbrerw.js";import{Nr}from"./chunk-zyn0ys4m.js";import{To,Mo}from"./chunk-7s7cevjh.js";import{Lt}from"./chunk-ftsnryz8.js";import{codexMessageError as q,codexTurnError as z,isContentEntry as me,isEmbeddedResource as Z,isImage as ee,isResourceLink as le,isText as de,nativeTurnId as ce}from"@nyssance/codex-acp-v2/client";import{SparklesIcon as ge}from"lucide-react";import{Fragment as X,memo as ue,useEffect as pe,useState as fe}from"react";import{jsx as i,jsxs as m,Fragment as A}from"react/jsx-runtime";function Y(s){if(ee(s))return`${s.mimeType.toLowerCase()}:${s.data}`;if(Z(s)&&"blob"in s.resource&&s.resource.mimeType?.toLowerCase().startsWith("image/"))return`${s.resource.mimeType.toLowerCase()}:${s.resource.blob}`;return null}function ye({item:s}){let{t:n}=t(),l=s.status==="in_progress",[o,g]=fe(()=>Date.now()-s.at>=1e4);return pe(()=>{if(!l)return;let a=Math.max(0,s.at+1e4-Date.now());if(g(a===0),a===0)return;let h=setTimeout(()=>g(!0),a);return()=>clearTimeout(h)},[s.id,s.at,l]),m("div",{className:"codex-context-compaction",children:[i(ge,{"aria-hidden":"true"}),i("span",{children:s.status==="completed"?n("stream.codex.contextCompacted"):s.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:s,entry:n,terminals:l,streaming:o,streamingThoughtId:g}){let{t:a}=t();switch(n.kind){case"activity":return i(Ao,{sessionId:s,items:n.items,terminals:l,streamingThoughtId:g});case"text":return F(n.item._meta).length>0?i(Do,{sessionId:s,item:n.item}):i(je,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return i(os,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(To,{children:[i("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&i("div",{children:n.item.error})]});return i(ye,{item:n.item})}}function he({sessionId:s,turn:n,terminals:l,active:o,blocked:g=!1,continued:a=!1,edits:h=n.edits,activityItems:M=n.items,workStartedAt:te=n.startedAt,isLast:L,error:k,interrupted:P,retry:G,retrying:p,extraWork:d=null,answerActions:O,footer:ne}){let{t:c}=t(),b=n.errors.map((e)=>{let r=q(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let E=G?.turnId===ce(e)?G:void 0;return i(Mo,{error:r,retry:E},`${e.id}:${E?.delaySeconds??"manual"}`)});if(L&&k!==null&&!n.errors.some((e)=>{let r=q(e);return r!==null&&r.stopReason===k.stopReason&&z(r).message===z(k).message}))b.push(i(Mo,{error:k},"current-run-error"));let x=b.length>0?i("div",{className:"codex-turn-errors",children:b}):null,C=n.items.filter(Ro);if(d===null&&C.length>0&&C.length===n.items.length)return m(A,{children:[i(Ao,{sessionId:s,items:C,terminals:l,streamingThoughtId:null}),x]});let T=n.work,w=T.length>0&&T.every((e)=>e.kind==="compaction");if(d===null&&(as(n)||w&&n.final.length===0))return m(A,{children:[i("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),x]});let W=Ht(n),D=n.final.filter((e)=>F(e._meta).length===0).map((e)=>xe({...e,content:Lo(e.content,n.items)})).join(`
|
|
2
|
+
`),I=o?null:Lt(n,"assistant"),B=n.items.filter((e)=>e.kind==="tool"&&(e.name==="image_generation"||e.name==="generate_image"||e.name?.endsWith(".generate_image"))&&(e.status==="pending"||e.status==="in_progress")),H=new Set(n.final.flatMap((e)=>e.content.map(Y).filter((r)=>r!==null))),f=n.items.flatMap((e)=>{if(!Et(e))return[];return e.content.filter(me).flatMap((r,E)=>{let u=r.content,oe=ee(u),ae=le(u)||Z(u)&&"blob"in u.resource;if(!oe&&!ae)return[];let _=Y(u);if(_!==null){if(H.has(_))return[];H.add(_)}return[{key:`${e.id}:${E}`,block:u}]})}),K=n.final.some((e)=>F(e._meta).length===0&&e.content.some((r)=>!de(r)||r.text.trim().length>0)),ie=B.length>0||f.length>0||w||K||n.final.some((e)=>F(e._meta).length>0),v=n.items.findIndex((e)=>n.final.includes(e)),R=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),Q=T.filter((e)=>v===-1||R(e)<v),se=T.filter((e)=>v!==-1&&R(e)>v),re=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...se.map((e)=>({kind:"work",entry:e,index:R(e)}))].toSorted((e,r)=>e.index-r.index),V=!o&&!a&&(D.trim().length>0?i(Po,{text:D,isMostRecentTurn:L,time:I,afterCopy:O}):m("div",{className:"flex items-center gap-0.5",children:[O,I&&i("span",{className:"codex-user-time ms-1",title:I.full,children:I.short})]})),y=Nr({...n,items:M},{running:o,blocked:g,retrying:p!==void 0}),j=y.kind==="reasoning"?y.ownerKey??null:null,J=y.kind==="thinking",S=cs({...n,items:M}),U=o&&!K||d?.active===!0;return m(A,{children:[i(Io,{stateKey:JSON.stringify([s,n.replayed?"history":"live",n.key]),active:U,defaultExpanded:U||d?.defaultExpanded===!0||!n.replayed&&(P||W),...S,durationMs:d?.active?void 0:S.durationMs,startedAt:S.startedAt??te,loading:(J||y.kind==="working")&&n.work.length===0&&d===null,loadingLabel:y.kind==="working"?c("stream.codex.working"):void 0,work:[...a||w?[]:Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:o,streamingThoughtId:j},e.key)),...d===null?[]:[i(X,{children:d.content},"additional-work")]],answer:ie||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||w)&&Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),re.map((e)=>{if(e.kind==="work")return i(N,{sessionId:s,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:j},e.entry.key);let r=e.item;return m(X,{children:[F(r._meta).length>0?i(Do,{sessionId:s,item:r}):i(je,{content:Lo(r.content,n.items),messageId:r.id,streaming:o}),r===n.final.at(-1)&&f.length===0&&V]},r.id)}),B.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":c(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[i("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&i(Ir,{startedAt:e.at}),!o&&c("timeline.imageStopped")]})]},e.id)),f.length>0&&i("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:f.map((e)=>i(je,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),(n.final.length===0||f.length>0)&&V]}):null,footer:m(A,{children:[J&&n.work.length>0&&i("div",{className:"codex-pending-message py-2",role:"status",children:i("span",{className:"codex-activity-running",children:c("message.thinking")})}),ne,h.length>0&&!o&&!a&&i(Tr,{items:h}),P&&!W&&i("div",{className:"codex-interrupted-turn",role:"status",children:c("timeline.interrupted")}),!o&&x]})}),o&&p!==void 0&&i("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return e===void 0?c("timeline.capacityReconnecting"):c("timeline.capacityReconnectingProgress",{progress:e})})():p.message}),o&&x]})}var _r=ue(he);
|
|
3
|
+
export{_r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{t}from"./chunk-y8gz9rsc.js";import{xn}from"./chunk-ax7c2kam.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Mi({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:xn(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:xn(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
|
|
2
|
+
export{Mi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{g}from"./chunk-tgnftxyb.js";import{e}from"./chunk-acf4sdp7.js";import{yt}from"./chunk-amf0m4tb.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ni({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=g(),{text:c,status:n}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(r,{type:"button",variant:"ghost",disabled:n!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:n==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(n==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),n==="error"&&a.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>yt(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
+
export{Ni};
|