@alwith/module-chat 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-host.d.ts +2 -0
- package/dist/activity-host.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-00sds3wb.js +2 -0
- package/dist/{chunk-r6e2abj6.js → chunk-0h993cve.js} +2 -2
- package/dist/{chunk-61vxy6yd.js → chunk-0jw4ffzj.js} +1 -1
- package/dist/{chunk-4dcagj01.js → chunk-0vy9fzs3.js} +1 -1
- package/dist/{chunk-9bjywaze.js → chunk-11v81zha.js} +1 -1
- package/dist/chunk-1dce9zt8.js +2 -0
- package/dist/{chunk-b5g1j1zv.js → chunk-1mnc7200.js} +2 -2
- package/dist/{chunk-hr9d9zpb.js → chunk-1mv3y3cs.js} +2 -2
- package/dist/{chunk-zjg9n6zj.js → chunk-1q1hyka4.js} +2 -2
- package/dist/chunk-1tz8afx9.js +2 -0
- package/dist/chunk-1v3wc4cv.js +2 -0
- package/dist/chunk-29wvjf38.js +2 -0
- package/dist/{chunk-cr294svm.js → chunk-2q71dv8k.js} +1 -1
- package/dist/chunk-2w9f1q84.js +4 -0
- package/dist/{chunk-x71x2atx.js → chunk-34xzrr3s.js} +2 -2
- package/dist/{chunk-dfengqjx.js → chunk-39f0d44a.js} +2 -2
- package/dist/{chunk-d4yhdesy.js → chunk-3d58k7fn.js} +2 -2
- package/dist/chunk-3p9j3gmw.js +2 -0
- package/dist/chunk-3zj0ka21.js +2 -0
- package/dist/chunk-42fw8maa.js +2 -0
- package/dist/{chunk-w92s8704.js → chunk-48av28r4.js} +5 -5
- package/dist/{chunk-w2tmm1va.js → chunk-494jkxv9.js} +2 -2
- package/dist/chunk-52y4pyr1.js +2 -0
- package/dist/chunk-5nemwzzv.js +2 -0
- package/dist/{chunk-w99ah6qt.js → chunk-5s5tedyw.js} +3 -3
- package/dist/{chunk-zcrct67v.js → chunk-5w48y2ad.js} +1 -1
- package/dist/{chunk-qpz97p1m.js → chunk-5xjm1hab.js} +1 -1
- package/dist/chunk-6bdd2cgs.js +2 -0
- package/dist/{chunk-j4teycge.js → chunk-6jyd3a7v.js} +2 -2
- package/dist/{chunk-hesyytcd.js → chunk-76fxyvb0.js} +2 -2
- package/dist/chunk-7w4tjrdw.js +2 -0
- package/dist/{chunk-p0cc67an.js → chunk-812n3qd8.js} +2 -2
- package/dist/chunk-85gdavf5.js +2 -0
- package/dist/{chunk-ptt7q7za.js → chunk-8fd8jhbf.js} +3 -3
- package/dist/chunk-8w6ze6pw.js +4 -0
- package/dist/{chunk-20re64ta.js → chunk-91qp7sps.js} +2 -2
- package/dist/chunk-932ykb37.js +2 -0
- package/dist/{chunk-jdv29apq.js → chunk-9d0vkezs.js} +2 -2
- package/dist/{chunk-3jcxkpvs.js → chunk-9mcfd41e.js} +2 -2
- package/dist/{chunk-3m06tqqk.js → chunk-9yv5c2s3.js} +2 -2
- package/dist/{chunk-cgxcxfh1.js → chunk-ad32h099.js} +3 -3
- package/dist/{chunk-mgakm5yv.js → chunk-ap1br099.js} +2 -2
- package/dist/{chunk-eyre28p1.js → chunk-at0v48cp.js} +2 -2
- package/dist/chunk-azp1438s.js +2 -0
- package/dist/{chunk-wf4tq3fn.js → chunk-b0v983ch.js} +1 -1
- package/dist/chunk-bafntrka.js +3 -0
- package/dist/chunk-bje0nmh9.js +2 -0
- package/dist/chunk-bse4zh1d.js +2 -0
- package/dist/chunk-bx1x7t6v.js +3 -0
- package/dist/{chunk-tptnjbrd.js → chunk-c7b8rscf.js} +2 -2
- package/dist/{chunk-mk10tgjk.js → chunk-cbbr9m3a.js} +2 -2
- package/dist/{chunk-a7mr12yc.js → chunk-cg97byvk.js} +1 -1
- package/dist/{chunk-2snmjnz9.js → chunk-cka09jf6.js} +2 -2
- package/dist/chunk-dgx31pdr.js +2 -0
- package/dist/{chunk-pb6xtb3n.js → chunk-dhvpffgf.js} +2 -2
- package/dist/{chunk-tj44vjyv.js → chunk-dkbtw3g9.js} +2 -2
- package/dist/{chunk-px7xxz3v.js → chunk-eyqbvc19.js} +2 -2
- package/dist/{chunk-aygzz2yg.js → chunk-ez1ac611.js} +2 -2
- package/dist/{chunk-zwvyfjj8.js → chunk-f3xhtnkz.js} +2 -2
- package/dist/chunk-f59aepmd.js +2 -0
- package/dist/{chunk-n3raktzz.js → chunk-fv7tp8pr.js} +2 -2
- package/dist/chunk-gdbzk1kt.js +2 -0
- package/dist/{chunk-23wzpgbs.js → chunk-gdhkb2rz.js} +2 -2
- package/dist/{chunk-bycbj1aq.js → chunk-h2nvgcbs.js} +2 -2
- package/dist/{chunk-tre0r8qm.js → chunk-h3s5e0c5.js} +2 -2
- package/dist/chunk-haf9qn5a.js +2 -0
- package/dist/chunk-hd682pax.js +2 -0
- package/dist/{chunk-86kkb0z4.js → chunk-hw5n7sqm.js} +2 -2
- package/dist/{chunk-dzydvx7r.js → chunk-jh46xzr6.js} +3 -3
- package/dist/{chunk-fqj76wq8.js → chunk-jhxjbpt3.js} +2 -2
- package/dist/chunk-jmcb7an2.js +2 -0
- package/dist/{chunk-kbvkr5mr.js → chunk-jtafw6h4.js} +2 -2
- package/dist/{chunk-8r010kvn.js → chunk-k6b4cf05.js} +1 -1
- package/dist/chunk-kc9rzb07.js +2 -0
- package/dist/{chunk-ckp6661s.js → chunk-key9msc9.js} +2 -2
- package/dist/{chunk-ek06eyp4.js → chunk-kjtd3wc3.js} +1 -1
- package/dist/{chunk-9v2gk9ex.js → chunk-kk2nr6dd.js} +2 -2
- package/dist/chunk-m3cbbk3v.js +2 -0
- package/dist/chunk-m92evp24.js +2 -0
- package/dist/{chunk-8kjsqjy6.js → chunk-mme37xva.js} +1 -1
- package/dist/{chunk-802bgza1.js → chunk-mwkr9pvg.js} +2 -2
- package/dist/{chunk-k50475tn.js → chunk-mxj4s2r8.js} +1 -1
- package/dist/{chunk-pcngn73n.js → chunk-mzc51shd.js} +2 -2
- package/dist/{chunk-d25r0vq3.js → chunk-n514z4we.js} +2 -2
- package/dist/chunk-n6xa65sp.js +2 -0
- package/dist/{chunk-st90r31c.js → chunk-nhsbjys5.js} +1 -1
- package/dist/{chunk-cw68hvkc.js → chunk-p0ebmb2m.js} +1 -1
- package/dist/{chunk-mmdpwbef.js → chunk-p2khnrm1.js} +2 -2
- package/dist/{chunk-rqbbb37p.js → chunk-p8n6rm5h.js} +2 -2
- package/dist/{chunk-zy6338m6.js → chunk-q53h2y2a.js} +2 -2
- package/dist/chunk-q989x2x5.js +2 -0
- package/dist/chunk-qqv0bewt.js +2 -0
- package/dist/{chunk-acrrwrzy.js → chunk-qsqyf4y3.js} +2 -2
- package/dist/chunk-r22h488a.js +3 -0
- package/dist/{chunk-543v9eke.js → chunk-r8k9jd0z.js} +2 -2
- package/dist/{chunk-87t0qtkr.js → chunk-raz9hb3h.js} +4 -4
- package/dist/{chunk-691gxr2e.js → chunk-rd2n48s1.js} +2 -2
- package/dist/{chunk-t2ceq16d.js → chunk-rmv0t2ee.js} +2 -2
- package/dist/chunk-s1vxbxzr.js +2 -0
- package/dist/chunk-s3mx42dt.js +2 -0
- package/dist/chunk-seg9xzjy.js +2 -0
- package/dist/chunk-sq5zstzq.js +2 -0
- package/dist/{chunk-3nmqebb6.js → chunk-t794afpy.js} +3 -3
- package/dist/{chunk-maj7m5s7.js → chunk-t9nky8ka.js} +3 -3
- package/dist/{chunk-hwwhxb3x.js → chunk-ta45etnd.js} +1 -1
- package/dist/{chunk-zzwnpk4q.js → chunk-tcgx9yxg.js} +2 -2
- package/dist/{chunk-aaqk0jrt.js → chunk-tjykfxrd.js} +2 -2
- package/dist/chunk-tp5y8cc7.js +2 -0
- package/dist/{chunk-51qsyrd6.js → chunk-tv9wdbxr.js} +1 -1
- package/dist/{chunk-t9vvcy09.js → chunk-v8rqevms.js} +3 -3
- package/dist/{chunk-awrzpp7x.js → chunk-v958q8hh.js} +2 -2
- package/dist/chunk-vmywavgm.js +2 -0
- package/dist/chunk-w3z37qwe.js +2 -0
- package/dist/{chunk-hmtgx7fw.js → chunk-w522gwhm.js} +2 -2
- package/dist/chunk-w5wzxdbk.js +2 -0
- package/dist/{chunk-d6nxypzc.js → chunk-w9nr7saa.js} +1 -1
- package/dist/chunk-wpx2bvd0.js +7 -0
- package/dist/chunk-wthttnkz.js +2 -0
- package/dist/{chunk-e3mkvx24.js → chunk-x8vd2d2g.js} +1 -1
- package/dist/{chunk-rkqe8p8n.js → chunk-xf91jp39.js} +2 -2
- package/dist/{chunk-ncekagm6.js → chunk-xjtqdp82.js} +1 -1
- package/dist/chunk-xnmjg8r1.js +2 -0
- package/dist/chunk-xrek8rbm.js +2 -0
- package/dist/{chunk-0n82kdek.js → chunk-xttthm0n.js} +2 -2
- package/dist/{chunk-4mnf89r3.js → chunk-y6v59cgf.js} +1 -1
- package/dist/{chunk-jnfp7j32.js → chunk-y8qmxd0j.js} +2 -2
- package/dist/{chunk-qbdqh38y.js → chunk-ygebvrv5.js} +1 -1
- package/dist/{chunk-1dp50khb.js → chunk-z79xmq12.js} +2 -2
- package/dist/{chunk-h80g3eme.js → chunk-zw2q13qg.js} +2 -2
- package/dist/codex/activity-group.d.ts +2 -1
- package/dist/codex/activity-group.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/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.d.ts +14 -0
- package/dist/codex/turn-activity.js +1 -0
- package/dist/codex/user-message.d.ts +3 -2
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.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/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.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/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.d.ts +1 -1
- package/dist/conversation/composer/prediction.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/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-view.d.ts +1 -0
- 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/session-actions.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/locales.d.ts +24 -8
- package/dist/locales.js +1 -1
- package/dist/search/chat-search.d.ts +2 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.d.ts +1 -0
- 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/archived-sessions.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/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.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.css +6 -4
- 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/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-preview.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-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/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.d.ts +2 -0
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.d.ts +3 -0
- package/dist/session-timeline/turn-activity.js +1 -0
- 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.d.ts +1 -0
- 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/ui/alert.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group-textarea.js +1 -1
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/kbd.js +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/spinner.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-0j15twx6.js +0 -2
- package/dist/chunk-0pa5t12s.js +0 -2
- package/dist/chunk-0vvn08gg.js +0 -2
- package/dist/chunk-14a9wet3.js +0 -2
- package/dist/chunk-1wc83vxg.js +0 -2
- package/dist/chunk-20bww40d.js +0 -2
- package/dist/chunk-20gtemb9.js +0 -2
- package/dist/chunk-2b185a0a.js +0 -2
- package/dist/chunk-2sy8cs84.js +0 -2
- package/dist/chunk-30g0y24x.js +0 -2
- package/dist/chunk-33mgpcnd.js +0 -2
- package/dist/chunk-4d8q9bpy.js +0 -2
- package/dist/chunk-67txww0x.js +0 -2
- package/dist/chunk-6fht8rx9.js +0 -2
- package/dist/chunk-6ndz2pf9.js +0 -2
- package/dist/chunk-7gaper2w.js +0 -2
- package/dist/chunk-8mvg9a32.js +0 -2
- package/dist/chunk-9x4et210.js +0 -2
- package/dist/chunk-asxwsg2p.js +0 -2
- package/dist/chunk-cj5pkg2y.js +0 -4
- package/dist/chunk-ctedwb0a.js +0 -3
- package/dist/chunk-czahfwp7.js +0 -2
- package/dist/chunk-dnn8064m.js +0 -2
- package/dist/chunk-dqw30cz4.js +0 -2
- package/dist/chunk-e43pfcrt.js +0 -2
- package/dist/chunk-h4sw0pez.js +0 -2
- package/dist/chunk-jmx0awnf.js +0 -2
- package/dist/chunk-maepz12p.js +0 -3
- package/dist/chunk-npjw8dm5.js +0 -2
- package/dist/chunk-qf3a35g4.js +0 -2
- package/dist/chunk-r41p7378.js +0 -2
- package/dist/chunk-rzajhyrq.js +0 -2
- package/dist/chunk-sc746nr6.js +0 -2
- package/dist/chunk-sgbde4dv.js +0 -2
- package/dist/chunk-tgb70x2n.js +0 -2
- package/dist/chunk-vxnjsga5.js +0 -2
- package/dist/chunk-vyzzs0nc.js +0 -7
- package/dist/chunk-w0y1svj7.js +0 -3
- package/dist/chunk-wqwqx3hc.js +0 -2
- package/dist/chunk-wtk721nx.js +0 -2
- package/dist/chunk-x3b4dpac.js +0 -2
- package/dist/chunk-xem94nq0.js +0 -4
- package/dist/chunk-yx02h2ja.js +0 -2
- package/dist/chunk-z8fdvq3v.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{_o}from"./chunk-39f0d44a.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function Do(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await _o(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
|
|
2
|
+
export{Do};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var ei=280;function Jn({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function ie({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function At({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function eo({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function to({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function no({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
|
|
2
|
+
export{ei,Jn,ie,At,eo,to,no};
|
|
@@ -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 Go=o(null);function Y(t){let e=n(Go);r(()=>{if(t&&e!==null)return e()},[t,e])}
|
|
2
|
+
export{Go,Y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
`).length}function
|
|
3
|
-
export{
|
|
1
|
+
import{a}from"./chunk-3p9j3gmw.js";import{ChevronDownIcon as v,ChevronUpIcon as b,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as n}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
+
`).length}function Hr(e){let l=new Map;for(let u of e)for(let d of u.content){if(d.type!=="diff")continue;let f=d,r=f._meta?.alwith?.hunks??[],h=r.reduce((o,i)=>o+x(i.newText),0),c=r.reduce((o,i)=>o+x(i.oldText),0);for(let o of f.changes){let i=l.get(o.path);if(i)i.additions+=h,i.deletions+=c;else l.set(o.path,{path:o.path,additions:h,deletions:c})}}return[...l.values()]}function po({blocks:e}){return s(zt,{files:Hr(e)})}function zt({files:e,onOpen:l,renderPath:u}){let{t:d,openLink:f}=a(),[r,h]=m(!0),[c,o]=m(!1);if(e.length===0)return null;let i=e.reduce((t,p)=>t+p.additions,0),g=e.reduce((t,p)=>t+p.deletions,0);return n("section",{className:"codex-edited-files-card",children:[n("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(C,{})}),n("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),o(!1)},"aria-expanded":r,children:d(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),n("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[n("span",{className:"codex-diff-additions",children:["+",i]}),n("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&n("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((t)=>n("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>l===void 0?f(t.path):l(t),children:u===void 0?t.path:u(t)}),n("span",{className:"codex-edited-file-counts",children:[n("span",{className:"codex-diff-additions",children:["+",t.additions]}),n("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&n("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>o((t)=>!t),children:[d(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?s(b,{size:16,"aria-hidden":"true"}):s(v,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
+
export{Hr,po,zt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function
|
|
2
|
-
export{
|
|
1
|
+
function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function Xe(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
|
|
2
|
+
export{Xe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{o}from"./chunk-vmywavgm.js";import{Ue,$e,qe}from"./chunk-mme37xva.js";import{n}from"./chunk-1v3wc4cv.js";import{y,G}from"./chunk-tp5y8cc7.js";import{hasAccount as D}from"@nyssance/codex-acp-v2/client";import{cn as M}from"cn";import{useEffect as C,useState as L}from"react";import{jsx as a,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),H=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),T=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function p(e){return typeof e==="number"&&!Number.isNaN(e)?Math.max(0,e):0}function W(e,t){let r=Math.min(100,e/t*100),s=r>=90?"text-destructive":r>=70?"text-foreground":"text-muted-foreground";return{pct:r,className:s}}function F(e){let t=y(e.configOptions,"model");return t===void 0?void 0:G(t)}function gn(e,t){let r=e.windowDurationMins;if(r===null)return t("usage.usage");if(r%1440===0)return t("usage.windowDays",{count:r/1440});return t("usage.windowHours",{count:Math.round(r/60)})}function z(){let{client:e}=n(),t=o((i)=>i.connection==="ready"&&D(i.agent)),[r,s]=L(null);return C(()=>{if(!t){s(null);return}let i=!0;e.readRateLimits().then((m)=>{if(i)s(m)},()=>{return});let l=e.onRateLimits((m)=>{if(i)s(m)});return()=>{i=!1,l()}},[t,e]),r}function Je({session:e}){let{t}=n().host,r=z(),{usage:s,lastTurnUsage:i}=e;if(s===null&&i===null)return null;let l=s&&s.size>0?W(s.used,s.size):null,m=7,N=2*Math.PI*m,x=p(i?.inputTokens),h=p(i?.outputTokens),f=p(i?.cachedReadTokens),v=p(i?.cachedWriteTokens),b=p(i?.totalTokens)||x+h+f+v,k=x+f,w=k>0?H.format(f/k):t("tokens.notAvailable"),R=[[t("tokens.input"),d.format(x)],[t("tokens.output"),d.format(h)],[t("tokens.cachedRead"),d.format(f)],[t("tokens.cachedWrite"),d.format(v)],[t("tokens.cacheHitRate"),w],[t("tokens.total"),d.format(b)]],g=F(e);return u(Ue,{children:[a($e,{delay:100,closeDelay:100,render:u("button",{type:"button",className:M("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",l?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[a("circle",{cx:"9",cy:"9",r:m,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),l!==null&&a("circle",{cx:"9",cy:"9",r:m,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:N,strokeDashoffset:N*(1-l.pct/100),transform:"rotate(-90 9 9)"})]}),l!==null&&u("span",{children:[Math.round(l.pct),"%"]})]})}),u(qe,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[g!==void 0&&a("div",{className:"border-b px-3 py-2",children:a("p",{className:"text-foreground truncate text-xs font-semibold",title:g,children:g})}),u("div",{className:"flex flex-col gap-3 p-3",children:[i!==null&&u("div",{className:"flex flex-col gap-1.5",children:[a("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),a("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:R.map(([c,S])=>u("div",{className:"contents",children:[a("dt",{className:"text-muted-foreground",children:c}),a("dd",{className:"text-end tabular-nums",children:S})]},c))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[a("p",{className:"text-xs font-medium",children:t("tokens.context")}),a("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:T.format(s.used/s.size*100)})})]}),r!==null&&(r.primary!==null||r.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[a("p",{className:"text-xs font-medium",children:t("usage.limits")}),a("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[r.primary,r.secondary].filter((c)=>c!==null).map((c)=>u("div",{className:"contents",children:[a("dt",{className:"text-muted-foreground",children:gn(c,t)}),a("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,c.usedPercent)))})})]},`${c.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{gn,Je};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g}from"./chunk-3p9j3gmw.js";import{_}from"./chunk-xf91jp39.js";import{isPlanItems as n,isPlanMarkdown as r}from"@alwith/api";import{jsx as e}from"react/jsx-runtime";function Mn({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(g,{text:t.content,streaming:!1})});if(!n(t))return null;return e(_,{entries:t.entries})}
|
|
2
|
+
export{Mn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as t}from"cn";import{jsx as n}from"react/jsx-runtime";function
|
|
1
|
+
import{cn as t}from"cn";import{jsx as n}from"react/jsx-runtime";function on({className:e,...o}){return n("div",{"data-slot":"skeleton",className:t("bg-muted animate-pulse rounded-md",e),...o})}export{on};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a,g}from"./chunk-3p9j3gmw.js";import{E}from"./chunk-t794afpy.js";import{lo}from"./chunk-p2khnrm1.js";import{_}from"./chunk-xf91jp39.js";import{uo,Ne}from"./chunk-wpx2bvd0.js";import{po}from"./chunk-ad32h099.js";import{Ft}from"./chunk-q989x2x5.js";import{cn as b}from"cn";import{jsx as o,jsxs as y}from"react/jsx-runtime";var R=new WeakMap,w=1;function N(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=R.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return R.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return y("div",{className:"codex-assistant-message",children:[o(g,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(g,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(_,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var S=new Set;function ti({message:t,isMostRecentTurn:n,hiddenTools:s=S,time:i,beforeCopy:r,afterCopy:l,providerIcon:u,renderText:T,renderEditedFiles:C}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(A,{});let h=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
|
|
2
|
+
`),B=!t.streaming&&h.trim().length>0?o(Ht,{text:h,isMostRecentTurn:n,beforeCopy:r,afterCopy:l,time:i}):null,d=lo(t.content,"compact"),x=d.reduce((e,c,p)=>c.kind==="codexActivityGroup"?p:e,-1),k=d.findIndex((e,c)=>c>x&&e.kind==="block"&&e.block.type==="text"),M=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&E(e).category==="edit"),v=(e)=>{if(e.kind==="codexActivityGroup"){let c=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return c.length===0?null:o(Ne,{blocks:c},`activity:${N(c[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===M?B:void 0,renderText:T},N(e.block))},m=x===-1?0:k===-1?d.length:k;return o(Ot,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:d.slice(0,m).map(v),answer:d.length>m?d.slice(m).map(v):null,footer:x!==-1&&f.length>0&&(C===void 0?o(po,{blocks:f}):C(f))})}function Ht({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let l=a(),{t:u}=l;return y("div",{className:b("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Ft,{text:t,label:u("actions.copy"),host:l}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function A(){let{t}=a();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t("message.thinking")})})}function Ot({work:t,answer:n,footer:s,loading:i=!1,...r}){if(i)return o(A,{});return y("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(uo,{...r,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
|
|
3
|
+
export{ti,Ht,Ot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as r}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var Wo={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-success",idle:"bg-success"},jo={requires_action:"text-red-500",running:"text-yellow-500",done:"text-success",idle:"text-success"};function yt({state:n,className:t,pulse:i=!0,title:s}){if(n===void 0)return null;let o=Wo[n];if(n==="running"&&i)return u("span",{title:s,className:r("relative inline-flex size-1.5 shrink-0 items-center justify-center",jo.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:s,className:r("size-2 shrink-0 rounded-full",o,t)})}
|
|
2
|
+
export{Wo,jo,yt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{d,u,w,q,m,k}from"./chunk-p0ebmb2m.js";import{Y}from"./chunk-9yv5c2s3.js";import{createContext as g,useContext as C,useState as y,useSyncExternalStore as L}from"react";import{jsx as i,jsxs as p}from"react/jsx-runtime";var v=g(null),f=g(null),x=g(null);function Cr({host:t,client:o,children:n}){let[l,a]=y(null);Y(l!==null);let{t:c}=t;return i(v,{value:t,children:i(f,{value:o,children:p(x,{value:a,children:[n,i(d,{open:l!==null,onOpenChange:(D)=>!D&&a(null),children:p(u,{children:[p(w,{children:[i(m,{children:c("sessionList.deleteTitle")}),i(k,{children:c("sessionList.deleteDescription")})]}),p(q,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:c("sessionList.cancel")}),i(e,{onClick:()=>{if(l)S(t,o.delete(l.sessionId));a(null)},children:c("sessionList.delete")})]})]})})]})})})}function h(){let t=C(v);if(t===null)throw Error("Session list host is missing");return t}function s(){let t=C(f);if(t===null)throw Error("Session list client is missing");return t}function vt(){let t=C(x);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=s();return L((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function S(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
|
|
2
|
+
export{Cr,h,s,vt,r,S};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Ht,Ot}from"./chunk-bafntrka.js";import{p}from"./chunk-2w9f1q84.js";import{t}from"./chunk-vmywavgm.js";import{Hn,D,Ie,Fn}from"./chunk-6bdd2cgs.js";import{En}from"./chunk-xnmjg8r1.js";import{W}from"./chunk-34xzrr3s.js";import{It}from"./chunk-7w4tjrdw.js";import{Ln}from"./chunk-48av28r4.js";import{Mn}from"./chunk-azp1438s.js";import{Pn}from"./chunk-85gdavf5.js";import{Pt,St}from"./chunk-p8n6rm5h.js";import{Te}from"./chunk-f3xhtnkz.js";import{isContentEntry as oe,isEmbeddedResource as X,isImage as Y,isResourceLink as ae,isText as me}from"@alwith/api";import{codexMessageError as J,codexTurnError as q,nativeTurnId as le}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as de,SparklesIcon as ce}from"lucide-react";import{Fragment as ge,memo as pe}from"react";import{jsx as s,jsxs as m,Fragment as R}from"react/jsx-runtime";function U(r){if(Y(r))return`${r.mimeType.toLowerCase()}:${r.data}`;if(X(r)&&"blob"in r.resource&&r.resource.mimeType?.toLowerCase().startsWith("image/"))return`${r.resource.mimeType.toLowerCase()}:${r.resource.blob}`;return null}function T({sessionId:r,entry:n,terminals:l,streaming:o,streamingThoughtId:w}){let{t:a}=t();switch(n.kind){case"activity":return s(En,{sessionId:r,items:n.items,terminals:l,streamingThoughtId:w});case"text":return p(n.item._meta).length>0?s(It,{sessionId:r,item:n.item}):s(W,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(Mn,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(Pt,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return m("div",{className:"codex-context-compaction",children:[s(ce,{"aria-hidden":"true"}),s("span",{children:n.item.status==="completed"?a("stream.codex.contextCompacted"):n.item.status==="cancelled"?a("timeline.interrupted"):a("timeline.compacting")})]})}}function ue({sessionId:r,turn:n,terminals:l,active:o,blocked:w=!1,continued:a=!1,edits:S=n.edits,activityItems:_=n.items,workStartedAt:Z=n.startedAt,isLast:F,error:u,interrupted:M,retry:L,retrying:g,answerActions:K,footer:ee}){let{t:d}=t(),I=n.errors.map((e)=>{let i=J(e);if(i===null)throw Error("Turn error item is missing its diagnostics");let k=L?.turnId===le(e)?L:void 0;return s(St,{error:i,retry:k},`${e.id}:${k?.delaySeconds??"manual"}`)});if(F&&u!==null&&!n.errors.some((e)=>{let i=J(e);return i!==null&&i.stopReason===u.stopReason&&q(i).message===q(u).message}))I.push(s(St,{error:u},"current-run-error"));let v=I.length>0?s("div",{className:"codex-turn-errors",children:I}):null,f=n.work,y=f.length>0&&f.every((e)=>e.kind==="compaction");if(Hn(n)||y&&n.final.length===0)return m(R,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),v]});let O=Ie(n),P=n.final.filter((e)=>p(e._meta).length===0).map(D).join(`
|
|
2
|
+
`),h=o?null:Te(n,"assistant"),G=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),B=new Set(n.final.flatMap((e)=>e.content.map(U).filter((i)=>i!==null))),N=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(oe).flatMap((i,k)=>{let c=i.content,ie=e.name==="image_generation"&&Y(c),re=e.toolKind!=="read"&&e.toolKind!=="search"&&(ae(c)||X(c)&&("blob"in c.resource));if(!ie&&!re)return[];let b=U(c);if(b!==null){if(B.has(b))return[];B.add(b)}return[{key:`${e.id}:${k}`,block:c}]})}),A=n.final.some((e)=>p(e._meta).length===0&&e.content.some((i)=>!me(i)||i.text.trim().length>0)),te=G.length>0||N.length>0||y||A||n.final.some((e)=>p(e._meta).length>0),x=n.items.findIndex((e)=>n.final.includes(e)),C=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),H=f.filter((e)=>x===-1||C(e)<x),ne=f.filter((e)=>x!==-1&&C(e)>x),se=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...ne.map((e)=>({kind:"work",entry:e,index:C(e)}))].toSorted((e,i)=>e.index-i.index),Q=!o&&!a&&(P.trim().length>0?s(Ht,{text:P,isMostRecentTurn:F,time:h,afterCopy:K}):m("div",{className:"flex items-center gap-0.5",children:[K,h&&s("span",{className:"codex-user-time ms-1",title:h.full,children:h.short})]})),E=Pn({...n,items:_},{running:o,blocked:w,retrying:g!==void 0}),V=E.kind==="reasoning"?E.ownerKey??null:null,j=E.kind==="thinking",z=Fn({...n,items:_});return m(R,{children:[s(Ot,{stateKey:JSON.stringify([r,n.replayed?"history":"live",n.key]),active:o&&!A,defaultExpanded:o&&!A||!n.replayed&&(M||O),...z,startedAt:z.startedAt??Z,loading:j&&n.work.length===0,work:a||y?[]:H.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:o,streamingThoughtId:V},e.key)),answer:te||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||y)&&H.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),se.map((e)=>{if(e.kind==="work")return s(T,{sessionId:r,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:V},e.entry.key);let i=e.item;return m(ge,{children:[p(i._meta).length>0?s(It,{sessionId:r,item:i}):s(W,{content:i.content,messageId:i.id,streaming:o}),i===n.final.at(-1)&&Q]},i.id)}),G.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":d(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&s(de,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),N.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:N.map((e)=>s(W,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),n.final.length===0&&Q]}):null,footer:m(R,{children:[j&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:d("message.thinking")})}),ee,S.length>0&&!o&&!a&&s(Ln,{items:S}),M&&!O&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&v]})}),o&&g!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:g.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(g.message)?.[1];return e===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:e})})():g.message}),o&&v]})}var In=pe(ue);
|
|
3
|
+
export{In};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var
|
|
2
|
-
export{
|
|
1
|
+
import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var De="group/trailing";function le({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function _e({content:n,actions:e,className:r}){if(n==null&&e==null)return null;return s("span",{className:i("group/swap relative flex min-h-5 min-w-5 shrink-0 items-center justify-end",r),children:[n!=null&&t("span",{className:i("flex items-center justify-end",e!=null&&"group-focus-within/trailing:hidden group-hover/trailing:hidden group-has-[[data-popup-open]]/swap:hidden"),children:n}),e!=null&&t("span",{className:"absolute inset-y-0 end-0 hidden w-max items-center justify-end gap-0.5 group-focus-within/trailing:flex group-hover/trailing:flex has-[[data-popup-open]]:flex",onClick:(a)=>a.stopPropagation(),onKeyDown:(a)=>a.stopPropagation(),children:e})]})}
|
|
2
|
+
export{De,le,_e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function wt({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function F({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
|
|
2
|
+
export{wt,F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";import{jsx as s}from"react/jsx-runtime";var
|
|
1
|
+
import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";import{jsx as s}from"react/jsx-runtime";var Vr=d("group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 shadow-xs",secondary:"bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function e({className:r,variant:t="default",size:i="default",...a}){return s(n,{"data-slot":"button",className:o(Vr({variant:t,size:i,className:r})),...a})}export{Vr,e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,r}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{s,r}from"./chunk-bse4zh1d.js";import{A}from"./chunk-z79xmq12.js";import{useEffect as f,useMemo as p}from"react";function br(c){let e=s(),i=c===null?null:e.projectPath(c),u=r((t)=>t.sessionList),l=r((t)=>t.connection),n=r((t)=>t.sessionListLoaded),o=r((t)=>t.sessionListError),a=()=>e.listSessions({reset:!0}).catch(()=>{return});return f(()=>{if(l==="ready"&&!n&&o===null)e.listSessions().catch(()=>{return})},[e,l,n,o]),{result:p(()=>{if(n)return{status:"ready",sessionRows:u.filter((t)=>i===null?A(t.cwd):e.projectPath(t.cwd)===i).toSorted((t,d)=>(d.updatedAt??"").localeCompare(t.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[e,u,n,o,i]),retry:a}}
|
|
2
|
+
export{br};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{zo,x}from"./chunk-6jyd3a7v.js";import{Co}from"./chunk-t9nky8ka.js";import{Q}from"./chunk-seg9xzjy.js";import{So,No,Ro,Mo,Eo,H}from"./chunk-812n3qd8.js";import{Fo,Bo}from"./chunk-q53h2y2a.js";import{Gt}from"./chunk-jh46xzr6.js";import{t,o}from"./chunk-vmywavgm.js";import{n}from"./chunk-1v3wc4cv.js";import{Ct}from"./chunk-29wvjf38.js";import{i,xn,I,st}from"./chunk-xttthm0n.js";import{Xe}from"./chunk-ap1br099.js";import{ne,it}from"./chunk-w5wzxdbk.js";import{et,nt}from"./chunk-jf5651fz.js";import{fn}from"./chunk-1mv3y3cs.js";import{Ze}from"./chunk-qqv0bewt.js";import{hn}from"./chunk-jhxjbpt3.js";import{Ye}from"./chunk-dkbtw3g9.js";import{ot}from"./chunk-kc9rzb07.js";import{mn}from"./chunk-s3mx42dt.js";import{pn}from"./chunk-xrek8rbm.js";import{Je}from"./chunk-at0v48cp.js";import{hasFuzzyFileSearch as St}from"@nyssance/codex-acp-v2/client";import{PlusIcon as Nt}from"lucide-react";import{useCallback as S,useEffect as Ot,useLayoutEffect as X,useMemo as q,useRef as K,useState as N}from"react";import{jsx as c,jsxs as v}from"react/jsx-runtime";var Ft=["image/png","image/jpeg","image/webp","image/gif"],J=[];async function kt(e){let d=await(await fetch(e.url)).blob();return new Promise((b,G)=>{let w=new FileReader;w.onerror=()=>G(w.error),w.onload=()=>{let O=w.result;b(O.slice(O.indexOf(",")+1))},w.readAsDataURL(d)})}function Dt(e){let{t:d}=t(),b=x();return c(H,{"aria-label":d("composer.attachImage"),title:d("composer.attachImage"),onClick:()=>b.openFileDialog(),...e,children:c(Nt,{className:"size-4"})})}function Qe({session:e,onSubmit:d,onHandOff:b,modelSelector:G,modelMenu:w,inputHeader:O,actions:gt,children:xt,attachmentPolicy:yt,predictions:Pt=!0,disabled:bt=!1,preparing:Z=!1,allowPendingInput:vt=!1}){let{host:F,client:A}=n(),{t:s}=F,k=S((r)=>{if(F.reportError)F.reportError(r);else console.error(r)},[F]),[tt,D]=N(()=>({text:i.get(e.id)?.text??"",revision:0})),{text:M}=tt,[C,It]=N(()=>i.get(e.id)?.attachments??J),[h,_]=N(()=>i.get(e.id)?.mentions??[]),W=C.some((r)=>ne(r)&&r.pastedText.status!=="ready"),[T,rt]=N(!1),[L,wt]=N(!1),[Y,at]=N(!1),u=K(null),ct=K(null),a=K(tt),z=S((r)=>{ct.current?.(),a.current={text:r,revision:a.current.revision+1},D(a.current)},[]),pt=q(()=>({read:()=>{let p=u.current?.getTextarea(),g=p===null||p===void 0?[a.current.text.length,a.current.text.length]:[p.selectionStart,p.selectionEnd];return{target:e.id,...a.current,selection:g}},compareAndSet(p,g,y){if(p.target!==e.id||p.revision!==a.current.revision)return null;a.current={text:g,revision:a.current.revision+1},D(a.current);let l=u.current?.getTextarea();if(l!==null&&l!==void 0)l.value=g,l.setSelectionRange(y[0],y[1]);return{target:e.id,...a.current,selection:y}}}),[e.id]),B=K(null),mt=S((r)=>(B.current=r,()=>{if(B.current===r)B.current=null}),[]),lt=e.state!=="idle",f=!bt&&!Z&&e.attached&&!e.restoring&&!e.readOnly,R=!e.readOnly&&(vt||f),E=ot(e,f&&!T&&!L&&!W&&!Y,M.length>0||C.length>0||h.length>0,Pt),dt=E.invalidate;X(()=>{i.set(e.id,{text:M,attachments:C,mentions:h,modelId:i.get(e.id)?.modelId??null})},[e.id,M,C,h]),X(()=>xn(e.id,It),[e.id]),X(()=>st(e.id,(r)=>{if(!R||T)throw Error("The composer cannot take text now; try again later");if(M.length||C.length||h.length)throw Error("The composer already has a draft; send or clear it first");z(r)}),[e.id,R,T,M,C,h,z]);let ut=o((r)=>St(r.agent)),Tt=q(()=>ut&&f?async(r)=>Xe((await A.fuzzyFileSearch({query:r,roots:[e.cwd]})).files):void 0,[A,ut,f,e.cwd]),V=S((r)=>{_((p)=>p.includes(r)?p:[...p,r])},[]);Ot(()=>{u.current?.focus()},[]);let ft=S(async({text:r,files:p})=>{let g=r.trim();if(g.length===0&&p.length===0&&h.length===0)return;let y=B.current;rt(!0);let l=i.get(e.id),Et=a.current.revision,U=null;try{let P=[];for(let m of h){let j={kind:"file",absPath:m};P.push({type:"resource_link",uri:et(j),name:nt(j)})}if(g.length>0)P.push({type:"text",text:g});for(let m of p)if(ne(m)){if(m.pastedText.status!=="ready")throw Error("Text attachment is not ready");P.push({type:"resource_link",uri:m.url,name:m.filename??"pasted-text.txt"})}else P.push({type:"image",data:await kt(m),mimeType:m.mediaType});if(a.current.revision===Et&&i.get(e.id)===l)a.current={text:"",revision:a.current.revision+1},U=a.current.revision,D(a.current),_([]),I(e.id,()=>J),i.set(e.id,{text:"",attachments:J,mentions:[],modelId:l?.modelId??null}),u.current?.resetHeight();if(d)if(y===null)await d(P);else await d(P,(m)=>{if(y.signal.aborted||B.current!==y)return;y.accept(m),b?.(e.id,m)});else if(y===null)await A.prompt(e.id,P);else{let m=await A.prompt(e.id,P);y.accept(m)}dt();for(let m of l?.attachments??[])if(m.url.startsWith("blob:")&&!i.get(e.id)?.attachments.some((j)=>j.id===m.id))URL.revokeObjectURL(m.url)}catch(P){if(l&&U!==null&&a.current.revision===U&&i.get(e.id)?.attachments.length===0&&i.get(e.id)?.mentions.length===0)a.current={text:l.text,revision:U+1},D(a.current),_(l.mentions),i.set(e.id,l),I(e.id,()=>l.attachments);throw P}finally{rt(!1),u.current?.focus()}},[A,e.id,h,d,b,dt]),At=()=>{A.cancel(e.id).catch(k)},Mt=S((r)=>{let p=r.code==="max_total_size"?Object.assign(Error(s("composer.imageTooLargeTitle")),{description:s("composer.imageTooLargeDescription",{mb:Q})}):Object.assign(Error(s("composer.unsupportedAttachmentTitle")),{description:s("composer.unsupportedAttachmentDescription")});k(p)},[k,s]),Rt=q(()=>({session:e,ready:f,inputReady:R,sending:T,textareaRef:u,draft:pt,interruptRef:ct,observeReceipts:mt,addMention:V,setAdding:wt,handsFree:d===void 0||b!==void 0}),[e,f,R,T,pt,mt,V,d,b]),ht=F.writeTextAttachment;return c(Ct,{value:Rt,children:c("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:v("div",{className:"relative",children:[O&&c("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:O}),v(zo,{attachmentPolicy:yt,value:M,revision:a.current.revision,onValueChange:z,onSubmittedClear:()=>{a.current={text:"",revision:a.current.revision+1},D(a.current)},attachments:C,onAttachmentsChange:(r)=>I(e.id,()=>r),children:[c(Co,{handleRef:u,commands:e.commands,searchFiles:Tt,onMention:V,onSearchError:k,forcedOpen:Y,onForcedOpenChange:at,emptyLabel:s("composer.noCommands"),fileStatusLabels:{loading:s("composer.searchingFiles"),empty:s("composer.noMatchingFiles")}}),v(So,{globalDrop:!0,multiple:!0,accept:Ft.join(","),onError:Mt,onSubmit:ft,onSubmitAsync:ft,onSubmitError:k,canSubmit:()=>f&&!T&&!L&&!W?!0:"chat_not_ready",className:"relative z-10",children:[xt,v(Ro,{className:"px-3 pt-3 pb-0 empty:hidden",children:[L&&c("span",{role:"status",className:"text-muted-foreground text-xs",children:s("composer.addingFiles")}),c(fn,{mentions:h,onRemove:(r)=>_((p)=>p.filter((g)=>g!==r))}),c(Bo,{children:(r)=>ne(r)?c(hn,{data:r,sessionId:e.id}):c(Fo,{data:r,t:s})})]}),v(No,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(r)=>{if(!E.text||u.current?.isComposing()||r.nativeEvent.isComposing||r.nativeEvent.keyCode===229||r.shiftKey||r.ctrlKey||r.altKey||r.metaKey||r.target!==u.current?.getTextarea())return;if(r.key==="Tab")r.preventDefault(),r.stopPropagation(),z(E.text)},children:[c(Gt,{className:"min-h-10 bg-transparent text-sm font-normal",ref:u,rows:2,bashMode:!1,disabled:!R,onPasteCapture:ht?(r)=>it(r,e.id,s("composer.pastedTextFilename"),ht):void 0,placeholder:E.text||(lt?s("composer.steerPlaceholder"):s("composer.placeholder")),"aria-label":s("composer.placeholder")}),E.error&&c("span",{className:"text-muted-foreground text-xs",role:"status",title:E.error,children:s("composer.predictionUnavailable")})]}),c(Mo,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:v("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[v("div",{className:"flex min-w-0 items-center gap-[5px]",children:[c(Dt,{className:"text-foreground",disabled:!R}),c(mn,{textareaRef:u,menuOpen:Y,onOpenChange:at,disabled:!f||e.commands.length===0}),c(Ye,{sessionId:e.id,options:e.configOptions,disabled:!f})]}),v(Eo,{className:"w-full min-w-0 items-center justify-end gap-1",children:[c(Je,{session:e}),G??c(Ze,{...w,sessionId:e.id,options:e.configOptions,disabled:!f}),gt,c(pn,{active:lt,sending:T||Z||L,ready:f&&!W,hasMentions:h.length>0,onStop:At})]})]})})]})]})]})})})}
|
|
2
|
+
export{Qe};
|
|
@@ -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 yo({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{yo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{qo}from"./chunk-00sds3wb.js";import{n,b}from"./chunk-1v3wc4cv.js";import{T,y}from"./chunk-tp5y8cc7.js";import{createLucideIcon as C,HandIcon as k,ShieldAlertIcon as w,ShieldCheckIcon as r}from"lucide-react";import{jsx as t}from"react/jsx-runtime";var S=C("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),d={"read-only":k,"workspace-write":r,agent:S,"agent-full-access":w},O={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function Ye({sessionId:u,options:m,disabled:g,onConfigChange:c}){let{host:l,client:f}=n(),{t:a}=l,s=y(m,"mode");if(!s)return null;let o=s.currentValue,p=T(s).map((e)=>{let i=O[e.value];return i?{...e,name:a(`permissionModes.${i}.name`),description:a(`permissionModes.${i}.description`)}:e}),h=p.find((e)=>e.value===o),I=d[o]??r,M=(e)=>{if(e===o)return;b(l,c?c(s.configId,e):f.setConfig(u,s.configId,e))};return t(qo,{value:o,currentName:h?.name??o,icon:t(I,{className:"size-3.5 shrink-0"}),header:a("permissionModes.heading"),disabled:g,label:a("composer.switchPermissionMode"),onValueChange:M,options:p.map((e)=>{let i=d[e.value]??r,v=e.value==="agent-full-access";return{value:e.value,label:t("span",{"data-permission-warning":v?"":void 0,children:e.name}),description:e.description?t("span",{className:"whitespace-normal",children:e.description}):void 0,icon:t(i,{className:"size-3.5 shrink-0"})}})})}
|
|
2
|
+
export{Ye};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function Bt(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
|
|
2
|
+
export{Bt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function Rn(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
|
|
2
|
+
export{Rn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var a=(e)=>String(e).padStart(2,"0");function
|
|
2
|
-
export{
|
|
1
|
+
var a=(e)=>String(e).padStart(2,"0");function Te(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
|
|
2
|
+
export{Te};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-vmywavgm.js";import{e}from"./chunk-cg97byvk.js";import{Tn}from"./chunk-n6xa65sp.js";import{fe,he,ve,xe}from"./chunk-5xjm1hab.js";import{n,b}from"./chunk-1v3wc4cv.js";import{Loader2Icon as y}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function je({session:t,timeline:l}){let{host:s,client:a}=n(),{t:r}=s,c=o((f)=>f.historyPages[t.id]?.cursor!=null),d=()=>b(s,a.open(t.id,t.cwd)),p=i(Tn,{...l,session:t,client:a,host:s});if(t.restoring)return t.items.length===0?m("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[i(y,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(fe,{className:"flex-1",children:[m(he,{children:[i(ve,{children:r("conversation.reopen")}),i(xe,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!c)return i(fe,{className:"flex-1",children:m(he,{children:[i(ve,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(xe,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{je};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{xt,Z}from"./chunk-932ykb37.js";import{L}from"./chunk-tjykfxrd.js";import{yt}from"./chunk-bje0nmh9.js";import{Y}from"./chunk-9yv5c2s3.js";import{De,le,_e}from"./chunk-c7b8rscf.js";import{PreviewCard as x}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as I}from"lucide-react";import{createContext as S,useContext as k,useLayoutEffect as T,useState as R}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as G}from"react/jsx-runtime";function Vo(o){if(o.as==="ul"){let{as:i,className:s,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",s),...a})}let{as:t,className:n,...r}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...r})}function Le({className:o,...t}){return e("span",{"data-slot":"navigation-leading",className:p("flex size-6 shrink-0 items-center justify-center [&_.lucide]:size-3.5",o),...t})}function pt({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function Zt({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:N,headerChildren:f,wrapHeader:u,onHeaderClick:w,children:h}){let C=()=>{w?.(),t(!o)},v=p(De,"relative flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),b=d(G,{children:[r!=null&&e(Le,{children:r}),f??e(L,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(_e,{content:s!==void 0?e(le,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:N})})]}),P=f==null?d("div",{"data-active":l?"":void 0,title:n,className:p(v,Z),onClick:C,onKeyDown:(c)=>{if(c.target!==c.currentTarget)return;if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault(),C()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),b]}):e("div",{"data-active":l?"":void 0,className:v,children:b});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[u===void 0?P:u(P),o&&e(Vo,{className:"mt-0.5",children:h})]})}var H=S(()=>{}),O=S(()=>{});function gt(){return k(O)}function ft(){return k(H)}function ht({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:N,preview:f,listeningPorts:u,onOpenPort:w,accessory:h,meta:C,hint:v,actions:b,className:P,...c}){let y=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(De,xt,"group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(f||u!=null&&u.length>0)&&"h-auto min-h-[var(--navigation-row-height)] py-2.5",P),...c,children:[e(Le,{children:t!=null?e(yt,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(L,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),N!=null&&e(L,{className:"text-muted-foreground text-xs",children:N}),f&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:f}),u!=null&&u.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:u.map((m)=>w?d("button",{type:"button",className:"underline",onPointerDown:(g)=>g.stopPropagation(),onKeyDown:(g)=>g.stopPropagation(),onClick:(g)=>{g.stopPropagation(),w(m)},children:[":",m]},m):d("span",{children:[":",m]},m))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(I,{className:"text-muted-foreground size-3"}),e(_e,{content:h!=null?e(le,{children:h}):C??e(le,{}),actions:b}),v!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:v})]})]});if(a==null)return y;return e(_,{row:y,onOpenChange:l,children:a})}function _({row:o,children:t,onOpenChange:n}){let[r,i]=R(!1),[s,a]=R(!1),l=r||s;return T(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(H.Provider,{value:a,children:e(O.Provider,{value:()=>{i(!1),a(!1)},children:e(E,{open:l,onOpenChange:i,trigger:o,children:t})})})}function E({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return Y(o),d(x.Root,{open:o,onOpenChange:t,children:[e(x.Trigger,{render:n,delay:700,closeDelay:100}),e(x.Portal,{children:e(x.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(x.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
|
|
2
|
+
export{Vo,Le,pt,Zt,gt,ft,ht};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function kn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function Tt(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function oe(t){return t.type==="array"}function lt(t){return(oe(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
|
|
2
|
+
export{kn,Tt,oe,lt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function
|
|
2
|
-
export{
|
|
1
|
+
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function xo(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function $t(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{xo,$t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function
|
|
2
|
-
export{
|
|
1
|
+
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Kn(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Kr(){c()}function Qn(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function Xn(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return vr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Qr(e,n,t,i,o,a){if(a==="none")return;_(o,[vr(e,n,t,i,a)])}function vr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ar(t,i);return xr(e,n)}function Ar(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function xr(e,n){return y+Lr(e,n)}function Xr(e,n){return D(xr(e,n))}function Lr(e,n){if(n<=l)return Dr(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Dr(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function Yr(){return r.context?.state}function Zr(e){return g(e).ready}
|
|
2
|
+
export{Kn,Kr,Qn,Xn,Qr,vr,Ar,xr,Xr,Lr,Dr,Yr,Zr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{wn}from"./chunk-hd682pax.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function bn({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=wn(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}
|
|
2
|
+
export{bn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{terminalOf as u,textOf as g}from"@alwith/api";function An(n,o,r){if(n.kind!=="tool"){let t=g(n.content),c=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(t);return{type:"thinking",id:n.id,thinking:c?c[1]:t,isComplete:!r}}if(n.name==="subagent"){let t=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:p(t.agentPath,n.id),threadId:f(t.agentThreadId,"agentThreadId",n.id),activity:y(t.activity,n.id),model:l(t.model,"model",n.id),reasoningEffort:l(t.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let t=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof t.tool!=="string"||!Array.isArray(t.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:t.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:t.agents}}let i=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},e=u(n,o);if(Array.isArray(i.command))i.command=i.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof i.command!=="string"){let t=e?.command??n.title;if(t!==null)i.command=t}let a=n.rawOutput;if(typeof a==="object"&&a!==null&&"output"in a&&typeof a.output==="string")a=a.output;if(e!==null&&e.output.length>0)a=e.output;let d=e?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:i,rawOutput:a,...typeof d==="number"?{exitCode:d}:{}}}function s(n,o){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${o} is missing an object codex-acp-v2 always sends`);return n}function l(n,o,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${o}`)}function p(n,o){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${o} has no agent path`);return r}function f(n,o,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${o}`)}function y(n,o){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${o} has an unknown activity ${String(n)}`)}
|
|
2
|
+
export{An};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gr={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function wn(e){return[...e].toSorted((o,n)=>(gr[o.kind]??99)-(gr[n.kind]??99))}function Gr(e){return e==="allow_once"||e==="allow_always"}function Wr(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
+
export{gr,wn,Gr,Wr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{Jo,er,tr,nr,or,rr}from"./chunk-w9nr7saa.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function yn({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(Jo,{size:"sm",children:[n(er,{children:[a(nr,{children:i("approval.needed")}),a(tr,{children:r})]}),a(or,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(rr,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
|
|
2
|
+
export{yn};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ln}from"./chunk-w3z37qwe.js";import{Io,Po,dt}from"./chunk-1tz8afx9.js";import{Ee,x}from"./chunk-6jyd3a7v.js";import{cn as w}from"cn";import{forwardRef as A,useCallback as D,useEffect as M,useImperativeHandle as K,useRef as f}from"react";import{jsx as F}from"react/jsx-runtime";var L=(i)=>!i.shiftKey,R=()=>!1,Gt=A(({onChange:i,onCompositionStart:g,onCompositionEnd:v,className:T,placeholder:y,bashMode:b=!1,isSendShortcut:E=L,isNewlineShortcut:I=R,...C},H)=>{let n=Ee(),l=x(),o=f(!1),u=f(!1),r=f(null),s=D(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);M(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=b&&(n?.textInput.value??"").startsWith("!"),P=(e)=>{if(o.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||u.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
|
|
2
2
|
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:a,selectionEnd:m,value:p}=t,d=`${p.slice(0,a)}
|
|
3
|
-
${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(E(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},S=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=
|
|
4
|
-
export{
|
|
3
|
+
${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(E(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},S=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=Io(t),p=Po(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},k=n?{value:o.current&&r.current?r.current.value:c?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=o.current?e.currentTarget.value:dt(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)dt(e.currentTarget);s(),i?.(e)}};return K(H,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),F(ln,{"data-chat-input":!0,ref:r,rows:3,className:w("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",T),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=dt(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),v?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,g?.(e)},onKeyDown:P,onPaste:S,placeholder:y,...C,...k})});Gt.displayName="PromptInputTextarea";
|
|
4
|
+
export{Gt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{x}from"./chunk-6jyd3a7v.js";import{e}from"./chunk-cg97byvk.js";import{n}from"./chunk-1v3wc4cv.js";import{Ce}from"./chunk-w5wzxdbk.js";import{FileText as l,RotateCcw as d,X as u}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function hn({data:s,sessionId:m}){let{host:a}=n(),{t:o}=a,p=x(),{text:c,status:r}=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(e,{type:"button",variant:"ghost",disabled:r!=="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:r==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(r==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),r==="error"&&a.writeTextAttachment&&t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Ce(m,s,a.writeTextAttachment),children:t(d,{className:"size-3"})}),t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(u,{className:"size-3"})})]})}
|
|
2
|
+
export{hn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{ue,me,J,pe,bt,ge,He,Oe,Fe,Jt,N}from"./chunk-k6b4cf05.js";import{Be}from"./chunk-y6v59cgf.js";import{ye,be,we}from"./chunk-mxj4s2r8.js";import{Wt}from"./chunk-1mnc7200.js";import{f}from"./chunk-jtafw6h4.js";import{cn as m}from"cn";import{ArrowUpRight as E,ChevronUp as j,Loader2Icon as B,Zap as G}from"lucide-react";import{Fragment as ee,useState as P}from"react";import{jsx as n,jsxs as s,Fragment as p}from"react/jsx-runtime";function ko({value:c,onChange:F,models:x,modelGroups:S,compactCatalog:l,effortPresentation:z="slider",unavailableEffort:v,providerMenu:h,header:w,className:_,condensed:C,stripLabelPrefix:T,showDescription:U,showModelList:W=!0,loading:Z,switching:R,isLoading:q,effortConfig:i,booleanOptions:y,onBooleanChange:O,selectOptions:H=[],t:u,...r}){let[K,Q]=P(!1),[X,Y]=P(!1),d=y?.find((a)=>a.id==="fast_mode"),V=l?y?.filter((a)=>a!==d):y,I=(a)=>T&&a.startsWith(T)?a.slice(T.length):a;if(Z)return n("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:s(e,{variant:"ghost",disabled:!0,className:m("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",_),children:[n(B,{className:"size-3 animate-spin"}),n("span",{className:"text-muted-foreground truncate",children:u("model.loadingModels")})]})});return s("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&s(ue,{open:K,onOpenChange:Q,children:[s(ye,{children:[n(be,{render:n(me,{render:s(e,{"data-testid":"provider-trigger",variant:"ghost",disabled:r.disabled,className:m("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,n(j,{className:"size-2.5 shrink-0 opacity-60"})]})})}),n(we,{children:u("model.switchProvider")})]}),s(J,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((a,t)=>s(ee,{children:[t>0&&a.length>0&&n(N,{}),n(f,{value:h.value,onValueChange:h.onChange,options:a})]},t)),h.moreAction&&s(p,{children:[n(N,{}),s(ge,{onClick:h.moreAction,className:"whitespace-nowrap",children:[n("span",{className:"min-w-0 flex-1 truncate",children:u("model.moreModels")}),n(E,{className:"size-4"})]})]})]})]}),s(ue,{open:X,onOpenChange:Y,children:[s(ye,{children:[n(be,{render:n(me,{render:s(e,{"data-testid":"model-trigger","aria-busy":R,variant:"ghost",className:m("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",C&&"h-7 gap-1 px-1.5 text-[11px]",_),...r,children:[c.icon,y?.some((a)=>a.id==="fast_mode"&&a.currentValue&&!a.disabled)&&n(G,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),n("span",{className:m("min-w-0 flex-1 truncate text-start",C&&"text-[11px]"),children:I(c.label)||u("model.selectModel")}),i&&s("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[n("span",{className:"invisible col-start-1 row-start-1",children:i.sizer??i.levels.reduce((a,t)=>t.name.length>a.length?t.name:a,"")}),n("span",{className:"col-start-1 row-start-1",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),R?n(B,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):n(j,{className:m("size-3 shrink-0",C&&"size-2.5")})]})})}),n(we,{children:u("model.switchModel")})]}),s(J,{side:"top",align:"end",sideOffset:4,className:m("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",l&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[l&&s(p,{children:[s(pe,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-1 py-1",children:[i?z==="slider"?n("div",{role:"menuitem","aria-label":i.name,className:"min-w-0 [&>div]:justify-start [&>div]:gap-3 [&>div]:px-2 [&>div]:py-1.5",children:n(Wt,{...i,disabled:r.disabled})}):s(He,{children:[s(Oe,{disabled:r.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[n("span",{children:i.name}),n("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(Fe,{children:n(f,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):v?s(ge,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[n("span",{children:v.name}),n("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):n(bt,{className:"min-w-0 flex-1 truncate",children:w?.name}),d&&n(Jt,{"aria-label":d.name,title:d.title??d.name,disabled:r.disabled||d.disabled,checked:d.currentValue,closeOnClick:!1,onCheckedChange:(a)=>O?.(d.id,a),className:m("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ml-auto size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",d.currentValue&&!d.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:d.icon??n(G,{className:"size-4","aria-hidden":"true"})})]}),n(N,{className:"shrink-0"})]}),w&&!l&&s(p,{children:[s("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,n("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),n(N,{})]}),s(pe,{"data-model-menu-list":l?"":void 0,className:l?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[W&&(q?n(ge,{disabled:!0,className:"text-muted-foreground",children:u("model.loadingModels")}):x.length===0?n(ge,{disabled:!0,className:"text-muted-foreground",children:u("model.noModelsAvailable")}):(()=>{let a=x.filter((o)=>!o.more),t=x.filter((o)=>o.more),A=a.length>0&&t.length>0,M=(o,g)=>({disabled:r.disabled,icon:o.icon,value:o.api_id,label:I(o.label),description:g?.noDescription?void 0:U?o.description:void 0}),D=(o)=>{let g=x.find((k)=>k.api_id===o);if(g)F(g)};if(l)return n(f,{value:c.api_id,onValueChange:D,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((o)=>M(o))});return s(p,{children:[S?S.map((o)=>{let g=o.models.filter((b)=>!b.more),k=o.models.filter((b)=>b.more),L=g.length>0&&k.length>0;return s(pe,{children:[n(bt,{className:"text-muted-foreground text-xs font-normal",children:o.name}),n(f,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(L?g:o.models).map((b)=>M(b))}),L&&s(He,{children:[n(Oe,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),n(Fe,{children:n(f,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:k.map((b)=>M(b,{noDescription:!0}))})})]})]},o.id)}):n(f,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(A?a:x).map((o)=>M(o))}),!S&&A&&s(He,{children:[n(Oe,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),n(Fe,{children:n(f,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:t.map((o)=>M(o,{noDescription:!0}))})})]})]})})()),!l&&i&&s(p,{children:[n(N,{}),z==="menu"?s(He,{children:[s(Oe,{disabled:r.disabled,children:[n("span",{className:"flex-1",children:i.name}),n("span",{className:"text-muted-foreground",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(Fe,{children:n(f,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):n(Wt,{...i,disabled:r.disabled})]}),!l&&!i&&v&&s(p,{children:[n(N,{}),s(ge,{disabled:!0,children:[n("span",{className:"flex-1",children:v.name}),n("span",{children:v.label})]})]}),H.map((a)=>s(pe,{children:[n(N,{}),n(bt,{children:a.name}),n(f,{value:a.value,onValueChange:a.onChange,options:a.options,itemClassName:"whitespace-nowrap"})]},a.id)),V&&V.length>0&&s(p,{children:[!i&&n(N,{}),V.map((a)=>l?s(Jt,{"aria-label":a.name,title:a.title,disabled:r.disabled||a.disabled,checked:a.currentValue,closeOnClick:!1,onCheckedChange:(t)=>O?.(a.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[s("span",{className:"flex items-center gap-2",children:[a.icon,a.name]}),n("span",{"aria-hidden":"true",className:m("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",a.currentValue?"bg-primary":"bg-input"),children:n("span",{className:m("bg-background size-3.5 rounded-full shadow-xs transition-transform",a.currentValue&&"translate-x-3.5")})})]},a.id):s("div",{title:a.title,className:m("flex items-center justify-between gap-3 px-2 py-2.5",a.disabled&&"opacity-50"),children:[s("span",{className:"flex items-center gap-2 text-sm font-medium",children:[a.icon,a.name]}),n(Be,{"aria-label":a.name,disabled:r.disabled||a.disabled,checked:a.currentValue,onCheckedChange:(t)=>O?.(a.id,t)})]},a.id))]})]}),l&&w?.action&&s(p,{children:[n(N,{className:"shrink-0"}),n(pe,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
|
|
2
|
+
export{ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ko,Qo}from"./chunk-k6b4cf05.js";import{cn as l}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function f({value:i,onValueChange:n,options:o,itemClassName:d}){return t(Ko,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(Qo,{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{f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Menu as n}from"@base-ui/react/menu";import{cn as i}from"cn";import{CheckIcon as c,ChevronRightIcon as p}from"lucide-react";import{jsx as t,jsxs as u}from"react/jsx-runtime";function
|
|
1
|
+
import{Menu as n}from"@base-ui/react/menu";import{cn as i}from"cn";import{CheckIcon as c,ChevronRightIcon as p}from"lucide-react";import{jsx as t,jsxs as u}from"react/jsx-runtime";function ue({...e}){return t(n.Root,{"data-slot":"dropdown-menu",...e})}function ui({...e}){return t(n.Portal,{"data-slot":"dropdown-menu-portal",...e})}function me({...e}){return t(n.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function J({align:e="start",alignOffset:o=0,side:a="bottom",sideOffset:r=4,className:d,...s}){return t(n.Portal,{children:t(n.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:o,side:a,sideOffset:r,children:t(n.Popup,{"data-slot":"dropdown-menu-content",className:i("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 duration-100 outline-none data-closed:overflow-hidden",d),...s})})})}function pe({...e}){return t(n.Group,{"data-slot":"dropdown-menu-group",...e})}function bt({className:e,inset:o,...a}){return t(n.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:i("text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:pl-8",e),...a})}function ge({className:e,inset:o,variant:a="default",...r}){return t(n.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a,className:i("group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function He({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e})}function Oe({className:e,inset:o,children:a,...r}){return u(n.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:i("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,t(p,{className:"ml-auto"})]})}function Fe({align:e="start",alignOffset:o=-3,side:a="right",sideOffset:r=0,className:d,...s}){return t(J,{"data-slot":"dropdown-menu-sub-content",className:i("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100",d),align:e,alignOffset:o,side:a,sideOffset:r,...s})}function Jt({className:e,children:o,checked:a,inset:r,...d}){return u(n.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:i("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...d,children:[t("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:t(n.CheckboxItemIndicator,{children:t(c,{})})}),o]})}function Ko({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function Qo({className:e,children:o,inset:a,...r}){return u(n.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":a,className:i("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[t("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:t(n.RadioItemIndicator,{children:t(c,{})})}),o]})}function N({className:e,...o}){return t(n.Separator,{"data-slot":"dropdown-menu-separator",className:i("bg-border -mx-1 my-1 h-px",e),...o})}function mi({className:e,...o}){return t("span",{"data-slot":"dropdown-menu-shortcut",className:i("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",e),...o})}export{ue,ui,me,J,pe,bt,ge,He,Oe,Fe,Jt,Ko,Qo,N,mi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-vmywavgm.js";import{n}from"./chunk-1v3wc4cv.js";import{isBooleanOption as T,isSelectOption as w}from"@alwith/api";import{codexExtensionCapabilities as j,codexTurnId as B,composerPrediction as F}from"@nyssance/codex-acp-v2/client";import{useEffect as b,useRef as C,useState as P}from"react";function ot(t,g,c,y){let{client:S}=n(),R=o((e)=>j(e.agent).composerPredictions),k=t.items.findLast((e)=>e.kind==="user"),i=B(k?._meta),O=t.configOptions.flatMap((e)=>w(e)||T(e)?[[e.configId,e.currentValue]]:[]).sort(([e],[u])=>String(e).localeCompare(String(u))),r=JSON.stringify([t.id,i,O]),s=F(t._meta),d=t._meta?.codex,m=typeof d==="object"&&d!==null&&"prediction"in d?d.prediction:null,l=C(null),f=C(!1);b(()=>(f.current=!0,()=>{f.current=!1}),[]);let[a,_]=P(null),[v,x]=P(null),p=y&&R&&g&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!k?.replayed&&i!==null;b(()=>{if(!p||c||a===r||l.current?.key===r||i===null)return;let e={key:r,previousResult:m};l.current=e,x(null),S.requestPrediction(t.id,i).catch((u)=>{if(f.current&&l.current===e)x({key:r,message:u instanceof Error?u.message:String(u)})})},[S,p,c,a,r,m,t.id,i]);let I=p&&!c&&a!==r&&l.current?.key===r&&l.current.previousResult!==m&&s?.sourceTurnId===i,q=I&&s.result.type==="completed"?s.result.text:null,E=y&&g&&t.state==="idle"&&!c&&a!==r?v?.key===r?v.message:I&&s.result.type==="failed"?"Prediction failed":null:null;return{text:q,error:E,invalidate:()=>{if(p)_(r)}}}
|
|
2
|
+
export{ot};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{de}from"./chunk-0jw4ffzj.js";import{SquareIcon as u}from"lucide-react";import{useRef as c,useState as f}from"react";import{jsx as a}from"react/jsx-runtime";function ut({title:t,onStop:s}){let[o,i]=f(!1),n=c(!1),l=async()=>{if(n.current)return;n.current=!0,i(!0);try{await s()}finally{n.current=!1,i(!1)}};return a(e,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(r)=>r.stopPropagation(),onClick:(r)=>{r.stopPropagation(),l()},children:o?a(de,{className:"size-3","aria-label":t}):a(u,{className:"size-3 fill-current"})})}
|
|
2
|
+
export{ut};
|