@alwith/module-chat 0.5.5 → 0.5.6
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-mzc51shd.js → chunk-0d8k5bmd.js} +2 -2
- package/dist/{chunk-6bdd2cgs.js → chunk-0fvpmcps.js} +2 -2
- package/dist/{chunk-76fxyvb0.js → chunk-0grd0g0x.js} +2 -2
- package/dist/chunk-0hpww4x3.js +2 -0
- package/dist/{chunk-3d58k7fn.js → chunk-0k654tyt.js} +2 -2
- package/dist/{chunk-3zj0ka21.js → chunk-0mf7yh69.js} +2 -2
- package/dist/chunk-0rxpyf0k.js +2 -0
- package/dist/{chunk-dhvpffgf.js → chunk-17wjmyj7.js} +2 -2
- package/dist/{chunk-11v81zha.js → chunk-1drkvxzk.js} +1 -1
- package/dist/{chunk-p0ebmb2m.js → chunk-1txn4b0v.js} +1 -1
- package/dist/{chunk-rmv0t2ee.js → chunk-2s4y2v50.js} +2 -2
- package/dist/{chunk-q53h2y2a.js → chunk-2ysnmwx1.js} +2 -2
- package/dist/{chunk-tjykfxrd.js → chunk-3nj26hhf.js} +2 -2
- package/dist/{chunk-r8k9jd0z.js → chunk-3ryhmzsq.js} +2 -2
- package/dist/{chunk-34xzrr3s.js → chunk-3wsg6710.js} +2 -2
- package/dist/{chunk-zw2q13qg.js → chunk-3x1eq95a.js} +2 -2
- package/dist/{chunk-42fw8maa.js → chunk-470vq7d1.js} +1 -1
- package/dist/{chunk-f3xhtnkz.js → chunk-4jagfjhm.js} +2 -2
- package/dist/chunk-4pbh3fph.js +2 -0
- package/dist/{chunk-k6b4cf05.js → chunk-5s2wpbdt.js} +1 -1
- package/dist/chunk-5t3rrnfd.js +2 -0
- package/dist/{chunk-y6v59cgf.js → chunk-5wyxvpgt.js} +1 -1
- package/dist/{chunk-0jw4ffzj.js → chunk-61vxy6yd.js} +1 -1
- package/dist/chunk-65ajc856.js +2 -0
- package/dist/chunk-65jedxc3.js +4 -0
- package/dist/{chunk-z79xmq12.js → chunk-68y66m3v.js} +2 -2
- package/dist/{chunk-v8rqevms.js → chunk-69yx37pv.js} +3 -3
- package/dist/chunk-6d38ff76.js +2 -0
- package/dist/{chunk-5s5tedyw.js → chunk-6j4g51ff.js} +2 -2
- package/dist/chunk-6pq1xmwg.js +2 -0
- package/dist/chunk-6vqnsdgc.js +2 -0
- package/dist/chunk-6ym3w4kf.js +2 -0
- package/dist/{chunk-1v3wc4cv.js → chunk-76tkqx9n.js} +2 -2
- package/dist/{chunk-48av28r4.js → chunk-78ew0821.js} +5 -5
- package/dist/chunk-7e1m1d9x.js +2 -0
- package/dist/chunk-88vkk9s3.js +2 -0
- package/dist/{chunk-at0v48cp.js → chunk-8bzk9e4v.js} +2 -2
- package/dist/{chunk-ez1ac611.js → chunk-8fn5n4yv.js} +2 -2
- package/dist/{chunk-85gdavf5.js → chunk-8p0074ye.js} +2 -2
- package/dist/{chunk-kc9rzb07.js → chunk-91trh8rj.js} +2 -2
- package/dist/{chunk-2q71dv8k.js → chunk-93q2dm10.js} +1 -1
- package/dist/{chunk-m92evp24.js → chunk-94k9byb1.js} +2 -2
- package/dist/{chunk-tp5y8cc7.js → chunk-9c41y5hw.js} +2 -2
- package/dist/{chunk-rd2n48s1.js → chunk-9eh80kxk.js} +2 -2
- package/dist/{chunk-0vy9fzs3.js → chunk-a2ftkzak.js} +1 -1
- package/dist/{chunk-qsqyf4y3.js → chunk-acrrwrzy.js} +2 -2
- package/dist/{chunk-y8qmxd0j.js → chunk-an03g9e8.js} +2 -2
- package/dist/{chunk-fv7tp8pr.js → chunk-bwas6kp2.js} +2 -2
- package/dist/{chunk-ta45etnd.js → chunk-c6w4bp15.js} +1 -1
- package/dist/{chunk-jtafw6h4.js → chunk-cywx4qmv.js} +2 -2
- package/dist/chunk-d2rrvka6.js +2 -0
- package/dist/chunk-dcxprfnp.js +2 -0
- package/dist/{chunk-wthttnkz.js → chunk-dsdxw9s8.js} +2 -2
- package/dist/{chunk-5w48y2ad.js → chunk-ehh31hzz.js} +1 -1
- package/dist/{chunk-hw5n7sqm.js → chunk-epqjzw63.js} +2 -2
- package/dist/{chunk-9d0vkezs.js → chunk-fzetrkvd.js} +2 -2
- package/dist/chunk-gb2dmt6b.js +2 -0
- package/dist/{chunk-mwkr9pvg.js → chunk-gmhbqxcg.js} +2 -2
- package/dist/{chunk-q989x2x5.js → chunk-gsq8mzr7.js} +2 -2
- package/dist/{chunk-h2nvgcbs.js → chunk-gtddnhdy.js} +2 -2
- package/dist/chunk-gwav4k8b.js +2 -0
- package/dist/{chunk-w3z37qwe.js → chunk-gy63n5pz.js} +2 -2
- package/dist/chunk-h05s12jn.js +3 -0
- package/dist/chunk-hf65xscb.js +2 -0
- package/dist/{chunk-9mcfd41e.js → chunk-hhw1pjz6.js} +2 -2
- package/dist/{chunk-tv9wdbxr.js → chunk-hjm26kwf.js} +1 -1
- package/dist/chunk-hmj7yqyb.js +3 -0
- package/dist/{chunk-h3s5e0c5.js → chunk-hmze7f10.js} +2 -2
- package/dist/{chunk-812n3qd8.js → chunk-hrexfky6.js} +2 -2
- package/dist/{chunk-494jkxv9.js → chunk-jd61cfkk.js} +2 -2
- package/dist/{chunk-jhxjbpt3.js → chunk-jwb3723b.js} +2 -2
- package/dist/chunk-k2zg8xva.js +2 -0
- package/dist/chunk-kg1gk77d.js +2 -0
- package/dist/chunk-kh1tc15g.js +2 -0
- package/dist/{chunk-wpx2bvd0.js → chunk-m4mfw5s4.js} +7 -7
- package/dist/{chunk-0h993cve.js → chunk-m5jhw1e6.js} +2 -2
- package/dist/{chunk-x8vd2d2g.js → chunk-mgt5j803.js} +1 -1
- package/dist/chunk-mj5720c4.js +2 -0
- package/dist/chunk-mv8jmv1e.js +2 -0
- package/dist/chunk-n3m7t85x.js +2 -0
- package/dist/{chunk-8fd8jhbf.js → chunk-n4cseazv.js} +3 -3
- package/dist/{chunk-cka09jf6.js → chunk-nb5wjv92.js} +2 -2
- package/dist/{chunk-kjtd3wc3.js → chunk-nx91ewps.js} +1 -1
- package/dist/{chunk-haf9qn5a.js → chunk-p2s04v76.js} +2 -2
- package/dist/{chunk-key9msc9.js → chunk-pkgrt90z.js} +2 -2
- package/dist/{chunk-m3cbbk3v.js → chunk-py1t2v6e.js} +2 -2
- package/dist/{chunk-5nemwzzv.js → chunk-q3hdevem.js} +2 -2
- package/dist/{chunk-sq5zstzq.js → chunk-q4y1q1na.js} +2 -2
- package/dist/{chunk-tcgx9yxg.js → chunk-q98941j2.js} +2 -2
- package/dist/{chunk-ygebvrv5.js → chunk-qbdqh38y.js} +1 -1
- package/dist/chunk-qbj5s8qa.js +2 -0
- package/dist/{chunk-5xjm1hab.js → chunk-qgfq5vrz.js} +1 -1
- package/dist/chunk-qqdca2rm.js +2 -0
- package/dist/{chunk-cbbr9m3a.js → chunk-r7c0tca8.js} +2 -2
- package/dist/chunk-r8z8f31m.js +2 -0
- package/dist/{chunk-v958q8hh.js → chunk-rd94eyan.js} +2 -2
- package/dist/{chunk-1mnc7200.js → chunk-rdtj6bad.js} +2 -2
- package/dist/{chunk-gdhkb2rz.js → chunk-rgkhm4s4.js} +2 -2
- package/dist/{chunk-xf91jp39.js → chunk-rkqe8p8n.js} +2 -2
- package/dist/chunk-s44rx1sz.js +3 -0
- package/dist/{chunk-w9nr7saa.js → chunk-scddkjv8.js} +1 -1
- package/dist/{chunk-nhsbjys5.js → chunk-sj7jdb7m.js} +1 -1
- package/dist/chunk-spt7tnqx.js +2 -0
- package/dist/{chunk-mme37xva.js → chunk-sqh158m4.js} +1 -1
- package/dist/{chunk-w522gwhm.js → chunk-syv6gady.js} +2 -2
- package/dist/{chunk-6jyd3a7v.js → chunk-tpx841s3.js} +2 -2
- package/dist/{chunk-raz9hb3h.js → chunk-ttdxc6mg.js} +5 -5
- package/dist/{chunk-91qp7sps.js → chunk-ttk21631.js} +2 -2
- package/dist/{chunk-bje0nmh9.js → chunk-twwqgd8e.js} +2 -2
- package/dist/{chunk-p8n6rm5h.js → chunk-tzjk7zkc.js} +2 -2
- package/dist/{chunk-t9nky8ka.js → chunk-v5wwv2t9.js} +3 -3
- package/dist/{chunk-b0v983ch.js → chunk-wf4tq3fn.js} +1 -1
- package/dist/{chunk-39f0d44a.js → chunk-wjs8bwpk.js} +2 -2
- package/dist/{chunk-xnmjg8r1.js → chunk-x053g6f2.js} +2 -2
- package/dist/chunk-xf14bg2v.js +4 -0
- package/dist/{chunk-jh46xzr6.js → chunk-xfjcwypy.js} +3 -3
- package/dist/{chunk-kk2nr6dd.js → chunk-xp0nfvxg.js} +2 -2
- package/dist/{chunk-9yv5c2s3.js → chunk-xw0gvwh5.js} +2 -2
- package/dist/{chunk-t794afpy.js → chunk-y438yezf.js} +3 -3
- package/dist/{chunk-3p9j3gmw.js → chunk-y6r6tzfh.js} +2 -2
- package/dist/{chunk-ap1br099.js → chunk-yegh80h4.js} +2 -2
- package/dist/{chunk-c7b8rscf.js → chunk-yf2p44mq.js} +2 -2
- package/dist/{chunk-ad32h099.js → chunk-yg42bpjr.js} +3 -3
- package/dist/{chunk-xttthm0n.js → chunk-z3e38981.js} +2 -2
- package/dist/{chunk-eyqbvc19.js → chunk-z4zm74ge.js} +2 -2
- package/dist/{chunk-mxj4s2r8.js → chunk-z75zbdq8.js} +1 -1
- package/dist/{chunk-p2khnrm1.js → chunk-zc2hdmk1.js} +2 -2
- package/dist/{chunk-1q1hyka4.js → chunk-zjg9n6zj.js} +2 -2
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.d.ts +2 -0
- 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.d.ts +2 -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.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.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.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/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/tooltip.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-00sds3wb.js +0 -2
- package/dist/chunk-1dce9zt8.js +0 -2
- package/dist/chunk-1mv3y3cs.js +0 -2
- package/dist/chunk-1tz8afx9.js +0 -2
- package/dist/chunk-29wvjf38.js +0 -2
- package/dist/chunk-2w9f1q84.js +0 -4
- package/dist/chunk-52y4pyr1.js +0 -2
- package/dist/chunk-7w4tjrdw.js +0 -2
- package/dist/chunk-8w6ze6pw.js +0 -4
- package/dist/chunk-932ykb37.js +0 -2
- package/dist/chunk-azp1438s.js +0 -2
- package/dist/chunk-bafntrka.js +0 -3
- package/dist/chunk-bse4zh1d.js +0 -2
- package/dist/chunk-bx1x7t6v.js +0 -3
- package/dist/chunk-dgx31pdr.js +0 -2
- package/dist/chunk-dkbtw3g9.js +0 -2
- package/dist/chunk-f59aepmd.js +0 -2
- package/dist/chunk-gdbzk1kt.js +0 -2
- package/dist/chunk-hd682pax.js +0 -2
- package/dist/chunk-jf5651fz.js +0 -2
- package/dist/chunk-jmcb7an2.js +0 -2
- package/dist/chunk-n514z4we.js +0 -2
- package/dist/chunk-n6xa65sp.js +0 -2
- package/dist/chunk-qqv0bewt.js +0 -2
- package/dist/chunk-r22h488a.js +0 -3
- package/dist/chunk-s1vxbxzr.js +0 -2
- package/dist/chunk-s3mx42dt.js +0 -2
- package/dist/chunk-seg9xzjy.js +0 -2
- package/dist/chunk-vmywavgm.js +0 -2
- package/dist/chunk-w5wzxdbk.js +0 -2
- package/dist/chunk-xrek8rbm.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v}from"./chunk-y6r6tzfh.js";import{U}from"./chunk-rkqe8p8n.js";import{isPlanItems as n,isPlanMarkdown as r}from"@alwith/api";import{jsx as e}from"react/jsx-runtime";function Ho({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(v,{text:t.content,streaming:!1})});if(!n(t))return null;return e(U,{entries:t.entries})}
|
|
2
|
+
export{Ho};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g,s,kt,r,S}from"./chunk-gb2dmt6b.js";import{H}from"./chunk-r7c0tca8.js";import{yt}from"./chunk-bwas6kp2.js";import{pt}from"./chunk-pkgrt90z.js";import{He,gt}from"./chunk-qqdca2rm.js";import{hasRename as F}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as D,ArchiveRestoreIcon as A,GitForkIcon as N,PencilIcon as x,Trash2Icon as R}from"lucide-react";import{useRef as B,useState as y}from"react";import{jsx as n,jsxs as b,Fragment as C}from"react/jsx-runtime";function Bt({sessionRow:e,active:f,onSelect:u,onForked:p=u,onHoverCardOpenChange:a,actions:c}){let i=g(),{t:m,i18n:v}=i,k=s(),l=r((o)=>o.runStates[e.sessionId]),h=kt(),d=()=>u(e);return n(yt,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:f,onClick:d,onKeyDown:(o)=>{if(o.key==="Enter"||o.key===" ")o.preventDefault(),d()},state:l?.state,interruption:l?.interruption??null,title:e.title??m("sessionList.untitled"),onHoverCardOpenChange:a,hoverCard:n(E,{sessionRow:e,onDelete:()=>h(e),onForked:p,actions:c}),meta:e.updatedAt!==null?n("span",{className:"text-muted-foreground shrink-0 text-xs",children:He(e.updatedAt,v.language)}):void 0,actions:l!=null?n(pt,{title:m("sessionList.stop"),onStop:()=>S(i,k.stopSession(e.sessionId))}):void 0})}function E({sessionRow:e,onDelete:f,onForked:u,actions:p}){let a=g(),{t:c}=a,i=s(),m=r((t)=>F(t.agent)),v=r((t)=>t.connection==="ready"&&t.agent?.capabilities?.session?.fork!=null),[k,l]=y(!1),[h,d]=y(!1),o=B(!1);return n(gt,{sessionRow:e,renaming:k,onRename:(t)=>{if(l(!1),t!==null)S(a,i.renameSession(e.sessionId,t))},actions:b(C,{children:[m&&n(H,{icon:n(x,{}),label:c("sessionList.rename"),onClick:()=>l(!0)}),p,e.archived?n(H,{icon:n(A,{}),label:c("sessionList.unarchive"),onClick:()=>void S(a,i.unarchive(e.sessionId))}):b(C,{children:[n(H,{icon:n(N,{}),label:c("sessionList.fork"),disabled:!v||h,onClick:()=>{if(o.current)return;o.current=!0,d(!0),S(a,i.fork(e.sessionId,e.cwd).then((t)=>{let I=i.state.sessionList.find((L)=>L.sessionId===t);if(!I)throw Error("Forked chat is missing from the session list");u(I)}).finally(()=>{o.current=!1,d(!1)}))}}),n(H,{icon:n(D,{}),label:c("sessionList.archive"),onClick:()=>void S(a,i.archive(e.sessionId))})]}),n(H,{variant:"destructive",icon:n(R,{}),label:c("sessionList.delete"),onClick:f})]})})}
|
|
2
|
+
export{Bt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-6d38ff76.js";import{e}from"./chunk-cg97byvk.js";import{go}from"./chunk-n3m7t85x.js";import{oe,re,ie,ae}from"./chunk-qgfq5vrz.js";import{n,b}from"./chunk-76tkqx9n.js";import{Loader2Icon as y}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function Ve({session:t,timeline:l}){let{host:s,client:a}=n(),{t:r}=s,c=o((f)=>f.historyPages[t.id]?.cursor!=null),d=()=>b(s,a.open(t.id,t.cwd)),p=i(go,{...l,session:t,client:a,host:s});if(t.restoring)return t.items.length===0?m("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[i(y,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(oe,{className:"flex-1",children:[m(re,{children:[i(ie,{children:r("conversation.reopen")}),i(ae,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!c)return i(oe,{className:"flex-1",children:m(re,{children:[i(ie,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(ae,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{Ve};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{J}from"./chunk-6d38ff76.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function lt({host:o,client:e,children:t}){let s=a(()=>({host:o,client:e}),[o,e]);return r(J,{host:o,client:e,children:r(i,{value:s,children:t})})}function n(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function b(o,e){e.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
|
|
2
|
+
export{lt,n,b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function
|
|
3
|
-
`)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function
|
|
4
|
-
${d}`:d;else s.set(r,{path:r,patch:d,...c})}}return[...s.values()]}function
|
|
5
|
-
export{
|
|
1
|
+
import{Zt}from"./chunk-yg42bpjr.js";import{t}from"./chunk-6d38ff76.js";import{isDiffEntry as p}from"@alwith/api";import{jsx as f,jsxs as g,Fragment as h}from"react/jsx-runtime";function Dr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
|
|
2
|
+
`,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function _r(o){let s=new Map,e=null;for(let n of o.split(`
|
|
3
|
+
`)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Hr(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?_r(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let c=u(i,r),d=n.patch?Dr(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=c.additions,l.deletions+=c.deletions,l.patch=l.patch?`${l.patch}
|
|
4
|
+
${d}`:d;else s.set(r,{path:r,patch:d,...c})}}return[...s.values()]}function Io({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return f(Zt,{files:Hr(o),onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[f(n,{path:i.path,className:"codex-edited-file-icon"}),f("span",{className:"codex-edited-file-name",children:i.path})]})})}
|
|
5
|
+
export{Dr,_r,Hr,Io};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-6d38ff76.js";import{ne,Pe,st}from"./chunk-n4cseazv.js";import{jsx as n,jsxs as m,Fragment as r}from"react/jsx-runtime";var c=[];function at({sessionId:s}){let e=o((i)=>i.actions),l=e.some((i)=>i.sessionId===s)?e.filter((i)=>i.sessionId===s):c,t=l.filter(ne),a=l.filter((i)=>!ne(i));return m(r,{children:[a.length>0&&n("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:a.map((i)=>n(st,{action:i},i.id))}),t[0]!==void 0&&n(Pe,{action:t[0],total:t.length},t[0].id)]})}
|
|
2
|
+
export{at};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{o}from"./chunk-6d38ff76.js";import{Re,Me,Ee}from"./chunk-sqh158m4.js";import{n}from"./chunk-76tkqx9n.js";import{y,G}from"./chunk-9c41y5hw.js";import{hasAccount as D}from"@nyssance/codex-acp-v2/client";import{cn as M}from"cn";import{useEffect as C,useState as L}from"react";import{jsx as a,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),H=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),T=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function p(e){return typeof e==="number"&&!Number.isNaN(e)?Math.max(0,e):0}function W(e,t){let r=Math.min(100,e/t*100),s=r>=90?"text-destructive":r>=70?"text-foreground":"text-muted-foreground";return{pct:r,className:s}}function F(e){let t=y(e.configOptions,"model");return t===void 0?void 0:G(t)}function bn(e,t){let r=e.windowDurationMins;if(r===null)return t("usage.usage");if(r%1440===0)return t("usage.windowDays",{count:r/1440});return t("usage.windowHours",{count:Math.round(r/60)})}function z(){let{client:e}=n(),t=o((i)=>i.connection==="ready"&&D(i.agent)),[r,s]=L(null);return C(()=>{if(!t){s(null);return}let i=!0;e.readRateLimits().then((m)=>{if(i)s(m)},()=>{return});let l=e.onRateLimits((m)=>{if(i)s(m)});return()=>{i=!1,l()}},[t,e]),r}function Ke({session:e}){let{t}=n().host,r=z(),{usage:s,lastTurnUsage:i}=e;if(s===null&&i===null)return null;let l=s&&s.size>0?W(s.used,s.size):null,m=7,N=2*Math.PI*m,x=p(i?.inputTokens),h=p(i?.outputTokens),f=p(i?.cachedReadTokens),v=p(i?.cachedWriteTokens),b=p(i?.totalTokens)||x+h+f+v,k=x+f,w=k>0?H.format(f/k):t("tokens.notAvailable"),R=[[t("tokens.input"),d.format(x)],[t("tokens.output"),d.format(h)],[t("tokens.cachedRead"),d.format(f)],[t("tokens.cachedWrite"),d.format(v)],[t("tokens.cacheHitRate"),w],[t("tokens.total"),d.format(b)]],g=F(e);return u(Re,{children:[a(Me,{delay:100,closeDelay:100,render:u("button",{type:"button",className:M("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",l?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[a("circle",{cx:"9",cy:"9",r:m,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),l!==null&&a("circle",{cx:"9",cy:"9",r:m,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:N,strokeDashoffset:N*(1-l.pct/100),transform:"rotate(-90 9 9)"})]}),l!==null&&u("span",{children:[Math.round(l.pct),"%"]})]})}),u(Ee,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[g!==void 0&&a("div",{className:"border-b px-3 py-2",children:a("p",{className:"text-foreground truncate text-xs font-semibold",title:g,children:g})}),u("div",{className:"flex flex-col gap-3 p-3",children:[i!==null&&u("div",{className:"flex flex-col gap-1.5",children:[a("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),a("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:R.map(([c,S])=>u("div",{className:"contents",children:[a("dt",{className:"text-muted-foreground",children:c}),a("dd",{className:"text-end tabular-nums",children:S})]},c))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[a("p",{className:"text-xs font-medium",children:t("tokens.context")}),a("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:T.format(s.used/s.size*100)})})]}),r!==null&&(r.primary!==null||r.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[a("p",{className:"text-xs font-medium",children:t("usage.limits")}),a("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[r.primary,r.secondary].filter((c)=>c!==null).map((c)=>u("div",{className:"contents",children:[a("dt",{className:"text-muted-foreground",children:bn(c,t)}),a("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,c.usedPercent)))})})]},`${c.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{bn,Ke};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function Uo(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
|
|
2
|
+
export{Uo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Fo}from"./chunk-q4y1q1na.js";import{isPlanItems as o}from"@alwith/api";function Oo(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 Fo(a,r)}
|
|
2
|
+
export{Oo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{o}from"./chunk-6d38ff76.js";import{n}from"./chunk-76tkqx9n.js";import{isBooleanOption as T,isSelectOption as w}from"@alwith/api";import{codexExtensionCapabilities as j,codexTurnId as B,composerPrediction as F}from"@nyssance/codex-acp-v2/client";import{useEffect as b,useRef as C,useState as P}from"react";function Ze(t,g,c,y){let{client:S}=n(),R=o((e)=>j(e.agent).composerPredictions),k=t.items.findLast((e)=>e.kind==="user"),i=B(k?._meta),O=t.configOptions.flatMap((e)=>w(e)||T(e)?[[e.configId,e.currentValue]]:[]).sort(([e],[u])=>String(e).localeCompare(String(u))),r=JSON.stringify([t.id,i,O]),s=F(t._meta),d=t._meta?.codex,m=typeof d==="object"&&d!==null&&"prediction"in d?d.prediction:null,l=C(null),f=C(!1);b(()=>(f.current=!0,()=>{f.current=!1}),[]);let[a,_]=P(null),[v,x]=P(null),p=y&&R&&g&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!k?.replayed&&i!==null;b(()=>{if(!p||c||a===r||l.current?.key===r||i===null)return;let e={key:r,previousResult:m};l.current=e,x(null),S.requestPrediction(t.id,i).catch((u)=>{if(f.current&&l.current===e)x({key:r,message:u instanceof Error?u.message:String(u)})})},[S,p,c,a,r,m,t.id,i]);let I=p&&!c&&a!==r&&l.current?.key===r&&l.current.previousResult!==m&&s?.sourceTurnId===i,q=I&&s.result.type==="completed"?s.result.text:null,E=y&&g&&t.state==="idle"&&!c&&a!==r?v?.key===r?v.message:I&&s.result.type==="failed"?"Prediction failed":null:null;return{text:q,error:E,invalidate:()=>{if(p)_(r)}}}
|
|
2
|
+
export{Ze};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as e}from"cn";import{jsx as o}from"react/jsx-runtime";function
|
|
1
|
+
import{cn as e}from"cn";import{jsx as o}from"react/jsx-runtime";function Un({className:t,...n}){return o("kbd",{"data-slot":"kbd",className:e("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",t),...n})}function ei({className:t,...n}){return o("kbd",{"data-slot":"kbd-group",className:e("inline-flex items-center gap-1",t),...n})}export{Un,ei};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as r}from"@alwith/api/client";var
|
|
2
|
-
export{
|
|
1
|
+
import{createStore as r}from"@alwith/api/client";var Yt=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function Co(e){Yt.setState({...e,terminals:e.terminals??{}})}function To(e){if(Yt.getState().sessionId===e)Yt.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function bi(e,t,n){let i=Yt.getState();if(n.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(t,void 0,{align:"top"})}
|
|
2
|
+
export{Yt,Co,To,bi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isGroupedSelect as i,isSelectOption as o}from"@alwith/api";function
|
|
2
|
-
export{
|
|
1
|
+
import{isGroupedSelect as i,isSelectOption as o}from"@alwith/api";function I(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function y(e,t){return e.find((n)=>n.category===t&&o(n))}function G(e){return I(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
|
|
2
|
+
export{I,y,G};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{jo}from"./chunk-ttdxc6mg.js";import{Vo,Go,Wo}from"./chunk-gtddnhdy.js";import{Ko}from"./chunk-0mf7yh69.js";import{t}from"./chunk-6d38ff76.js";import{q}from"./chunk-0fvpmcps.js";import{textOf as f}from"@alwith/api";import{nativeTurnId as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function Br(i,n){return{installUnlock:n==="none"?()=>()=>{}:Go,preload:()=>{if(n!=="none")Vo(i)},playSequence:(a,d,l)=>Wo(a,d,l,i,n)}}function $o(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=f(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(I).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:q(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(jo,{text:i.response,host:a})})]})}function qo(i){return r(Ko,{...i,renderPreview:(n)=>r(T,{item:n})})}
|
|
2
|
+
export{Br,$o,qo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as s}from"class-variance-authority";import{cn as a}from"cn";import{jsx as r}from"react/jsx-runtime";var n=s("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function
|
|
1
|
+
import{cva as s}from"class-variance-authority";import{cn as a}from"cn";import{jsx as r}from"react/jsx-runtime";var n=s("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function O({className:t,variant:e,...o}){return r("div",{"data-slot":"alert",role:"alert",className:a(n({variant:e}),t),...o})}function $t({className:t,...e}){return r("div",{"data-slot":"alert-title",className:a("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...e})}function F({className:t,...e}){return r("div",{"data-slot":"alert-description",className:a("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...e})}function di({className:t,...e}){return r("div",{"data-slot":"alert-action",className:a("absolute top-2.5 end-3",t),...e})}export{O,$t,F,di};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useState as r}from"react";var t=new Map;function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useState as r}from"react";var t=new Map;function N(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
|
|
2
|
+
export{N};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function uo({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
|
|
2
|
+
export{uo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{wt,j}from"./chunk-r8z8f31m.js";import{M}from"./chunk-3nj26hhf.js";import{bt}from"./chunk-twwqgd8e.js";import{X}from"./chunk-xw0gvwh5.js";import{Fe,he,Be}from"./chunk-yf2p44mq.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 E}from"react/jsx-runtime";function oo(o){if(o.as==="ul"){let{as:i,className:s,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",s),...a})}let{as:t,className:n,...r}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...r})}function Oe({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 ht({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function Ut({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:N,headerChildren:f,wrapHeader:u,onHeaderClick:w,children:h}){let C=()=>{w?.(),t(!o)},v=p(Fe,"relative flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),b=d(E,{children:[r!=null&&e(Oe,{children:r}),f??e(M,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(Be,{content:s!==void 0?e(he,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:N})})]}),P=f==null?d("div",{"data-active":l?"":void 0,title:n,className:p(v,j),onClick:C,onKeyDown:(c)=>{if(c.target!==c.currentTarget)return;if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault(),C()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),b]}):e("div",{"data-active":l?"":void 0,className:v,children:b});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[u===void 0?P:u(P),o&&e(oo,{className:"mt-0.5",children:h})]})}var H=S(()=>{}),O=S(()=>{});function vt(){return k(O)}function xt(){return k(H)}function yt({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:N,preview:f,listeningPorts:u,onOpenPort:w,accessory:h,meta:C,hint:v,actions:b,className:P,...c}){let y=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(Fe,wt,"group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(f||u!=null&&u.length>0)&&"h-auto min-h-[var(--navigation-row-height)] py-2.5",P),...c,children:[e(Oe,{children:t!=null?e(bt,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(M,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),N!=null&&e(M,{className:"text-muted-foreground text-xs",children:N}),f&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:f}),u!=null&&u.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:u.map((m)=>w?d("button",{type:"button",className:"underline",onPointerDown:(g)=>g.stopPropagation(),onKeyDown:(g)=>g.stopPropagation(),onClick:(g)=>{g.stopPropagation(),w(m)},children:[":",m]},m):d("span",{children:[":",m]},m))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(I,{className:"text-muted-foreground size-3"}),e(Be,{content:h!=null?e(he,{children:h}):C??e(he,{}),actions:b}),v!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:v})]})]});if(a==null)return y;return e(L,{row:y,onOpenChange:l,children:a})}function L({row:o,children:t,onOpenChange:n}){let[r,i]=R(!1),[s,a]=R(!1),l=r||s;return T(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(H.Provider,{value:a,children:e(O.Provider,{value:()=>{i(!1),a(!1)},children:e(_,{open:l,onOpenChange:i,trigger:o,children:t})})})}function _({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return X(o),d(x.Root,{open:o,onOpenChange:t,children:[e(x.Trigger,{render:n,delay:700,closeDelay:100}),e(x.Portal,{children:e(x.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(x.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
|
|
2
|
+
export{oo,Oe,ht,Ut,vt,xt,yt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Select as r}from"@base-ui/react/select";import{cn as o}from"cn";import{CheckIcon as u,ChevronDownIcon as c,ChevronUpIcon as f}from"lucide-react";import{jsx as e,jsxs as n}from"react/jsx-runtime";var
|
|
1
|
+
import{Select as r}from"@base-ui/react/select";import{cn as o}from"cn";import{CheckIcon as u,ChevronDownIcon as c,ChevronUpIcon as f}from"lucide-react";import{jsx as e,jsxs as n}from"react/jsx-runtime";var qt=r.Root;function ui({className:t,...i}){return e(r.Group,{"data-slot":"select-group",className:o("scroll-my-1 p-1",t),...i})}function Vt({className:t,...i}){return e(r.Value,{"data-slot":"select-value",className:o("flex flex-1 text-start",t),...i})}function Gt({className:t,size:i="default",children:a,...s}){return n(r.Trigger,{"data-slot":"select-trigger","data-size":i,className:o("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 ps-2.5 pe-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[a,e(r.Icon,{render:e(c,{className:"text-muted-foreground pointer-events-none size-4"})})]})}function ao({className:t,children:i,side:a="bottom",sideOffset:s=4,align:d="center",alignOffset:p=0,alignItemWithTrigger:l=!0,...m}){return e(r.Portal,{children:e(r.Positioner,{side:a,sideOffset:s,align:d,alignOffset:p,alignItemWithTrigger:l,className:"isolate z-50",children:n(r.Popup,{"data-slot":"select-content","data-align-trigger":l,className:o("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none",t),...m,children:[e(Mr,{}),e(r.List,{children:i}),e(Er,{})]})})})}function mi({className:t,...i}){return e(r.GroupLabel,{"data-slot":"select-label",className:o("text-muted-foreground px-2 py-1.5 text-xs",t),...i})}function K({className:t,children:i,...a}){return n(r.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[e(r.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:i}),e(r.ItemIndicator,{render:e("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:e(u,{className:"pointer-events-none"})})]})}function pi({className:t,...i}){return e(r.Separator,{"data-slot":"select-separator",className:o("bg-border pointer-events-none -mx-1 my-1 h-px",t),...i})}function Mr({className:t,...i}){return e(r.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:o("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",t),...i,children:e(f,{})})}function Er({className:t,...i}){return e(r.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:o("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",t),...i,children:e(c,{})})}export{qt,ui,Vt,Gt,ao,mi,K,pi,Mr,Er};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Jn,eo}from"./chunk-5s2wpbdt.js";import{cn as l}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function p({value:i,onValueChange:n,options:o,itemClassName:d}){return t(Jn,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(eo,{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{p};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function*Mt(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 Yr(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 Mt(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
+
export{Mt,Yr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-cg97byvk.js";import{
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{ue}from"./chunk-1drkvxzk.js";import{d,u,w,z,m,k}from"./chunk-1txn4b0v.js";import{h}from"./chunk-nx91ewps.js";import{At,Lt,Qn,Xn,Yn,ut}from"./chunk-sj7jdb7m.js";import{l}from"./chunk-1hy64ewz.js";import{V,R}from"./chunk-ehh31hzz.js";import{Ne}from"./chunk-5wyxvpgt.js";import{C}from"./chunk-xjtqdp82.js";import{isArrayProperty as D,isBooleanProperty as S,isNumberProperty as A,isStringProperty as E}from"@alwith/api";import{useEffect as N,useMemo as q,useState as P}from"react";import{jsx as o,jsxs as p}from"react/jsx-runtime";function L(r){if(!E(r))return null;if(r.oneOf&&r.oneOf.length>0)return r.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(r.enum&&r.enum.length>0)return r.enum.map((t)=>({value:t,label:t}));return null}function G(r){let t=r,n=t._meta?.alwith?.options;if(Array.isArray(n)&&Array.isArray(t.enum))return n.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((i)=>({value:String(i),label:String(i)}));if(Array.isArray(t.oneOf))return t.oneOf.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));return null}function Sr(r){let t=new Set(r.required??[]);return Object.entries(r.properties??{}).map(([n,i])=>({key:n,property:i,title:i.title??n,description:i.description??null,required:t.has(n),options:L(i),multiOptions:D(i)?G(i.items):null}))}function hr(r){let t={};for(let n of r){let i=n.property.default;if(i!==void 0&&i!==null)t[n.key]=i;else if(n.options)t[n.key]=n.options[0].value;else if(S(n.property))t[n.key]=!1;else if(D(n.property))t[n.key]=[]}return t}function Nr(r,t){if(r.multiOptions)return Array.isArray(t)&&t.length>0;if(!r.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function O({id:r,label:t,description:n,control:i}){return p("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[i,p(h,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[o("div",{className:"text-foreground text-sm",children:t}),n&&o("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function I({id:r,field:t,value:n,onChange:i}){if(t.multiOptions){let a=new Set(Array.isArray(n)?n:[]);return p(At,{children:[o(Lt,{variant:"label",children:t.title}),t.description&&o(ut,{children:t.description}),o("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((c)=>{let f=`${r}:${c.value}`;return o(O,{id:f,...c,control:o(ue,{id:f,checked:a.has(c.value),onCheckedChange:(y)=>{let g=new Set(a);if(y)g.add(c.value);else g.delete(c.value);i([...g])}})},c.value)})})]})}if(t.options)return p(At,{children:[o(Lt,{variant:"label",children:t.title}),t.description&&o(ut,{children:t.description}),o(V,{value:typeof n==="string"?n:"",onValueChange:(a)=>i(String(a)),className:"flex flex-col gap-1",children:t.options.map((a)=>{let c=`${r}:${a.value}`;return o(O,{id:c,...a,control:o(R,{value:a.value,id:c})},a.value)})})]});return p(Xn,{children:[o(Yn,{htmlFor:r,children:t.title}),S(t.property)?o(Ne,{id:r,checked:n===!0,onCheckedChange:(a)=>i(a)}):A(t.property)?o(l,{id:r,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(a)=>i(a.target.value===""?void 0:Number(a.target.value))}):o(C,{id:r,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(a)=>i(a.target.value)}),t.description&&o(ut,{children:t.description})]})}function On({requestId:r,schema:t,message:n,total:i,t:a,onRespond:c}){let f=q(()=>Sr(t),[t]),[y,g]=P(()=>hr(f));N(()=>g(hr(f)),[r,f]);let b=f.every((s)=>Nr(s,y[s.key])),x=()=>{if(!b)return;let s={};for(let[v,F]of Object.entries(y))if(F!==void 0)s[v]=F;c({action:"accept",content:s})};return o(d,{open:!0,onOpenChange:(s)=>!s&&c({action:"cancel"}),children:p(u,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(s)=>{if(s.key==="Enter"&&(s.metaKey||s.ctrlKey))s.preventDefault(),x()},children:[p(w,{children:[p("div",{className:"flex items-center justify-between gap-2 pe-8",children:[o(m,{children:t.title??a("approval.needed")}),i>1&&o("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),o(k,{children:n})]}),o("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o(Qn,{children:f.map((s)=>o(I,{id:`${r}:${s.key}`,field:s,value:y[s.key],onChange:(v)=>g((F)=>({...F,[s.key]:v}))},s.key))})}),p(z,{children:[o(e,{variant:"ghost",onClick:()=>c({action:"decline"}),children:a("actions.decline")}),o(e,{disabled:!b,onClick:x,children:a("actions.submit")})]})]})})}
|
|
2
|
+
export{Sr,hr,Nr,On};
|
|
@@ -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 V({className:r,...a}){return i(d,{"data-slot":"radio-group",className:o("grid w-full gap-3",r),...a})}function R({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{V,R};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-cg97byvk.js";import{
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{qn,Vn,Gn,Wn,jn,Kn}from"./chunk-scddkjv8.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function Fn({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(qn,{size:"sm",children:[n(Vn,{children:[a(Wn,{children:i("approval.needed")}),a(Gn,{children:r})]}),a(jn,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(Kn,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
|
|
2
|
+
export{Fn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{po}from"./chunk-wjs8bwpk.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function to(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await po(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
|
|
2
|
+
export{to};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{d,u,w,z,m,k}from"./chunk-1txn4b0v.js";import{X}from"./chunk-xw0gvwh5.js";import{createContext as C,useContext as v,useState as L,useSyncExternalStore as h}from"react";import{jsx as i,jsxs as p}from"react/jsx-runtime";var f=C(null),x=C(null),D=C(null);function br({host:t,client:o,children:n}){let[l,a]=L(null);X(l!==null);let{t:c}=t;return i(f,{value:t,children:i(x,{value:o,children:p(D,{value:a,children:[n,i(d,{open:l!==null,onOpenChange:(y)=>!y&&a(null),children:p(u,{children:[p(w,{children:[i(m,{children:c("sessionList.deleteTitle")}),i(k,{children:c("sessionList.deleteDescription")})]}),p(z,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:c("sessionList.cancel")}),i(e,{onClick:()=>{if(l)S(t,o.delete(l.sessionId));a(null)},children:c("sessionList.delete")})]})]})})]})})})}function g(){let t=v(f);if(t===null)throw Error("Session list host is missing");return t}function s(){let t=v(x);if(t===null)throw Error("Session list client is missing");return t}function kt(){let t=v(D);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=s();return h((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function S(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
|
|
2
|
+
export{br,g,s,kt,r,S};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,r}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{s,r}from"./chunk-gb2dmt6b.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function vr(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{vr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ro}from"./chunk-q98941j2.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 Jt({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(Ro,{src:c,alt:"",onClose:()=>a(!1)})]})}function No({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(Jt,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
|
|
2
|
+
export{Jt,No};
|
|
@@ -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 Vo(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Ci(){c()}function Go(){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 Wo(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 kr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Ti(e,n,t,i,o,a){if(a==="none")return;_(o,[kr(e,n,t,i,a)])}function kr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return zr(t,i);return Cr(e,n)}function zr(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 Cr(e,n){return y+Ur(e,n)}function Ii(e,n){return D(Cr(e,n))}function Ur(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 Pi(){return r.context?.state}function Si(e){return g(e).ready}
|
|
2
|
+
export{Vo,Ci,Go,Wo,Ti,kr,zr,Cr,Ii,Ur,$r,Pi,Si};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var fr={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Hn(e){return[...e].toSorted((o,n)=>(fr[o.kind]??99)-(fr[n.kind]??99))}function Qr(e){return e==="allow_once"||e==="allow_always"}function Xr(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
+
export{fr,Hn,Qr,Xr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C}from"./chunk-xjtqdp82.js";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{C}from"./chunk-xjtqdp82.js";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function Ht({className:r,...e}){return o(C,{"data-slot":"input-group-control",className:n("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",r),...e})}
|
|
2
|
+
export{Ht};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{O,F}from"./chunk-a2ftkzak.js";import{e}from"./chunk-cg97byvk.js";import{d,u,w,z,m,k}from"./chunk-1txn4b0v.js";import{l}from"./chunk-1hy64ewz.js";import{qt,Vt,Gt,ao,K}from"./chunk-c6w4bp15.js";import{ve}from"./chunk-61vxy6yd.js";import{g,s,r}from"./chunk-gb2dmt6b.js";import{Q,E,xe,B}from"./chunk-68y66m3v.js";import{cn as me}from"cn";import{ArchiveIcon as he,FolderIcon as Y,ListFilterIcon as pe,SearchIcon as fe,Trash2Icon as Z}from"lucide-react";import{useEffect as ge,useRef as Se,useState as h}from"react";import{jsx as i,jsxs as n}from"react/jsx-runtime";function ee({className:p,...a}){return i(ao,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...a,className:me("max-w-(--available-width) min-w-0 p-1",p)})}function _(p){return p instanceof Error?p.message:String(p)}function ye({children:p}){return i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"flex flex-col gap-8",children:p})})}function yr({Scroll:p=ye}){let{t:a,i18n:T}=g(),f=s(),L=r((t)=>t.archivedSessions),b=r((t)=>t.connection),[V,te]=h(""),[N,se]=h("all"),[v,ie]=h("all"),[re,ae]=h(0),[H,U]=h(!0),[q,G]=h(null),[R,W]=h(null),[D,A]=h(!1),x=Se(!1),[I,S]=h(null),[J,j]=h(null),[ne,M]=h(!1);ge(()=>{if(b!=="ready")return;let t=!1;U(!0),G(null);async function c(){try{await f.listArchived({reset:!0});let o=new Set;while(!t&&f.state.archivedCursor!==null){let y=f.state.archivedCursor;if(o.has(y))throw Error("Archive pagination returned a repeated cursor");o.add(y),await f.listArchived()}}catch(o){if(!t)G(_(o))}finally{if(!t)U(!1)}}return c(),()=>{t=!0}},[f,b,re]);let P=!(b==="ready"&&!H&&q===null)||D,C=(t)=>t.title??a("sessionList.untitled"),le=[...new Set(L.filter((t)=>!E(t.cwd)).map((t)=>t.cwd))].toSorted(),oe=V.trim().toLocaleLowerCase(T.language),X=L.filter((t)=>{let c=E(t.cwd);return C(t).toLocaleLowerCase(T.language).includes(oe)&&(N==="all"||(N==="quick"?c:!c))&&(v==="all"||(v==="quick"?c:t.cwd===v))}),ce=new Intl.DateTimeFormat(T.language,{dateStyle:"medium",timeStyle:"short"});async function ue(t){if(x.current)return;x.current=!0,A(!0),W(null);try{await f.unarchive(t.sessionId)}catch(c){W(_(c))}finally{x.current=!1,A(!1)}}async function de(){if(x.current||!I)return;x.current=!0,A(!0),j(null);let t=[],c=[];try{for(let o of I){if(!f.state.archivedSessions.some((y)=>y.sessionId===o.sessionId))continue;try{await f.delete(o.sessionId)}catch(y){t.push(o),c.push(`${C(o)}: ${_(y)}`)}}if(t.length)S(t),j(c.join(`
|
|
2
|
+
`));else S(null)}finally{x.current=!1,A(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":a("sessionList.archives.title"),children:[n("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:[n("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:a("sessionList.archives.title")}),n(e,{variant:"destructive",className:"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]",disabled:P||L.length===0,onClick:()=>{j(null),M(!0),S([...L])},children:[i(Z,{"aria-hidden":"true"}),a("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[i(fe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(l,{"aria-label":a("sessionList.archives.search"),placeholder:a("sessionList.archives.search"),value:V,onChange:(t)=>te(t.target.value),className:"rounded-md ps-9"})]}),n(qt,{value:N,onValueChange:(t)=>{if(t===null)throw Error("Archive chat type cannot be empty");se(t)},children:[n(Gt,{"aria-label":a("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[i(pe,{"aria-hidden":"true"}),i(Vt,{children:a(`sessionList.archives.${N==="all"?"allChats":N==="quick"?"quickChats":"projectChats"}`)})]}),n(ee,{children:[i(K,{value:"all",children:a("sessionList.archives.allChats")}),i(K,{value:"quick",children:a("sessionList.archives.quickChats")}),i(K,{value:"project",children:a("sessionList.archives.projectChats")})]})]}),n(qt,{value:v,onValueChange:(t)=>{if(t===null)throw Error("Archive project filter cannot be empty");ie(t)},children:[n(Gt,{"aria-label":a("sessionList.archives.project"),className:"w-48 rounded-md",children:[i(Y,{"aria-hidden":"true"}),i(Vt,{className:"truncate",children:v==="all"?a("sessionList.archives.allProjects"):v==="quick"?a("sessionList.archives.noProject"):B(v)})]}),n(ee,{children:[i(K,{value:"all",children:a("sessionList.archives.allProjects")}),i(K,{value:"quick",children:a("sessionList.archives.noProject")}),le.map((t)=>i(K,{value:t,title:t,children:B(t)},t))]})]})]}),n(p,{children:[b!=="ready"?i("p",{role:"status",className:"text-muted-foreground",children:a("sessionList.archives.connecting")}):H?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[i(ve,{}),a("sessionList.archives.loading")]}):q?i(O,{variant:"destructive",children:n(F,{className:"flex items-center justify-between gap-4",children:[i("span",{children:q}),i(e,{variant:"outline",onClick:()=>ae((t)=>t+1),children:a("sessionList.archives.retry")})]})}):L.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[i(he,{"aria-hidden":"true",className:"size-8"}),i("p",{children:a("sessionList.archives.empty")})]}):X.length===0?i("p",{className:"text-muted-foreground py-12 text-center",children:a("sessionList.archives.noResults")}):xe(X).filter(([,t])=>t.length>0).map(([t,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:t===Q?void 0:t,children:[i(Y,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("span",{className:"truncate",children:t===Q?a("sessionList.archives.noProject"):B(t)})]}),i("span",{className:"text-muted-foreground shrink-0 text-sm",children:a("sessionList.archives.count",{count:c.length})})]}),i("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((o)=>n("article",{"aria-label":C(o),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[i("h3",{className:"truncate text-sm font-medium",title:C(o),children:C(o)}),o.updatedAt!==null&&i("time",{dateTime:o.updatedAt,title:a("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:ce.format(new Date(o.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[i(e,{variant:"ghost",size:"icon-sm","aria-label":a("sessionList.delete"),title:a("sessionList.delete"),disabled:P,className:"text-muted-foreground hover:text-destructive",onClick:()=>{j(null),M(!1),S([o])},children:i(Z,{"aria-hidden":"true"})}),i(e,{variant:"secondary",size:"sm",disabled:P,onClick:()=>void ue(o),children:a("sessionList.archives.unarchive")})]})]},o.sessionId))})]},t)),R&&i(O,{variant:"destructive",children:i(F,{children:R})})]})]}),i(d,{open:I!==null,onOpenChange:(t)=>{if(!t&&!x.current)S(null)},children:n(u,{showCloseButton:!D,children:[n(w,{children:[i(m,{children:a("sessionList.archives.deleteTitle")}),i(k,{children:a(ne?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:I?.length??0})})]}),J&&i(O,{variant:"destructive",children:i(F,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:J})}),n(z,{children:[i(e,{variant:"outline",disabled:D,onClick:()=>S(null),children:a("sessionList.cancel")}),n(e,{variant:"destructive",className:"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]",disabled:P,onClick:()=>void de(),children:[D&&i(ve,{}),a("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
|
+
export{yr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{me,pe,W}from"./chunk-5s2wpbdt.js";import{p}from"./chunk-cywx4qmv.js";import{useState as w}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function vn({value:r,currentName:o,icon:i,options:s,label:d,header:a,onValueChange:l,showLabel:u=!1,disabled:m=!1,warning:c=!1}){let[g,f]=w(!1);return t(me,{open:g,onOpenChange:f,children:[n(pe,{render:t(e,{disabled:m,"data-permission-warning":c?"":void 0,variant:"ghost","aria-label":`${d}: ${o}`,title:o,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[i,n("span",{className:u?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:o})]})}),t(W,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&n("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:n("span",{children:a})}),n(p,{value:r,onValueChange:l,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:s})]})]})}
|
|
2
|
+
export{vn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var xi=280;function ho({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 ye({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 jt({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 vo({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 xo({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 yo({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{xi,ho,ye,jt,vo,xo,yo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var
|
|
1
|
+
import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var Rr=o("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ae({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:d(Rr({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{Rr,Ae};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Kt,Qt}from"./chunk-s44rx1sz.js";import{f}from"./chunk-xf14bg2v.js";import{t}from"./chunk-6d38ff76.js";import{Jo,q,$e,tr}from"./chunk-0fvpmcps.js";import{Eo}from"./chunk-x053g6f2.js";import{Z}from"./chunk-3wsg6710.js";import{Xt}from"./chunk-kh1tc15g.js";import{Io}from"./chunk-78ew0821.js";import{Ho}from"./chunk-6pq1xmwg.js";import{Oo}from"./chunk-8p0074ye.js";import{tn,nn}from"./chunk-tzjk7zkc.js";import{Ue}from"./chunk-4jagfjhm.js";import{isContentEntry as oe,isEmbeddedResource as U,isImage as X,isResourceLink as ae,isText as me}from"@alwith/api";import{codexMessageError as z,codexTurnError as J,nativeTurnId as le}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as de,SparklesIcon as ce}from"lucide-react";import{Fragment as ge,memo as pe}from"react";import{jsx as s,jsxs as m,Fragment as R}from"react/jsx-runtime";function D(r){if(X(r))return`${r.mimeType.toLowerCase()}:${r.data}`;if(U(r)&&"blob"in r.resource&&r.resource.mimeType?.toLowerCase().startsWith("image/"))return`${r.resource.mimeType.toLowerCase()}:${r.resource.blob}`;return null}function T({sessionId:r,entry:n,terminals:l,streaming:o,streamingThoughtId:w}){let{t:a}=t();switch(n.kind){case"activity":return s(Eo,{sessionId:r,items:n.items,terminals:l,streamingThoughtId:w});case"text":return f(n.item._meta).length>0?s(Xt,{sessionId:r,item:n.item}):s(Z,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(Ho,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(tn,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return m("div",{className:"codex-context-compaction",children:[s(ce,{"aria-hidden":"true"}),s("span",{children:n.item.status==="completed"?a("stream.codex.contextCompacted"):n.item.status==="cancelled"?a("timeline.interrupted"):a("timeline.compacting")})]})}}function ue({sessionId:r,turn:n,terminals:l,active:o,blocked:w=!1,continued:a=!1,edits:S=n.edits,activityItems:_=n.items,workStartedAt:Y=n.startedAt,isLast:F,error:p,interrupted:M,retry:L,retrying:g,answerActions:W,footer:ee}){let{t:d}=t(),I=n.errors.map((e)=>{let i=z(e);if(i===null)throw Error("Turn error item is missing its diagnostics");let k=L?.turnId===le(e)?L:void 0;return s(nn,{error:i,retry:k},`${e.id}:${k?.delaySeconds??"manual"}`)});if(F&&p!==null&&!n.errors.some((e)=>{let i=z(e);return i!==null&&i.stopReason===p.stopReason&&J(i).message===J(p).message}))I.push(s(nn,{error:p},"current-run-error"));let v=I.length>0?s("div",{className:"codex-turn-errors",children:I}):null,u=n.work,y=u.length>0&&u.every((e)=>e.kind==="compaction");if(Jo(n)||y&&n.final.length===0)return m(R,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),v]});let K=$e(n),O=n.final.filter((e)=>f(e._meta).length===0).map(q).join(`
|
|
2
|
+
`),h=o?null:Ue(n,"assistant"),P=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),G=new Set(n.final.flatMap((e)=>e.content.map(D).filter((i)=>i!==null))),N=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(oe).flatMap((i,k)=>{let c=i.content,ie=e.name==="image_generation"&&X(c),re=e.toolKind!=="read"&&e.toolKind!=="search"&&(ae(c)||U(c)&&("blob"in c.resource));if(!ie&&!re)return[];let b=D(c);if(b!==null){if(G.has(b))return[];G.add(b)}return[{key:`${e.id}:${k}`,block:c}]})}),A=n.final.some((e)=>f(e._meta).length===0&&e.content.some((i)=>!me(i)||i.text.trim().length>0)),te=P.length>0||N.length>0||y||A||n.final.some((e)=>f(e._meta).length>0),x=n.items.findIndex((e)=>n.final.includes(e)),C=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),B=u.filter((e)=>x===-1||C(e)<x),ne=u.filter((e)=>x!==-1&&C(e)>x),se=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...ne.map((e)=>({kind:"work",entry:e,index:C(e)}))].toSorted((e,i)=>e.index-i.index),H=!o&&!a&&(O.trim().length>0?s(Kt,{text:O,isMostRecentTurn:F,time:h,afterCopy:W}):m("div",{className:"flex items-center gap-0.5",children:[W,h&&s("span",{className:"codex-user-time ms-1",title:h.full,children:h.short})]})),E=Oo({...n,items:_},{running:o,blocked:w,retrying:g!==void 0}),Q=E.kind==="reasoning"?E.ownerKey??null:null,V=E.kind==="thinking",j=tr({...n,items:_});return m(R,{children:[s(Qt,{stateKey:JSON.stringify([r,n.replayed?"history":"live",n.key]),active:o&&!A,defaultExpanded:o&&!A||!n.replayed&&(M||K),...j,startedAt:j.startedAt??Y,loading:V&&n.work.length===0,work:a||y?[]:B.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:o,streamingThoughtId:Q},e.key)),answer:te||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||y)&&B.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),se.map((e)=>{if(e.kind==="work")return s(T,{sessionId:r,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:Q},e.entry.key);let i=e.item;return m(ge,{children:[f(i._meta).length>0?s(Xt,{sessionId:r,item:i}):s(Z,{content:i.content,messageId:i.id,streaming:o}),i===n.final.at(-1)&&H]},i.id)}),P.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":d(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&s(de,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),N.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:N.map((e)=>s(Z,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),n.final.length===0&&H]}):null,footer:m(R,{children:[V&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:d("message.thinking")})}),ee,S.length>0&&!o&&!a&&s(Io,{items:S}),M&&!K&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&v]})}),o&&g!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:g.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(g.message)?.[1];return e===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:e})})():g.message}),o&&v]})}var bo=pe(ue);
|
|
3
|
+
export{bo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Hn}from"./chunk-gwav4k8b.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 _n({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=Hn(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{_n};
|