@alwith/module-chat 0.5.8 → 0.5.10
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.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-zk3j2f24.js → chunk-0fr24sxr.js} +3 -3
- package/dist/{chunk-zsxt5bbk.js → chunk-0sdhavk8.js} +2 -2
- package/dist/{chunk-9r0g5jc9.js → chunk-115a3p9z.js} +2 -2
- package/dist/{chunk-syffw61b.js → chunk-12swy4za.js} +4 -4
- package/dist/{chunk-tdwk5dct.js → chunk-13y1xqbb.js} +2 -2
- package/dist/chunk-1jzxmw98.js +2 -0
- package/dist/{chunk-0mm2wh23.js → chunk-1k1e55de.js} +1 -1
- package/dist/chunk-1wxebrbt.js +2 -0
- package/dist/chunk-1xg1qw4g.js +4 -0
- package/dist/{chunk-377s443r.js → chunk-2879v3ps.js} +2 -2
- package/dist/{chunk-zz734bzf.js → chunk-2pj3pcc7.js} +2 -2
- package/dist/{chunk-5n1xv5w0.js → chunk-2ymhbrf9.js} +3 -3
- package/dist/{chunk-0pz9ryqh.js → chunk-34a7aha4.js} +2 -2
- package/dist/chunk-3g8ck68k.js +2 -0
- package/dist/chunk-3wg25354.js +2 -0
- package/dist/chunk-3xnbypjz.js +2 -0
- package/dist/{chunk-ryz4c13z.js → chunk-46gb51y9.js} +2 -2
- package/dist/chunk-4ecdn9z1.js +2 -0
- package/dist/{chunk-401q6mpb.js → chunk-4t6bd8j7.js} +2 -2
- package/dist/{chunk-jn0q0b7k.js → chunk-5c4z345j.js} +2 -2
- package/dist/{chunk-ksv9pjc2.js → chunk-5d94195x.js} +1 -1
- package/dist/{chunk-rky16ygr.js → chunk-5f4m4ptz.js} +3 -3
- package/dist/{chunk-88xay4pa.js → chunk-5nqhvv28.js} +2 -2
- package/dist/chunk-60ks28ef.js +2 -0
- package/dist/chunk-62x983rq.js +2 -0
- package/dist/{chunk-xxkdv1zf.js → chunk-64hrczd9.js} +1 -1
- package/dist/chunk-6f2h379x.js +2 -0
- package/dist/{chunk-cg97byvk.js → chunk-6kn920c5.js} +1 -1
- package/dist/chunk-6xp64b2e.js +2 -0
- package/dist/{chunk-gzff19t3.js → chunk-6z9r27t2.js} +2 -2
- package/dist/{chunk-p2prcbq9.js → chunk-76xfekar.js} +2 -2
- package/dist/chunk-78x93ef2.js +2 -0
- package/dist/{chunk-gjkrfb1m.js → chunk-7awdgc0t.js} +2 -2
- package/dist/chunk-7e1m1d9x.js +2 -0
- package/dist/{chunk-qfk24bq6.js → chunk-7q07tm0w.js} +1 -1
- package/dist/{chunk-sr5rcdza.js → chunk-83dkw1mh.js} +2 -2
- package/dist/chunk-8dtaq4eh.js +2 -0
- package/dist/{chunk-gd9s35b8.js → chunk-8tn17nw7.js} +2 -2
- package/dist/{chunk-znx2e9e7.js → chunk-90c0tynf.js} +2 -2
- package/dist/{chunk-m8sp44qa.js → chunk-94r5frad.js} +2 -2
- package/dist/{chunk-0n240acr.js → chunk-951wn2bd.js} +2 -2
- package/dist/{chunk-1drkvxzk.js → chunk-9bjywaze.js} +1 -1
- package/dist/{chunk-q256c3hn.js → chunk-9cbpmdqf.js} +2 -2
- package/dist/{chunk-1dw0dx23.js → chunk-9h86hvc3.js} +2 -2
- package/dist/chunk-9tgtskz4.js +2 -0
- package/dist/{chunk-3arz4kfx.js → chunk-9w0w5by0.js} +2 -2
- package/dist/chunk-a7nqzhxj.js +2 -0
- package/dist/chunk-aafg3jqm.js +3 -0
- package/dist/{chunk-6r5s4bjp.js → chunk-akcs13sj.js} +2 -2
- package/dist/{chunk-9evhky1b.js → chunk-anshr0mw.js} +1 -1
- package/dist/{chunk-xb1wvyky.js → chunk-b616t3fp.js} +2 -2
- package/dist/{chunk-tv89wh8b.js → chunk-b81yxz7f.js} +2 -2
- package/dist/chunk-b8ywzj88.js +2 -0
- package/dist/chunk-b9ew8dwr.js +2 -0
- package/dist/{chunk-wdyyy8c1.js → chunk-bhrnw36x.js} +2 -2
- package/dist/{chunk-6ss1981q.js → chunk-bm4s6n8a.js} +2 -2
- package/dist/{chunk-tjgq4882.js → chunk-bq05e911.js} +2 -2
- package/dist/{chunk-svt0t387.js → chunk-btjqewxj.js} +2 -2
- package/dist/chunk-cc6vp2sg.js +2 -0
- package/dist/{chunk-n8yj6reh.js → chunk-ct5wk01a.js} +3 -3
- package/dist/{chunk-gc9g67j5.js → chunk-d8rf7rff.js} +2 -2
- package/dist/{chunk-6edz9f7j.js → chunk-dnhmnmgf.js} +2 -2
- package/dist/{chunk-30wqrz8v.js → chunk-dzx4rypz.js} +2 -2
- package/dist/{chunk-qq9p31a7.js → chunk-eg1d1gbc.js} +2 -2
- package/dist/{chunk-jtaph5am.js → chunk-erzjz56d.js} +1 -1
- package/dist/{chunk-ty6yjhwk.js → chunk-et0rpfh9.js} +1 -1
- package/dist/{chunk-bbwb4555.js → chunk-f4e289mj.js} +2 -2
- package/dist/chunk-fb6vxbmc.js +2 -0
- package/dist/chunk-fcyzhbmn.js +2 -0
- package/dist/{chunk-w8qmh6he.js → chunk-fjwg3y8h.js} +2 -2
- package/dist/chunk-fw3emcqw.js +2 -0
- package/dist/{chunk-s9sf8hqk.js → chunk-gajhc4bp.js} +2 -2
- package/dist/{chunk-qgm2pqvw.js → chunk-gc1m6aw5.js} +2 -2
- package/dist/{chunk-ab3thrqy.js → chunk-gq30yqjk.js} +2 -2
- package/dist/{chunk-f7kngj14.js → chunk-grncrd31.js} +2 -2
- package/dist/{chunk-7ncycdpp.js → chunk-gthvary5.js} +1 -1
- package/dist/chunk-h7ks1p6h.js +2 -0
- package/dist/chunk-j4cm74nv.js +4 -0
- package/dist/{chunk-4q3w2353.js → chunk-j8fybkv1.js} +2 -2
- package/dist/{chunk-4svcj9c6.js → chunk-jbz530rv.js} +2 -2
- package/dist/{chunk-temeekck.js → chunk-jegkf64h.js} +2 -2
- package/dist/chunk-jjtgsnj0.js +2 -0
- package/dist/chunk-jnrcqphc.js +2 -0
- package/dist/chunk-jyy20tw1.js +2 -0
- package/dist/{chunk-34e5ad6w.js → chunk-k583q9wq.js} +3 -3
- package/dist/chunk-k7wta28t.js +2 -0
- package/dist/{chunk-e11qjnb4.js → chunk-kathd6f3.js} +2 -2
- package/dist/{chunk-zb8cdt79.js → chunk-kgkrtc3r.js} +1 -1
- package/dist/{chunk-ek06eyp4.js → chunk-kjtd3wc3.js} +1 -1
- package/dist/chunk-ksmcznp2.js +3 -0
- package/dist/chunk-m2ab6p4w.js +2 -0
- package/dist/chunk-n89jvr5q.js +2 -0
- package/dist/{chunk-6amcjhqh.js → chunk-nsns7rgs.js} +2 -2
- package/dist/chunk-nvya2g1d.js +2 -0
- package/dist/{chunk-qgkj3wee.js → chunk-pmpeh7e8.js} +2 -2
- package/dist/{chunk-460phps1.js → chunk-ptws0wtt.js} +2 -2
- package/dist/{chunk-85xjmqq8.js → chunk-r55p44ys.js} +2 -2
- package/dist/{chunk-rnzphmk6.js → chunk-r67bkrmr.js} +2 -2
- package/dist/{chunk-hjnf5kvc.js → chunk-r828rqdv.js} +2 -2
- package/dist/{chunk-b65vdzz3.js → chunk-rawfwgmw.js} +1 -1
- package/dist/{chunk-t6t6hgzx.js → chunk-rg5vskrr.js} +2 -2
- package/dist/{chunk-294gms5s.js → chunk-rmv0t2ee.js} +2 -2
- package/dist/{chunk-0v0mgxb4.js → chunk-rqnvygqy.js} +6 -6
- package/dist/{chunk-k3375qqd.js → chunk-rw9bsnyp.js} +2 -2
- package/dist/chunk-s1z1418w.js +2 -0
- package/dist/{chunk-t0fs5s5v.js → chunk-s4tydqhr.js} +2 -2
- package/dist/chunk-sgy6b5me.js +2 -0
- package/dist/chunk-sk14wfkj.js +2 -0
- package/dist/chunk-sx4fhs54.js +2 -0
- package/dist/{chunk-yvnad5k0.js → chunk-t1yd4a57.js} +1 -1
- package/dist/{chunk-ak0k5vg6.js → chunk-tc85dd04.js} +1 -1
- package/dist/{chunk-sc57jf2x.js → chunk-tjhwk02y.js} +1 -1
- package/dist/{chunk-hxhptw6e.js → chunk-v2bbgpvw.js} +2 -2
- package/dist/{chunk-0yvbqccv.js → chunk-vdeh7n7d.js} +2 -2
- package/dist/chunk-vmcxp5e2.js +2 -0
- package/dist/{chunk-abwjd5yv.js → chunk-vpt3vyfc.js} +2 -2
- package/dist/{chunk-x4jqabfz.js → chunk-vvk1knxf.js} +1 -1
- package/dist/{chunk-18mgzmdc.js → chunk-vxm45kym.js} +2 -2
- package/dist/{chunk-c0ac9k7h.js → chunk-vyf9wx2w.js} +2 -2
- package/dist/{chunk-989btr3w.js → chunk-wp673je0.js} +1 -1
- package/dist/{chunk-5ar229ya.js → chunk-wqrn3428.js} +1 -1
- package/dist/{chunk-hzxyj69n.js → chunk-wzjq9j6g.js} +3 -3
- package/dist/{chunk-2407f23n.js → chunk-x66yhg5y.js} +2 -2
- package/dist/{chunk-ncekagm6.js → chunk-xjtqdp82.js} +1 -1
- package/dist/{chunk-jg1ntm7n.js → chunk-xv3qen27.js} +2 -2
- package/dist/{chunk-b91ggk46.js → chunk-y0ppdmcv.js} +2 -2
- package/dist/{chunk-t3ew92b3.js → chunk-y8qmxd0j.js} +2 -2
- package/dist/{chunk-2pha46d9.js → chunk-ybwgmphj.js} +1 -1
- package/dist/{chunk-5hv3f2z9.js → chunk-zbnjrtye.js} +5 -5
- package/dist/{chunk-dwwpe6se.js → chunk-zse2yz8e.js} +3 -3
- 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/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/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/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.d.ts +1 -2
- 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.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/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/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.d.ts +1 -0
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/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.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/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 +1 -1
- package/dist/chunk-0bcmb1tj.js +0 -4
- package/dist/chunk-0j0xezr5.js +0 -2
- package/dist/chunk-2qhzvpzz.js +0 -2
- package/dist/chunk-31x6chk8.js +0 -2
- package/dist/chunk-4hj619eb.js +0 -2
- package/dist/chunk-5d0a5ykg.js +0 -2
- package/dist/chunk-6ceybn6m.js +0 -3
- package/dist/chunk-8b8hc0b7.js +0 -2
- package/dist/chunk-8pktp9pc.js +0 -2
- package/dist/chunk-9fbkfhsv.js +0 -2
- package/dist/chunk-aprxk7c2.js +0 -2
- package/dist/chunk-asyfbagd.js +0 -3
- package/dist/chunk-b9m454cd.js +0 -2
- package/dist/chunk-bjg1zasm.js +0 -2
- package/dist/chunk-bztgv33r.js +0 -2
- package/dist/chunk-cyatvpv4.js +0 -2
- package/dist/chunk-dp8pjv6r.js +0 -2
- package/dist/chunk-e0n346aa.js +0 -2
- package/dist/chunk-fcqkxfv3.js +0 -2
- package/dist/chunk-g5tsnsqt.js +0 -2
- package/dist/chunk-jhe1aqmm.js +0 -2
- package/dist/chunk-jsjgymb4.js +0 -2
- package/dist/chunk-m8djwdd5.js +0 -2
- package/dist/chunk-mvv28374.js +0 -2
- package/dist/chunk-ncwd36vj.js +0 -2
- package/dist/chunk-nfeea6s7.js +0 -4
- package/dist/chunk-nfwmx8by.js +0 -2
- package/dist/chunk-pth2ajxw.js +0 -2
- package/dist/chunk-qpc4ca5y.js +0 -2
- package/dist/chunk-s6k9sg4g.js +0 -2
- package/dist/chunk-sgy0gbar.js +0 -2
- package/dist/chunk-ssmhqn6a.js +0 -2
- package/dist/chunk-szanfktp.js +0 -2
- package/dist/chunk-tjbn0y8j.js +0 -2
- package/dist/chunk-vc5nsece.js +0 -2
- package/dist/chunk-ve686fw1.js +0 -2
- package/dist/chunk-ysc51tpb.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function
|
|
2
|
-
export{
|
|
1
|
+
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function qt(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function So(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=qt(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
|
|
2
|
+
export{qt,So};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,r}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{s,r}from"./chunk-fw3emcqw.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function kr(e,o){let a=s(),c=r((t)=>t.connection),i=r((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=r((t)=>v(t.sessions[e]?.items)),f=r((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await a.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(o==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[a,e,c,f,i,o]),i?u:p??u}
|
|
2
|
+
export{kr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-3g8ck68k.js";import{e}from"./chunk-6kn920c5.js";import{Cn}from"./chunk-4ecdn9z1.js";import{he,ve,xe,ye}from"./chunk-anshr0mw.js";import{n,b}from"./chunk-sgy6b5me.js";import{Loader2Icon as f}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function Ke({session:t,timeline:c}){let{host:s,client:a}=n(),{t:r}=s,l=o((y)=>y.historyPages[t.id]?.cursor!=null),d=()=>b(s,a.open(t.id,t.cwd)),p=i(Cn,{...c,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(f,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(he,{className:"flex-1",children:[m(ve,{children:[i(xe,{children:r("conversation.reopen")}),i(ye,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!l)return i(he,{className:"flex-1",children:m(ve,{children:[i(xe,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(ye,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{Ke};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Rt}from"./chunk-cc6vp2sg.js";async function Yn(i,c){let s=new WeakSet;while(!c.aborted){let r=Array.from(i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')).filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function dt(i,c){if(!c)return[];let s=[],r="",e=[],o=()=>{let t=0,n=0;for(let{start:a,end:l}of Rt(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<l)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,l-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let l=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+l.length}),r+=l;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){o();return}if(t.tagName==="BR"){o();return}let n=m.has(t.tagName);if(n)o();for(let a of t.childNodes)u(a);if(n)o()};return u(i),o(),s}
|
|
2
|
+
export{Yn,dt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tooltip as i}from"@base-ui/react/tooltip";import{cn as l}from"cn";import{jsx as o,jsxs as p}from"react/jsx-runtime";function
|
|
1
|
+
import{Tooltip as i}from"@base-ui/react/tooltip";import{cn as l}from"cn";import{jsx as o,jsxs as p}from"react/jsx-runtime";function Ni({delay:t=0,...e}){return o(i.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function be({...t}){return o(i.Root,{"data-slot":"tooltip",...t})}function we({...t}){return o(i.Trigger,{"data-slot":"tooltip-trigger",...t})}function ke({className:t,side:e="top",sideOffset:a=4,align:d="center",alignOffset:r=0,children:n,...s}){return o(i.Portal,{children:o(i.Positioner,{align:d,alignOffset:r,side:e,sideOffset:a,className:"isolate z-50",children:p(i.Popup,{"data-slot":"tooltip-content",className:l("bg-foreground text-background 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-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm",t),...s,children:[n,o(i.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}export{Ni,be,we,ke};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{co}from"./chunk-951wn2bd.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function Ot({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(co,{src:c,alt:"",onClose:()=>a(!1)})]})}function lo({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e(Ot,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
|
|
2
|
+
export{Ot,lo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var ti=280;function Zn({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 de({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 Et({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 Jn({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 eo({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 to({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{ti,Zn,de,Et,Jn,eo,to};
|
|
@@ -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 wo({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{wo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{jo,Ko}from"./chunk-wqrn3428.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(jo,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(Ko,{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,2 +1,2 @@
|
|
|
1
|
-
import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function co({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
|
|
2
|
+
export{co};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Checkbox as i}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function
|
|
1
|
+
import{Checkbox as i}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function ge({className:r,...a}){return e(i.Root,{"data-slot":"checkbox",className:o("peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:e(i.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e(t,{})})})}export{ge};
|
|
@@ -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 _e="group/trailing";function pe({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function He({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{_e,pe,He};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Zn,de,Et,Jn,eo,to}from"./chunk-8tn17nw7.js";import{forwardRef as ve,useCallback as K,useEffect as he,useImperativeHandle as pe,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var Re=12,X=2,V=800,me=new Map;function He({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:H,onReady:L,children:z}){let h=s(null),[T,_]=F(!1),U=K((m)=>{h.current=m,H(q,m)},[H,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let b=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){b();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),b()});return d.observe(m,{childList:!0,subtree:!0}),()=>d.disconnect()},[L]),re("div",{style:T?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!T||void 0,style:!T&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":T?"":void 0,children:z}),!T&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var Wn=ve(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:H,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},T){let _=s(null),[U,m]=F(z),b=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[b]);let d=ne(()=>me.get(H),[H]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>Zn({entries:x,gapPx:Re,measuredHeightsByKey:j,leadingInsetPx:b?U:z}),[x,j,b,U,z]),fe=ne(()=>{let e=de({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Et({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(fe),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),le=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(le);Y.current=le;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=de({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),xe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),ye=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);he(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=to({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=de({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Jn({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),he(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];me.set(H,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[H]),pe(T,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=eo({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=de({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Et({anchorKey:e,layout:i,previousRange:M}))??de({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,ge=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(ge!==void 0)te.push({entry:ge,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[b&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(He,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:ye,onReady:xe,children:W(e,t)})},e.turnKey))]})});
|
|
2
|
+
export{Wn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-3g8ck68k.js";import{$e,qe,Ve}from"./chunk-rawfwgmw.js";import{n}from"./chunk-sgy6b5me.js";import{x,Y}from"./chunk-jyy20tw1.js";import{hasAccount as M,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{useEffect as W,useState as T}from"react";import{jsx as r,jsxs as u}from"react/jsx-runtime";var m=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),F=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),z=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function O(a,t){let e=Math.min(100,a/t*100),p=e>=90?"text-destructive":e>=70?"text-foreground":"text-muted-foreground";return{pct:e,className:p}}function A(a){let t=x(a.configOptions,"model");return t===void 0?void 0:Y(t)}function gn(a,t){let e=a.windowDurationMins;if(e===null)return t("usage.usage");if(e%1440===0)return t("usage.windowDays",{count:e/1440});return t("usage.windowHours",{count:Math.round(e/60)})}function I(a){let{client:t}=n(),e=o((s)=>a&&s.connection==="ready"&&M(s.agent)),[p,l]=T(null);return W(()=>{if(!e){l(null);return}let s=!0;t.readRateLimits().then((d)=>{if(s)l(d)},()=>{return});let c=t.onRateLimits((d)=>{if(s)l(d)});return()=>{s=!1,c()}},[e,t]),e?p:null}function et({session:a}){let{t}=n().host,e=x(a.configOptions,"model"),p=e!==void 0&&(L(e.options)?e.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===e.currentValue)):!e.currentValue.startsWith("gateway:")&&e.options.some((i)=>i.value===e.currentValue)),l=I(p),{usage:s,lastTurnUsage:c}=a;if(s===null&&c===null)return null;let d=s&&s.size>0?O(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(c?.inputTokens),k=f(c?.outputTokens),g=f(c?.cachedReadTokens),w=f(c?.cachedWriteTokens),S=f(c?.totalTokens)||N+k+g+w,R=N+g,C=R>0?F.format(g/R):t("tokens.notAvailable"),D=[[t("tokens.input"),m.format(N)],[t("tokens.output"),m.format(k)],[t("tokens.cachedRead"),m.format(g)],[t("tokens.cachedWrite"),m.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),m.format(S)]],v=A(a);return u($e,{children:[r(qe,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",d?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),d!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-d.pct/100),transform:"rotate(-90 9 9)"})]}),d!==null&&u("span",{children:[Math.round(d.pct),"%"]})]})}),u(Ve,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[c!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:D.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:m.format(s.used),limit:m.format(s.size),percent:z.format(s.used/s.size*100)})})]}),l!==null&&(l.primary!==null||l.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[l.primary,l.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:gn(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{gn,et};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{a}from"./chunk-46gb51y9.js";import{I}from"./chunk-ckft9abb.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function ue(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let r=[];for(let[c,l]of e.content.entries()){if(!b(l))continue;let o=l.content;if(N(o))r.push({key:`${e.id}:${c}`,src:`data:${o.mimeType};base64,${o.data}`,alt:e.title??""});if(w(o))r.push({key:`${e.id}:${c}`,path:o.uri,alt:o.name})}if(r.length)return r;let i=e.rawInput;if(i!==null&&typeof i==="object"&&"path"in i&&typeof i.path==="string")return[{key:e.id,path:i.path,alt:i.path.split(/[\\/]/).at(-1)??i.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:i,openImage:c,t:l}=a(),[o,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(f);g({});for(let s of u)(s.src!==void 0?Promise.resolve(s.src):s.path!==void 0&&r?r(s.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[s.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[s.key]:{error:!0}}))});return()=>{t=!1}},[f,r,v]);let k=e.flatMap((t)=>{let u=o[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return n("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let s=o[t.key];if(!s)return n("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:n(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in s)return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:n(R,{"aria-hidden":"true"})},t.key);return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=o[d.key];return p&&"src"in p}).length;if(i)i(k,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function po({blocks:e}){let{t:r}=a(),i=e.flatMap(T),[c,l]=I(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((o)=>!o),children:[y("span",{className:"codex-activity-label",children:[n(S,{className:"codex-activity-icon","aria-hidden":"true"}),n("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:i.length})})]}),n(C,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&n(E,{images:i})]})}
|
|
2
|
+
export{ue,po};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Co}from"./chunk-fcyzhbmn.js";import{o}from"./chunk-3g8ck68k.js";import{n,b}from"./chunk-sgy6b5me.js";import{T,x,Y}from"./chunk-jyy20tw1.js";import{isBooleanOption as E,isGroupedSelect as R,isSelectOption as U}from"@nyssance/codex-acp-v2/client";import{Zap as q}from"lucide-react";import{jsx as y}from"react/jsx-runtime";function Je({sessionId:p,options:f,disabled:w,onModelChange:g,onConfigChange:M,defaultGroup:I={id:"models",name:"Models"},catalog:B=(s)=>s,headerAction:G}){let{host:s,client:L}=n(),{t:r}=s,h=o((e)=>Boolean(e.configPending[p])),N=o((e)=>{let a=e.sessions[p];return a?.state==="running"||a?.state==="requires_action"}),t=x(f,"model"),l=x(f,"thought_level"),C=f.filter((e)=>e.configId!=="collaboration_mode"&&(e.category==="model_config"||e.category!=="mode"&&e!==t&&e!==l)),O=C.filter(U),d=C.filter(E);if(!t&&!l&&O.length===0&&d.length===0)return null;let c=(e,a)=>{if(a===e.currentValue)return;b(s,M?M(e.configId,a):L.setConfig(p,e.configId,a))},m=l?T(l):[],k=m.reduce((e,a)=>a.name.length>=e.length?a.name:e,""),z=t?Y(t):r("composer.model"),_=(e)=>({api_id:e.value,label:e.name}),v=B(t&&R(t.options)?t.options.map((e)=>({id:e.groupId,name:e.name,models:e.options.map(_)})):[{...I,models:t?T(t).map(_):[]}]),S=v.flatMap((e)=>e.models),u=S.find((e)=>e.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:z},i=d.find((e)=>e.configId==="fast-mode");return y(Co,{disabled:w||h||N,switching:h,value:{...u,label:u.shortLabel??u.label},compactCatalog:!0,models:S,showModelList:Boolean(t),onChange:(e)=>{if(e.api_id===t?.currentValue)return;if(g)g(e.api_id);else if(t)c(t,e.api_id)},header:{name:t?.name??r("composer.model"),action:G},modelGroups:v,t:r,effortConfig:l&&m.length>0?{name:"Effort",value:l.currentValue,levels:m,sizer:k,onChange:(e)=>c(l,e)}:void 0,selectOptions:O.map((e)=>({id:e.configId,name:e.name,value:e.currentValue,options:T(e).map((a)=>({value:a.value,label:a.name})),onChange:(a)=>c(e,a)})),booleanOptions:[{id:"fast_mode",name:r("composer.fastMode"),currentValue:i?.currentValue??!1,disabled:!i,title:!i?r("composer.fastModeUnsupported"):void 0,icon:y(q,{className:"size-4","aria-hidden":"true"})},...d.filter((e)=>e!==i).map((e)=>({id:e.configId,name:e.name,currentValue:e.currentValue}))],onBooleanChange:(e,a)=>{let V=e==="fast_mode"?i:d.find((P)=>P.configId===e);if(!V)throw Error(`Unknown boolean config: ${e}`);c(V,a)}})}
|
|
2
|
+
export{Je};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{W,j}from"./chunk-1k1e55de.js";import{e}from"./chunk-6kn920c5.js";import{d,u,w,Q,m,k}from"./chunk-et0rpfh9.js";import{l}from"./chunk-1hy64ewz.js";import{Jt,en,tn,Qo,ie}from"./chunk-t1yd4a57.js";import{fe}from"./chunk-64hrczd9.js";import{h,s,r}from"./chunk-fw3emcqw.js";import{me,q,D}from"./chunk-nvya2g1d.js";import{sessionGroup as z}from"@nyssance/codex-acp-v2/client";import{cn as he}from"cn";import{ArchiveIcon as ve,FolderIcon as Y,ListFilterIcon as ge,SearchIcon as xe,Trash2Icon as Z}from"lucide-react";import{useEffect as Se,useRef as ye,useState as f}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function ee({className:v,...n}){return i(Qo,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...n,className:he("max-w-(--available-width) min-w-0 p-1",v)})}function V(v){return v instanceof Error?v.message:String(v)}function Le({children:v}){return i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"flex flex-col gap-8",children:v})})}function br({Scroll:v=Le}){let{t:n,i18n:F}=h(),g=s(),N=r((t)=>t.archivedSessions),A=r((t)=>t.connection),[H,te]=f(""),[C,se]=f("all"),[x,re]=f("all"),[ne,ae]=f(0),[O,G]=f(!0),[_,K]=f(null),[U,R]=f(null),[I,P]=f(!1),S=ye(!1),[T,y]=f(null),[J,E]=f(null),[le,M]=f(!1);Se(()=>{if(A!=="ready")return;let t=!1;G(!0),K(null);async function p(){try{await g.listArchived({reset:!0});let o=new Set;while(!t&&g.state.archivedCursor!==null){let L=g.state.archivedCursor;if(o.has(L))throw Error("Archive pagination returned a repeated cursor");o.add(L),await g.listArchived()}}catch(o){if(!t)K(V(o))}finally{if(!t)G(!1)}}return p(),()=>{t=!0}},[g,A,ne]);let c=r((t)=>t.projectContext),B=!(c!==null&&A==="ready"&&!O&&_===null)||I,b=(t)=>t.title??n("sessionList.untitled"),oe=[...new Set(N.filter((t)=>c&&z(c,t).id!==D).map((t)=>c?z(c,t).id:t.cwd))].toSorted(),ce=H.trim().toLocaleLowerCase(F.language),X=N.filter((t)=>{let p=c?z(c,t).id:null,o=p===D;return b(t).toLocaleLowerCase(F.language).includes(ce)&&(C==="all"||(C==="quick"?o:!o))&&(x==="all"||(x==="quick"?o:p===x))}),de=new Intl.DateTimeFormat(F.language,{dateStyle:"medium",timeStyle:"short"});async function ue(t){if(S.current)return;S.current=!0,P(!0),R(null);try{await g.unarchive(t.sessionId)}catch(p){R(V(p))}finally{S.current=!1,P(!1)}}async function pe(){if(S.current||!T)return;S.current=!0,P(!0),E(null);let t=[],p=[];try{for(let o of T){if(!g.state.archivedSessions.some((L)=>L.sessionId===o.sessionId))continue;try{await g.delete(o.sessionId)}catch(L){t.push(o),p.push(`${b(o)}: ${V(L)}`)}}if(t.length)y(t),E(p.join(`
|
|
2
|
+
`));else y(null)}finally{S.current=!1,P(!1)}}return a("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":n("sessionList.archives.title"),children:[a("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[a("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[i("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:n("sessionList.archives.title")}),a(e,{variant:"destructive",className:"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]",disabled:B||N.length===0,onClick:()=>{E(null),M(!0),y([...N])},children:[i(Z,{"aria-hidden":"true"}),n("sessionList.archives.deleteAll")]})]}),a("div",{className:"flex shrink-0 flex-wrap gap-3",children:[a("div",{className:"relative min-w-48 flex-1",children:[i(xe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(l,{"aria-label":n("sessionList.archives.search"),placeholder:n("sessionList.archives.search"),value:H,onChange:(t)=>te(t.target.value),className:"rounded-md ps-9"})]}),a(Jt,{value:C,onValueChange:(t)=>{if(t===null)throw Error("Archive chat type cannot be empty");se(t)},children:[a(tn,{"aria-label":n("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[i(ge,{"aria-hidden":"true"}),i(en,{children:n(`sessionList.archives.${C==="all"?"allChats":C==="quick"?"quickChats":"projectChats"}`)})]}),a(ee,{children:[i(ie,{value:"all",children:n("sessionList.archives.allChats")}),i(ie,{value:"quick",children:n("sessionList.archives.quickChats")}),i(ie,{value:"project",children:n("sessionList.archives.projectChats")})]})]}),a(Jt,{value:x,onValueChange:(t)=>{if(t===null)throw Error("Archive project filter cannot be empty");re(t)},children:[a(tn,{"aria-label":n("sessionList.archives.project"),className:"w-48 rounded-md",children:[i(Y,{"aria-hidden":"true"}),i(en,{className:"truncate",children:x==="all"?n("sessionList.archives.allProjects"):x==="quick"?n("sessionList.archives.noProject"):q(x,c??void 0)})]}),a(ee,{children:[i(ie,{value:"all",children:n("sessionList.archives.allProjects")}),i(ie,{value:"quick",children:n("sessionList.archives.noProject")}),oe.map((t)=>i(ie,{value:t,title:t,children:q(t,c??void 0)},t))]})]})]}),a(v,{children:[A!=="ready"?i("p",{role:"status",className:"text-muted-foreground",children:n("sessionList.archives.connecting")}):O?a("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[i(fe,{}),n("sessionList.archives.loading")]}):_?i(W,{variant:"destructive",children:a(j,{className:"flex items-center justify-between gap-4",children:[i("span",{children:_}),i(e,{variant:"outline",onClick:()=>ae((t)=>t+1),children:n("sessionList.archives.retry")})]})}):N.length===0?a("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[i(ve,{"aria-hidden":"true",className:"size-8"}),i("p",{children:n("sessionList.archives.empty")})]}):X.length===0?i("p",{className:"text-muted-foreground py-12 text-center",children:n("sessionList.archives.noResults")}):(c?me(X,c):[]).filter(([,t])=>t.length>0).map(([t,p])=>a("section",{className:"flex flex-col gap-3",children:[a("div",{className:"flex items-center justify-between gap-3",children:[a("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:t===D?void 0:t,children:[i(Y,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("span",{className:"truncate",children:t===D?n("sessionList.archives.noProject"):q(t,c??void 0)})]}),i("span",{className:"text-muted-foreground shrink-0 text-sm",children:n("sessionList.archives.count",{count:p.length})})]}),i("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:p.map((o)=>a("article",{"aria-label":b(o),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[a("div",{className:"min-w-0 flex-1 basis-40",children:[i("h3",{className:"truncate text-sm font-medium",title:b(o),children:b(o)}),o.updatedAt!==null&&i("time",{dateTime:o.updatedAt,title:n("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:de.format(new Date(o.updatedAt))})]}),a("div",{className:"flex shrink-0 items-center gap-2",children:[i(e,{variant:"ghost",size:"icon-sm","aria-label":n("sessionList.delete"),title:n("sessionList.delete"),disabled:B,className:"text-muted-foreground hover:text-destructive",onClick:()=>{E(null),M(!1),y([o])},children:i(Z,{"aria-hidden":"true"})}),i(e,{variant:"secondary",size:"sm",disabled:B,onClick:()=>void ue(o),children:n("sessionList.archives.unarchive")})]})]},o.sessionId))})]},t)),U&&i(W,{variant:"destructive",children:i(j,{children:U})})]})]}),i(d,{open:T!==null,onOpenChange:(t)=>{if(!t&&!S.current)y(null)},children:a(u,{showCloseButton:!I,children:[a(w,{children:[i(m,{children:n("sessionList.archives.deleteTitle")}),i(k,{children:n(le?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:T?.length??0})})]}),J&&i(W,{variant:"destructive",children:i(j,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:J})}),a(Q,{children:[i(e,{variant:"outline",disabled:I,onClick:()=>y(null),children:n("sessionList.cancel")}),a(e,{variant:"destructive",className:"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]",disabled:B,onClick:()=>void pe(),children:[I&&i(fe,{}),n("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
|
+
export{br};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ko}from"./chunk-r55p44ys.js";import{n,b}from"./chunk-sgy6b5me.js";import{T,x}from"./chunk-jyy20tw1.js";import{createLucideIcon as C,HandIcon as k,ShieldAlertIcon as w,ShieldCheckIcon as c}from"lucide-react";import{jsx as t}from"react/jsx-runtime";var y=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":c,agent:y,"agent-full-access":w},S={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function Ze({sessionId:u,options:g,disabled:m,onConfigChange:r}){let{host:l,client:f}=n(),{t:a}=l,o=x(g,"mode");if(!o)return null;let s=o.currentValue,p=T(o).map((e)=>{let i=S[e.value];return i?{...e,name:a(`permissionModes.${i}.name`),description:a(`permissionModes.${i}.description`)}:e}),h=p.find((e)=>e.value===s),I=d[s]??c,M=(e)=>{if(e===s)return;b(l,r?r(o.configId,e):f.setConfig(u,o.configId,e))};return t(ko,{value:s,warning:s==="agent-full-access",currentName:h?.name??s,icon:t(I,{className:"size-3.5 shrink-0"}),header:a("permissionModes.heading"),disabled:m,label:a("composer.switchPermissionMode"),onValueChange:M,options:p.map((e)=>{let i=d[e.value]??c,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{Ze};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function
|
|
1
|
+
import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function he({className:e,...t}){return a("div",{"data-slot":"empty",className:n("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",e),...t})}function ve({className:e,...t}){return a("div",{"data-slot":"empty-header",className:n("flex max-w-sm flex-col items-center gap-2",e),...t})}var i=o("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function Ii({className:e,variant:t="default",...r}){return a("div",{"data-slot":"empty-icon","data-variant":t,className:n(i({variant:t,className:e})),...r})}function xe({className:e,...t}){return a("div",{"data-slot":"empty-title",className:n("font-heading text-lg font-medium tracking-tight",e),...t})}function ye({className:e,...t}){return a("div",{"data-slot":"empty-description",className:n("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function Pi({className:e,...t}){return a("div",{"data-slot":"empty-content",className:n("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}export{he,ve,Ii,xe,ye,Pi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,r}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{s,r}from"./chunk-fw3emcqw.js";import{QUICK_CHATS_GROUP as m,sessionGroup as a}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function yr(c){let e=s(),o=r((t)=>t.projectContext),u=c===null?m:o?a(o,{cwd:e.projectPath(c)}).id:null,d=r((t)=>t.sessionList),l=r((t)=>t.connection),i=r((t)=>t.sessionListLoaded),n=r((t)=>t.sessionListError),f=()=>e.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(l==="ready"&&!i&&n===null)e.listSessions().catch(()=>{return})},[e,l,i,n]),{result:L(()=>{if(i&&o)return{status:"ready",sessionRows:d.filter((t)=>a(o,{...t,cwd:e.projectPath(t.cwd)}).id===u).toSorted((t,p)=>(p.updatedAt??"").localeCompare(t.updatedAt??""))};if(n!==null)return{status:"failed",error:n};return{status:"loading"}},[e,d,i,n,u,o]),retry:f}}
|
|
2
|
+
export{yr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
async function
|
|
2
|
-
export{
|
|
1
|
+
async function Ho(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
|
|
2
|
+
export{Ho};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{yt,oe}from"./chunk-n89jvr5q.js";import{_}from"./chunk-2pj3pcc7.js";import{V}from"./chunk-r828rqdv.js";import{ne}from"./chunk-k7wta28t.js";import{_e,pe,He}from"./chunk-9cbpmdqf.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 qo(o){if(o.as==="ul"){let{as:i,className:r,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",r),...a})}let{as:t,className:n,...s}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...s})}function De({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 gt({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-[30px] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function Yt({open:o,onOpenChange:t,tooltip:n,leading:s,label:i,count:r,countLabel:a,active:l=!1,actions:N,headerChildren:f,wrapHeader:u,onHeaderClick:w,children:C}){let b=()=>{w?.(),t(!o)},m=p(_e,"relative flex h-[30px] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),h=d(G,{children:[s!=null&&e(De,{children:s}),f??e(_,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(He,{content:r!==void 0?e(pe,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??r})}):void 0,actions:N})})]}),P=f==null?d("div",{"data-active":l?"":void 0,title:n,className:p(m,oe),onClick:b,onKeyDown:(c)=>{if(c.target!==c.currentTarget)return;if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault(),b()},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]"}),h]}):e("div",{"data-active":l?"":void 0,className:m,children:h});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[u===void 0?P:u(P),o&&e(qo,{className:"mt-0.5",children:C})]})}var H=S(()=>{}),O=S(()=>{});function ft(){return k(O)}function ht(){return k(H)}function vt({active:o=!1,state:t,interruption:n=null,leased:s=!1,media:i,title:r,hoverCard:a,onHoverCardOpenChange:l,subtitle:N,preview:f,listeningPorts:u,onOpenPort:w,accessory:C,meta:b,hint:m,actions:h,className:P,...c}){let y=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(_e,yt,"group/navigation-row focus-visible:outline-ring flex h-[30px] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(f||u!=null&&u.length>0)&&"h-auto min-h-[30px] py-2.5",P),...c,children:[e(De,{children:t!=null?e(V,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(_,{className:p("leading-none",t==="done"&&"font-semibold"),children:r}),N!=null&&e(_,{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((v)=>w?d("button",{type:"button",className:"underline",onPointerDown:(g)=>g.stopPropagation(),onKeyDown:(g)=>g.stopPropagation(),onClick:(g)=>{g.stopPropagation(),w(v)},children:[":",v]},v):d("span",{children:[":",v]},v))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[s&&e(I,{className:"text-muted-foreground size-3"}),e(He,{content:C!=null?e(pe,{children:C}):b??e(pe,{}),actions:h}),m!=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:m})]})]});if(a==null)return y;return e(L,{row:y,onOpenChange:l,children:a})}function L({row:o,children:t,onOpenChange:n}){let[s,i]=R(!1),[r,a]=R(!1),l=s||r;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:s,side:i="inline-end",sideOffset:r=2,align:a="start",alignOffset:l}){return ne(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:r,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:s})})})})]})}
|
|
2
|
+
export{qo,De,gt,Yt,ft,ht,vt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t}from"./chunk-3g8ck68k.js";import{Ue}from"./chunk-vvk1knxf.js";import{e}from"./chunk-6kn920c5.js";import{nt}from"./chunk-7e1m1d9x.js";import{FileIcon as m,XIcon as r}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function fn({mentions:n,onRemove:s}){let{t:i}=t();if(n.length===0)return null;return a("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:n.map((o)=>l(Ue,{variant:"secondary",className:"gap-1 pe-0.5",title:o,children:[a(m,{className:"size-3"}),a("span",{className:"max-w-40 truncate",children:nt(o)}),a(e,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":i("composer.removeMention",{name:nt(o)}),onClick:()=>s(o),children:a(r,{className:"size-3"})})]},o))})}
|
|
2
|
+
export{fn};
|
|
@@ -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 jn(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Qr(){c()}function Kn(){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 Qn(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 hr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Xr(e,n,t,i,o,a){if(a==="none")return;_(o,[hr(e,n,t,i,a)])}function hr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Lr(t,i);return vr(e,n)}function Lr(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 vr(e,n){return y+Dr(e,n)}function Yr(e,n){return D(vr(e,n))}function Dr(e,n){if(n<=l)return _r(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function _r(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 Zr(){return r.context?.state}function Jr(e){return g(e).ready}
|
|
2
|
+
export{jn,Qr,Kn,Qn,Xr,hr,Lr,vr,Yr,Dr,_r,Zr,Jr};
|
|
@@ -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 bt({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 G({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{bt,G};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function oo(r,e){if(!e.running)return{kind:"idle"};if(e.blocked)return{kind:"waiting"};if(e.retrying)return{kind:"retrying"};let t=r.findLast((i)=>i.kind==="tool"&&i.active);if(t)return{kind:"tool",ownerKey:t.key};let n=r.findLast((i)=>i.kind!=="user");if(n?.active){if(n.kind==="answer")return{kind:"speaking",ownerKey:n.key};if(n.kind==="text")return{kind:"thinking",ownerKey:n.key};if(n.kind==="reasoning")return{kind:"reasoning",ownerKey:n.key};if(n.kind==="plan")return{kind:"planning",ownerKey:n.key};if(n.kind==="compaction")return{kind:"tool",ownerKey:n.key}}if(n?.kind==="answer")return{kind:"idle"};return{kind:"thinking",ownerKey:n?.key}}
|
|
2
|
+
export{oo};
|
|
@@ -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 Ye(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{Ye};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function*Rt(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function ei(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of Rt(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
+
export{Rt,ei};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}function R({subject:t,requestTitle:e}){let{host:o}=n();if(!h(t))return null;let r=t.toolCall,s=b(r),i=A(r),c=v(r),a=o.toolTitle?.(r)??r.title;return u("div",{className:"flex flex-col gap-2",children:[a&&a!==e&&s===null&&l("div",{className:"text-sm font-medium",children:a}),s!==null&&u("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[l("span",{className:"text-muted-foreground select-none",children:"$ "}),s]}),i!==null&&l("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:l(Ne,{patch:i,theme:o.theme})}),i===null&&s===null&&c.length>0&&l("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&l("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((p)=>l("li",{className:"truncate font-mono",children:p.path},`${p.path}:${p.line??""}`))})]})}function m(t,e){let{host:o,client:r}=n();return(s)=>{try{if(e)e(t.id,s);else r.respond(t.id,s)}catch(i){if(o.reportError)o.reportError(i);else console.error(i)}}}function T({action:t,total:e,onRespond:o}){let{host:r}=n(),s=m(t,o),i=t.params,c=r.permissionTitle?.(i)??i.title;return u(
|
|
3
|
-
export{
|
|
1
|
+
import{bn}from"./chunk-eg1d1gbc.js";import{pn}from"./chunk-60ks28ef.js";import{yn}from"./chunk-vxm45kym.js";import{Ne}from"./chunk-2879v3ps.js";import{n}from"./chunk-sgy6b5me.js";import{isContentEntry as d,isDiffEntry as f,isFormElicitation as x,isText as g,isToolCallSubject as h,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as l,jsxs as u}from"react/jsx-runtime";function ae(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let o=e.description;return typeof o==="string"?o:null}function b(t){let e=t.rawInput;if(typeof e!=="object"||e===null)return null;let o=e.command;if(typeof o==="string")return o;if(Array.isArray(o))return o.map(String).join(" ");return null}function A(t){for(let e of t.content??[])if(f(e)&&e.patch&&e.patch.text.length>0)return e.patch.text;return null}function v(t){return(t.content??[]).filter(d).map((e)=>g(e.content)?e.content.text:"").filter((e)=>e.length>0).join(`
|
|
2
|
+
`)}function R({subject:t,requestTitle:e}){let{host:o}=n();if(!h(t))return null;let r=t.toolCall,s=b(r),i=A(r),c=v(r),a=o.toolTitle?.(r)??r.title;return u("div",{className:"flex flex-col gap-2",children:[a&&a!==e&&s===null&&l("div",{className:"text-sm font-medium",children:a}),s!==null&&u("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[l("span",{className:"text-muted-foreground select-none",children:"$ "}),s]}),i!==null&&l("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:l(Ne,{patch:i,theme:o.theme})}),i===null&&s===null&&c.length>0&&l("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&l("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((p)=>l("li",{className:"truncate font-mono",children:p.path},`${p.path}:${p.line??""}`))})]})}function m(t,e){let{host:o,client:r}=n();return(s)=>{try{if(e)e(t.id,s);else r.respond(t.id,s)}catch(i){if(o.reportError)o.reportError(i);else console.error(i)}}}function T({action:t,total:e,onRespond:o}){let{host:r}=n(),s=m(t,o),i=t.params,c=r.permissionTitle?.(i)??i.title;return u(bn,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:e,options:i.options.map((a)=>({...a,description:y(a)??void 0})),onRespond:(a)=>s({outcome:a===null?{outcome:"cancelled"}:{outcome:"selected",optionId:a}}),children:[i.description&&l("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&l(R,{subject:i.subject,requestTitle:c})]})}function Ce({action:t,total:e,onRespond:o}){let{host:r}=n(),s=m(t,o);return l(pn,{requestId:t.id,schema:t.params.requestedSchema,message:t.params.message,total:e,t:r.t,onRespond:s})}function Qe({action:t,total:e,onRespond:o}){let{host:r}=n(),s=m(t,o);if(t.kind==="permission")return l(T,{action:t,total:e,onRespond:o});if(ae(t))return l(Ce,{action:t,total:e??1,onRespond:o});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return l(yn,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>s(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
|
+
export{ae,Ce,Qe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{oo}from"./chunk-bq05e911.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function In(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return oo(a,r)}
|
|
2
|
+
export{In};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function Ft(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{Ft};
|
|
@@ -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 bo(){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 Ut(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{bo,Ut};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{wn}from"./chunk-62x983rq.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as i}from"react/jsx-runtime";function
|
|
1
|
+
import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as i}from"react/jsx-runtime";function K({className:r,...a}){return i(d,{"data-slot":"radio-group",className:o("grid w-full gap-3",r),...a})}function E({className:r,...a}){return i(e.Root,{"data-slot":"radio-group-item",className:o("group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:i(e.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:i("span",{className:"bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"})})})}export{K,E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-6kn920c5.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as g}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function d({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function yi({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o})}function $r({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o})}function Yo({...o}){return a(i.Close,{"data-slot":"dialog-close",...o})}function qr({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t})}function u({className:o,children:t,showCloseButton:n=!0,...s}){return l($r,{children:[a(qr,{}),l(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 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 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...s,children:[t,n&&l(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[a(g,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function w({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t})}function Q({className:o,showCloseButton:t=!1,children:n,...s}){return l("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...s,children:[n,t&&a(i.Close,{render:a(e,{variant:"outline"}),children:"Close"})]})}function m({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t})}function k({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t})}export{d,yi,$r,Yo,qr,u,w,Q,m,k};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Qt({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
|
|
2
|
+
export{Qt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{l}from"./chunk-1hy64ewz.js";import{X}from"./chunk-5d94195x.js";import{h}from"./chunk-fw3emcqw.js";import{bt}from"./chunk-bm4s6n8a.js";import{_}from"./chunk-2pj3pcc7.js";import{ft,ht}from"./chunk-b8ywzj88.js";import{formatDistanceToNowStrict as H}from"date-fns";import{enUS as L,zhCN as z}from"date-fns/locale";import{ClockIcon as E,MessageSquareIcon as A}from"lucide-react";import{useEffect as g,useState as D}from"react";import{jsx as o,jsxs as C,Fragment as w}from"react/jsx-runtime";var S={en:L,"zh-CN":z};function Le(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return H(new Date(t),{locale:r})}function pt({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:y,PathAction:u}=h(),f=ht(),I=ft();g(()=>{f(n)},[n,f]);let[x,p]=D(t.title??"");g(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?Le(t.updatedAt,y.language):null,v=[];if(N!==null)v.push({icon:o(E,{className:"size-3.5"}),text:N});let s=u&&o(u,{cwd:t.cwd,onOpened:I});return o(bt,{title:n?o(l,{autoFocus:!0,value:x,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):C("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(_,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(A,{className:"size-3.5"}),details:v,actions:s||a!==void 0?C(w,{children:[s,s&&a!==void 0&&o(X,{}),a]}):void 0})}
|
|
2
|
+
export{Le,pt};
|