@alwith/module-chat 0.6.33 → 0.6.34
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 +1 -1
- package/assets/catalogs/deepseek/models.json +4 -66
- package/assets/catalogs/doubao/models.json +92 -0
- package/assets/catalogs/doubao-coding/models.json +92 -0
- package/assets/catalogs/kimi/models.json +84 -0
- package/assets/catalogs/minimax/models.json +79 -0
- package/assets/catalogs/qwen/models.json +10 -201
- package/assets/catalogs/xai/models.json +4 -77
- package/assets/catalogs/zhipu/models.json +83 -0
- package/assets/provider-catalog.json +130 -58
- package/assets/provider-models.v1.json +379 -0
- package/dist/activity-host.js +1 -1
- package/dist/agent/client.js +1 -1
- package/dist/agent/custom-model-effort.d.ts +1 -1
- package/dist/agent/custom-model-effort.js +1 -1
- package/dist/agent/fork-title.js +1 -1
- package/dist/agent/image-request.js +1 -1
- package/dist/agent/image-tools.js +1 -1
- package/dist/agent/input-config.js +1 -1
- package/dist/agent/input-modes/chat.js +1 -1
- package/dist/agent/input-modes/execution-meta.js +1 -1
- package/dist/agent/input-modes/image-context.js +1 -1
- package/dist/agent/input-modes/image.js +1 -1
- package/dist/agent/input-modes/index.js +1 -1
- package/dist/agent/project-path.js +1 -1
- package/dist/agent/request-error.js +1 -1
- package/dist/agent/session-list-refresh.js +1 -1
- package/dist/app-reference.js +1 -1
- package/dist/application-tools.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/{chunk-1y5zgya3.js → chunk-0a3tr9ws.js} +2 -2
- package/dist/{chunk-af0e5epn.js → chunk-0b50jg23.js} +2 -2
- package/dist/{chunk-e31s069c.js → chunk-0bc7gfq4.js} +2 -2
- package/dist/{chunk-23r2z6bp.js → chunk-0kaa9dja.js} +2 -2
- package/dist/{chunk-y2bb2ey4.js → chunk-0myfs71s.js} +2 -2
- package/dist/{chunk-mahky9ad.js → chunk-0t4fcgge.js} +2 -2
- package/dist/{chunk-9b8gnrcb.js → chunk-103z8myv.js} +2 -2
- package/dist/{chunk-fxdkhe0d.js → chunk-11kkxd6v.js} +2 -2
- package/dist/{chunk-w2z3sxdq.js → chunk-19jh646d.js} +2 -2
- package/dist/{chunk-b7gntaap.js → chunk-19jwgexv.js} +3 -3
- package/dist/{chunk-2d4zb2ac.js → chunk-1d29gnb2.js} +2 -2
- package/dist/{chunk-84zzf0ys.js → chunk-1gb1vwvy.js} +2 -2
- package/dist/{chunk-zmr5pwhd.js → chunk-1md5vq9g.js} +2 -2
- package/dist/chunk-1p3ekdt4.js +2 -0
- package/dist/chunk-1xgm6fpr.js +2 -0
- package/dist/{chunk-egbb5295.js → chunk-2016dacx.js} +2 -2
- package/dist/{chunk-mfrg4vze.js → chunk-28nsjq3w.js} +3 -3
- package/dist/{chunk-11kv54bx.js → chunk-2dnzdsrv.js} +3 -3
- package/dist/{chunk-xjbf9h6m.js → chunk-2eceheqt.js} +3 -3
- package/dist/{chunk-jfyz3rx6.js → chunk-2rjg9fs9.js} +2 -2
- package/dist/{chunk-2ay0m7xn.js → chunk-2s0jckfr.js} +2 -2
- package/dist/{chunk-8at9k0cn.js → chunk-3272z6sv.js} +2 -2
- package/dist/{chunk-ekfs7wrp.js → chunk-38eckxjk.js} +2 -2
- package/dist/{chunk-pe6ex52z.js → chunk-45yrj0e1.js} +4 -4
- package/dist/{chunk-zyermn00.js → chunk-4jza4wwy.js} +2 -2
- package/dist/{chunk-q988bycf.js → chunk-4wm5emgf.js} +2 -2
- package/dist/{chunk-nec3tcjh.js → chunk-52wrk1mh.js} +2 -2
- package/dist/{chunk-mfmh7ztq.js → chunk-54j6xftt.js} +2 -2
- package/dist/{chunk-hzcerz8j.js → chunk-56jqg70p.js} +1 -1
- package/dist/{chunk-nqt9gyz9.js → chunk-5h49mv0e.js} +2 -2
- package/dist/{chunk-06mvwewp.js → chunk-5rzy2287.js} +2 -2
- package/dist/{chunk-r84xcy0d.js → chunk-5x2aqmhm.js} +2 -2
- package/dist/{chunk-3y9az4b9.js → chunk-64apxzn7.js} +2 -2
- package/dist/{chunk-hj8nkk6a.js → chunk-68afy8mk.js} +2 -2
- package/dist/{chunk-h3geg09z.js → chunk-69tgmjdb.js} +2 -2
- package/dist/chunk-6cedp3k2.js +2 -0
- package/dist/{chunk-69965ctr.js → chunk-6eg26dz5.js} +3 -3
- package/dist/{chunk-kn1j4cy1.js → chunk-6h10jana.js} +2 -2
- package/dist/{chunk-7a806p3q.js → chunk-6nbqbjnb.js} +3 -3
- package/dist/{chunk-k76s8cq2.js → chunk-72xm1tz1.js} +2 -2
- package/dist/{chunk-m31f2m2y.js → chunk-75xtk0a3.js} +2 -2
- package/dist/chunk-7hhc8y2n.js +2 -0
- package/dist/{chunk-pd5yrdg6.js → chunk-7m8hw6gh.js} +2 -2
- package/dist/{chunk-k1f40yn4.js → chunk-7p0d3rz7.js} +2 -2
- package/dist/{chunk-h77c4pnj.js → chunk-7xsrqwvt.js} +2 -2
- package/dist/{chunk-askwff3a.js → chunk-81xwn9e5.js} +3 -3
- package/dist/{chunk-yw927w3q.js → chunk-84p483n0.js} +2 -2
- package/dist/{chunk-3dvxhfcr.js → chunk-86tpa1nn.js} +2 -2
- package/dist/{chunk-vcj2jfnz.js → chunk-88ysxbdh.js} +2 -2
- package/dist/{chunk-7z1k4s4f.js → chunk-89gyxwmd.js} +1 -1
- package/dist/{chunk-zwpv75f4.js → chunk-8gas4q2s.js} +2 -2
- package/dist/{chunk-hpv8x22r.js → chunk-8hm3nkrk.js} +2 -2
- package/dist/{chunk-basmnv1z.js → chunk-8sa6xn88.js} +2 -2
- package/dist/{chunk-pyqhwz2d.js → chunk-8w08gd0y.js} +3 -3
- package/dist/{chunk-6yx869ht.js → chunk-965sngjd.js} +2 -2
- package/dist/{chunk-j9f4mh66.js → chunk-9jth6sk7.js} +2 -2
- package/dist/chunk-9s8ht9xe.js +2 -0
- package/dist/{chunk-ep9z16w6.js → chunk-9t672hzm.js} +2 -2
- package/dist/{chunk-bf7sgpzq.js → chunk-9x70f7zv.js} +2 -2
- package/dist/{chunk-5jvpeww3.js → chunk-9y0fxq8e.js} +2 -2
- package/dist/{chunk-544g9fky.js → chunk-a18avvt2.js} +2 -2
- package/dist/{chunk-0zncrzar.js → chunk-ad53zbdb.js} +2 -2
- package/dist/{chunk-y47sn7w2.js → chunk-arr0hypp.js} +2 -2
- package/dist/{chunk-m8243rnx.js → chunk-as2j0yp0.js} +2 -2
- package/dist/{chunk-gh1rtwrb.js → chunk-at25g15n.js} +2 -2
- package/dist/{chunk-k3h77wtz.js → chunk-b6sb3akb.js} +2 -2
- package/dist/{chunk-5f7t16kj.js → chunk-b9v0vew6.js} +2 -2
- package/dist/chunk-bhajnmtf.js +2 -0
- package/dist/{chunk-ma6ycen5.js → chunk-bq31dzpj.js} +2 -2
- package/dist/{chunk-eb78ebxa.js → chunk-bqbyjazm.js} +2 -2
- package/dist/{chunk-3a8qwbgh.js → chunk-bsb08p49.js} +3 -3
- package/dist/{chunk-3vdx0cme.js → chunk-cef598jy.js} +2 -2
- package/dist/{chunk-hwppy236.js → chunk-ckbqdg1s.js} +2 -2
- package/dist/chunk-cmfcnze3.js +4 -0
- package/dist/chunk-d4jkh19p.js +2 -0
- package/dist/{chunk-pxbr08fz.js → chunk-dcvmc9hn.js} +2 -2
- package/dist/{chunk-akgjyyz8.js → chunk-dhn9f10w.js} +2 -2
- package/dist/{chunk-v92wj4tv.js → chunk-dn8xcv31.js} +2 -2
- package/dist/{chunk-rhptdqpp.js → chunk-dqjhmzjy.js} +1 -1
- package/dist/chunk-dwv3z2sk.js +2 -0
- package/dist/{chunk-cy5kh1yr.js → chunk-dwxmgsg8.js} +2 -2
- package/dist/{chunk-spqfmr4z.js → chunk-dxwbgg69.js} +2 -2
- package/dist/chunk-e4ws15tg.js +2 -0
- package/dist/{chunk-x0etjzy8.js → chunk-e84mhse2.js} +3 -3
- package/dist/chunk-e8bazy7m.js +2 -0
- package/dist/chunk-eaxevj9t.js +2 -0
- package/dist/{chunk-4z6gyvy3.js → chunk-eqa6cd7b.js} +2 -2
- package/dist/{chunk-02sj8dwy.js → chunk-erdrx47j.js} +1 -1
- package/dist/chunk-f0hb6t2w.js +2 -0
- package/dist/{chunk-a0qy1r02.js → chunk-f67e77e6.js} +2 -2
- package/dist/{chunk-nf7q3crw.js → chunk-f6cexkjm.js} +2 -2
- package/dist/chunk-fcy6mh2e.js +2 -0
- package/dist/{chunk-705j0x4q.js → chunk-fwn521m5.js} +2 -2
- package/dist/{chunk-3dbxzwcz.js → chunk-g1de763m.js} +2 -2
- package/dist/chunk-g7dxg38a.js +2 -0
- package/dist/{chunk-n96z8etk.js → chunk-g947bnqx.js} +2 -2
- package/dist/{chunk-ypdh88cj.js → chunk-gfkx1z04.js} +2 -2
- package/dist/{chunk-qm0zd4wj.js → chunk-gktjkghg.js} +2 -2
- package/dist/chunk-gs0b02g2.js +2 -0
- package/dist/{chunk-33bd1ey8.js → chunk-h4xx90s4.js} +2 -2
- package/dist/{chunk-5e575zvm.js → chunk-hs98zk6m.js} +2 -2
- package/dist/{chunk-036wyz4n.js → chunk-j4ejwthn.js} +2 -2
- package/dist/{chunk-abbpbnjj.js → chunk-jaghs2z5.js} +2 -2
- package/dist/{chunk-fbrv2v3t.js → chunk-jf7em132.js} +1 -1
- package/dist/chunk-k2xs8svj.js +2 -0
- package/dist/{chunk-zvfad5gd.js → chunk-k3fwyr6s.js} +2 -2
- package/dist/{chunk-wbnmcagf.js → chunk-k5kzw2px.js} +3 -3
- package/dist/{chunk-j4w2hbbe.js → chunk-kbzsn9xw.js} +2 -2
- package/dist/{chunk-7hfd7hnm.js → chunk-kj3a1k2q.js} +2 -2
- package/dist/{chunk-exrt8sd0.js → chunk-ks22p0wq.js} +2 -2
- package/dist/chunk-ksq9a3pf.js +2 -0
- package/dist/{chunk-fer4r3b8.js → chunk-kv3hsfyk.js} +2 -2
- package/dist/{chunk-b89bzpce.js → chunk-kyqf7cqh.js} +2 -2
- package/dist/{chunk-qm9c9sd7.js → chunk-m4ds8kjc.js} +2 -2
- package/dist/{chunk-rfkgks0a.js → chunk-m6sdmcpj.js} +2 -2
- package/dist/{chunk-djqexpgf.js → chunk-masqfje4.js} +2 -2
- package/dist/{chunk-znafsq0a.js → chunk-mfkrs2at.js} +2 -2
- package/dist/{chunk-3d3z6dam.js → chunk-mhhtcbh9.js} +2 -2
- package/dist/{chunk-ggxdrm0c.js → chunk-mmrwaa9h.js} +2 -2
- package/dist/{chunk-y81242w2.js → chunk-mq0npf36.js} +2 -2
- package/dist/{chunk-x4brdfv3.js → chunk-mrwawq46.js} +2 -2
- package/dist/{chunk-p72pzfww.js → chunk-mt01qph9.js} +2 -2
- package/dist/chunk-n88j8hsd.js +2 -0
- package/dist/{chunk-f84mdhkx.js → chunk-n8fe2njr.js} +2 -2
- package/dist/{chunk-xmesmh1h.js → chunk-nef7y6mg.js} +2 -2
- package/dist/{chunk-016v1nnv.js → chunk-nhz4egjh.js} +3 -3
- package/dist/chunk-nvsws1yg.js +2 -0
- package/dist/{chunk-srqs8z90.js → chunk-p02bdewy.js} +2 -2
- package/dist/{chunk-7r3k37ys.js → chunk-p216frcj.js} +2 -2
- package/dist/{chunk-cr0pb6g0.js → chunk-pae2hjvq.js} +2 -2
- package/dist/{chunk-8zsta2p3.js → chunk-pr6qwqpj.js} +2 -2
- package/dist/{chunk-3eetka54.js → chunk-pr7xj1fn.js} +2 -2
- package/dist/{chunk-kvwyryw2.js → chunk-prwzyc7q.js} +2 -2
- package/dist/{chunk-tzb4b5ve.js → chunk-ptdx40ae.js} +2 -2
- package/dist/{chunk-hjbq9ez1.js → chunk-q61xz251.js} +2 -2
- package/dist/{chunk-fy8dmpv3.js → chunk-q78ng7mn.js} +2 -2
- package/dist/{chunk-kx9nnmwb.js → chunk-qd9s7wmj.js} +3 -3
- package/dist/{chunk-f8bx4etj.js → chunk-qwjz3jsz.js} +2 -2
- package/dist/{chunk-4vfrxhj4.js → chunk-r0dg1bjd.js} +2 -2
- package/dist/{chunk-kdcde4s5.js → chunk-r5q65gf3.js} +2 -2
- package/dist/{chunk-ky3n1mza.js → chunk-r7g85s0a.js} +2 -2
- package/dist/{chunk-v6x7x69b.js → chunk-r8gnmyb1.js} +2 -2
- package/dist/{chunk-51s7qck0.js → chunk-r8sq654w.js} +2 -2
- package/dist/{chunk-g2ew3jg9.js → chunk-rd51rvde.js} +2 -2
- package/dist/{chunk-46bgwhx8.js → chunk-re4vc51w.js} +2 -2
- package/dist/{chunk-mjd3839j.js → chunk-rr5ek064.js} +2 -2
- package/dist/{chunk-9pm3vzgx.js → chunk-rt9dn0b3.js} +3 -3
- package/dist/{chunk-cfj92m1y.js → chunk-sbyp6k8w.js} +2 -2
- package/dist/{chunk-12bfnfbk.js → chunk-sgmh6sa8.js} +2 -2
- package/dist/{chunk-5p53j8mf.js → chunk-ske5z0gp.js} +2 -2
- package/dist/chunk-t1qj0vqe.js +2 -0
- package/dist/{chunk-5hjk7xnq.js → chunk-t2ej667n.js} +2 -2
- package/dist/{chunk-1jxvmsgm.js → chunk-tab23kkx.js} +2 -2
- package/dist/{chunk-enc99kvz.js → chunk-tj0530fn.js} +2 -2
- package/dist/{chunk-2ad4fb9z.js → chunk-tjt1s9qs.js} +2 -2
- package/dist/{chunk-8q5zwkry.js → chunk-tz1gzwas.js} +2 -2
- package/dist/{chunk-c4rptwfx.js → chunk-v4tznge3.js} +3 -3
- package/dist/{chunk-tszqev50.js → chunk-vab1ysnz.js} +2 -2
- package/dist/{chunk-xg6ayxsy.js → chunk-vb9mn75j.js} +2 -2
- package/dist/{chunk-e6wq8gef.js → chunk-vedvkp9e.js} +3 -3
- package/dist/{chunk-pe79c1re.js → chunk-vgea7ggq.js} +2 -2
- package/dist/{chunk-1pnbntv2.js → chunk-vnd6smsp.js} +2 -2
- package/dist/{chunk-x4bzkzbt.js → chunk-vys8kfkp.js} +2 -2
- package/dist/{chunk-twwcd2qv.js → chunk-w1ga47ww.js} +2 -2
- package/dist/{chunk-cjj5bxdb.js → chunk-w2bgfpdh.js} +2 -2
- package/dist/{chunk-1jznzjzn.js → chunk-w83nb5a8.js} +2 -2
- package/dist/{chunk-d9q9qgm1.js → chunk-wj9s8331.js} +2 -2
- package/dist/chunk-wjgrrfq9.js +2 -0
- package/dist/{chunk-p6ffd8yn.js → chunk-wpacvdsv.js} +2 -2
- package/dist/{chunk-b7ze9dje.js → chunk-wvm6ppb3.js} +2 -2
- package/dist/{chunk-wkbxdz82.js → chunk-x2wcwpw3.js} +2 -2
- package/dist/{chunk-82e3194f.js → chunk-x2x9g6vk.js} +2 -2
- package/dist/{chunk-p9x6rya1.js → chunk-x49qjrbk.js} +2 -2
- package/dist/{chunk-chg6j0zg.js → chunk-x6spt0mc.js} +2 -2
- package/dist/{chunk-9m36e0yq.js → chunk-xqb4thy8.js} +2 -2
- package/dist/{chunk-enbvjbcm.js → chunk-xqqk85kd.js} +2 -2
- package/dist/{chunk-tftgnw1w.js → chunk-y0rnvmrw.js} +2 -2
- package/dist/{chunk-vqqafkcx.js → chunk-y8p2dmw3.js} +2 -2
- package/dist/{chunk-7f5xngd2.js → chunk-ygaqqwmb.js} +2 -2
- package/dist/{chunk-r8gfcyeb.js → chunk-yq4wz4n8.js} +2 -2
- package/dist/{chunk-3myhs627.js → chunk-yvzkb5p5.js} +2 -2
- package/dist/{chunk-xckysrk7.js → chunk-z0q7ghbg.js} +2 -2
- package/dist/{chunk-qmx3t5he.js → chunk-z6tw9cf9.js} +2 -2
- package/dist/{chunk-p9226dye.js → chunk-z6x70w62.js} +2 -2
- package/dist/{chunk-rej2s2c0.js → chunk-z8b3nz7t.js} +2 -2
- package/dist/{chunk-67a3eqhg.js → chunk-zb0m2cqy.js} +2 -2
- package/dist/{chunk-68a1sgrr.js → chunk-zea1chz7.js} +3 -3
- package/dist/{chunk-c531krny.js → chunk-zg0tv3sj.js} +3 -3
- package/dist/{chunk-rsbced6k.js → chunk-zk395v8p.js} +2 -2
- package/dist/{chunk-zhf7403q.js → chunk-zqpcrtde.js} +2 -2
- package/dist/{chunk-pwk7epmy.js → chunk-zv3bm3np.js} +2 -2
- package/dist/{chunk-jhaf3qtt.js → chunk-zy6qme7n.js} +2 -2
- package/dist/{chunk-4hasepkm.js → chunk-zyn0ys4m.js} +2 -2
- package/dist/{chunk-tss25z64.js → chunk-zyyn9t8n.js} +3 -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/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/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-inline.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/app-mentions.js +1 -1
- package/dist/conversation/composer/apps-menu.js +1 -1
- package/dist/conversation/composer/composer-menu.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/prompt-history.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/connection-notice.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-search.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/diff-modal.js +1 -1
- package/dist/conversation/draft-project-picker.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/conversation/subagent-sessions.js +1 -1
- package/dist/conversation/subagent-tasks.js +1 -1
- package/dist/desktop/desktop-composer.js +1 -1
- package/dist/desktop/desktop.js +1 -1
- package/dist/desktop/draft-model-select.js +1 -1
- package/dist/desktop/load-image.js +1 -1
- package/dist/desktop/model-catalog.js +1 -1
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.d.ts +65 -65
- package/dist/generated/commands.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.js +1 -1
- package/dist/lib/app-reference.js +1 -1
- package/dist/lib/application-metadata.js +1 -1
- package/dist/lib/chat-path.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/lib/tool-artifacts.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mermaid/diagram.js +1 -1
- package/dist/mermaid/export.js +1 -1
- package/dist/mermaid/index.js +1 -1
- package/dist/mermaid/preview.js +1 -1
- package/dist/oauth/claude-login.js +1 -1
- package/dist/oauth.js +1 -1
- package/dist/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.js +1 -1
- package/dist/plugins/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/reference-projection.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/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.d.ts +3 -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.d.ts +2 -4
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.d.ts +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 +1 -1
- package/assets/catalogs/openrouter/models.json +0 -215
- package/dist/chunk-1wk1yw69.js +0 -2
- package/dist/chunk-2qa3c571.js +0 -2
- package/dist/chunk-2reym9jt.js +0 -4
- package/dist/chunk-2w3c4tg8.js +0 -2
- package/dist/chunk-5t2ge7gg.js +0 -2
- package/dist/chunk-680e6bz4.js +0 -2
- package/dist/chunk-6ewv4vns.js +0 -2
- package/dist/chunk-6wsr59dr.js +0 -2
- package/dist/chunk-8byhp88a.js +0 -2
- package/dist/chunk-c4mm4fzg.js +0 -2
- package/dist/chunk-jnpkpe5t.js +0 -2
- package/dist/chunk-jp2s1xsa.js +0 -2
- package/dist/chunk-ky4j58wz.js +0 -2
- package/dist/chunk-p0v9d7e1.js +0 -2
- package/dist/chunk-qj87dxrr.js +0 -2
- package/dist/chunk-qth2ames.js +0 -2
- package/dist/chunk-qyfkwznx.js +0 -2
- package/dist/chunk-rayhzb8p.js +0 -2
- package/dist/chunk-wg223rq3.js +0 -2
- package/dist/chunk-wv6ntscn.js +0 -2
- package/dist/chunk-wvm8srp7.js +0 -2
- package/dist/chunk-x03z0hme.js +0 -2
- package/dist/chunk-zdqjjwx0.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{xr}from"./chunk-3dvxhfcr.js";import{Vo,Ve,t,$e,n,ce}from"./chunk-rayhzb8p.js";import{as,Ot,Go,ds,us}from"./chunk-fy8dmpv3.js";import{Rt}from"./chunk-mahky9ad.js";import{Sr}from"./chunk-68a1sgrr.js";import{Or}from"./chunk-3vdx0cme.js";import{Hr,Ur}from"./chunk-67a3eqhg.js";import{Yr,es}from"./chunk-6yx869ht.js";import{Dr}from"./chunk-3y9az4b9.js";import{Fr}from"./chunk-yw927w3q.js";import{os}from"./chunk-b7gntaap.js";import{codexExtensionCapabilities as ze,codexMessageError as Be,codexRetryNotice as Oe,codexTurnError as qe,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Fe}from"lucide-react";import{useCallback as M,useEffect as H,useLayoutEffect as Te,useMemo as K,useRef as b,useState as U}from"react";import{flushSync as ye}from"react-dom";import{Button as Y}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as E}from"react/jsx-runtime";var xe=24;function De(e){let f=Math.max(0,e.turnTopPx-xe),v=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),c=f-v;return{scrollTopPx:f,spacerPx:c>0?e.spacerPx+c:e.spacerPx}}function Ke({viewportRef:e,viewportProps:f,children:v}){return o("div",{ref:e,...f,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:v})}function Ue({sessionId:e,turnId:f,root:v,error:c,connected:S}){let z=b(null),V=$e(),{t:w}=t(),k=M(()=>{V.loadHistoryTurn(e,f).catch(()=>{})},[V,e,f]);return H(()=>{if(!v||!z.current||!S||c)return;let R=new IntersectionObserver((_)=>{if(_.some((g)=>g.isIntersecting))R.disconnect(),k()},{root:v,rootMargin:"800px 0px"});return R.observe(z.current),()=>R.disconnect()},[v,S,c,k]),o("div",{ref:z,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":f,"data-markdown-pending":!0,children:c?E("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:c}),o(Y,{variant:"outline",size:"sm",onClick:k,disabled:!S,children:w("timeline.navigationRetry")})]}):E("div",{role:"status","aria-label":w("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function _e(e,f){let v=b([]),c=b(null);if(c.current?.items!==e.items||c.current.state!==e.state||c.current.ended!==e.turnEndedAt||c.current.usage!==e.turnUsage||c.current.historyOrder!==f)c.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:f,turns:as(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function Nt(e){return o(Ve,{host:e.host,client:e.client,children:o(Vo,{value:e.session.cwd,children:o(We,{...e})})})}function We({session:e,leading:f,afterTurn:v,turnWork:c,answerActions:S,turnFooter:z,renderUserMessage:V,insert:w,navigation:k,anchorNewTurn:R=!1,Viewport:_=Ke}){let g=$e(),L=t(),T=n((r)=>r.historyNavigation[e.id]),he=K(()=>e.commands.map((r)=>r.name),[e.commands]),m=_e(e,T?.turns),A=m.at(-1)?.key,be=ds(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Or(m,T),[m,T]),Z=K(()=>W.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[W]),we=K(()=>k===void 0?[]:Hr(m,e.turnUsage,T),[k,m,e.turnUsage,T]),ee=w&&w.afterItemId!==null?m.findIndex((r)=>r.items.some((u)=>u.id===w.afterItemId)):-1,j=b(m);j.current=m;let[l,Re]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),Se=n((r)=>ze(r.agent).sessionRetry),te=x!==void 0;H(()=>{if(P&&te&&!e.restoring)g.loadHistoryNavigation(e.id).catch(()=>{})},[g,P,te,e.id,e.restoring]);let[ke,Pe]=U(!1),q=b(null),[Ie,ne]=U(!1),re=b(0),X=b({key:A,running:y});X.current={key:A,running:y};let[ie,F]=U(0),I=b(0),N=b(null);I.current=ie;let Ne=M(()=>{if(N.current!==null)N.current.keepTop=!1},[]),{isFollowing:C,scrollToBottom:G,stopFollowing:B,schedulePin:oe,contentResized:le,beginLocate:ae,cancelLocation:ue}=Fr(l,y,Ne),se=M(()=>{if(l===null||!y)return;let r=m.at(-1)?.key;if(r===void 0)return;let u=ae(!0),d=()=>u.isCurrent()&&X.current.running&&X.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!d())return;let a=l.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(a===null)return;let s=l.scrollTop+a.getBoundingClientRect().top-l.getBoundingClientRect().top,p=De({turnTopPx:s,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:I.current});N.current=p.spacerPx>0?{element:a,heightPx:a.getBoundingClientRect().height+p.spacerPx,keepTop:!0}:null,ye(()=>F(p.spacerPx)),requestAnimationFrame(()=>{if(d())u.finish(p.scrollTopPx)})})),h=q.current;if(h===null)return;h.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(d())i()})},[ae,y,l,m]);Te(()=>{if(!R||y)return;ue(),N.current=null,I.current=0,F(0)},[R,ue,y]);let J=M(()=>{B(),g.loadOlderHistory(e.id).catch(()=>{})},[g,e.id,B]);H(()=>{if(l===null)return;let r=()=>{let u=l.scrollTop<600;if(Pe(u),u&&!T?.complete&&P&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)J()};return r(),l.addEventListener("scroll",r,{passive:!0}),()=>l.removeEventListener("scroll",r)},[P,x,C,J,l,e.restoring,T?.complete]),H(()=>{Yr({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>es(e.id),[e.id]);let He=M(async(r,u)=>{let d=++re.current;ne(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await g.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((s)=>requestAnimationFrame(()=>s()));if(!u())return null;let i=j.current.find((s)=>s.user?.id===(r.messageId??r.id))??j.current.find((s)=>s.user!==null&&r.nativeTurnId!==void 0&&s.items.some((p)=>ge(p)===r.nativeTurnId));if(!i?.user)return null;let h=i.user.id,a=q.current;if(a===null)throw Error("Virtual timeline is not mounted");return await a.scrollToKey(i.key,(s)=>s.querySelector(`[data-content-search-unit-key="${CSS.escape(h)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(h)}"]`)}finally{if(re.current===d)ne(!1)}},[g,e.id]),Ee=M(async(r)=>{if(r.nativeTurnId!==void 0)await g.previewHistoryTurn(e.id,r.nativeTurnId)},[g,e.id]);H(()=>{if(l===null)return;let r=l.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let u=new ResizeObserver(()=>{let a=N.current,s=null;if(a!==null){let p=Math.max(0,a.heightPx-a.element.getBoundingClientRect().height);if(p!==I.current&&(p<I.current||a.keepTop)){if(I.current=p,ye(()=>F(p)),p===0)N.current=null}if(p>0&&a.keepTop)s=l.scrollTop+a.element.getBoundingClientRect().top-l.getBoundingClientRect().top-xe}le(s)});u.observe(r),u.observe(l);let d=null,i=()=>{let a=A===void 0?null:r.querySelector(`[data-codex-turn="${CSS.escape(A)}"]`);if(a===d)return;if(d!==null)u.unobserve(d);if(d=a,d!==null)u.observe(d)};i();let h=new MutationObserver(i);return h.observe(r,{childList:!0,subtree:!0}),()=>{h.disconnect(),u.disconnect()}},[le,A,l]),H(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let de=b(null);Te(()=>{if(l===null)return;let r=m.at(-1),u=de.current;if(de.current=r===void 0?null:{key:r.key,running:y},r===void 0||u===null||r.user===null||r.replayed)return;if(R){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==u.key||!u.running))N.current=null,I.current=0,F(0),se()}else if(r.key!==u.key)G()},[se,R,y,G,l,e.turnEndedAt,m]);let Le=(r,u)=>{let d=r,i=d.turn;if(i===void 0){if(d.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return o(Ue,{sessionId:e.id,turnId:d.nativeTurnId,root:l,error:T?.turnErrors[d.nativeTurnId],connected:P&&!C&&!Ie})}let h=m.indexOf(i),a=i.key===be,s=us(e,m,h),p=!a&&s.continued,D=i.key===A,O=i.errors.at(-1),me=O===void 0?null:Be(O),Q=O===void 0?null:ge(O),Ae=!e.subagent&&D&&!a&&P&&Se&&e.attached&&!e.readOnly&&!e.restoring&&O===e.items.at(-1)&&me!==null&&qe(me).kind==="overloaded"&&Q!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",fe=z?.(i)??null,pe=c?.(i)??null,Ce=pe!==null||i.work.length>0||i.final.length>0||i.errors.length>0||a||fe!==null||Ot(i)||Go(i)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=i.user===null?null:Rt(i);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(V===void 0?o(os,{item:i.user,messageTime:ve,skillNames:he}):V(i.user,ve)),Ce&&o(Sr,{sessionId:e.id,turn:i,terminals:e.terminals,active:a,blocked:e.state==="requires_action",continued:p,edits:s.edits,activityItems:s.items,workStartedAt:s.startedAt,isLast:D,error:e.error,retrying:a?Oe(e._meta)??void 0:void 0,retry:Ae?{turnId:Q,delaySeconds:Dr(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:Go(i)||!a&&D&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:S?.(i),footer:fe}),u===ee&&w?.node,v?.(i)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(_,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":L.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:E("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[w&&ee===-1&&w.node,o(xr,{ref:q,entries:W,renderTurn:Le,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:f===void 0?void 0:o("div",{className:"pt-3",children:f})}),R&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(Y,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{g.loadHistoryNavigation(e.id).catch(()=>{})},children:L.t("timeline.navigationRetry")})}),ke&&x?.cursor&&!T?.complete&&E("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(Y,{variant:"outline",size:"sm",disabled:!P||e.restoring||x.loading,onClick:J,children:x.loading?L.t("timeline.loadingEarlier"):L.t("timeline.loadEarlier")}),x.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),k!==void 0&&o(Ur,{items:we,audio:k.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ee,onRevealError:(r)=>ce(L,r),targetTopMarginPx:16},e.id),o("button",{type:"button",className:C?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:C?-1:void 0,onClick:G,"aria-label":L.t("timeline.scrollToBottom"),children:y?E("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Fe,{})})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{br}from"./chunk-86tpa1nn.js";import{jo,je,t,Ke,n,ce}from"./chunk-e4ws15tg.js";import{ls,Gt,Vo,us,ps}from"./chunk-q78ng7mn.js";import{Ot}from"./chunk-0t4fcgge.js";import{_r}from"./chunk-zea1chz7.js";import{Hr}from"./chunk-cef598jy.js";import{Ur,Br}from"./chunk-zb0m2cqy.js";import{es,ts}from"./chunk-965sngjd.js";import{Fr}from"./chunk-64apxzn7.js";import{Or}from"./chunk-84p483n0.js";import{is}from"./chunk-19jwgexv.js";import{codexExtensionCapabilities as ze,codexMessageError as Ve,codexRetryNotice as Be,codexTurnError as Oe,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as qe}from"lucide-react";import{useCallback as M,useEffect as H,useLayoutEffect as Te,useMemo as K,useRef as b,useState as U}from"react";import{flushSync as ye}from"react-dom";import{Button as Y}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as E}from"react/jsx-runtime";var xe=24;function Fe(e){let f=Math.max(0,e.turnTopPx-xe),v=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),c=f-v;return{scrollTopPx:f,spacerPx:c>0?e.spacerPx+c:e.spacerPx}}function De({viewportRef:e,viewportProps:f,children:v}){return o("div",{ref:e,...f,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:v})}function Ue({sessionId:e,turnId:f,root:v,error:c,connected:S}){let z=b(null),V=Ke(),{t:w}=t(),k=M(()=>{V.loadHistoryTurn(e,f).catch(()=>{})},[V,e,f]);return H(()=>{if(!v||!z.current||!S||c)return;let R=new IntersectionObserver((_)=>{if(_.some((g)=>g.isIntersecting))R.disconnect(),k()},{root:v,rootMargin:"800px 0px"});return R.observe(z.current),()=>R.disconnect()},[v,S,c,k]),o("div",{ref:z,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":f,"data-markdown-pending":!0,children:c?E("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:c}),o(Y,{variant:"outline",size:"sm",onClick:k,disabled:!S,children:w("timeline.navigationRetry")})]}):E("div",{role:"status","aria-label":w("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function _e(e,f){let v=b([]),c=b(null);if(c.current?.items!==e.items||c.current.state!==e.state||c.current.ended!==e.turnEndedAt||c.current.usage!==e.turnUsage||c.current.historyOrder!==f)c.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:f,turns:ls(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function Lt(e){return o(je,{host:e.host,client:e.client,children:o(jo,{value:e.session.cwd,children:o(We,{...e})})})}function We({session:e,leading:f,afterTurn:v,turnWork:c,answerActions:S,turnFooter:z,renderUserMessage:V,insert:w,navigation:k,anchorNewTurn:R=!1,Viewport:_=De}){let g=Ke(),L=t(),T=n((r)=>r.historyNavigation[e.id]),he=K(()=>e.commands.map((r)=>r.name),[e.commands]),m=_e(e,T?.turns),A=m.at(-1)?.key,be=us(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Hr(m,T),[m,T]),Z=K(()=>W.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[W]),we=K(()=>k===void 0?[]:Ur(m,e.turnUsage,T),[k,m,e.turnUsage,T]),ee=w&&w.afterItemId!==null?m.findIndex((r)=>r.items.some((u)=>u.id===w.afterItemId)):-1,j=b(m);j.current=m;let[l,Re]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),Se=n((r)=>ze(r.agent).sessionRetry),te=x!==void 0;H(()=>{if(P&&te&&!e.restoring)g.loadHistoryNavigation(e.id).catch(()=>{})},[g,P,te,e.id,e.restoring]);let[ke,Pe]=U(!1),q=b(null),[Ie,ne]=U(!1),re=b(0),X=b({key:A,running:y});X.current={key:A,running:y};let[ie,F]=U(0),I=b(0),N=b(null);I.current=ie;let Ne=M(()=>{if(N.current!==null)N.current.keepTop=!1},[]),{isFollowing:C,scrollToBottom:G,stopFollowing:B,schedulePin:oe,contentResized:le,beginLocate:ae,cancelLocation:ue}=Or(l,y,Ne),se=M(()=>{if(l===null||!y)return;let r=m.at(-1)?.key;if(r===void 0)return;let u=ae(!0),d=()=>u.isCurrent()&&X.current.running&&X.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!d())return;let a=l.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(a===null)return;let s=l.scrollTop+a.getBoundingClientRect().top-l.getBoundingClientRect().top,p=Fe({turnTopPx:s,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:I.current});N.current=p.spacerPx>0?{element:a,heightPx:a.getBoundingClientRect().height+p.spacerPx,keepTop:!0}:null,ye(()=>F(p.spacerPx)),requestAnimationFrame(()=>{if(d())u.finish(p.scrollTopPx)})})),h=q.current;if(h===null)return;h.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(d())i()})},[ae,y,l,m]);Te(()=>{if(!R||y)return;ue(),N.current=null,I.current=0,F(0)},[R,ue,y]);let J=M(()=>{B(),g.loadOlderHistory(e.id).catch(()=>{})},[g,e.id,B]);H(()=>{if(l===null)return;let r=()=>{let u=l.scrollTop<600;if(Pe(u),u&&!T?.complete&&P&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)J()};return r(),l.addEventListener("scroll",r,{passive:!0}),()=>l.removeEventListener("scroll",r)},[P,x,C,J,l,e.restoring,T?.complete]),H(()=>{es({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>ts(e.id),[e.id]);let He=M(async(r,u)=>{let d=++re.current;ne(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await g.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((s)=>requestAnimationFrame(()=>s()));if(!u())return null;let i=j.current.find((s)=>s.user?.id===(r.messageId??r.id))??j.current.find((s)=>s.user!==null&&r.nativeTurnId!==void 0&&s.items.some((p)=>ge(p)===r.nativeTurnId));if(!i?.user)return null;let h=i.user.id,a=q.current;if(a===null)throw Error("Virtual timeline is not mounted");return await a.scrollToKey(i.key,(s)=>s.querySelector(`[data-content-search-unit-key="${CSS.escape(h)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(h)}"]`)}finally{if(re.current===d)ne(!1)}},[g,e.id]),Ee=M(async(r)=>{if(r.nativeTurnId!==void 0)await g.previewHistoryTurn(e.id,r.nativeTurnId)},[g,e.id]);H(()=>{if(l===null)return;let r=l.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let u=new ResizeObserver(()=>{let a=N.current,s=null;if(a!==null){let p=Math.max(0,a.heightPx-a.element.getBoundingClientRect().height);if(p!==I.current&&(p<I.current||a.keepTop)){if(I.current=p,ye(()=>F(p)),p===0)N.current=null}if(p>0&&a.keepTop)s=l.scrollTop+a.element.getBoundingClientRect().top-l.getBoundingClientRect().top-xe}le(s)});u.observe(r),u.observe(l);let d=null,i=()=>{let a=A===void 0?null:r.querySelector(`[data-codex-turn="${CSS.escape(A)}"]`);if(a===d)return;if(d!==null)u.unobserve(d);if(d=a,d!==null)u.observe(d)};i();let h=new MutationObserver(i);return h.observe(r,{childList:!0,subtree:!0}),()=>{h.disconnect(),u.disconnect()}},[le,A,l]),H(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let de=b(null);Te(()=>{if(l===null)return;let r=m.at(-1),u=de.current;if(de.current=r===void 0?null:{key:r.key,running:y},r===void 0||u===null||r.user===null||r.replayed)return;if(R){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==u.key||!u.running))N.current=null,I.current=0,F(0),se()}else if(r.key!==u.key)G()},[se,R,y,G,l,e.turnEndedAt,m]);let Le=(r,u)=>{let d=r,i=d.turn;if(i===void 0){if(d.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return o(Ue,{sessionId:e.id,turnId:d.nativeTurnId,root:l,error:T?.turnErrors[d.nativeTurnId],connected:P&&!C&&!Ie})}let h=m.indexOf(i),a=i.key===be,s=ps(e,m,h),p=!a&&s.continued,D=i.key===A,O=i.errors.at(-1),me=O===void 0?null:Ve(O),Q=O===void 0?null:ge(O),Ae=!e.subagent&&D&&!a&&P&&Se&&e.attached&&!e.readOnly&&!e.restoring&&O===e.items.at(-1)&&me!==null&&Oe(me).kind==="overloaded"&&Q!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",fe=z?.(i)??null,pe=c?.(i)??null,Ce=pe!==null||i.work.length>0||i.final.length>0||i.errors.length>0||a||fe!==null||Gt(i)||Vo(i)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=i.user===null?null:Ot(i);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(V===void 0?o(is,{item:i.user,messageTime:ve,skillNames:he}):V(i.user,ve)),Ce&&o(_r,{sessionId:e.id,turn:i,terminals:e.terminals,active:a,blocked:e.state==="requires_action",continued:p,edits:s.edits,activityItems:s.items,workStartedAt:s.startedAt,isLast:D,error:e.error,retrying:a?Be(e._meta)??void 0:void 0,retry:Ae?{turnId:Q,delaySeconds:Fr(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:Vo(i)||!a&&D&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:S?.(i),footer:fe}),u===ee&&w?.node,v?.(i)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(_,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":L.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:E("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[w&&ee===-1&&w.node,o(br,{ref:q,entries:W,renderTurn:Le,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:f===void 0?void 0:o("div",{className:"pt-3",children:f})}),R&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(Y,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{g.loadHistoryNavigation(e.id).catch(()=>{})},children:L.t("timeline.navigationRetry")})}),ke&&x?.cursor&&!T?.complete&&E("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(Y,{variant:"outline",size:"sm",disabled:!P||e.restoring||x.loading,onClick:J,children:x.loading?L.t("timeline.loadingEarlier"):L.t("timeline.loadEarlier")}),x.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),k!==void 0&&o(Br,{items:we,audio:k.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ee,onRevealError:(r)=>ce(L,r),targetTopMarginPx:16},e.id),o("button",{type:"button",className:C?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:C?-1:void 0,onClick:G,"aria-label":L.t("timeline.scrollToBottom"),children:y?E("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(qe,{})})]})}
|
|
2
|
+
export{Lt};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c,F}from"./chunk-06mvwewp.js";import{Eo}from"./chunk-mfmh7ztq.js";import{oe}from"./chunk-nf7q3crw.js";import{T}from"./chunk-fpsn6fmf.js";import{it,Rr}from"./chunk-chg6j0zg.js";import{ve}from"./chunk-15m908ph.js";import{cn as v}from"cn";import{BotIcon as ue,CheckIcon as me,CopyIcon as pe}from"lucide-react";import{Fragment as ge,memo as fe,useEffect as P,useRef as U,useState as E}from"react";import{jsx as n,jsxs as p,Fragment as D}from"react/jsx-runtime";function xe(e,t){if(e.status==="pending"||e.status==="in_progress")return;if(e.status==="cancelled"||e.status==="interrupted")return t("stream.codex.commandStopped");if(e.exitCode!==void 0&&e.exitCode!==0)return t("stream.codex.exitCode",{code:e.exitCode});if(e.status==="completed"&&e.exitCode===void 0)return;return t(e.status==="failed"?"stream.codex.commandFailed":"stream.codex.commandSucceeded")}function H(e,t){let[a,o]=E(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var G=new WeakMap,q=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=G.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=q;return q+=1,G.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function V(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var Ce="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function I({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:Ce})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function he(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function we(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function Le(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function z(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function Y({block:e}){if(e.type!=="tool_use")return null;if(O(e))return n(z,{});let t=oe(e).category;if(t==="read")return n(ye,{});if(t==="search"||t==="fetch")return n(he,{});if(t==="execute")return n(we,{});if(t==="edit")return n(Le,{});return n(z,{})}function B(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Ne(e){return oe(e).target}function W(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function O(e){return W(e)||e.name==="dynamic_tool"}function ee(e,t){let{category:a}=oe(e),o=Ne(e),i=N(e.status);if(O(e))return{leading:e.title};if(a==="execute"){let r=B(e,"command")?.split(`
|
|
1
|
+
import{c,F}from"./chunk-5rzy2287.js";import{Lo}from"./chunk-54j6xftt.js";import{oe}from"./chunk-f6cexkjm.js";import{T}from"./chunk-fpsn6fmf.js";import{at,Lr}from"./chunk-x6spt0mc.js";import{ve}from"./chunk-15m908ph.js";import{cn as v}from"cn";import{BotIcon as ue,CheckIcon as me,CopyIcon as pe}from"lucide-react";import{Fragment as ge,memo as fe,useEffect as P,useRef as U,useState as E}from"react";import{jsx as n,jsxs as p,Fragment as D}from"react/jsx-runtime";function xe(e,t){if(e.status==="pending"||e.status==="in_progress")return;if(e.status==="cancelled"||e.status==="interrupted")return t("stream.codex.commandStopped");if(e.exitCode!==void 0&&e.exitCode!==0)return t("stream.codex.exitCode",{code:e.exitCode});if(e.status==="completed"&&e.exitCode===void 0)return;return t(e.status==="failed"?"stream.codex.commandFailed":"stream.codex.commandSucceeded")}function H(e,t){let[a,o]=E(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var G=new WeakMap,q=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=G.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=q;return q+=1,G.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function V(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var Ce="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function I({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:Ce})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function he(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function we(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function Le(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function z(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function Y({block:e}){if(e.type!=="tool_use")return null;if(O(e))return n(z,{});let t=oe(e).category;if(t==="read")return n(ye,{});if(t==="search"||t==="fetch")return n(he,{});if(t==="execute")return n(we,{});if(t==="edit")return n(Le,{});return n(z,{})}function B(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Ne(e){return oe(e).target}function W(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function O(e){return W(e)||e.name==="dynamic_tool"}function ee(e,t){let{category:a}=oe(e),o=Ne(e),i=N(e.status);if(O(e))return{leading:e.title};if(a==="execute"){let r=B(e,"command")?.split(`
|
|
2
2
|
`)[0]??o;return r?{leading:t(i?"stream.codex.running":"stream.codex.ran"),trailing:r}:{leading:t(i?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let r=B(e,"pattern")??B(e,"query")??o;return r?{leading:t(i?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let r=B(e,"query")??B(e,"url")??o;return r?{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return o?{leading:t("stream.codex.readLabel"),trailing:o}:{leading:t("stream.codex.readFiles")};if(a==="edit")return o?{leading:t(i?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:o}:{leading:t(i?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return o?{leading:t(i?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:o}:{leading:t(i?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return o?{leading:t(i?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:o}:{leading:t(i?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function be(e,t){let a=ee(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function Te(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
|
|
3
3
|
`).trim()}function $e(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="image"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Ae(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="audio"?[{data:a.data,mimeType:a.mimeType}]:[]})}function ke(e){if(typeof e==="string"&&e.length>0)return e;return}function Be(e){return e.type==="diff"}function Ie(e){let t=e.content.find(Be);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
|
|
4
4
|
`)}function te(e){let t=ke(e.rawOutput);if(t!==void 0)return t;let a=Te(e.content);if(a.length>0)return a;return Ie(e)}function K({block:e,command:t}){let{t:a,Output:o,commandStatus:i}=c(),[r,u]=E(!1),[d,l]=E(!1),m=te(e),s=i===void 0?xe(e,a):i(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
|
|
5
5
|
`)),u(!0),setTimeout(()=>u(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:v("codex-command-line",!d&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:g,children:r?n(me,{}):n(pe,{})})]}),m!==void 0&&(o===void 0?n("pre",{className:"codex-command-output",children:m}):n(o,{text:m})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ne({block:e}){let{t,openLink:a,Patch:o,openImage:i,commandStatus:r,expandToolOutput:u=!1}=c(),d=te(e),l=o===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let k=x;return k.patch?.text?[k.patch.text]:[]}).join(`
|
|
6
|
-
`),m=$e(e.content),s=Ae(e.content),[g,f]=T(`tool:${e.id}`,!1),C=H(`tool:${e.id}`,g),h=oe(e),w=h.category,y=ee(e,t),b=w==="execute"?B(e,"command"):void 0;if(e.userShell&&b!==void 0)return n(K,{block:e,command:b});let A=b!==void 0||O(e)||m.length>0||s.length>0||Boolean(l)||u&&d!==void 0,M=!A&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(Y,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):p(D,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(M!==void 0?p(D,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:M,onClick:()=>a(M),children:y.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[A?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[S,n(I,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&p(D,{children:[b!==void 0?n(K,{block:e,command:b}):o!==void 0&&l?n(o,{patch:l}):d!==void 0&&n("pre",{className:"codex-activity-details",children:d}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let k=`data:${x.mimeType};base64,${x.data}`,j=n("img",{src:k,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?j:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(k),children:j},k)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}var ae=fe(function({block:t}){if(t.type==="tool_use")return n(ne,{block:t});if(t.type==="thinking")return n(le,{block:t});if(t.type==="collab")return n(ce,{block:t});return n(ie,{block:t})});function ie({block:e}){let{t,openSession:a}=c(),o=N(e.status),[i,r]=T(`subagent:${e.id}`,o),u=U(o);P(()=>{if(o)r(!0);if(u.current&&!o)r(!1);u.current=o},[o,r]);let d=`${_e(e.activity,o,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?i:void 0,disabled:!m,onClick:()=>r((s)=>!s),children:[p("span",{className:"codex-activity-label",children:[n(Ee,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:d}):d:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:d})})]}),m&&n(I,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ne,{block:s},s.id);if(s.type==="thinking")return n(le,{block:s},L(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(ce,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(F,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(ve,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Me=8;function Se(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Me}function Ee({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Se(e),"aria-hidden":"true"})}function _e(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var Fe=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${Eo(e)}`;let o=Fe.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${Eo(e)} · ${o}`}var Re={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function se(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=se(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Re[e.tool]}.${o}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function de(e,t){let a=e.agents.length>0?e.agents.length:1;return`${Z(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var _="\x01";function R(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${_}${r}${_}`]));return e(t,{...a,...i}).split(new RegExp(`${_}(\\w+)${_}`,"u")).map((r,u)=>n(ge,{children:u%2===1?o[r]:r},`${u}:${r}`))}function Pe({agent:e,showModel:t}){let{t:a,openSession:o}=c(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return p("span",{children:[r,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function J({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,t){let a=e.prompt?.trim()?e.prompt:null,o=se(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,u=De(e),d=[];if(u.length===0)d.push({key:"generic",node:Z(e,"row",t)});for(let l of u){let m=n(Pe,{agent:l,showModel:e.tool==="spawnAgent"});if(i)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:R(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(J,{prompt:a})})})});else if(r)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:R(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:m,prompt:n(J,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";d.push({key:l.threadId,node:R(t,"stream.codex.collab.agentRow",{action:Z(e,"row",t),state:g},{agent:m})})}}if(!i&&!r&&a!==null)d.push({key:"input",node:R(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return d}function ce({block:e}){let{t}=c(),[a,o]=T(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=de(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(ue,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(I,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Ue(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function le({block:e}){let{t,i18n:a}=c(),o=Boolean(e.isComplete),[i,r]=T(`thinking:${L(e)}`,!1),u=U(null),d=e.thinking.trim().length>0;P(()=>{if(o||!d)return;let s=u.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[d,o]);let l=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:V(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!d&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":d?i:void 0,disabled:!d,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?l:n("span",{className:"codex-activity-running",children:l})})}),d&&n(I,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:d&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(F,{text:m,streaming:!o})})})})]})}function Oe(e){if(W(e))return"mcp";let t=oe(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ve(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ze(e,t,a){let o=new Map,i=[],r=new Set;for(let d of e){if(W(d)&&typeof d.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(d.rawInput.server);continue}if(O(d)){if(!i.some((m)=>m.kind==="named"&&m.title===d.title))i.push({kind:"named",title:d.title});continue}let l=Oe(d);if(!o.has(l))i.push({kind:"category",category:l});o.set(l,(o.get(l)??0)+1)}let u=i.map((d,l)=>{if(d.kind==="named")return d.title;if(d.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ve(d.category,o.get(d.category),l===0,t)});if(a.startsWith("zh"))return u.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(u)}function Ar({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:u,providerIcon:d,children:l}){let{t:m,i18n:s}=c(),[g,f]=T(`work:${e}`,i,!0),C=H(`work:${e}`,g||o),h=U(null),[w,y]=E(0);P(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let A=()=>{let S=h.current;if(S===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-S)};A();let M=window.setInterval(A,1000);return()=>window.clearInterval(M)},[o,r,t]);let b=t!==void 0?m(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:V(t,s.language)}):o&&w>=1000?m("stream.codex.workingFor",{duration:V(w,s.language)}):m(o?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((A)=>!A),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:d}),n("span",{children:b}),n(I,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&l})})})]})}function He(e,t){if(e.type==="tool_use")return be(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return de(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function Q(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function We(e,t,a=1000){let[o,i]=E({text:e,live:t}),r=U(Date.now());return P(()=>{if(e===o.text&&t===o.live)return;let u=Date.now(),d=Math.max(0,r.current+a-u);if(d===0||t!==o.live){r.current=u,i({text:e,live:t});return}let l=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},d);return()=>window.clearTimeout(l)},[o,t,a,e]),t===o.live?o.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=c(),i=e.some(Q),r=L(e[0]),u=e.every((C)=>C.type==="tool_use"&&oe(C).category==="execute"),[d,l]=T(`group:${r}`,t&&!u),m=H(`group:${r}`,d),s=e.findLast(Q)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=We(i?He(s,a):Ze(g,a,o.language),i);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((C)=>!C),children:[p("span",{className:"codex-activity-label",children:[n(Y,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(I,{expanded:d})]}),n("div",{className:v("codex-activity-group-grid",d&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((C)=>n(ae,{block:C},L(C)))})})})]})}function X({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(ae,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function Et({blocks:e,defaultExpanded:t}){if(!e.some(it))return n(X,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&it(i[0])===it(o))i.push(o);else a.push([o])}return n(D,{children:a.map((o)=>it(o[0])?n(Rr,{blocks:o.filter(it)},L(o[0])):n(X,{blocks:o,defaultExpanded:t},L(o[0])))})}
|
|
7
|
-
export{
|
|
6
|
+
`),m=$e(e.content),s=Ae(e.content),[g,f]=T(`tool:${e.id}`,!1),C=H(`tool:${e.id}`,g),h=oe(e),w=h.category,y=ee(e,t),b=w==="execute"?B(e,"command"):void 0;if(e.userShell&&b!==void 0)return n(K,{block:e,command:b});let A=b!==void 0||O(e)||m.length>0||s.length>0||Boolean(l)||u&&d!==void 0,M=!A&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(Y,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):p(D,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(M!==void 0?p(D,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:M,onClick:()=>a(M),children:y.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[A?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[S,n(I,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&p(D,{children:[b!==void 0?n(K,{block:e,command:b}):o!==void 0&&l?n(o,{patch:l}):d!==void 0&&n("pre",{className:"codex-activity-details",children:d}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let k=`data:${x.mimeType};base64,${x.data}`,j=n("img",{src:k,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?j:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(k),children:j},k)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}var ae=fe(function({block:t}){if(t.type==="tool_use")return n(ne,{block:t});if(t.type==="thinking")return n(le,{block:t});if(t.type==="collab")return n(ce,{block:t});return n(ie,{block:t})});function ie({block:e}){let{t,openSession:a}=c(),o=N(e.status),[i,r]=T(`subagent:${e.id}`,o),u=U(o);P(()=>{if(o)r(!0);if(u.current&&!o)r(!1);u.current=o},[o,r]);let d=`${_e(e.activity,o,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?i:void 0,disabled:!m,onClick:()=>r((s)=>!s),children:[p("span",{className:"codex-activity-label",children:[n(Ee,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:d}):d:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:d})})]}),m&&n(I,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ne,{block:s},s.id);if(s.type==="thinking")return n(le,{block:s},L(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(ce,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(F,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(ve,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Me=8;function Se(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Me}function Ee({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Se(e),"aria-hidden":"true"})}function _e(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var Fe=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${Lo(e)}`;let o=Fe.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${Lo(e)} · ${o}`}var Re={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function se(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=se(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Re[e.tool]}.${o}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function de(e,t){let a=e.agents.length>0?e.agents.length:1;return`${Z(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var _="\x01";function R(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${_}${r}${_}`]));return e(t,{...a,...i}).split(new RegExp(`${_}(\\w+)${_}`,"u")).map((r,u)=>n(ge,{children:u%2===1?o[r]:r},`${u}:${r}`))}function Pe({agent:e,showModel:t}){let{t:a,openSession:o}=c(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return p("span",{children:[r,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function J({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,t){let a=e.prompt?.trim()?e.prompt:null,o=se(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,u=De(e),d=[];if(u.length===0)d.push({key:"generic",node:Z(e,"row",t)});for(let l of u){let m=n(Pe,{agent:l,showModel:e.tool==="spawnAgent"});if(i)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:R(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(J,{prompt:a})})})});else if(r)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:R(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:m,prompt:n(J,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";d.push({key:l.threadId,node:R(t,"stream.codex.collab.agentRow",{action:Z(e,"row",t),state:g},{agent:m})})}}if(!i&&!r&&a!==null)d.push({key:"input",node:R(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return d}function ce({block:e}){let{t}=c(),[a,o]=T(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=de(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(ue,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(I,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Ue(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function le({block:e}){let{t,i18n:a}=c(),o=Boolean(e.isComplete),[i,r]=T(`thinking:${L(e)}`,!1),u=U(null),d=e.thinking.trim().length>0;P(()=>{if(o||!d)return;let s=u.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[d,o]);let l=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:V(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!d&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":d?i:void 0,disabled:!d,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?l:n("span",{className:"codex-activity-running",children:l})})}),d&&n(I,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:d&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(F,{text:m,streaming:!o})})})})]})}function Oe(e){if(W(e))return"mcp";let t=oe(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ve(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ze(e,t,a){let o=new Map,i=[],r=new Set;for(let d of e){if(W(d)&&typeof d.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(d.rawInput.server);continue}if(O(d)){if(!i.some((m)=>m.kind==="named"&&m.title===d.title))i.push({kind:"named",title:d.title});continue}let l=Oe(d);if(!o.has(l))i.push({kind:"category",category:l});o.set(l,(o.get(l)??0)+1)}let u=i.map((d,l)=>{if(d.kind==="named")return d.title;if(d.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ve(d.category,o.get(d.category),l===0,t)});if(a.startsWith("zh"))return u.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(u)}function Er({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:u,providerIcon:d,children:l}){let{t:m,i18n:s}=c(),[g,f]=T(`work:${e}`,i,!0),C=H(`work:${e}`,g||o),h=U(null),[w,y]=E(0);P(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let A=()=>{let S=h.current;if(S===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-S)};A();let M=window.setInterval(A,1000);return()=>window.clearInterval(M)},[o,r,t]);let b=t!==void 0?m(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:V(t,s.language)}):o&&w>=1000?m("stream.codex.workingFor",{duration:V(w,s.language)}):m(o?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((A)=>!A),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:d}),n("span",{children:b}),n(I,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&l})})})]})}function He(e,t){if(e.type==="tool_use")return be(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return de(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function Q(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function We(e,t,a=1000){let[o,i]=E({text:e,live:t}),r=U(Date.now());return P(()=>{if(e===o.text&&t===o.live)return;let u=Date.now(),d=Math.max(0,r.current+a-u);if(d===0||t!==o.live){r.current=u,i({text:e,live:t});return}let l=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},d);return()=>window.clearTimeout(l)},[o,t,a,e]),t===o.live?o.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=c(),i=e.some(Q),r=L(e[0]),u=e.every((C)=>C.type==="tool_use"&&oe(C).category==="execute"),[d,l]=T(`group:${r}`,t&&!u),m=H(`group:${r}`,d),s=e.findLast(Q)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=We(i?He(s,a):Ze(g,a,o.language),i);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((C)=>!C),children:[p("span",{className:"codex-activity-label",children:[n(Y,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(I,{expanded:d})]}),n("div",{className:v("codex-activity-group-grid",d&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((C)=>n(ae,{block:C},L(C)))})})})]})}function X({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(ae,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function Ft({blocks:e,defaultExpanded:t}){if(!e.some(at))return n(X,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&at(i[0])===at(o))i.push(o);else a.push([o])}return n(D,{children:a.map((o)=>at(o[0])?n(Lr,{blocks:o.filter(at)},L(o[0])):n(X,{blocks:o,defaultExpanded:t},L(o[0])))})}
|
|
7
|
+
export{Er,Ft};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{qi}from"./chunk-fcy6mh2e.js";import{fe}from"./chunk-56jqg70p.js";var t={chat:qi,image:fe};function ot(n){return Object.hasOwn(t,n)}function Ue(n){if(!ot(n))throw Error(`Unsupported input mode: ${n}`);return t[n]}function xa(n){if(n===null)return"chat";let o=n.mode;if(!ot(o))throw Error(`Unsupported input mode: ${o}`);return t[o].parseConfig(n.config),o}
|
|
2
|
+
export{ot,Ue,xa};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{F}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{F}from"./chunk-5rzy2287.js";import{ve}from"./chunk-15m908ph.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function os({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(F,{text:t.content,streaming:!1})});if(!n(t))return null;return e(ve,{entries:t.entries})}
|
|
2
|
+
export{os};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{n}from"./chunk-e4ws15tg.js";import{e}from"./chunk-kyqf7cqh.js";import{et,vt,De}from"./chunk-k5kzw2px.js";import{inSessionTree as m}from"@nyssance/codex-acp-v2/client";import{jsx as l,jsxs as f,Fragment as x}from"react/jsx-runtime";var p=[];function cn({sessionId:s}){let o=n((t)=>t.sessions),{host:u}=e(),d=n((t)=>t.actions),a=d.some((t)=>m(o,s,t.sessionId))?d.filter((t)=>m(o,s,t.sessionId)):p,i=a.filter(et).filter((t)=>{if(t.sessionId!==s||o[s]?.subagent!==void 0)return!0;let r=t.params._meta?.codex;return!(typeof r==="object"&&r!==null&&("delivery"in r)&&r.delivery==="async")}),c=a.filter((t)=>!et(t));return f(x,{children:[c.length>0&&l("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:c.map((t)=>f("div",{children:[t.sessionId!==s&&l("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:t.sessionId===null?"":o[t.sessionId]?.title??u.t("subagents.untitled")}),l(De,{action:t})]},t.id))}),i[0]!==void 0&&l(vt,{action:i[0],total:i.length},i[0].id)]})}
|
|
2
|
+
export{cn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{er}from"./chunk-m6sdmcpj.js";import{e,b}from"./chunk-kyqf7cqh.js";import{Y,y}from"./chunk-rkqptd9w.js";import{createLucideIcon as v,HandIcon as k,ShieldAlertIcon as w,ShieldCheckIcon as a}from"lucide-react";import{memo as S}from"react";import{jsx as t}from"react/jsx-runtime";var O=v("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),d={"read-only":k,"workspace-write":a,agent:O,"agent-full-access":w},A={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function N({sessionId:u,options:m,disabled:g,onConfigChange:c}){let{host:l,client:f}=e(),{t:r}=l,s=y(m,"mode");if(!s)return null;let o=s.currentValue,p=Y(s).map((n)=>{let i=A[n.value];return i?{...n,name:r(`permissionModes.${i}.name`),description:r(`permissionModes.${i}.description`)}:n}),h=p.find((n)=>n.value===o),M=d[o]??a,I=(n)=>{if(n===o)return;b(l,c?c(s.configId,n):f.setConfig(u,s.configId,n))};return t(er,{value:o,warning:o==="agent-full-access",currentName:h?.name??o,icon:t(M,{className:"size-3.5 shrink-0"}),header:r("permissionModes.heading"),disabled:g,label:r("composer.switchPermissionMode"),onValueChange:I,options:p.map((n)=>{let i=d[n.value]??a,C=n.value==="agent-full-access";return{value:n.value,label:t("span",{"data-permission-warning":C?"":void 0,children:n.name}),description:n.description?t("span",{className:"whitespace-normal",children:n.description}):void 0,icon:t(i,{className:"size-3.5 shrink-0"})}})})}var In=S(N);
|
|
2
|
+
export{In};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{c}from"./chunk-5rzy2287.js";import{Bt,Xr}from"./chunk-zk395v8p.js";import{le}from"./chunk-e4ws15tg.js";import{Zn,L}from"./chunk-38eckxjk.js";import{useEffect as d,useState as g}from"react";import{jsx as o,jsxs as w}from"react/jsx-runtime";var l=/\.(?:png|jpe?g|gif|webp|bmp|svg|pdf|docx?|xlsx?|pptx?|csv|tsv|zip|tar|gz|mp[34]|wav|ogg|webm|mov)(?:[?#].*)?$/i,u=/\.(?:png|jpe?g|gif|webp|bmp|svg)(?:[?#].*)?$/i;function Wr(e){if(e.type!=="link"&&e.type!=="image"||e.href===void 0)return!1;let r=e.href;return!/^www\.|^\/\//i.test(r)&&!/^[a-z][a-z\d+.-]*:/i.test(r.replace(/^file:/i,""))&&l.test(r)}function h({uri:e,directory:r}){let t=c(),[i,s]=g(),n=Bt(e,r),p=n!==null&&t.loadImage!==void 0&&Xr(r,n);if(d(()=>{if(!p||n===null||t.loadImage===void 0)return;let m=!1;return t.loadImage(n).then((a)=>{let f=/^data:([^;,]+);base64,(.*)$/s.exec(a);if(!f)throw Error("The image preview is not a data URL");if(!m)s({uri:e,mimeType:f[1],data:f[2]})},(a)=>{if(!m)s({uri:e,error:a instanceof Error?a.message:String(a)})}),()=>{m=!0}},[t,n,p,e]),i?.uri!==e)return null;if("error"in i)return o("div",{role:"alert",className:"text-muted-foreground text-xs",children:i.error});return o(L,{block:{type:"image",uri:e,data:i.data,mimeType:i.mimeType}})}function Zr({links:e}){let r=le();return o("div",{className:"codex-markdown-artifacts flex min-w-0 flex-col gap-2","data-wide-markdown-block":"true",children:e.map((t,i)=>{let s=t.text||Zn(t.href);return w("div",{className:"min-w-0",children:[r!==null&&u.test(t.href)&&o(h,{uri:t.href,directory:r}),o(L,{block:{type:"resource_link",uri:t.href,name:s}})]},`${i}-${t.href}`)})})}
|
|
2
|
+
export{Wr,Zr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d,i}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{d,i}from"./chunk-6cedp3k2.js";import{K,q,de,W,Z,we}from"./chunk-jf7em132.js";import{Ce}from"./chunk-89gyxwmd.js";import{k}from"./chunk-qk1yqepm.js";import{ke}from"./chunk-yvzkb5p5.js";import{Q,Se}from"./chunk-n8b9yg4q.js";import{CheckIcon as O,SparklesIcon as A,XIcon as U}from"lucide-react";import{useDeferredValue as V,useState as y}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogClose as X,DialogContent as _,DialogDescription as J,DialogHeader as R,DialogTitle as Y}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ne,TabsList as le,TabsTrigger as ie}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function T({skill:r}){let{assetUrl:p}=d(),[u,s]=y(!1),l=r.interface?.iconSmall,h=l&&p?p(l):r.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(A,{className:"text-muted-foreground size-6"})})}function oe({skill:r}){let{t:p}=d(),u=i((l)=>l.setSkillEnabled),s=i((l)=>(r.path in l.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:r.enabled,disabled:s,"aria-label":`${p(r.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${r.interface?.displayName??r.name}`,onCheckedChange:(l)=>void u(r,l)})]})}function jt({query:r,ready:p,onOpenPlugin:u}){let{t:s}=d(),l=i((e)=>e.skills),h=i((e)=>e.skillErrors),P=i((e)=>e.loading)||!p,j=i((e)=>e.installed),z=i((e)=>e.skillProjects),[M,E]=y(null),[v,L]=y(!1),[B,C]=y(null),b=V(r.trim().toLowerCase()),o=l.find((e)=>e.path===B),x=j.find(({plugin:e})=>e.id===o?.pluginId),c=l.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(b)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),m=[...["user","system","admin"].flatMap((e)=>{let a=l.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(z).flatMap(([e,a])=>{if(!l.some((I)=>I.scope==="repo"&&a.includes(I.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],H=m.map((e)=>e.label);for(let e of m)if(e.path&&H.filter((a)=>a===e.label).length>1)e.label=e.path;let g=m.find((e)=>e.id===M)??m[0],D=g?c.filter((e)=>g.paths.has(e.path)):[],G=v||b?c:c.slice(0,6),w=(e)=>t(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(we,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(W,{className:"pointer-events-none relative translate-none! self-center!",children:t(T,{skill:a})}),n(q,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(de,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(K,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(O,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(k,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${Q} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),P?t(Ce,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:c.length})})]}),c.length?w(G):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(b?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!b&&c.length>6&&t(N,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":v,onClick:()=>L((e)=>!e),children:v?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:c.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")E(e)},className:"gap-6",children:[t(le,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:m.map((e)=>t(ie,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),m.map((e)=>t(ne,{value:e.id,children:e.id===g.id&&(D.length?w(D):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(F,{open:!!o,onOpenChange:(e)=>{if(!e)C(null)},children:t(_,{showCloseButton:!1,className:Se,children:o&&n(S,{children:[t(ke,{path:o.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(T,{skill:o}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(oe,{skill:o}),e,t(X,{render:t(N,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(U,{})})]})]}),n(R,{className:"gap-3",children:[t(Y,{className:"text-2xl leading-8 font-semibold break-words",children:o.interface?.displayName??o.name}),t(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:o.description})]})]})},o.path),o.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),x?t(N,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(x)},children:x.plugin.interface?.displayName??x.plugin.name}):o.pluginId]})]})})})]})}
|
|
2
|
+
export{jt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ut}from"./chunk-8hm3nkrk.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=Ut({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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{be}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{be}from"./chunk-vys8kfkp.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=be();function Fo(f,m){let i=new Set;for(let e of m){if(e.kind!=="tool"||e.status!=="completed")continue;let o=e.content.filter(u);if(!o.some((n)=>c(n.content)))continue;o.forEach((n,a)=>{if(c(n.content))i.add(`${e.id}:${a}`);if(!s(n.content))return;let r;try{r=JSON.parse(n.content.text)}catch(t){if(t instanceof SyntaxError)return;throw t}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let t of r.images)if(t!==null&&typeof t==="object"&&typeof t.reference==="string")i.add(t.reference)})}if(i.size===0)return f;return f.map((e)=>{if(!s(e)||!e.text.includes("!["))return e;let o=d.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let a=0;return n.tokens.map((t)=>(a+=t.raw.length,t.type==="image"&&i.has(t.href)?"":t.raw)).join("")+n.raw.slice(a)}).join("");return o===e.text?e:{...e,text:o}}).filter((e)=>!s(e)||e.text.trim().length>0)}
|
|
2
|
+
export{Fo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Pt}from"./chunk-7m8hw6gh.js";import{n}from"./chunk-e4ws15tg.js";import{e,b}from"./chunk-kyqf7cqh.js";import{Y,y,ee}from"./chunk-rkqptd9w.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 B}from"react/jsx-runtime";function H({sessionId:l,options:u,disabled:G,onModelChange:h,onConfigChange:C,defaultGroup:I={id:"models",name:"Models"},catalog:x=(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=y(u,"model"),a=y(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=C?C(o.configId,r):N.setConfig(l,o.configId,r);return b(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=x(t&&q(t.options)?t.options.map((o)=>({id:o.groupId,name:o.name,models:o.options.map(S)})):[{...I,models:t?Y(t).map(S):[]}]),w=V.flatMap((o)=>o.models),M=w.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 B(Pt,{disabled:G||O||k,switching:O,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:w,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:B(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 Tn=D(H);
|
|
2
|
+
export{Tn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D}from"./chunk-
|
|
2
|
-
export{Va,
|
|
1
|
+
import{D}from"./chunk-zg0tv3sj.js";import{codexMessageError as b,nativeTurnId as y,textOf as w,turns as h}from"@nyssance/codex-acp-v2/client";function Va(t){return t.kind==="tool"&&t.name==="mcp_startup"}function v(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function g(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function as(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&g(e))}function I(t,e,n){let r=t.work.at(-1);if(r?.kind==="activity"&&r.items.at(-1)===n){r.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function T(t,e,n){if(t.kind!=="tool"){e.push(t);return}let r=n.get(t.id);if(r===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(r);for(let i of t.children)T(i,e,n)}function M(t,e,n,r){switch(e.kind){case"user":break;case"assistant":{if(b(e)!==null){let s=y(e),l=t.errors.findIndex((p)=>s!==null&&y(p)===s);if(l===-1)t.errors.push(e);else t.errors[l]=e;break}let i=v(e),u=e._meta?.codex,o=D(e._meta).length>0||typeof u==="object"&&u!==null&&"delivery"in u&&u.delivery==="async";if(D(e._meta).length>0)t.final.push(e);else if(o)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(i==="final_answer")t.final.push(e);else if(i==="commentary"||g(e)||i===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":I(t,e,r);break;case"tool":if(I(t,e,r),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function x(t){return t.kind==="user"&&(t.echo==="pending"||t.echo==="acknowledged")}function A(t,e){let n=new Set(e.map((a)=>a.turnId)),r=new Map,i=[],u=(a)=>{let d={items:[],nativeId:a};return i.push(d),d},o,s,l=[],p=0;for(let a of t){let d=y(a);if(d!==null){let f=r.get(d);if(f!==void 0){f.items.push(a);continue}let k=l[p],c=k??o,m=a.kind!=="user"&&c?.nativeId===null&&c.items.length===1&&c.items[0]?.kind==="user"&&!n.has(d)&&!Wn(a)?c:u(d);if(m===k)p++;m.nativeId=d,m.items.push(a),r.set(d,m),o=s=m;continue}if(a.kind==="user"){if(o=u(null),o.items.push(a),x(a))l.push(o);else s=o;continue}if(s===void 0)s={items:[],nativeId:null},i.unshift(s);s.items.push(a)}return i}function R(t,e){if(e.nativeId===null)return h({...t,items:e.items});let n=e.items[0],r=e.items.find((o)=>o.kind==="user");if(r===void 0)return h({...t,items:e.items});let i=r.echo==="adopted"&&r.at<n.at?[r,...e.items.filter((o)=>o!==r)]:e.items;if(!x(n))return h({...t,items:i});let u={...n,echo:null};return h({...t,items:[u,...i.slice(1)]}).map((o)=>o.prompt===u?{...o,prompt:n}:o)}function ls(t,e=[],n=[]){let r=new Map(e.map((o)=>[o.key,o])),i=new Map(t.items.filter((o)=>o.kind==="tool").map((o)=>[o.id,o])),u={...t,items:t.items.filter((o)=>!Va(o))};return A(u.items,n).flatMap((o)=>R(u,o)).map((o)=>{let s=o.prompt===null?[]:[o.prompt];for(let c of o.entries)T(c,s,i);let l=s[0];if(l===void 0)throw Error("A turn without items");let p=`turn:${l.kind}:${l.id}`,a=o.endedAt??Math.max(...s.map((c)=>c.at)),d=r.get(p);if(d!==void 0&&S(d.items,s)&&d.endedAt===a)return d;let f={key:p,user:o.prompt,work:[],final:[],errors:[],edits:[],startedAt:o.startedAt??l.at,endedAt:a,replayed:s.every(Wn),items:s},k=s.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return s.forEach((c,m)=>M(f,c,m<k,s[m-1])),f})}function S(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function Wn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function ye(t){return w(t.content)}function Gt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Vo(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function cs(t){let e=(i)=>{for(let u of t.items){let o=u._meta?.codex;if(typeof o!=="object"||o===null)continue;let s=o[i];if(typeof s==="number"&&Number.isFinite(s)&&s>=0)return s}return},n=e("workDurationMs"),r=e("turnDurationMs");return{durationMs:n??r,durationKind:n===void 0&&r!==void 0?"total":"work",startedAt:e("workStartedAt")}}function ds(t,e,n){if(n?.user==null)return!1;let r=e.items.map(y).find((u)=>u!==null),i=y(n.user);if(r!==void 0&&i!==null)return r===i;return!e.items.some((u)=>{let o=u._meta?.codex;return typeof o==="object"&&o!==null&&"turnCompletedAt"in o&&typeof o.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function us(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let r=e[n];if(r.items.some((i)=>i.kind!=="user"))break;if(!ds(t,e[n-1],r))break;n--}return e[n]?.key}function ps(t,e,n){let r=n,i=n;while(r>0&&ds(t,e[r-1],e[r]))r--;while(i+1<e.length&&ds(t,e[i],e[i+1]))i++;let u=e.slice(r,i+1),o=u.findLast((s)=>s.items.some((l)=>l.kind!=="user"))??u[0];return{continued:e[n]!==o,items:u.flatMap((s)=>s.items),edits:u.flatMap((s)=>s.edits),startedAt:u[0].startedAt}}
|
|
2
|
+
export{Va,as,ls,Wn,ye,Gt,Vo,cs,ds,us,ps};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{C,
|
|
1
|
+
import{C,gs}from"./chunk-wjgrrfq9.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Ai(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
|
|
2
2
|
`):n.value.slice(n.selectionEnd).includes(`
|
|
3
3
|
`))return;if(!e){if(!s||n.value!==""||y)return;let u=o.items.flatMap((a)=>{if(a.kind!=="user")return[];let f=a.content.filter(v).map((l)=>l.text).join(`
|
|
4
|
-
`),p=a.content.filter(g).flatMap((l)=>{let d=C(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:
|
|
5
|
-
export{
|
|
4
|
+
`),p=a.content.filter(g).flatMap((l)=>{let d=C(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:gs(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
|
|
5
|
+
export{Ai};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-kyqf7cqh.js";import{De}from"./chunk-k5kzw2px.js";import{nt}from"./chunk-ckbqdg1s.js";import{en}from"./chunk-r8gnmyb1.js";import{format as f}from"date-fns";import{useState as y}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Skeleton as m}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as t,jsxs as u,Fragment as h}from"react/jsx-runtime";function Xt({label:o,window:a,t:l}){let n=a?100-Math.round(Math.min(100,Math.max(0,a.usedPercent))):0,i=a&&a.resetsAt!==null?l("usage.resetsAt",{time:f(new Date(a.resetsAt*1000),"yyyy/MM/dd HH:mm")}):null;return u("div",{className:"space-y-1.5","aria-busy":!a,children:[u("div",{className:"grid min-h-5 grid-cols-[3.5rem_minmax(0,1fr)_5rem] items-center gap-3",children:[a?t("span",{className:"text-sm",children:o}):t(m,{className:"h-4 w-10 motion-reduce:animate-none"}),a?t("div",{className:"bg-muted h-2 overflow-hidden rounded-full",role:"progressbar","aria-label":o,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:t("div",{className:"bg-primary h-full rounded-full",style:{width:`${n}%`}})}):t(m,{className:"h-2 rounded-full motion-reduce:animate-none"}),a?t("span",{className:"text-muted-foreground text-end text-xs tabular-nums",children:l("usage.remaining",{percent:n})}):t(m,{className:"h-4 w-14 justify-self-end motion-reduce:animate-none"})]}),t("div",{className:"text-muted-foreground flex min-h-4 items-center justify-end text-xs",children:a?i:t(m,{className:"h-3 w-32 motion-reduce:animate-none"})})]})}function ui({account:o,disabled:a,onSignOut:l}){let{t:n}=e().host,i=o===void 0,r=o?.account.account??null,c=o===null?n("usage.accountUnavailable"):r===null?n("usage.notSignedIn"):r.type==="chatgpt"?[r.email,r.planType!=="unknown"?n(`usage.plan.${r.planType}`):null].filter(Boolean).join(" · "):r.type==="apiKey"?n("usage.apiKey"):n("usage.bedrock"),s=o?.rateLimits??null;return u("section",{"aria-busy":i,"aria-label":"Codex",className:"space-y-4",children:[u("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[i?t(m,{className:"h-4 w-40 max-w-[65%] motion-reduce:animate-none"}):t("span",{className:"min-w-0 text-sm break-words",children:c}),i?t(m,{className:"h-8 w-16 shrink-0 motion-reduce:animate-none"}):r!==null&&t(x,{variant:"outline",size:"sm",className:"shrink-0",disabled:a,onClick:l,children:n("connection.signOut")})]}),(i||r!==null)&&t("div",{className:"flex flex-col gap-4",children:i?t(Xt,{t:n}):s===null?t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")}):u(h,{children:[s.primary!==null&&t(Xt,{label:nt(s.primary,n),window:s.primary,t:n}),s.secondary!==null&&t(Xt,{label:nt(s.secondary,n),window:s.secondary,t:n}),s.primary===null&&s.secondary===null&&t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")})]})})]})}function Yt({bridge:o,className:a="rounded-xl border p-4"}){let{host:l}=e(),n=o.useSettingsAgent(),i=o.useSettingsAccount(),[r,c]=y(!1);return u("div",{className:a,children:[t(ui,{account:i,disabled:n==null||r,onSignOut:()=>{c(!0),o.requestSignOut().catch((s)=>l.reportError?.(s)).finally(()=>c(!1))}}),i!=null&&!i.account.account&&n&&t(en,{methods:n.authMethods,signIn:o.requestSignIn}),n?.actions.map((s)=>t(De,{action:s,onRespond:(d,p)=>{o.requestActionResponse(d,p).catch((g)=>l.reportError?.(g))}},s.id))]})}
|
|
2
|
+
export{Xt,ui,Yt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as I}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function w(a){return a.interface?.displayName??a.name}function v(a){let g={},i=new Map,r=new Map;for(let c of a.data){for(let o of c.skills)if(i.set(o.path,o),o.scope==="repo"){let p=g[c.cwd]??[];if(!p.includes(o.path))p.push(o.path);g[c.cwd]=p}for(let o of c.errors)r.set(o.path,o)}return{skills:[...i.values()],errors:[...r.values()],projects:g}}function A(a){let g=[];for(let i of a.marketplaces)for(let r of i.plugins)if(r.installed)g.push({plugin:r,marketplace:i});return g.toSorted((i,r)=>(r.plugin.installedAt??0)-(i.plugin.installedAt??0))}function
|
|
2
|
-
export{
|
|
1
|
+
import{createStore as I}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function w(a){return a.interface?.displayName??a.name}function v(a){let g={},i=new Map,r=new Map;for(let c of a.data){for(let o of c.skills)if(i.set(o.path,o),o.scope==="repo"){let p=g[c.cwd]??[];if(!p.includes(o.path))p.push(o.path);g[c.cwd]=p}for(let o of c.errors)r.set(o.path,o)}return{skills:[...i.values()],errors:[...r.values()],projects:g}}function A(a){let g=[];for(let i of a.marketplaces)for(let r of i.plugins)if(r.installed)g.push({plugin:r,marketplace:i});return g.toSorted((i,r)=>(r.plugin.installedAt??0)-(i.plugin.installedAt??0))}function ei(a){let{plugin:g,marketplace:i}=a;return{installAttemptId:crypto.randomUUID(),pluginName:i.path===null?g.remotePluginId??g.name:g.name,...i.path===null?{remoteMarketplaceName:i.name}:{marketplacePath:i.path}}}function N(a){let{plugin:g,marketplace:i}=a;return{pluginName:i.path===null?g.remotePluginId??g.name:g.name,...i.path===null?{remoteMarketplaceName:i.name}:{marketplacePath:i.path}}}function Zt(a,g){let i=g??{t:(e)=>e},r=(e,l)=>i.t(e,l),c=(e)=>i.notify?.(e),o=(e)=>{if(i.reportError)i.reportError(Error(e));else console.error(e)},p=null,b=null,d=(e)=>S.setState(e),m=()=>S.getState(),y=async(e=!1)=>{if(await m().refresh(void 0,{forceRefetch:e,background:!0}),m().error)throw Error(r("plugins.toast.syncError",{message:m().error}))},f=(e,l)=>d((n)=>{let s={...n.busyIds};if(l===null)delete s[e];else s[e]=l;return{busyIds:s}}),h=(e,l)=>d((n)=>{let s={...n.busyMarketplaces};if(l)s[e]=!0;else delete s[e];return{busyMarketplaces:s}}),R=I({loading:!1,loadedScope:null,upgrading:!1,error:null,cwds:[],marketplaces:[],marketplaceLoadErrors:[],featuredPluginIds:[],installed:[],skills:[],skillProjects:{},skillErrors:[],busyIds:{},busySkills:{},busyMarketplaces:{},refresh:(e=m().cwds,l={})=>{let n=l.forceRefetch===!0||p?.forceRefetch===!0,s=l.catalog!==!1||n||p?.catalog===!0;if(p={cwds:e,forceRefetch:n,catalog:s},d({cwds:e,...!l.background?{loading:!0}:{}}),b)return b;return b=(async()=>{while(p){let t=p;p=null,d({error:null});try{let[u,P,M]=await Promise.all([a.listSkills(t.cwds,t.forceRefetch),t.catalog?a.listPlugins({...t.cwds.length>0?{cwds:t.cwds}:{},...t.forceRefetch?{forceRefetch:!0}:{}}):null,a.installedPlugins(t.cwds)]);if(p)continue;let E=v(u);d({loadedScope:JSON.stringify(t.cwds),skills:E.skills,skillProjects:E.projects,skillErrors:E.errors,...P?{marketplaces:P.marketplaces,marketplaceLoadErrors:P.marketplaceLoadErrors,featuredPluginIds:P.featuredPluginIds}:{},installed:A(M)})}catch(u){if(!p)d({error:k(u)})}}})().finally(()=>{b=null,d({loading:!1})}),b},install:async(e)=>{if(e.plugin.id in m().busyIds)throw Error("Plugin operation already in progress");let l=w(e.plugin);f(e.plugin.id,"installing");try{let n=await a.installPlugin(ei(e));return await y(),f(e.plugin.id,null),c(r("plugins.toast.installed",{pluginName:l})),n}catch(n){throw o(`${r("plugins.toast.installError")}: ${k(n)}`),n}finally{f(e.plugin.id,null)}},setPluginEnabled:async(e,l)=>{if(e.id in m().busyIds)return;f(e.id,"toggling");let n=(t)=>d((u)=>({installed:u.installed.map((P)=>P.plugin.id===e.id?{...P,plugin:{...P.plugin,enabled:t}}:P)}));n(l);let s=e.enabled;try{let t=await a.setPluginEnabled(e.id,l);s=t.enabled,n(t.enabled),await y();let u=m().installed.find((P)=>P.plugin.id===e.id);if(u)s=u.plugin.enabled;if(!u||s!==l)throw Error(r("plugins.toast.toggleNotApplied"));f(e.id,null),c(r(l?"plugins.toast.enabled":"plugins.toast.disabled",{pluginName:w(e)}))}catch(t){n(s),o(`${r("plugins.toast.toggleError")}: ${k(t)}`)}finally{f(e.id,null)}},uninstall:async(e)=>{if(e.id in m().busyIds)return;let l=w(e);f(e.id,"uninstalling");try{let n=e.source.type==="remote"?e.remotePluginId:e.id;if(!n)throw Error("Remote plugin ID is missing");if(await a.uninstallPlugin(n),await y(),m().installed.some((s)=>s.plugin.id===e.id))throw Error(r("plugins.toast.uninstallNotApplied"));f(e.id,null),c(r("plugins.toast.uninstalled",{pluginName:l}))}catch(n){o(`${r("plugins.toast.uninstallError")}: ${k(n)}`)}finally{f(e.id,null)}},readPlugin:async(e)=>(await a.readPlugin(N(e))).plugin,setSkillEnabled:async(e,l)=>{if(e.path in m().busySkills)return;d((s)=>({busySkills:{...s.busySkills,[e.path]:!0}})),d((s)=>({skills:s.skills.map((t)=>t.path===e.path?{...t,enabled:l}:t)}));let n=e.interface?.displayName??e.name;try{let s=await a.setSkillEnabled({path:e.path,enabled:l});if(d((t)=>({skills:t.skills.map((u)=>u.path===e.path?{...u,enabled:s.effectiveEnabled}:u)})),s.effectiveEnabled!==l){o(r("plugins.catalog.toggleNotApplied"));return}c(r(l?"plugins.skills.enabledToast":"plugins.skills.disabledToast",{skillName:n}))}catch(s){d((t)=>({skills:t.skills.map((u)=>u.path===e.path?{...u,enabled:e.enabled}:u)})),o(`${r("plugins.skills.toggleError")}: ${k(s)}`)}finally{d((s)=>{let t={...s.busySkills};return delete t[e.path],{busySkills:t}})}},addMarketplace:async(e)=>{let l=await a.addMarketplace(e);return await y(!0),c(l.alreadyAdded?r("plugins.marketplace.alreadyAdded",{marketplaceName:l.marketplaceName}):r("plugins.marketplace.added",{marketplaceName:l.marketplaceName})),l},removeMarketplace:async(e)=>{h(e,!0);try{await a.removeMarketplace(e),await y(),h(e,!1),c(r("plugins.marketplace.removed",{marketplaceName:e}))}catch(l){o(`${r("plugins.marketplace.removeError")}: ${k(l)}`)}finally{h(e,!1)}},upgradeMarketplace:async(e)=>{h(e,!0);try{let l=await a.upgradeMarketplaces(e);if(await y(!0),h(e,!1),l.errors.length>0)o(`${r("plugins.marketplace.upgradeError")}: ${l.errors.map((n)=>n.message).join("; ")}`);else c(r("plugins.marketplace.upgraded",{marketplaceName:e}))}catch(l){o(`${r("plugins.marketplace.upgradeError")}: ${k(l)}`)}finally{h(e,!1)}},upgradeAll:async()=>{if(m().upgrading)return;d({upgrading:!0});try{let e=await a.upgradeMarketplaces();if(await y(!0),d({upgrading:!1}),e.errors.length>0)o(r("plugins.marketplace.upgradeAllError"));else c(r("plugins.marketplace.upgradedAll"))}catch(e){o(`${r("plugins.marketplace.upgradeAllRequestError")}: ${k(e)}`)}finally{d({upgrading:!1})}}}),S=Object.assign(R,{bindHost:(e)=>{i=e}});return S}
|
|
2
|
+
export{ei,Zt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{ol,ka,
|
|
1
|
+
import{yr}from"./chunk-wpacvdsv.js";import{vr,Rt}from"./chunk-at25g15n.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as it}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function ol(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function ka(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;ka(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function hr({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await vr(d,t),t.aborted)return;if(!l)ka(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=Rt(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=Rt(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(it,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(yr,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
|
|
2
|
+
export{ol,ka,hr};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function bt(e,t){if(e!==null&&e!=="generate"&&e!=="edit")throw Error("Invalid image intent");return{"alwith.imageIntent":e===null?"The current message uses ordinary chat input. For image generation or editing, use the native image generation tool, never the application generate_image tool. Do not apply application image-model settings or earlier application image-workflow instructions. Image generation is not implied by the input mode; follow the user's request.":[e==="edit"?"The current message requests an image edit. Use the application generate_image tool and the supplied source and reference attachments. Follow the specific editing instructions in the user message.":"The user selected image input for the current message. Treat descriptions as requests to generate or edit images using the application generate_image tool. Use attached images as references when relevant. Answer questions about previous results normally; do not generate another image unless requested.","Use only the application's selected image model for this image conversation. Do not substitute a native image generation tool.",t].filter(Boolean).join(`
|
|
2
2
|
|
|
3
3
|
`)}}
|
|
4
|
-
export{
|
|
4
|
+
export{bt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-kyqf7cqh.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function en({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
|
|
2
|
+
export{en};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function
|
|
2
|
-
export{
|
|
1
|
+
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function zr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function ll(){c()}function Vr(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function $r(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Sa(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function cl(e,n,t,i,o,a){if(a==="none")return;_(o,[Sa(e,n,t,i,a)])}function Sa(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ba(t,i);return _a(e,n)}function Ba(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function _a(e,n){return y+Ga(e,n)}function dl(e,n){return D(_a(e,n))}function Ga(e,n){if(n<=l)return za(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function za(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function ul(){return r.context?.state}function pl(e){return g(e).ready}
|
|
2
|
+
export{zr,ll,Vr,$r,cl,Sa,Ba,_a,dl,Ga,za,ul,pl};
|