@alwith/module-chat 0.6.28 → 0.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/catalogs/qwen/models.json +40 -0
- package/assets/provider-catalog.json +4 -0
- package/dist/activity-host.js +1 -1
- package/dist/agent/client.d.ts +1 -0
- package/dist/agent/client.js +1 -1
- package/dist/agent/custom-model-effort.js +1 -1
- package/dist/agent/fork-title.js +1 -1
- package/dist/agent/image-request.js +1 -1
- package/dist/agent/image-tools.js +1 -1
- package/dist/agent/input-config.js +1 -1
- package/dist/agent/input-modes/chat.js +1 -1
- package/dist/agent/input-modes/execution-meta.js +1 -1
- package/dist/agent/input-modes/image-context.js +1 -1
- package/dist/agent/input-modes/image.js +1 -1
- package/dist/agent/input-modes/index.js +1 -1
- package/dist/agent/request-error.js +1 -1
- package/dist/app-reference.js +1 -1
- package/dist/application-tools.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/{chunk-6tj5e7fc.js → chunk-06aaghwq.js} +2 -2
- package/dist/{chunk-gvqvw7ms.js → chunk-0c956xc0.js} +2 -2
- package/dist/chunk-0f00j53n.js +2 -0
- package/dist/{chunk-5dtpfpq5.js → chunk-12bfnfbk.js} +2 -2
- package/dist/chunk-12pd4nxy.js +2 -0
- package/dist/{chunk-rt1c2p25.js → chunk-188q5xn8.js} +2 -2
- package/dist/{chunk-sgbn37kz.js → chunk-189aq7st.js} +2 -2
- package/dist/{chunk-8v53bkyr.js → chunk-19jh646d.js} +2 -2
- package/dist/{chunk-rb4p3h5b.js → chunk-1bvgs2t1.js} +2 -2
- package/dist/{chunk-p83pk7ff.js → chunk-1dpk9zrb.js} +2 -2
- package/dist/{chunk-9kz3pxt9.js → chunk-239gtn3z.js} +2 -2
- package/dist/chunk-2c4hqv8f.js +2 -0
- package/dist/{chunk-ndfyste3.js → chunk-2c7a0zdc.js} +2 -2
- package/dist/chunk-2rk59ngw.js +2 -0
- package/dist/{chunk-cpe6vtpe.js → chunk-32zzqeyf.js} +2 -2
- package/dist/{chunk-tzczzqde.js → chunk-36j9fer8.js} +2 -2
- package/dist/{chunk-ztm4agfw.js → chunk-36rxa8k7.js} +3 -3
- package/dist/{chunk-jf2bxzee.js → chunk-37x36kph.js} +3 -3
- package/dist/{chunk-2cfhvb3k.js → chunk-3btheq4v.js} +2 -2
- package/dist/{chunk-zr8yk5np.js → chunk-3cwbxnxr.js} +3 -3
- package/dist/{chunk-2e1tg69n.js → chunk-3gkb117f.js} +3 -3
- package/dist/{chunk-38psn07c.js → chunk-3kxerrsh.js} +2 -2
- package/dist/{chunk-k7h34p5z.js → chunk-42dfq7ze.js} +1 -1
- package/dist/{chunk-tmec4by7.js → chunk-46j8adkj.js} +2 -2
- package/dist/{chunk-fqdtx7tp.js → chunk-483jakc1.js} +2 -2
- package/dist/chunk-48zgp33j.js +2 -0
- package/dist/{chunk-dnh1e01b.js → chunk-4fghmx57.js} +2 -2
- package/dist/chunk-4npg9v6h.js +2 -0
- package/dist/{chunk-c4awmmwt.js → chunk-4sj3t6mk.js} +2 -2
- package/dist/{chunk-k44dkkpg.js → chunk-4y07ykv2.js} +2 -2
- package/dist/chunk-52hvpdxw.js +2 -0
- package/dist/{chunk-2zy75522.js → chunk-54awxpw2.js} +2 -2
- package/dist/{chunk-jggts370.js → chunk-5arfhz6m.js} +2 -2
- package/dist/{chunk-n0q8e6sq.js → chunk-5cas0xvp.js} +2 -2
- package/dist/chunk-5dxzfdd1.js +2 -0
- package/dist/{chunk-tnzz1j83.js → chunk-5dygcexv.js} +2 -2
- package/dist/{chunk-3a3ecayr.js → chunk-5h8h4sas.js} +2 -2
- package/dist/{chunk-cpy7x31t.js → chunk-5n2304a1.js} +2 -2
- package/dist/chunk-5wed639g.js +2 -0
- package/dist/{chunk-a73hd95m.js → chunk-621g2ntr.js} +3 -3
- package/dist/{chunk-81hv0s07.js → chunk-6eebeq0f.js} +2 -2
- package/dist/chunk-6g5qmjph.js +2 -0
- package/dist/{chunk-r06hycq5.js → chunk-6gejqbns.js} +2 -2
- package/dist/{chunk-xsn2g4kk.js → chunk-6hxz5cpc.js} +2 -2
- package/dist/{chunk-kj3t4mqf.js → chunk-6ja6pt5x.js} +2 -2
- package/dist/{chunk-b2vtrd8n.js → chunk-6kyq5zxt.js} +1 -1
- package/dist/{chunk-2c2a1wvg.js → chunk-6m9frvzj.js} +2 -2
- package/dist/{chunk-vbk36ptt.js → chunk-6r1e3y4e.js} +3 -3
- package/dist/{chunk-sjqhtpzr.js → chunk-6wkcqhkk.js} +2 -2
- package/dist/{chunk-42ebtw00.js → chunk-6yzknjee.js} +2 -2
- package/dist/{chunk-ga265p00.js → chunk-717437bm.js} +2 -2
- package/dist/chunk-7ckdhz5y.js +2 -0
- package/dist/chunk-7egc2x4q.js +1 -0
- package/dist/{chunk-ayhxrzsq.js → chunk-7g0cbkbp.js} +2 -2
- package/dist/{chunk-kj3a1k2q.js → chunk-7hfd7hnm.js} +2 -2
- package/dist/{chunk-2sc2z6g5.js → chunk-7jk8s061.js} +2 -2
- package/dist/{chunk-7rgcj1w2.js → chunk-7n1v87h0.js} +2 -2
- package/dist/{chunk-tghj342y.js → chunk-7rqryntm.js} +2 -2
- package/dist/{chunk-gds55pjg.js → chunk-7sf2wz1n.js} +2 -2
- package/dist/{chunk-3nbpd0jt.js → chunk-7vby3f2v.js} +2 -2
- package/dist/{chunk-kk9dbwd1.js → chunk-84zzf0ys.js} +2 -2
- package/dist/{chunk-1gtmvxdr.js → chunk-8ktb3g8c.js} +2 -2
- package/dist/{chunk-17gs9pbn.js → chunk-8p861ztc.js} +2 -2
- package/dist/{chunk-w1yrsbw1.js → chunk-8w5bt0nc.js} +2 -2
- package/dist/{chunk-0q22f9vw.js → chunk-9162ez1n.js} +2 -2
- package/dist/{chunk-ty2cd00p.js → chunk-91jmmkd3.js} +2 -2
- package/dist/{chunk-78vckhxt.js → chunk-964fwwsg.js} +2 -2
- package/dist/{chunk-xk6f2raz.js → chunk-9xdne4k4.js} +2 -2
- package/dist/{chunk-t9xkg3pk.js → chunk-aa2xhwh2.js} +1 -1
- package/dist/{chunk-ms0h8x63.js → chunk-abxsr9d1.js} +2 -2
- package/dist/{chunk-nh56sb8e.js → chunk-afnnrn6z.js} +2 -2
- package/dist/{chunk-kfgy61cg.js → chunk-agz11n1h.js} +3 -3
- package/dist/{chunk-rkejggyx.js → chunk-ahzjy61p.js} +2 -2
- package/dist/{chunk-1ffpsz44.js → chunk-ansfap1a.js} +2 -2
- package/dist/{chunk-b6p0y68h.js → chunk-aq22zye1.js} +1 -1
- package/dist/{chunk-cvn9zbbc.js → chunk-azak3tb5.js} +2 -2
- package/dist/{chunk-gnd32zkx.js → chunk-b4qe4xnp.js} +2 -2
- package/dist/{chunk-9q6hz47j.js → chunk-b4wh6k5s.js} +2 -2
- package/dist/{chunk-q5qqhqw4.js → chunk-b64hyshj.js} +2 -2
- package/dist/{chunk-n8mexbh4.js → chunk-bajn7ssf.js} +2 -2
- package/dist/{chunk-trxf8c70.js → chunk-bbvhgh27.js} +2 -2
- package/dist/{chunk-38bpmgjd.js → chunk-bnf6pmgc.js} +2 -2
- package/dist/{chunk-evsyhxz1.js → chunk-bsqe29dh.js} +2 -2
- package/dist/chunk-cp3qcgdv.js +4 -0
- package/dist/{chunk-tky568fy.js → chunk-cttsbjr0.js} +2 -2
- package/dist/{chunk-ffs5nkt0.js → chunk-cxhyh0w9.js} +2 -2
- package/dist/{chunk-f4h84pav.js → chunk-d336k00a.js} +2 -2
- package/dist/{chunk-jg4c3zg4.js → chunk-d5pn8932.js} +2 -2
- package/dist/{chunk-3qqd9x6x.js → chunk-d8bjsf1d.js} +2 -2
- package/dist/{chunk-6xap6hvz.js → chunk-darm80tf.js} +2 -2
- package/dist/{chunk-s81m6yx7.js → chunk-dbrrbwb8.js} +2 -2
- package/dist/chunk-dfzhma2x.js +2 -0
- package/dist/{chunk-064vpdm9.js → chunk-ds6bqmdr.js} +2 -2
- package/dist/{chunk-dzpbbys1.js → chunk-dwf38vyq.js} +2 -2
- package/dist/chunk-dxfhy8gr.js +2 -0
- package/dist/{chunk-pk931bpm.js → chunk-dzw6vqqf.js} +2 -2
- package/dist/{chunk-v9v1v41p.js → chunk-e8mxwqxy.js} +2 -2
- package/dist/chunk-eedgav4q.js +2 -0
- package/dist/{chunk-r4nz54dh.js → chunk-eexn5mmk.js} +2 -2
- package/dist/{chunk-rncvy5pp.js → chunk-efkfzgs9.js} +2 -2
- package/dist/chunk-ehcnfvaz.js +2 -0
- package/dist/{chunk-rkks48gw.js → chunk-epdnafa1.js} +2 -2
- package/dist/{chunk-6yaxjcnj.js → chunk-esxjnj1y.js} +3 -3
- package/dist/{chunk-jz7dnk88.js → chunk-ezaypwps.js} +2 -2
- package/dist/{chunk-q46z21zs.js → chunk-f9zpep12.js} +2 -2
- package/dist/{chunk-mdf155e1.js → chunk-fednb216.js} +2 -2
- package/dist/{chunk-pxv38ttf.js → chunk-fpsn6fmf.js} +2 -2
- package/dist/{chunk-nzgjcp8w.js → chunk-fvf1et2s.js} +2 -2
- package/dist/{chunk-5hk14ksr.js → chunk-fvw65b49.js} +2 -2
- package/dist/{chunk-hyr8yww9.js → chunk-fz9y067h.js} +2 -2
- package/dist/{chunk-djd3sjp9.js → chunk-g9426ns9.js} +2 -2
- package/dist/chunk-gdn4vvks.js +2 -0
- package/dist/chunk-ge0anaww.js +4 -0
- package/dist/chunk-gjj5wbms.js +4 -0
- package/dist/{chunk-tj4b0s68.js → chunk-gt50nb3j.js} +2 -2
- package/dist/chunk-h1t76wws.js +2 -0
- package/dist/chunk-hc9bcwpa.js +2 -0
- package/dist/{chunk-26w51q10.js → chunk-hpv8x22r.js} +2 -2
- package/dist/chunk-hqfhb4ng.js +2 -0
- package/dist/{chunk-62kt6f1d.js → chunk-htsbt68m.js} +2 -2
- package/dist/{chunk-tftfggte.js → chunk-hz8yrg2t.js} +2 -2
- package/dist/{chunk-0xshzqb6.js → chunk-hzhcajx1.js} +2 -2
- package/dist/chunk-j1khvg9s.js +2 -0
- package/dist/{chunk-0aeq7qy7.js → chunk-jbnbx285.js} +2 -2
- package/dist/{chunk-heqa4swe.js → chunk-jkqh03w4.js} +2 -2
- package/dist/{chunk-s89p3zgn.js → chunk-k0rfgjm6.js} +2 -2
- package/dist/{chunk-7sr8weqn.js → chunk-k1atcess.js} +2 -2
- package/dist/{chunk-cf7cw2tj.js → chunk-kk5acm1s.js} +5 -5
- package/dist/{chunk-7zafb413.js → chunk-kq8jv5tf.js} +2 -2
- package/dist/{chunk-8hygfx41.js → chunk-kv1v7kgn.js} +2 -2
- package/dist/chunk-kzh7w9c0.js +2 -0
- package/dist/chunk-m76tgtge.js +3 -0
- package/dist/{chunk-kvnbmt00.js → chunk-m7t9asrq.js} +2 -2
- package/dist/{chunk-ccxsf02q.js → chunk-m7tj6194.js} +2 -2
- package/dist/{chunk-z4jv8svx.js → chunk-me230xjh.js} +3 -3
- package/dist/{chunk-ykz0h1r0.js → chunk-mtcxr3ns.js} +2 -2
- package/dist/{chunk-6pwssh9v.js → chunk-n7f38k3f.js} +2 -2
- package/dist/chunk-n7pyzjq1.js +2 -0
- package/dist/{chunk-6bhfdsyz.js → chunk-n9e1v175.js} +2 -2
- package/dist/{chunk-ypgvt8ky.js → chunk-nabyjzn5.js} +2 -2
- package/dist/{chunk-gea1q14z.js → chunk-nn8pmwqz.js} +2 -2
- package/dist/{chunk-rerm6x2f.js → chunk-nq2tqdb2.js} +2 -2
- package/dist/chunk-nravn5bk.js +2 -0
- package/dist/{chunk-p8cm3xw1.js → chunk-p781sb6h.js} +2 -2
- package/dist/chunk-pbx1417n.js +2 -0
- package/dist/{chunk-5vajeawb.js → chunk-pqw5qz4e.js} +2 -2
- package/dist/{chunk-e04g26qm.js → chunk-pqz2471h.js} +2 -2
- package/dist/chunk-pv7t4hw8.js +2 -0
- package/dist/{chunk-aq1j5vqn.js → chunk-q98s7d94.js} +2 -2
- package/dist/{chunk-evethx5n.js → chunk-qc49fm8e.js} +2 -2
- package/dist/{chunk-t50b1s7h.js → chunk-qd8j2d63.js} +3 -3
- package/dist/{chunk-jra2q5cx.js → chunk-qdbyn3xv.js} +2 -2
- package/dist/chunk-qecs9e31.js +2 -0
- package/dist/{chunk-dyks7e24.js → chunk-qz9q0g2b.js} +2 -2
- package/dist/{chunk-q01vmp9m.js → chunk-r013w7yb.js} +2 -2
- package/dist/{chunk-pccwq2dd.js → chunk-r3s28905.js} +3 -3
- package/dist/{chunk-zpcd9w2t.js → chunk-r51vcbf0.js} +2 -2
- package/dist/{chunk-qqphgn9b.js → chunk-r7z3mvej.js} +2 -2
- package/dist/chunk-rak4mkgh.js +2 -0
- package/dist/{chunk-snxpc6yr.js → chunk-rhyw89ap.js} +2 -2
- package/dist/{chunk-a4y4bsve.js → chunk-sb2694hc.js} +2 -2
- package/dist/{chunk-jfrj2qg1.js → chunk-sdhkpkbs.js} +2 -2
- package/dist/{chunk-y8fmawc6.js → chunk-smd9rszw.js} +3 -3
- package/dist/{chunk-kqekfj3v.js → chunk-sx1gjwb6.js} +3 -3
- package/dist/chunk-sykf5jnc.js +2 -0
- package/dist/{chunk-0fs2k5fe.js → chunk-t56ncd8f.js} +2 -2
- package/dist/{chunk-eavqh5fb.js → chunk-tbz64dbd.js} +3 -3
- package/dist/{chunk-tpdyjp90.js → chunk-tdaznr5w.js} +2 -2
- package/dist/{chunk-ckja1ppp.js → chunk-tjc0ntnh.js} +2 -2
- package/dist/chunk-ts7h148j.js +2 -0
- package/dist/{chunk-v042t2he.js → chunk-v0xy25sh.js} +2 -2
- package/dist/{chunk-gzc704c3.js → chunk-v6f6s828.js} +2 -2
- package/dist/{chunk-ec4q4rw7.js → chunk-vazspetj.js} +2 -2
- package/dist/{chunk-m8tt5bf9.js → chunk-vhxr0c4c.js} +2 -2
- package/dist/{chunk-tm5w5srq.js → chunk-vjgze5n7.js} +2 -2
- package/dist/{chunk-hygvdjq6.js → chunk-vvmmzcms.js} +2 -2
- package/dist/{chunk-phsvgv0f.js → chunk-vvy4ke91.js} +2 -2
- package/dist/{chunk-vzm88w2r.js → chunk-w5rg8wk8.js} +2 -2
- package/dist/{chunk-pqs039wv.js → chunk-w7vcd8d1.js} +4 -4
- package/dist/{chunk-at75m9hq.js → chunk-wf4z9w5x.js} +2 -2
- package/dist/chunk-wfk50eh6.js +2 -0
- package/dist/{chunk-smf7c649.js → chunk-wxafew32.js} +2 -2
- package/dist/chunk-wxjm3mq8.js +2 -0
- package/dist/chunk-x0m4ctqf.js +2 -0
- package/dist/{chunk-2v531sbv.js → chunk-x9rppnkq.js} +2 -2
- package/dist/{chunk-r7paw6ba.js → chunk-xca0vnvk.js} +2 -2
- package/dist/chunk-xk41ehy8.js +2 -0
- package/dist/{chunk-6cxvfwpe.js → chunk-xmy7ebed.js} +2 -2
- package/dist/{chunk-jca8s47n.js → chunk-xpj8gb9a.js} +1 -1
- package/dist/chunk-xpts50f0.js +2 -0
- package/dist/{chunk-36ttr22w.js → chunk-xqsfaaae.js} +2 -2
- package/dist/{chunk-kfm1sz3q.js → chunk-y5xjf5sb.js} +2 -2
- package/dist/chunk-y780cd4m.js +2 -0
- package/dist/{chunk-p79keq5q.js → chunk-ybwevt5n.js} +2 -2
- package/dist/{chunk-r1sj7c91.js → chunk-yc7w1en3.js} +2 -2
- package/dist/{chunk-m8pkmbtf.js → chunk-yfb5hj4w.js} +2 -2
- package/dist/{chunk-2fck5sy2.js → chunk-yn3d949k.js} +2 -2
- package/dist/chunk-ynp45k84.js +2 -0
- package/dist/chunk-yqhvxm9m.js +2 -0
- package/dist/{chunk-r8pm74zf.js → chunk-z930082m.js} +2 -2
- package/dist/chunk-zcfsbgvw.js +2 -0
- package/dist/chunk-zewseva6.js +2 -0
- package/dist/client.js +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/artifact-links.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/markdown.css +4 -0
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/locales.js +1 -1
- package/dist/collections/model.js +1 -1
- package/dist/collections/store.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/inline-document.js +1 -1
- package/dist/composer/inline-dom.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.d.ts +2 -0
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-inline.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/app-mentions.js +1 -1
- package/dist/conversation/composer/apps-menu.js +1 -1
- package/dist/conversation/composer/composer-menu.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/config-options.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/prompt-history.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/connection-notice.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-search.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/diff-modal.js +1 -1
- package/dist/conversation/draft-project-picker.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/conversation/subagent-sessions.js +1 -1
- package/dist/conversation/subagent-tasks.d.ts +1 -0
- package/dist/conversation/subagent-tasks.js +1 -1
- package/dist/desktop/desktop-composer.d.ts +3 -2
- package/dist/desktop/desktop-composer.js +1 -1
- package/dist/desktop/desktop.js +1 -1
- package/dist/desktop/draft-model-select.js +1 -1
- package/dist/desktop/load-image.js +1 -1
- package/dist/desktop/model-catalog.js +1 -1
- package/dist/desktop/model-recovery.d.ts +2 -2
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.d.ts +4 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.js +1 -1
- package/dist/lib/app-reference.js +1 -1
- package/dist/lib/application-metadata.js +1 -1
- package/dist/lib/chat-path.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/file-url.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/lib/tool-artifacts.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mermaid/diagram.js +1 -1
- package/dist/mermaid/export.js +1 -1
- package/dist/mermaid/index.js +1 -1
- package/dist/mermaid/preview.js +1 -1
- package/dist/oauth/claude-login.js +1 -1
- package/dist/oauth.js +1 -1
- package/dist/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.js +1 -1
- package/dist/plugins/locales.js +1 -1
- package/dist/plugins/new-chat-directory.js +1 -1
- package/dist/plugins/panel-item.js +1 -1
- package/dist/plugins/plugin-detail-page.js +1 -1
- package/dist/plugins/plugin-icon.js +1 -1
- package/dist/plugins/plugin-icons.js +1 -1
- package/dist/plugins/plugins-page.js +1 -1
- package/dist/plugins/plugins.js +1 -1
- package/dist/plugins/read-skill-document.js +1 -1
- package/dist/plugins/skill-document.js +1 -1
- package/dist/plugins/skills-tab.js +1 -1
- package/dist/plugins/store.js +1 -1
- package/dist/plugins/toolbox-layout.js +1 -1
- package/dist/reference-projection.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/highlight.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/locales.js +1 -1
- package/dist/session-list/navigation-controls.js +1 -1
- package/dist/session-list/navigation-header.js +1 -1
- package/dist/session-list/navigation-store.js +1 -1
- package/dist/session-list/navigation-tabs.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/platform.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/shortcut-hint.js +1 -1
- package/dist/session-list/shortcut.js +1 -1
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-image-references.js +1 -1
- package/dist/session-timeline/assistant-turn.d.ts +4 -0
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/image-generation-progress.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/settings/codex-account-card.js +1 -1
- package/dist/settings/login-card.js +1 -1
- package/dist/settings/model-alias-settings.js +1 -1
- package/dist/settings/model-aliases.js +1 -1
- package/dist/settings/provider-logos.js +1 -1
- package/dist/settings/provider-section.js +1 -1
- package/dist/settings/providers-port.js +1 -1
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.js +1 -1
- package/native/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/package.json +2 -2
- package/dist/chunk-0fqp48tv.js +0 -2
- package/dist/chunk-1a56svgj.js +0 -2
- package/dist/chunk-1fda3013.js +0 -2
- package/dist/chunk-3kn94cpp.js +0 -2
- package/dist/chunk-3r57tgvf.js +0 -2
- package/dist/chunk-4cbfgsg7.js +0 -2
- package/dist/chunk-5d138vq3.js +0 -1
- package/dist/chunk-5k4ec37x.js +0 -2
- package/dist/chunk-5mnjkjjr.js +0 -2
- package/dist/chunk-6tr1bch8.js +0 -4
- package/dist/chunk-8qzq9yq1.js +0 -2
- package/dist/chunk-8y838se4.js +0 -2
- package/dist/chunk-aepfqfad.js +0 -2
- package/dist/chunk-agx111cv.js +0 -2
- package/dist/chunk-b30n56t8.js +0 -2
- package/dist/chunk-b42vv8f2.js +0 -2
- package/dist/chunk-b8x98hyd.js +0 -2
- package/dist/chunk-bx11qvn9.js +0 -2
- package/dist/chunk-dd0f44xb.js +0 -2
- package/dist/chunk-dmq2fx7g.js +0 -2
- package/dist/chunk-dpfjxym1.js +0 -2
- package/dist/chunk-e27d47yd.js +0 -2
- package/dist/chunk-ep9vq47f.js +0 -2
- package/dist/chunk-fjrghy92.js +0 -2
- package/dist/chunk-gya560n0.js +0 -2
- package/dist/chunk-gyw21vnb.js +0 -2
- package/dist/chunk-j8ehajmt.js +0 -2
- package/dist/chunk-mhzqhd85.js +0 -2
- package/dist/chunk-mz90kcyd.js +0 -2
- package/dist/chunk-mzd9qfmj.js +0 -2
- package/dist/chunk-ngvdcqmt.js +0 -3
- package/dist/chunk-q73jne25.js +0 -2
- package/dist/chunk-sy1rf5m0.js +0 -4
- package/dist/chunk-t7xbh36h.js +0 -2
- package/dist/chunk-tk66t919.js +0 -4
- package/dist/chunk-ty9sa6we.js +0 -2
- package/dist/chunk-vnh0jnr4.js +0 -2
- package/dist/chunk-w368gk92.js +0 -2
- package/dist/chunk-x1mzrhtd.js +0 -2
- package/dist/chunk-xhbxpk0z.js +0 -2
- package/dist/chunk-y6p8xspr.js +0 -2
- package/dist/chunk-y85askf9.js +0 -2
- package/dist/chunk-yc47rq4m.js +0 -2
- package/dist/chunk-z6zsmpyz.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Kn}from"./chunk-ybwevt5n.js";import{xe}from"./chunk-vvy4ke91.js";import{cs}from"./chunk-6hxz5cpc.js";import{C,Ft}from"./chunk-x0m4ctqf.js";import{t}from"./chunk-dxfhy8gr.js";import{ui,pi}from"./chunk-pqw5qz4e.js";import{D}from"./chunk-epdnafa1.js";import{ue}from"./chunk-azak3tb5.js";import{isEmbeddedResource as g,isImage as x,isResourceLink as R,isText as h}from"@nyssance/codex-acp-v2/client";import{memo as v}from"react";import{jsx as i,jsxs as y}from"react/jsx-runtime";var di=v(function({item:n,messageTime:f,skillNames:u=[]}){let p=t(),r=pi(n._meta),m=r?r.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
|
+
${e.text}`).join(`
|
|
3
|
+
`):ue(n),l=n.content.filter(x),d=new Set(Ft(m).map((e)=>e.id)),o=new Map,a=n.content.filter((e)=>{if(R(e)){let s=C(e.uri);if(s!==null){if(!d.has(s))o.set(s,{id:s,name:e.title??e.name});return!1}return!0}return g(e)}),c=r??n.content.filter(h).map((e)=>{let s=ui(e._meta);return s?{question:s.question,text:s.answer}:{text:e.text}});if(m.length===0&&l.length===0&&a.length===0&&o.size===0)return null;return y("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":n.id,children:[a.length>0&&i("div",{className:"codex-user-mentions",children:a.map((e,s)=>i(D,{block:e},`${n.id}:${s}`))}),i(Kn,{value:{names:u,icon:p.skillIcon},children:i(cs,{host:p,message:n,text:m,textParts:c.some((e)=>("question"in e))?c:void 0,applicationReferences:o.size>0?i("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:[...o.values()].map((e)=>i(xe,{app:e},e.id))}):void 0,images:l,mentions:[],messageTime:f})})]})});
|
|
4
|
+
export{di};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t}from"./chunk-
|
|
2
|
-
export{Ia,
|
|
1
|
+
import{t}from"./chunk-dxfhy8gr.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function Ia(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function hi({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=Ia(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
|
|
2
|
+
export{Ia,hi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function Ne(e){if(e.startsWith("\\\\?\\UNC\\"))e="\\\\"+e.slice(8);else if(e.startsWith("\\\\?\\"))e=e.slice(4);if(/^[a-z]:[\\/]/i.test(e))e="/"+e.replaceAll("\\","/");else if(e.startsWith("\\\\"))e=e.replaceAll("\\","/");if(!e.startsWith("/"))throw Error("File URLs require an absolute path");let i=encodeURI(e).replaceAll(/[?#]/g,encodeURIComponent);return e.startsWith("//")?`file:${i}`:`file://${i}`}
|
|
2
|
+
export{Ne};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as o,useContext as n,useEffect as r}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as o,useContext as n,useEffect as r}from"react";var Br=o(null);function R(t){let e=n(Br);r(()=>{if(t&&e!==null)return e()},[t,e])}
|
|
2
|
+
export{Br,R};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as l}from"cn";import{DropdownMenuRadioGroup as r,DropdownMenuRadioItem as s}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as a}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as l}from"cn";import{DropdownMenuRadioGroup as r,DropdownMenuRadioItem as s}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as a}from"react/jsx-runtime";function A({value:i,onValueChange:n,options:o,itemClassName:d}){return t(r,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(s,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:l("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
|
|
2
|
+
export{A};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{n}from"./chunk-dxfhy8gr.js";import{ut}from"./chunk-efkfzgs9.js";import{e,x}from"./chunk-2c4hqv8f.js";import{Wn}from"./chunk-dfzhma2x.js";import{Loader2Icon as v}from"lucide-react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as c,EmptyDescription as l,EmptyHeader as d,EmptyTitle as f}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as o,jsxs as i}from"react/jsx-runtime";function Bt({session:t,timeline:s}){let{host:m,client:a}=e(),{t:r}=m,u=n((h)=>h.historyPages[t.id]?.cursor!=null),y=Wn(t,s?.turnWork),E=()=>x(m,a.open(t.id,t.cwd)),p=o(ut,{...s,session:t,client:a,host:m,turnWork:y});if(t.restoring)return t.items.length===0?i("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[o(v,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return i(c,{className:"flex-1",children:[i(d,{children:[o(f,{children:r("conversation.reopen")}),o(l,{children:r("conversation.detached")})]}),o(g,{onClick:E,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!u)return o(c,{className:"flex-1",children:i(d,{children:[o(f,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),o(l,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{Bt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function xo({name:p,value:M,levels:h,disabled:c,onChange:P,trackWidth:f=100}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
|
|
2
|
+
export{xo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{g}from"./chunk-32zzqeyf.js";import{e}from"./chunk-2c4hqv8f.js";import{ft}from"./chunk-kzh7w9c0.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Hi({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=g(),{text:c,status:n}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(r,{type:"button",variant:"ghost",disabled:n!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:n==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(n==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),n==="error"&&a.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>ft(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
+
export{Hi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T}from"./chunk-fpsn6fmf.js";import{n}from"./chunk-dxfhy8gr.js";import{ut}from"./chunk-efkfzgs9.js";import{y,Y}from"./chunk-p781sb6h.js";import{e}from"./chunk-2c4hqv8f.js";import{Zn}from"./chunk-12pd4nxy.js";import{ChevronDownIcon as A,ChevronRightIcon as G,GitBranchIcon as X,Loader2Icon as F,SquareIcon as Z}from"lucide-react";import{useCallback as ss,useEffect as es,useId as J,useRef as L,useState as w}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as h}from"react/jsx-runtime";function Wn(s,d){let p=n((l)=>l.sessions),o=n((l)=>l.actions),[k,f]=w(()=>new Set);return(l)=>{let r=d?.(l)??null,i=Zn(s.id,l,p,o,s);if(i.length===0)return r;let b=`${s.id}:${l.key}`,u=new Map;for(let c of i){let x=l.items.find((g)=>g.id===c.originItemId)?.id??l.user?.id??null,m=u.get(x)??[];m.push(c),u.set(x,m)}return{active:r?.active===!0||i.some((c)=>c.status==="running"||c.status==="requires_action"),defaultExpanded:r?.defaultExpanded===!0||k.has(b),content:r?.content??null,entries:[...r?.entries??[],...[...u].map(([c,x])=>({afterItemId:c,content:t(Zo,{sessionId:s.id,turn:l,parent:s,tasks:x,onExpand:()=>f((m)=>m.has(b)?m:new Set([...m,b]))})}))]}}}function Zo({sessionId:s,turn:d,parent:p,tasks:o,onExpand:k}){let{host:f}=e(),l=n((a)=>a.sessions),r=n((a)=>a.actions),i=o??Zn(s,d,l,r,p),b=i.some((a)=>a.status==="running"),u=i.some((a)=>a.status==="running"||a.status==="requires_action"),[c,x]=T(`subagents:${s}:${d.key}`,u,!0),m=J();if(i.length===0)return null;let g=new Map;for(let a of i)g.set(a.status,(g.get(a.status)??0)+1);let N=[...g].map(([a,I])=>`${f.t(`subagents.${a}`)} ${I}`).join(" · ");return h("section",{"data-subagent-sessions":!0,"data-subagent-turn":d.key,"aria-label":f.t("subagents.group"),className:"my-2 min-w-0",children:[h(C,{variant:"ghost",size:"sm",className:"text-muted-foreground h-auto min-h-8 max-w-full justify-start gap-2 text-xs","aria-expanded":c,"aria-controls":m,onClick:()=>{if(!c)k?.();x(!c)},children:[c?t(A,{className:"size-3.5 shrink-0"}):t(G,{className:"size-3.5 shrink-0"}),b?t(F,{className:"size-3.5 shrink-0 motion-safe:animate-spin","aria-hidden":"true"}):t(X,{className:"size-3.5 shrink-0"}),h("span",{className:"shrink-0",children:[f.t("subagents.group")," · ",i.length]}),t("span",{className:"truncate",role:"status",children:N})]}),t("div",{id:m,hidden:!c,className:"border-border ms-3 min-w-0 border-s ps-2",children:i.map((a)=>t(ts,{task:a,cwd:p?.cwd??l[s]?.cwd??"",visible:c,stateKey:`${s}:${d.key}:${a.key}`,onRead:()=>{k?.(),x(!0)}},a.key))})]})}function O(s,d){if(!d)return s;let p=new Map(s.items.map((o)=>[`${o.kind}:${o.id}`,o]));for(let o of d.items)p.set(`${o.kind}:${o.id}`,o);return{...s,...d,items:[...p.values()]}}function ts({task:s,cwd:d,stateKey:p,visible:o,onRead:k}){let{client:f,host:l}=e(),{t:r}=l,i=s.session,b=n((S)=>S.connection==="ready"),[u,c]=T(`subagent:${p}`,!1),[x,m]=w(!1),[g,N]=w(null),[a,I]=w(null),[R,Q]=w(null),[B,P]=w(!1),q=L(!1),_=L(!1),j=J(),W=i&&y(i.configOptions,"model"),z=s.title??r("subagents.untitled"),M=a?O(a,i):i,U=b&&i?.attached&&i.subagent?.capabilities?.cancel!=null&&(s.status==="running"||s.status==="requires_action"),H=s.threadId,D=i?.cwd??d,E=ss(async(S)=>{if(!f.readSubagentHistory||H===null||q.current)return;_.current=!0,q.current=!0,P(!0),N(null);try{let v=await f.readSubagentHistory(H,D,S);I((K)=>K===null?v.session:O(v.session,K)),Q(v.cursor)}catch(v){N(v instanceof Error?v.message:String(v))}finally{q.current=!1,P(!1)}},[f,H,D]);es(()=>{if(o&&u&&!_.current)E(null)},[o,u,E]);let V=async()=>{if(!i)throw Error("A live child session is required for cancellation");m(!0),N(null);try{await f.cancel(i.id)}catch(S){N(S instanceof Error?S.message:String(S))}finally{m(!1)}};return h("section",{"aria-label":z,className:"min-w-0",children:[h("div",{className:"flex min-w-0 items-center gap-1",children:[h(C,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start gap-2","aria-label":`${z} · ${r(`subagents.${s.status}`)}`,"aria-expanded":u,"aria-controls":j,onClick:()=>{if(!u)k();c(!u)},children:[u?t(A,{className:"size-3.5 shrink-0"}):t(G,{className:"size-3.5 shrink-0"}),t("span",{className:"truncate",children:z}),t("span",{className:"text-muted-foreground ms-auto shrink-0 text-xs",role:"status",children:r(`subagents.${s.status}`)})]}),U&&t(C,{variant:"ghost",size:"icon-sm",disabled:x,"aria-label":r("subagents.cancel",{name:z}),onClick:()=>{V()},children:x?t(F,{className:"size-3.5 animate-spin"}):t(Z,{className:"size-3.5"})})]}),g&&!u&&t("p",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:g}),h("div",{id:j,hidden:!u,className:"min-w-0 ps-4",children:[(s.description||W)&&h("div",{className:"text-muted-foreground flex min-w-0 items-center gap-2 px-2 py-1 text-xs",children:[t("span",{className:"min-w-0 flex-1 truncate",title:s.description??void 0,children:s.description}),W&&t("span",{className:"shrink-0",children:Y(W)})]}),g&&h("div",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:[g," ",s.threadId&&t(C,{variant:"ghost",size:"sm",onClick:()=>{E(a===null?null:R)},children:r("timeline.retry")})]}),B&&t("p",{role:"status",className:"text-muted-foreground px-2 py-2 text-xs",children:r("timeline.loadingEarlier")}),R&&t(C,{variant:"ghost",size:"sm",disabled:B,onClick:()=>{E(R)},children:r("timeline.loadEarlier")}),o&&u&&(M&&M.items.length>0?t("div",{className:"flex max-h-72 min-h-0 flex-col",children:t(ns,{session:M})}):!B&&!g&&t("p",{className:"text-muted-foreground px-2 py-3 text-xs",children:r("subagents.noMessages")}))]})]})}function ns({session:s}){let{client:d,host:p}=e(),o=Wn(s);return t(ut,{session:s,client:d,host:p,turnWork:o})}
|
|
2
|
+
export{Wn,Zo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{fe}from"./chunk-32zzqeyf.js";import{z,Sr}from"./chunk-pbx1417n.js";import{t}from"./chunk-dxfhy8gr.js";import{cn as d}from"cn";import{SquareIcon as b}from"lucide-react";import{Kbd as f}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as h,TooltipContent as I,TooltipTrigger as T}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as o,jsxs as n,Fragment as P}from"react/jsx-runtime";var v=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Oi({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=fe(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(P,{children:[a&&o(z,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(b,{className:"size-3 fill-current"})}),o("div",{className:d(l&&"cursor-not-allowed"),children:n(h,{children:[o(T,{render:o(Sr,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(I,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(f,{className:"shrink-0",children:v?"↩":"Enter"})]})]})})]})}
|
|
2
|
+
export{Oi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t}from"./chunk-
|
|
2
|
-
export{Aa,_i
|
|
1
|
+
import{t}from"./chunk-dxfhy8gr.js";import{Lt}from"./chunk-w7vcd8d1.js";import{Gr,zr,Vr}from"./chunk-54awxpw2.js";import{rs}from"./chunk-36j9fer8.js";import{ue}from"./chunk-azak3tb5.js";import{nativeTurnId as f,textOf as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function Aa(i,n){return{installUnlock:n==="none"?()=>()=>{}:zr,preload:()=>{if(n!=="none")Gr(i)},playSequence:(a,d,l)=>Vr(a,d,l,i,n)}}function Si(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=I(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(f).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:ue(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(Lt,{text:i.response,host:a})})]})}function _i(i){return r(rs,{...i,renderPreview:(n)=>r(T,{item:n})})}
|
|
2
|
+
export{Aa,Si,_i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{hs}from"./chunk-hz8yrg2t.js";import{createContext as s,useContext as o,useSyncExternalStore as m}from"react";import{jsx as l}from"react/jsx-runtime";var u=s(null),c=s(null),qo=s(null);function le(){return o(qo)}function Ve({host:e,client:i,children:r}){return l(hs,{host:e,children:l(u,{value:e,children:l(c,{value:i,children:r})})})}function t(){let e=o(u);if(e===null)throw Error("Timeline host is missing");return e}function je(){let e=o(c);if(e===null)throw Error("Timeline client is missing");return e}function w(e,i){return m((r)=>e.subscribe(r),()=>i(e.getState()),()=>i(e.getState()))}function n(e){let i=je();return w(i.store,e)}function Ko(){return o(u)!==null}function ce(e,i){if(e.reportError)e.reportError(i);else console.error(i)}
|
|
2
|
+
export{qo,le,Ve,t,je,w,n,Ko,ce};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{xo}from"./chunk-darm80tf.js";import{A}from"./chunk-d5pn8932.js";import{cn as r}from"cn";import{ArrowUpRight as pe,ChevronUp as H,Loader2Icon as W,Zap as Z}from"lucide-react";import{Fragment as ce,useState as q}from"react";import{Button as I}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as J,DropdownMenuCheckboxItem as K,DropdownMenuContent as Q,DropdownMenuGroup as D,DropdownMenuItem as y,DropdownMenuLabel as L,DropdownMenuSeparator as u,DropdownMenuSub as S,DropdownMenuSubContent as T,DropdownMenuSubTrigger as C,DropdownMenuTrigger as X}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as he}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as Y,TooltipContent as E,TooltipTrigger as ee}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as e,jsxs as a,Fragment as p}from"react/jsx-runtime";function Ct({value:c,onChange:ne,models:x,modelGroups:O,compactCatalog:o,catalogHeight:ae="fixed",effortPresentation:j="slider",unavailableEffort:v,providerMenu:h,header:w,className:B,condensed:V,stripLabelPrefix:z,showDescription:se,showModelList:ie=!0,loading:oe,switching:G,isLoading:te,effortConfig:s,booleanOptions:k,onBooleanChange:_,selectOptions:le=[],t:m,...d}){let[de,re]=q(!1),[me,ue]=q(!1),l=k?.find((n)=>n.id==="fast_mode"),R=o?k?.filter((n)=>n!==l):k,P=(n)=>z&&n.startsWith(z)?n.slice(z.length):n;if(oe)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(I,{variant:"ghost",disabled:!0,className:r("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(W,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:m("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&a(J,{open:de,onOpenChange:re,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(I,{"data-testid":"provider-trigger",variant:"ghost",disabled:d.disabled,className:r("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,e(H,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(E,{children:m("model.switchProvider")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((n,t)=>a(ce,{children:[t>0&&n.length>0&&e(u,{}),e(A,{value:h.value,onValueChange:h.onChange,options:n})]},t)),h.moreAction&&a(p,{children:[e(u,{}),a(y,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(J,{open:me,onOpenChange:ue,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(I,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:r("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",V&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,k?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(Z,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",V&&"text-[11px]"),children:P(c.label)||m("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,t)=>t.name.length>n.length?t.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(W,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(H,{className:r("size-3 shrink-0",V&&"size-2.5")})]})})}),e(E,{children:m("model.switchModel")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:r("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",o&&"flex w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5",o&&(ae==="content"?"max-h-[min(350px,var(--available-height))]":"h-[350px]")),children:[o&&a(p,{children:[a(D,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(xo,{...s,disabled:d.disabled})}):a(S,{children:[a(C,{disabled:d.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(A,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):v?a(y,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:v.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:w?.name}),l&&e(K,{"aria-label":l.name,title:l.title??l.name,disabled:d.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>_?.(l.id,n),className:r("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(Z,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),w&&!o&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(u,{})]}),a(D,{"data-model-menu-list":o?"":void 0,className:o?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ie&&(te?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):x.length===0?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=x.filter((i)=>!i.more),t=x.filter((i)=>i.more),F=n.length>0&&t.length>0,N=(i,g)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:g?.noDescription?void 0:se?i.description:void 0}),M=(i)=>{let g=x.find((f)=>f.api_id===i);if(g)ne(g)};if(o)return e(A,{value:c.api_id,onValueChange:M,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((i)=>N(i))});return a(p,{children:[O?O.map((i)=>{let g=i.models.filter((b)=>!b.more),f=i.models.filter((b)=>b.more),U=g.length>0&&f.length>0;return a(D,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(A,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(U?g:i.models).map((b)=>N(b))}),U&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(A,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:f.map((b)=>N(b,{noDescription:!0}))})})]})]},i.id)}):e(A,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(F?n:x).map((i)=>N(i))}),!O&&F&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(A,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:t.map((i)=>N(i,{noDescription:!0}))})})]})]})})()),!o&&s&&a(p,{children:[e(u,{}),j==="menu"?a(S,{children:[a(C,{disabled:d.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(A,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(xo,{...s,disabled:d.disabled})]}),!o&&!s&&v&&a(p,{children:[e(u,{}),a(y,{disabled:!0,children:[e("span",{className:"flex-1",children:v.name}),e("span",{children:v.label})]})]}),le.map((n)=>a(D,{children:[e(u,{}),e(L,{children:n.name}),e(A,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),R&&R.length>0&&a(p,{children:[!s&&e(u,{}),R.map((n)=>o?a(K,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(t)=>_?.(n.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:r("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:r("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:r("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(he,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(t)=>_?.(n.id,t)})]},n.id))]})]}),o&&w?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(D,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
|
|
2
|
+
export{Ct};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ys,rt,Wo,xs,bs,Cs}from"./chunk-tjc0ntnh.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var vs=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>ys({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=rt({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Wo({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=rt({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Cs({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=rt({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=xs({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=bs({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=rt({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Wo({anchorKey:e,layout:i,previousRange:M}))??rt({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
|
|
2
|
+
export{vs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{F}from"./chunk-hz8yrg2t.js";import{be}from"./chunk-vhxr0c4c.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function fi({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(be,{entries:t.entries})}
|
|
2
|
+
export{fi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Kr}from"./chunk-wf4z9w5x.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function yi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Kr(a,r)}
|
|
2
|
+
export{yi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ys}from"./chunk-v9v1v41p.js";import{Ko,$e,t,qe,n,le}from"./chunk-ty9sa6we.js";import{Ti,ft,so,Ai,Ei}from"./chunk-cvn9zbbc.js";import{gt}from"./chunk-rb4p3h5b.js";import{fi}from"./chunk-ngvdcqmt.js";import{Di}from"./chunk-b30n56t8.js";import{_i,Pi}from"./chunk-dzpbbys1.js";import{Ci,wi}from"./chunk-ty2cd00p.js";import{gi}from"./chunk-7rgcj1w2.js";import{Si}from"./chunk-fqdtx7tp.js";import{ui}from"./chunk-sy1rf5m0.js";import{codexExtensionCapabilities as ze,codexMessageError as Ve,codexRetryNotice as Be,codexTurnError as Oe,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Fe}from"lucide-react";import{useCallback as M,useEffect as H,useLayoutEffect as Te,useMemo as K,useRef as b,useState as U}from"react";import{flushSync as ye}from"react-dom";import{Button as Y}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as E}from"react/jsx-runtime";var xe=24;function De(e){let f=Math.max(0,e.turnTopPx-xe),v=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),c=f-v;return{scrollTopPx:f,spacerPx:c>0?e.spacerPx+c:e.spacerPx}}function Ke({viewportRef:e,viewportProps:f,children:v}){return o("div",{ref:e,...f,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:v})}function Ue({sessionId:e,turnId:f,root:v,error:c,connected:S}){let z=b(null),V=qe(),{t:w}=t(),k=M(()=>{V.loadHistoryTurn(e,f).catch(()=>{})},[V,e,f]);return H(()=>{if(!v||!z.current||!S||c)return;let R=new IntersectionObserver((_)=>{if(_.some((g)=>g.isIntersecting))R.disconnect(),k()},{root:v,rootMargin:"800px 0px"});return R.observe(z.current),()=>R.disconnect()},[v,S,c,k]),o("div",{ref:z,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":f,"data-markdown-pending":!0,children:c?E("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:c}),o(Y,{variant:"outline",size:"sm",onClick:k,disabled:!S,children:w("timeline.navigationRetry")})]}):E("div",{role:"status","aria-label":w("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function _e(e,f){let v=b([]),c=b(null);if(c.current?.items!==e.items||c.current.state!==e.state||c.current.ended!==e.turnEndedAt||c.current.usage!==e.turnUsage||c.current.historyOrder!==f)c.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:f,turns:Ti(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function mt(e){return o($e,{host:e.host,client:e.client,children:o(Ko,{value:e.session.cwd,children:o(We,{...e})})})}function We({session:e,leading:f,afterTurn:v,turnWork:c,answerActions:S,turnFooter:z,renderUserMessage:V,insert:w,navigation:k,anchorNewTurn:R=!1,Viewport:_=Ke}){let g=qe(),L=t(),T=n((r)=>r.historyNavigation[e.id]),he=K(()=>e.commands.map((r)=>r.name),[e.commands]),m=_e(e,T?.turns),A=m.at(-1)?.key,be=Ai(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Di(m,T),[m,T]),Z=K(()=>W.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[W]),we=K(()=>k===void 0?[]:_i(m,e.turnUsage,T),[k,m,e.turnUsage,T]),ee=w&&w.afterItemId!==null?m.findIndex((r)=>r.items.some((u)=>u.id===w.afterItemId)):-1,j=b(m);j.current=m;let[l,Re]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),Se=n((r)=>ze(r.agent).sessionRetry),te=x!==void 0;H(()=>{if(P&&te&&!e.restoring)g.loadHistoryNavigation(e.id).catch(()=>{})},[g,P,te,e.id,e.restoring]);let[ke,Pe]=U(!1),q=b(null),[Ie,ne]=U(!1),re=b(0),X=b({key:A,running:y});X.current={key:A,running:y};let[ie,F]=U(0),I=b(0),N=b(null);I.current=ie;let Ne=M(()=>{if(N.current!==null)N.current.keepTop=!1},[]),{isFollowing:C,scrollToBottom:G,stopFollowing:B,schedulePin:oe,contentResized:ae,beginLocate:ue,cancelLocation:se}=Si(l,y,Ne),ce=M(()=>{if(l===null||!y)return;let r=m.at(-1)?.key;if(r===void 0)return;let u=ue(!0),d=()=>u.isCurrent()&&X.current.running&&X.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!d())return;let a=l.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(a===null)return;let s=l.scrollTop+a.getBoundingClientRect().top-l.getBoundingClientRect().top,p=De({turnTopPx:s,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:I.current});N.current=p.spacerPx>0?{element:a,heightPx:a.getBoundingClientRect().height+p.spacerPx,keepTop:!0}:null,ye(()=>F(p.spacerPx)),requestAnimationFrame(()=>{if(d())u.finish(p.scrollTopPx)})})),h=q.current;if(h===null)return;h.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(d())i()})},[ue,y,l,m]);Te(()=>{if(!R||y)return;se(),N.current=null,I.current=0,F(0)},[R,se,y]);let J=M(()=>{B(),g.loadOlderHistory(e.id).catch(()=>{})},[g,e.id,B]);H(()=>{if(l===null)return;let r=()=>{let u=l.scrollTop<600;if(Pe(u),u&&!T?.complete&&P&&!e.restoring&&!C&&x?.cursor&&!x.loading&&!x.error)J()};return r(),l.addEventListener("scroll",r,{passive:!0}),()=>l.removeEventListener("scroll",r)},[P,x,C,J,l,e.restoring,T?.complete]),H(()=>{Ci({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>wi(e.id),[e.id]);let He=M(async(r,u)=>{let d=++re.current;ne(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await g.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((s)=>requestAnimationFrame(()=>s()));if(!u())return null;let i=j.current.find((s)=>s.user?.id===(r.messageId??r.id))??j.current.find((s)=>s.user!==null&&r.nativeTurnId!==void 0&&s.items.some((p)=>ge(p)===r.nativeTurnId));if(!i?.user)return null;let h=i.user.id,a=q.current;if(a===null)throw Error("Virtual timeline is not mounted");return await a.scrollToKey(i.key,(s)=>s.querySelector(`[data-content-search-unit-key="${CSS.escape(h)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(h)}"]`)}finally{if(re.current===d)ne(!1)}},[g,e.id]),Ee=M(async(r)=>{if(r.nativeTurnId!==void 0)await g.previewHistoryTurn(e.id,r.nativeTurnId)},[g,e.id]);H(()=>{if(l===null)return;let r=l.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let u=new ResizeObserver(()=>{let a=N.current,s=null;if(a!==null){let p=Math.max(0,a.heightPx-a.element.getBoundingClientRect().height);if(p!==I.current&&(p<I.current||a.keepTop)){if(I.current=p,ye(()=>F(p)),p===0)N.current=null}if(p>0&&a.keepTop)s=l.scrollTop+a.element.getBoundingClientRect().top-l.getBoundingClientRect().top-xe}ae(s)});u.observe(r),u.observe(l);let d=null,i=()=>{let a=A===void 0?null:r.querySelector(`[data-codex-turn="${CSS.escape(A)}"]`);if(a===d)return;if(d!==null)u.unobserve(d);if(d=a,d!==null)u.observe(d)};i();let h=new MutationObserver(i);return h.observe(r,{childList:!0,subtree:!0}),()=>{h.disconnect(),u.disconnect()}},[ae,A,l]),H(()=>{if(e.items.length===0)return;oe()},[oe,e.items]);let de=b(null);Te(()=>{if(l===null)return;let r=m.at(-1),u=de.current;if(de.current=r===void 0?null:{key:r.key,running:y},r===void 0||u===null||r.user===null||r.replayed)return;if(R){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==u.key||!u.running))N.current=null,I.current=0,F(0),ce()}else if(r.key!==u.key)G()},[ce,R,y,G,l,e.turnEndedAt,m]);let Le=(r,u)=>{let d=r,i=d.turn;if(i===void 0){if(d.nativeTurnId===void 0)throw Error(`Turn is missing at index ${u}`);return o(Ue,{sessionId:e.id,turnId:d.nativeTurnId,root:l,error:T?.turnErrors[d.nativeTurnId],connected:P&&!C&&!Ie})}let h=m.indexOf(i),a=i.key===be,s=Ei(e,m,h),p=!a&&s.continued,D=i.key===A,O=i.errors.at(-1),me=O===void 0?null:Ve(O),Q=O===void 0?null:ge(O),Ae=!e.subagent&&D&&!a&&P&&Se&&e.attached&&!e.readOnly&&!e.restoring&&O===e.items.at(-1)&&me!==null&&Oe(me).kind==="overloaded"&&Q!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",fe=z?.(i)??null,pe=c?.(i)??null,Ce=pe!==null||i.work.length>0||i.final.length>0||i.errors.length>0||a||fe!==null||ft(i)||so(i)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=i.user===null?null:gt(i);return E("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(V===void 0?o(ui,{item:i.user,messageTime:ve,skillNames:he}):V(i.user,ve)),Ce&&o(fi,{sessionId:e.id,turn:i,terminals:e.terminals,active:a,blocked:e.state==="requires_action",continued:p,edits:s.edits,activityItems:s.items,workStartedAt:s.startedAt,isLast:D,error:e.error,retrying:a?Be(e._meta)??void 0:void 0,retry:Ae?{turnId:Q,delaySeconds:gi(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:so(i)||!a&&D&&e.lastStopReason==="cancelled",extraWork:pe,answerActions:S?.(i),footer:fe}),u===ee&&w?.node,v?.(i)]})};return E("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(_,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":L.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:E("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[w&&ee===-1&&w.node,o(ys,{ref:q,entries:W,renderTurn:Le,scrollElement:l,sessionKey:e.id,preserveViewport:!C,leadingInsetPx:12,leadingContent:f===void 0?void 0:o("div",{className:"pt-3",children:f})}),R&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(Y,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{g.loadHistoryNavigation(e.id).catch(()=>{})},children:L.t("timeline.navigationRetry")})}),ke&&x?.cursor&&!T?.complete&&E("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(Y,{variant:"outline",size:"sm",disabled:!P||e.restoring||x.loading,onClick:J,children:x.loading?L.t("timeline.loadingEarlier"):L.t("timeline.loadEarlier")}),x.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),k!==void 0&&o(Pi,{items:we,audio:k.audio,scrollRoot:l,beforeReveal:B,ensureItemMounted:He,onPreviewItem:Ee,onRevealError:(r)=>le(L,r),targetTopMarginPx:16},e.id),o("button",{type:"button",className:C?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:C?-1:void 0,onClick:G,"aria-label":L.t("timeline.scrollToBottom"),children:y?E("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Fe,{})})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{vs}from"./chunk-e8mxwqxy.js";import{qo,Ve,t,je,n,ce}from"./chunk-dxfhy8gr.js";import{Ii,mt,ro,Ni,Ai}from"./chunk-azak3tb5.js";import{pt}from"./chunk-1bvgs2t1.js";import{gi}from"./chunk-m76tgtge.js";import{Li}from"./chunk-5dxzfdd1.js";import{Si,_i}from"./chunk-dwf38vyq.js";import{bi,Ci}from"./chunk-91jmmkd3.js";import{mi}from"./chunk-7n1v87h0.js";import{ki}from"./chunk-483jakc1.js";import{di}from"./chunk-cp3qcgdv.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=je(),{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:Ii(e,v.current,f)};let S=c.current.turns;return v.current=S,S}function ut(e){return o(Ve,{host:e.host,client:e.client,children:o(qo,{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=je(),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=Ni(e,m),y=e.state==="running"||e.state==="requires_action",W=K(()=>Li(m,T),[m,T]),Z=K(()=>W.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[W]),we=K(()=>k===void 0?[]:Si(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}=ki(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(()=>{bi({sessionId:e.id,turns:Z,api:q.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Z,B]),H(()=>()=>Ci(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=Ai(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||mt(i)||ro(i)||D&&(e.error!==null||e.lastStopReason==="cancelled"),ve=i.user===null?null:pt(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(di,{item:i.user,messageTime:ve,skillNames:he}):V(i.user,ve)),Ce&&o(gi,{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:mi(m),run:(Me)=>g.retrySession(e.id,Q,Me)}:void 0,interrupted:ro(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(vs,{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(_i,{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{ut};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ee}from"./chunk-xca0vnvk.js";import{b}from"./chunk-52hvpdxw.js";import{w}from"./chunk-dxfhy8gr.js";import{an}from"./chunk-4npg9v6h.js";import{Me}from"./chunk-gjj5wbms.js";import{fn}from"./chunk-v0xy25sh.js";import{Ee}from"./chunk-7ckdhz5y.js";import{Cn}from"./chunk-6g5qmjph.js";import{Ae}from"./chunk-q98s7d94.js";import{xn,bn}from"./chunk-zewseva6.js";import{useMemo as C,useRef as g}from"react";import{jsx as i,jsxs as m,Fragment as v}from"react/jsx-runtime";var d;function y(){return d??=fn(),d}function h({imagesOnly:r,picker:n}){let e=an();return i(bn,{imagesOnly:r,picker:n,sessionId:e.session.id,enabled:e.inputReady&&!e.sending&&!e.shellMode,onMention:e.addMention,onBusyChange:e.setAdding})}function Bs({client:r,providers:n,catalog:e,shellCommands:a=!0,imagesOnly:s=!1,modelMenu:c,children:f,...p}){let l=g(null),u=C(()=>({...xn,accept:s?"image/png,image/jpeg,image/webp,image/gif":void 0,onSelectFiles(o){if(!l.current)throw Error("The file picker is not ready");l.current(o)}}),[s]),{session:t}=p,P=w(r.store,(o)=>o.modelRecovery[t.id]??!1);return m(v,{children:[P&&!ee(t.error?.error)&&i(Cn,{client:r,session:t,providers:n??y(),catalog:e},t.id),m(Me,{modelMenu:c??{defaultGroup:b,catalog:(o)=>Ee(o,e),headerAction:i(Ae,{})},...p,attachmentPolicy:u,onShellCommand:a?(o)=>r.executeShell(t.id,o):void 0,children:[i(h,{imagesOnly:s,picker:l}),f]})]})}
|
|
2
|
+
export{Bs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{xe}from"./chunk-vvy4ke91.js";import{C}from"./chunk-x0m4ctqf.js";import{t,ce}from"./chunk-dxfhy8gr.js";import{isEmbeddedResource as T,isImage as N,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as F,FileIcon as y,ImageOffIcon as U,LoaderCircleIcon as z}from"lucide-react";import{useState as I}from"react";import{Button as c}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function qn(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function Oo(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function D({block:e,generated:r=!1}){let a=t(),[d,f]=I(!1),[R,B]=I(null);if(L(e)){let p=C(e.uri);if(p!==null)return n(xe,{app:{id:p,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(U,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=qn(e.uri);return s(c,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(y,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!N(e))return null;let i=N(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=qn(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(c,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(y,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:x}=a,v=x?()=>x([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else Oo(o,m)}catch(p){ce(a,p)}finally{f(!1)}},h=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(v===void 0?h:n(c,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:v,children:h})),s(c,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(z,{className:"motion-safe:animate-spin"}):n(F,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
|
|
2
|
+
export{qn,Oo,D};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c}from"./chunk-
|
|
2
|
-
`).length}function Va(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function
|
|
3
|
-
export{Va,
|
|
1
|
+
import{c}from"./chunk-hz8yrg2t.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
+
`).length}function Va(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function ls({blocks:e}){return s(zo,{files:Va(e)})}function zo({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
+
export{Va,ls,zo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{a}from"./chunk-r7z3mvej.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function ze(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>ze(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!ze(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Ao(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Ca(t){u.get(t)?.set(v(t))}function ne(t){let n=Ao(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ve(){return Ao(a()).set}function wa(){let t=ne((e)=>e.view),n=ve();return[t,(e)=>n({view:e})]}
|
|
2
|
+
export{ze,Ao,Ca,ne,ve,wa};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function ss({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
|
|
2
|
+
export{ss};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Qe,nn}from"./chunk-yc7w1en3.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function Ri(o){if(o===null||o===void 0)return Qe();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function Os(o,{reportError:t=console.error}={}){let e=S(Qe()),r=async()=>{e.setState(Ri(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(nn,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function Hs({store:o,children:t}){return w(f,{value:o,children:t})}function ao(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function Ie(o){let{store:t}=ao(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function pe(){return ao().dispatch}
|
|
2
|
+
export{Ri,Os,Hs,ao,Ie,pe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useState as r}from"react";var t=new Map;function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useState as r}from"react";var t=new Map;function T(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
|
|
2
|
+
export{T};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d,i}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{d,i}from"./chunk-0f00j53n.js";import{k}from"./chunk-qk1yqepm.js";import{U}from"./chunk-8ktb3g8c.js";import{we}from"./chunk-sdhkpkbs.js";import{Q,_e,Pe}from"./chunk-pqz2471h.js";import{ExternalLinkIcon as M,PlusIcon as W}from"lucide-react";import{useEffect as _,useState as y}from"react";import{Badge as L}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as q,DialogContent as F,DialogDescription as G,DialogHeader as J,DialogTitle as K}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as s,Fragment as O}from"react/jsx-runtime";function Qt({entry:o,onBack:p}){let u=d(),{t:l}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===o.plugin.id)),v=i((a)=>a.busyIds[o.plugin.id]),T=i((a)=>a.install),H=i((a)=>a.uninstall),V=i((a)=>a.setPluginEnabled),[n,B]=y(null),[D,I]=y(null),[j,R]=y(0),[c,z]=y(null);_(()=>{let a=!0;return I(null),B(null),P(o).then((g)=>{if(a)B(g)},(g)=>{if(a)I(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[o,P,j]);let m=n?.summary??o.plugin,r=C?.plugin??m,t=m.interface,h=t?.displayName??m.name,b=r.availability!=="AVAILABLE"||r.installPolicy==="NOT_AVAILABLE",E=t?.longDescription??n?.description??t?.shortDescription,A=[...u.assetUrl?t?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...t?.screenshotUrls??[]];return s("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(Pe,{children:s("header",{className:"flex min-w-0 flex-col gap-4",children:[s("nav",{"aria-label":l("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(f,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:l("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:h})]}),s("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[s("div",{className:"flex min-w-0 items-center gap-3",children:[e(U,{name:m.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:h})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?s(O,{children:[r.source.type==="remote"?null:e(X,{checked:r.enabled,disabled:!!v||b,"aria-label":l(r.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:h}),onCheckedChange:(a)=>void V(r,a)}),e(f,{variant:"outline",size:"sm",disabled:!!v,onClick:()=>void H(r),children:v?e(S,{}):l("plugins.detail.uninstall")})]}):e(f,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":l(b?"plugins.detail.unavailable":"plugins.detail.install"),title:l(b?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!v||b,onClick:()=>void T({...o,plugin:m}).catch(()=>{}),children:v?e(S,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} pt-2`,children:[t?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:t.shortDescription}),m.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(m.keywords)].map((a)=>e(L,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),s("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[t?.developerName&&e(x,{label:l("plugins.detail.developer"),children:t.developerName}),t?.category&&e(x,{label:l("plugins.detail.category"),children:t.category}),(r.localVersion??r.version)&&e(x,{label:l("plugins.detail.version"),children:r.localVersion??r.version}),e(x,{label:l("plugins.headings.marketplace"),children:o.marketplace.interface?.displayName??o.marketplace.name}),t?.websiteUrl&&e(x,{label:l("plugins.detail.website"),children:e(w,{url:t.websiteUrl,label:l("plugins.detail.website")})})]}),!n&&!D&&s("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),l("plugins.detail.loading")]}),D&&s("div",{role:"alert",className:"mt-8 space-y-2",children:[s("p",{className:"text-destructive text-sm",children:[l("plugins.detail.errorTitle"),": ",D]}),e(f,{variant:"outline",size:"sm",className:"h-9",onClick:()=>R((a)=>a+1),children:l("plugins.loadError.retry")})]}),E&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:E}),A.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(A)].map((a)=>e("img",{src:a,alt:h,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),t&&t.capabilities.length>0&&e(N,{label:l("plugins.detail.capabilities"),count:t.capabilities.length,children:t.capabilities.map((a)=>e(L,{variant:"secondary",className:"me-2",children:a},a))}),n&&n.mcpServers.length>0&&e(N,{label:l("plugins.detail.mcpServers"),count:n.mcpServers.length,children:n.mcpServers.map((a)=>s("div",{className:"flex items-center gap-3 py-1",children:[e(U,{name:m.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),n&&n.skills.length>0&&e(N,{label:l("plugins.detail.skills"),count:n.skills.length,children:n.skills.map((a)=>s(f,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(U,{name:a.name,className:"size-8"}),s("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),n&&n.apps.length>0&&e(N,{label:l("plugins.detail.apps"),count:n.apps.length,children:n.apps.map((a)=>s("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:l("plugins.installModal.connect")})]},a.id))}),n&&n.hooks.length>0&&e(N,{label:l("plugins.detail.hooks"),count:n.hooks.length,children:n.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(t?.privacyPolicyUrl||t?.termsOfServiceUrl)&&s("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[t.privacyPolicyUrl&&e(w,{url:t.privacyPolicyUrl,label:l("plugins.detail.privacyPolicy")}),t.termsOfServiceUrl&&e(w,{url:t.termsOfServiceUrl,label:l("plugins.detail.termsOfService")})]})]})}),e(q,{open:c!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(F,{className:_e,children:c&&s(O,{children:[e("div",{className:"shrink-0 pr-8",children:e(U,{name:c.name,className:"size-10"})}),s("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[s(J,{className:"gap-3",children:[e(K,{className:"text-2xl leading-8 font-semibold break-words",children:c.interface?.displayName??c.name}),e(G,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:c.description})]}),e(we,{path:c.path,description:c.description},c.path??c.name)]})]})})})]})}function x({label:o,children:p}){return s("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:o}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function N({label:o,count:p,children:u}){return s("section",{className:"mt-8",children:[s("h2",{className:"text-base font-medium",children:[o," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:o,label:p}){let{openLink:u}=d();if(!/^https?:\/\//i.test(o))return null;return s(f,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:o,onClick:()=>u(o),children:[p,e(M,{className:"size-3.5"})]})}
|
|
2
|
+
export{Qt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var l=/(?::\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?|#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?)$/;function s(t){return t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(String.raw`\\`)}function
|
|
2
|
-
export{
|
|
1
|
+
var l=/(?::\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?|#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?)$/;function s(t){return t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(String.raw`\\`)}function $o(t,o){let e=/^[^/\\:]+:\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?$/.test(t);if(/^[a-z][a-z\d+.-]*:/i.test(t)&&!e||s(t))return t;if(t.startsWith("www."))return`https://${t}`;if(o===null)throw Error("The conversation's directory is unavailable");return`${encodeURI(o.replace(/[\\/]$/,"")).replaceAll(/[?#]/g,encodeURIComponent)}/${t}`}function Ut(t,o){let e=$o(t,o),n;if(/^file:/i.test(e)){let r=new URL(e);if(n=decodeURIComponent(r.pathname),/^\/[A-Za-z]:\//.test(n))n=n.slice(1);if(r.hostname&&r.hostname!=="localhost")n=`//${r.hostname}${n}`}else if(s(e))try{n=decodeURI(e)}catch(r){if(!(r instanceof URIError))throw r;n=e}else return null;return n.replace(l,"")}function gs(t,o){let e=(i)=>i.replaceAll("\\","/").replace(/\/+$/,""),n=e(t),r=e(o);return r===n||r.startsWith(`${n}/`)}function fs(t,o){if(/^file:/i.test(t)){let e=new URL(t),n=decodeURIComponent(e.pathname);if(/^\/[A-Za-z]:\//.test(n))n=n.slice(1);if(e.hostname&&e.hostname!=="localhost")n=`//${e.hostname}${n}`;return n}if(s(t))return t;if(o===null)throw Error("The conversation's directory is unavailable");return`${o.replace(/[\\/]$/,"")}/${t}`}
|
|
2
|
+
export{$o,Ut,gs,fs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{_o,Pt}from"./chunk-7rqryntm.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function tt(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=_o(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function el(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Pt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
|
|
2
|
+
export{tt,el};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Dt}from"./chunk-hpv8x22r.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 Xr({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=Dt({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{Xr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ur}from"./chunk-r7z3mvej.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function qs({host:o,children:t}){return s(n,{value:o,children:t})}function M(){let o=i(n),e={...Ur(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function ji(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function me(){let o=M();return(t)=>ji(o,t)}function $i(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
|
|
2
|
+
export{qs,M,ji,me,$i};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{H}from"./chunk-3btheq4v.js";import{vo,p,S,En,yo,bt}from"./chunk-qdbyn3xv.js";import{sr,fo,ar,ho}from"./chunk-3cwbxnxr.js";import{wt,kt,Rn}from"./chunk-xqsfaaae.js";import{fe,g}from"./chunk-32zzqeyf.js";import{cn as q}from"cn";import{forwardRef as z,useImperativeHandle as j,useLayoutEffect as U,useRef as d}from"react";import{jsx as V}from"react/jsx-runtime";var F=(r,E)=>r.text===E.text&&JSON.stringify(r.apps)===JSON.stringify(E.apps),po=z((r,E)=>{let I=fe(),N=g(),s=d(null),R=d(null),a=d(S(p({text:I.textInput.value,apps:r.applications}))),f=d({start:r.initialCaret??p(a.current).length,end:r.initialCaret??p(a.current).length}),h=d(r.initialUndo?[{...r.initialUndo,selection:{start:Math.max(0,(r.initialCaret??1)-1),end:Math.max(0,(r.initialCaret??1)-1)}}]:[]),P=d([]),A=d(""),K=d(r.skillIcon),b=d(!1),x=d(!1),w=d(null),c=d({props:r,controller:I,attachments:N});c.current={props:r,controller:I,attachments:N};let m=()=>{if(s.current&&document.activeElement===s.current)f.current=ar(s.current,a.current.apps,f.current);return f.current},T=()=>{let e=s.current;if(!e)return;let t={...f.current};e.focus(),f.current=t,ho(e,t)},v=()=>({...a.current,selection:m()}),D=(e,t)=>{if(!s.current)return;if(sr(s.current,e,c.current.props.skillNames,c.current.props.skillIcon),K.current=c.current.props.skillIcon,A.current=JSON.stringify(c.current.props.skillNames??[]),s.current.dataset.empty=String(e.text.length===0&&e.apps.length===0),f.current=t,document.activeElement===s.current)ho(s.current,t)},C=(e,t,n=!0,l=!0)=>{if(l&&!F(a.current,e)){if(h.current.push(w.current??v()),h.current.length>100)h.current.shift();P.current=[]}if(w.current=null,a.current=e,f.current=t,n)D(e,t);c.current.props.onApplicationsChange(e.apps),c.current.controller.textInput.setInput(e.text)},y=(e)=>{let t=m(),n=p(a.current),l=p(e),i=new Set([...n.slice(0,t.start),...n.slice(t.end)].flatMap((k)=>typeof k==="string"?[]:[k.id])),u=l.filter((k)=>typeof k==="string"||!i.has(k.id)),o=S([...n.slice(0,t.start),...u,...n.slice(t.end)]),O=t.start+u.length;C(o,{start:O,end:O})},B=(e)=>{let n=(e?h.current:P.current).pop();if(!n)return;(e?P.current:h.current).push(v()),C({text:n.text,apps:n.apps},n.selection,!0,!1)},L=()=>{if(!s.current)return;let e=S(fo(s.current,a.current.apps)),t=m();if(b.current)return;let n=Rn(e.text),l=n===e.text?e:S(p({text:n,apps:e.apps}));C(l,t,n!==e.text)};U(()=>{let e=s.current;if(!e)throw Error("Inline prompt input is missing");Object.defineProperties(e,{value:{configurable:!0,get:()=>a.current.text,set:(i)=>{a.current=S(p({text:i,apps:a.current.apps})),D(a.current,f.current)}},selectionStart:{configurable:!0,get:()=>En(p(a.current),m().start)},selectionEnd:{configurable:!0,get:()=>En(p(a.current),m().end)},setSelectionRange:{configurable:!0,value:(i,u)=>{let o=p(a.current);f.current={start:yo(o,i),end:yo(o,u)},D(a.current,f.current),e.dispatchEvent(new Event("select"))}},disabled:{configurable:!0,get:()=>Boolean(c.current.props.disabled)},form:{configurable:!0,get:()=>e.closest("form")}}),R.current=e,D(a.current,f.current),T();let n=()=>{m()},l=(i)=>{if(c.current.props.disabled){i.preventDefault();return}if(b.current||i.isComposing)return;if(i.inputType==="historyUndo"||i.inputType==="historyRedo")i.preventDefault(),B(i.inputType==="historyUndo");else if(i.inputType==="insertParagraph"||i.inputType==="insertLineBreak")i.preventDefault(),y({text:`
|
|
2
|
+
`,apps:[]});else w.current=v()};return e.addEventListener("beforeinput",l),e.addEventListener("change",L),document.addEventListener("selectionchange",n),()=>{e.removeEventListener("beforeinput",l),e.removeEventListener("change",L),document.removeEventListener("selectionchange",n),R.current=null}},[]),U(()=>{if(b.current)return;let e=S(p({text:I.textInput.value,apps:r.applications}));if(F(e,a.current)&&A.current===JSON.stringify(r.skillNames??[])&&K.current===r.skillIcon)return;let t=m();a.current=e,D(e,t)},[I.textInput.value,r.applications,r.skillNames,r.skillIcon]),j(E,()=>({focus:T,getTextarea:()=>R.current,isComposing:()=>b.current||x.current,resetHeight:()=>{h.current=[],P.current=[]},insertInvocation:(e)=>{T(),y({text:`${e} `,apps:[]})},insertApplication:(e)=>{if(T(),a.current.apps.some((t)=>t.id===e.id))return;y({text:"",apps:[{...e,offset:0}]})}}),[]);let J=(e)=>{if(b.current||x.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;if(c.current.props.onKeyDown?.(e),e.defaultPrevented)return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")){e.preventDefault(),B(e.key.toLowerCase()==="z"&&!e.shiftKey);return}if(e.key==="Enter"){if(e.preventDefault(),e.shiftKey)y({text:`
|
|
3
|
+
`,apps:[]});else{let t=s.current?.closest("form"),n=t?.querySelector('button[type="submit"]');if(n&&!n.disabled)t?.requestSubmit(n)}return}if(e.key==="Backspace"||e.key==="Delete"){let t=m(),n=p(a.current);if(t.start!==t.end){e.preventDefault(),y({text:"",apps:[]});return}let l=En(n,t.start),i=H(a.current.text,c.current.props.skillNames??[]).find((o)=>e.key==="Backspace"?o.end===l:o.start===l);if(i){e.preventDefault();let o=t.start-(e.key==="Backspace"?i.name.length:0);C(S([...n.slice(0,o),...n.slice(o+i.name.length)]),{start:o,end:o});return}let u=e.key==="Backspace"?t.start-1:t.start;if(u>=0&&u<n.length&&typeof n[u]!=="string")e.preventDefault(),C(S([...n.slice(0,u),...n.slice(u+1)]),{start:u,end:u});else if(e.key==="Backspace"&&n.length===0){let o=c.current.attachments.files.at(-1);if(o)e.preventDefault(),c.current.attachments.remove(o.id)}}if(e.key.length===1&&e.key.charCodeAt(0)<32)e.preventDefault()},M=(e)=>{let t=m();if(t.start===t.end)return;let n=p(a.current).slice(t.start,t.end),l=S(n);if(e.preventDefault(),e.clipboardData.setData("text/plain",n.map((i)=>typeof i==="string"?i:`${i.name} `).join("")),e.clipboardData.setData(vo,JSON.stringify({version:1,...l})),e.type==="cut"&&!r.disabled)y({text:"",apps:[]})};return V("div",{ref:s,role:"textbox","aria-multiline":"true","aria-label":r["aria-label"],"aria-disabled":r.disabled||void 0,contentEditable:!r.disabled,suppressContentEditableWarning:!0,"data-chat-input":!0,"data-inline-input":!0,"data-placeholder":r.placeholder,"data-empty":a.current.text.length===0&&a.current.apps.length===0,className:q("bg-chat-input-bg data-[empty=true]:before:text-chat-input-placeholder relative max-h-(--chat-input-max-height) min-w-0 flex-1 overflow-y-auto p-0 pe-2.5 leading-(--chat-input-line-height) break-words whitespace-pre-wrap outline-none data-[empty=true]:before:pointer-events-none data-[empty=true]:before:absolute data-[empty=true]:before:content-[attr(data-placeholder)]",r.className),onInput:L,onKeyDown:J,onCompositionStart:()=>{w.current=v(),b.current=!0,x.current=!1},onCompositionEnd:()=>{b.current=!1,L(),x.current=!0,requestAnimationFrame(()=>{x.current=!1})},onPasteCapture:(e)=>r.onPasteCapture?.(e),onPaste:(e)=>{if(e.defaultPrevented||r.disabled)return;let{imageFiles:t,sawNonImageFile:n}=wt(e.clipboardData.items);if(e.preventDefault(),t.length){N.add(t);return}if(n&&!kt(e.clipboardData.items))return;y(bt(e.clipboardData)??{text:Rn(e.clipboardData.getData("text/plain")),apps:[]})},onCopy:M,onCut:M,onDrop:(e)=>{e.preventDefault()}})});po.displayName="PromptInputInline";
|
|
4
|
+
export{po};
|