@alwith/module-chat 0.5.13 → 0.5.15
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/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-0nkvfecf.js +1 -0
- package/dist/{chunk-2bkh8cjr.js → chunk-0pv9mq6d.js} +2 -2
- package/dist/{chunk-8q0nz9fp.js → chunk-10j68dch.js} +1 -1
- package/dist/chunk-12fcr66z.js +2 -0
- package/dist/{chunk-b0zk92wd.js → chunk-1aeswxaf.js} +1 -1
- package/dist/{chunk-emdw6cpb.js → chunk-1fm5vx1n.js} +1 -1
- package/dist/{chunk-x2wg6e97.js → chunk-1hzdqep7.js} +2 -2
- package/dist/chunk-25bzk1wv.js +1 -0
- package/dist/chunk-2a3tezgr.js +1 -0
- package/dist/{chunk-4p7yyxq8.js → chunk-2aqv0chk.js} +1 -1
- package/dist/{chunk-5mpabjpm.js → chunk-2ecx1xed.js} +2 -2
- package/dist/{chunk-gtyab797.js → chunk-2mkqpzzx.js} +1 -1
- package/dist/{chunk-gqxjp1xf.js → chunk-2rv3cq7q.js} +2 -2
- package/dist/{chunk-7x4dpkzh.js → chunk-3919sqde.js} +2 -2
- package/dist/{chunk-wdy20cvh.js → chunk-39sbgvd3.js} +1 -1
- package/dist/{chunk-ns6yd5s6.js → chunk-3w0wbv9c.js} +2 -2
- package/dist/{chunk-nvqy2rd1.js → chunk-4andq00q.js} +2 -2
- package/dist/{chunk-nt59nkbj.js → chunk-4ed8as5d.js} +2 -2
- package/dist/chunk-4s1rhts0.js +1 -0
- package/dist/{chunk-vbgfrh23.js → chunk-4tff1nyj.js} +2 -2
- package/dist/{chunk-3ccatjcc.js → chunk-54941m0z.js} +3 -3
- package/dist/{chunk-r8mszb32.js → chunk-56e8naj1.js} +2 -2
- package/dist/chunk-59g9h4v1.js +2 -0
- package/dist/{chunk-6y5d4j79.js → chunk-61944cv6.js} +2 -2
- package/dist/{chunk-mqxg6cgm.js → chunk-6k4mbmg1.js} +2 -2
- package/dist/{chunk-wmeebq8x.js → chunk-6s7z09b0.js} +1 -1
- package/dist/{chunk-can1xpx6.js → chunk-6wqbetcx.js} +1 -1
- package/dist/{chunk-tv74s60m.js → chunk-7eje3z81.js} +2 -2
- package/dist/{chunk-wf9bna6z.js → chunk-7f89k828.js} +1 -1
- package/dist/{chunk-d1z2ns5m.js → chunk-7jyekmy9.js} +2 -2
- package/dist/{chunk-a4j8mjg1.js → chunk-7qrz8zq8.js} +2 -2
- package/dist/{chunk-195y00jd.js → chunk-7zrnt6zw.js} +2 -2
- package/dist/{chunk-j5047dxn.js → chunk-8e3wcvkd.js} +2 -2
- package/dist/chunk-96x0d2vd.js +1 -0
- package/dist/{chunk-qx9j4bnh.js → chunk-9gv1zffv.js} +1 -1
- package/dist/{chunk-jgvbf3sx.js → chunk-9j609g4n.js} +1 -1
- package/dist/{chunk-bx2rafbd.js → chunk-9zmkj0dp.js} +2 -2
- package/dist/{chunk-qp7aywgn.js → chunk-a3x74cr0.js} +2 -2
- package/dist/{chunk-xpdv1aed.js → chunk-a6b2vhmb.js} +1 -1
- package/dist/chunk-aarvddmn.js +1 -0
- package/dist/{chunk-19a0ehyy.js → chunk-aj5fk4ez.js} +1 -1
- package/dist/chunk-bj5ma2sv.js +2 -0
- package/dist/chunk-c493d8ay.js +1 -0
- package/dist/{chunk-bm68x7xa.js → chunk-cf5mxxyp.js} +2 -2
- package/dist/chunk-cjmjv7pv.js +2 -0
- package/dist/{chunk-ajmyr2zy.js → chunk-d5ga13n0.js} +1 -1
- package/dist/{chunk-215c1t1e.js → chunk-d5w1nvrz.js} +2 -2
- package/dist/{chunk-y6xhz68r.js → chunk-da4m33bg.js} +2 -2
- package/dist/chunk-da6d6wze.js +1 -0
- package/dist/{chunk-c4t2a146.js → chunk-djmnmbm2.js} +2 -2
- package/dist/{chunk-yhxs6266.js → chunk-dxnttcwd.js} +1 -1
- package/dist/{chunk-c2bkhrcc.js → chunk-dyp6kjqz.js} +2 -2
- package/dist/chunk-e1gwprwe.js +2 -0
- package/dist/chunk-ea3582qy.js +1 -0
- package/dist/{chunk-m4dgha79.js → chunk-efcpawhs.js} +2 -2
- package/dist/{chunk-ksb110ef.js → chunk-egqxz6f8.js} +2 -2
- package/dist/{chunk-hhwdk46d.js → chunk-en8s7tet.js} +3 -3
- package/dist/{chunk-e8ngg07w.js → chunk-f4a1my6v.js} +2 -2
- package/dist/{chunk-mbjv33a2.js → chunk-frbeen15.js} +1 -1
- package/dist/{chunk-d0q5kbq8.js → chunk-frqg34kq.js} +1 -1
- package/dist/{chunk-zrx7qt5g.js → chunk-g5gz25jy.js} +2 -2
- package/dist/{chunk-qz8gpb9j.js → chunk-gkv8w3v0.js} +2 -2
- package/dist/{chunk-qpdgh554.js → chunk-gtahrx8j.js} +2 -2
- package/dist/{chunk-mst2ng40.js → chunk-h2gng003.js} +3 -3
- package/dist/{chunk-3wwkzyxs.js → chunk-jzkmsbpe.js} +1 -1
- package/dist/{chunk-qa6kb660.js → chunk-kq8kz0jn.js} +2 -2
- package/dist/{chunk-tc7qxw3f.js → chunk-m2jsfvs2.js} +1 -1
- package/dist/{chunk-mrfy48hg.js → chunk-m2xmz1ag.js} +2 -2
- package/dist/chunk-mr1azhef.js +1 -0
- package/dist/{chunk-cj9htyem.js → chunk-n1tjf64a.js} +2 -2
- package/dist/chunk-n5xqjct2.js +1 -0
- package/dist/chunk-n8kfbg68.js +2 -0
- package/dist/{chunk-phq6b35v.js → chunk-nact4a4b.js} +2 -2
- package/dist/{chunk-de85vphg.js → chunk-nbkkfyss.js} +1 -1
- package/dist/{chunk-4q7rpdzc.js → chunk-nt224frq.js} +2 -2
- package/dist/{chunk-9v7x6sqy.js → chunk-p1wnt0e5.js} +1 -1
- package/dist/{chunk-hfaarm10.js → chunk-pafshe3v.js} +2 -2
- package/dist/{chunk-4z4tec0p.js → chunk-pvj43sjx.js} +2 -2
- package/dist/{chunk-7cm1jptm.js → chunk-pzth3knm.js} +2 -2
- package/dist/{chunk-b7afpbwn.js → chunk-q4btsq6a.js} +3 -3
- package/dist/chunk-qpmjezsw.js +1 -0
- package/dist/{chunk-ftcydsbs.js → chunk-qsg1c5cc.js} +2 -2
- package/dist/{chunk-xqr05vqf.js → chunk-qvknvzqn.js} +2 -2
- package/dist/{chunk-8x43r6fk.js → chunk-r4r5ythb.js} +2 -2
- package/dist/{chunk-wtkn1jej.js → chunk-r9p03chx.js} +2 -2
- package/dist/{chunk-n9f80j0a.js → chunk-rvr6zj7p.js} +2 -2
- package/dist/{chunk-7h1m9nbx.js → chunk-rxc15vtr.js} +2 -2
- package/dist/{chunk-k7gn0faf.js → chunk-tp1gaw68.js} +2 -2
- package/dist/{chunk-0mze2qnw.js → chunk-vk36fprb.js} +2 -2
- package/dist/{chunk-ntegv7av.js → chunk-vzy4vwqr.js} +1 -1
- package/dist/{chunk-1z6v9pjq.js → chunk-w38vbf7h.js} +2 -2
- package/dist/{chunk-htnp024d.js → chunk-wpdn3rx8.js} +1 -1
- package/dist/{chunk-2wxea30c.js → chunk-x7jtngzd.js} +2 -2
- package/dist/{chunk-e4a1cf50.js → chunk-xe52kj6h.js} +5 -5
- package/dist/{chunk-xw93fypz.js → chunk-xfx689xm.js} +2 -2
- package/dist/{chunk-rf9yxbes.js → chunk-y3567zfn.js} +2 -2
- package/dist/{chunk-m5k1xtjr.js → chunk-y6afvrnv.js} +1 -1
- package/dist/{chunk-9wgngtx8.js → chunk-z3mp9z01.js} +1 -1
- package/dist/{chunk-kv0tnq8g.js → chunk-z4zm74ge.js} +2 -2
- package/dist/{chunk-t1m9ysv5.js → chunk-zjmqne2f.js} +2 -2
- package/dist/{chunk-cc0tan75.js → chunk-zynyx32t.js} +2 -2
- package/dist/{chunk-ey5vrsya.js → chunk-zzhwfrzb.js} +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/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/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.d.ts +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/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/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/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/conversation/subagent-sessions.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.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/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/session-list/archived-sessions.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/sidebar-overlay.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-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/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.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-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.d.ts +2 -2
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.d.ts +2 -2
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/field.d.ts +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group.d.ts +4 -3
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/kbd.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/select.d.ts +2 -2
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +11 -11
- package/dist/chunk-1ghceftn.js +0 -1
- package/dist/chunk-1gmz5kxh.js +0 -2
- package/dist/chunk-3fvwqfm2.js +0 -2
- package/dist/chunk-4tst6wwf.js +0 -1
- package/dist/chunk-5pr21n80.js +0 -1
- package/dist/chunk-9mxxxkzq.js +0 -1
- package/dist/chunk-aac5y6xt.js +0 -1
- package/dist/chunk-apqdf6y3.js +0 -1
- package/dist/chunk-bk0ezksw.js +0 -1
- package/dist/chunk-fsyc5ybt.js +0 -2
- package/dist/chunk-kzcrcs7q.js +0 -2
- package/dist/chunk-ms49ecg4.js +0 -1
- package/dist/chunk-ncekagm6.js +0 -1
- package/dist/chunk-p12g8enf.js +0 -1
- package/dist/chunk-rwczpvta.js +0 -2
- package/dist/chunk-rxwqvya2.js +0 -2
- package/dist/chunk-tc85dd04.js +0 -1
- package/dist/chunk-wmp3w889.js +0 -2
- package/dist/chunk-xx4tnhcy.js +0 -1
- package/dist/ui/input-group-textarea.d.ts +0 -2
- package/dist/ui/input-group-textarea.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{We}from"../chunk-
|
|
1
|
+
import{We}from"../chunk-9gv1zffv.js";import{e}from"../chunk-wpdn3rx8.js";import{fe}from"../chunk-2a3tezgr.js";import{s}from"../chunk-96x0d2vd.js";import{v}from"../chunk-kjtd3wc3.js";import{Y,A}from"../chunk-0nkvfecf.js";import{k}from"../chunk-da6d6wze.js";import{fn,St,ae,Ke}from"../chunk-egqxz6f8.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as H}from"cn";import{useCallback as Q,useEffect as M,useLayoutEffect as O,useMemo as _,useRef as G,useState as R}from"react";import{createPortal as V}from"react-dom";import{jsx as o,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:a,total:F,anchorRef:N,t:p,onAccept:I,onDecline:L}){let x=_(()=>a?fn(a.requestedSchema):[],[a]),[S,b]=R({}),T=G(null);M(()=>{if(a?.elicitationId===void 0)return;let t={};for(let{key:l,property:n}of x)if(!ae(n)){let u=Ke(n)[0];if(u)t[l]={selected:u.value}}b(t)},[a?.elicitationId,x]),M(()=>{if(a?.elicitationId!==void 0&&T.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")T.current.focus()},[a?.elicitationId]);let[y,q]=R(null),[C,z]=R(null),E=Q(()=>{let t=N.current;if(!t)return;let l=t.getBoundingClientRect();if(l.width===0){let n=Math.min(640,window.innerWidth*0.9);q({left:(window.innerWidth-n)/2,width:n,bottom:24});return}q({left:l.left,width:l.width,bottom:window.innerHeight-l.bottom+20})},[N]);O(()=>{if(!a)return;let t=0,l=()=>{if(N.current){E();return}t=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(t)},[a,E,N]),O(()=>{let t=N.current;if(!a||!t||!C)return;return j(t,C,E,{animationFrame:!0})},[a,C,N,E]);let U=_(()=>{if(!a)return!1;for(let{key:t,property:l}of x){let n=S[t];if(!n)return!1;if(ae(l)){if(!n.selectedSet||n.selectedSet.size===0)return!1;if(n.selectedSet.has(c)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===c&&!n.otherText?.trim())return!1}}return!0},[a,x,S]),D=Q(async()=>{if(!a)return;if(!U)return;let t={},l={};for(let{key:n,property:u}of x){let d=S[n];if(!d)continue;let g;if(ae(u))t[n]=[...d.selectedSet??[]].map((f)=>f===c?(d.otherText??"").trim():f).filter(Boolean);else{let f=d.selected??"";if(t[n]=f===c?(d.otherText??"").trim():f,f!==c)g=Ke(u).find((i)=>i.value===f)?.preview}let h=d.notes?.trim();if(g||h)l[n]={...g&&{preview:g},...h&&{notes:h}}}await I(a.elicitationId,t,l)},[a,x,S,U,I]),B=Q(async()=>{if(a)await L(a.elicitationId)},[a,L]);if(!a||!y)return null;return V(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),B()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:y.left,width:y.width,bottom:y.bottom,maxHeight:"70vh"},ref:(t)=>{T.current=t,z(t)},children:[m("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[o("div",{className:"text-foreground text-sm font-medium",children:p("askUserQuestion.title")}),F>1&&o("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${F}`})]}),o("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:l},n)=>{let u=S[t],d=u?.selected,g=u?.selectedSet??new Set,h=Ke(l),f=ae(l);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[o(We,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:St(l).title??t}),o("div",{className:"text-foreground text-sm font-medium",children:St(l).description})]}),f?m("div",{className:"space-y-1.5 ps-1",children:[h.map((i)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[o(fe,{checked:g.has(i.value),onCheckedChange:(r)=>{b((w)=>{let P=new Set(w[t]?.selectedSet??new Set);if(r)P.add(i.value);else P.delete(i.value);return{...w,[t]:{...w[t],selectedSet:P}}})}}),m("div",{className:"min-w-0 flex-1",children:[o("div",{className:"text-foreground text-sm",children:i.label}),i.description&&o("div",{className:"text-muted-foreground text-xs",children:i.description})]})]},i.value)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[o(fe,{checked:g.has(c),onCheckedChange:(i)=>{b((r)=>{let w=new Set(r[t]?.selectedSet??new Set);if(i)w.add(c);else w.delete(c);return{...r,[t]:{...r[t],selectedSet:w}}})}}),o("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&o("div",{className:"ps-7",children:o(s,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(i)=>b((r)=>({...r,[t]:{...r[t],otherText:i.target.value}}))})})]}):m(Y,{value:d??"",onValueChange:(i)=>b((r)=>({...r,[t]:{...r[t],selected:i}})),className:"space-y-1.5 ps-1",children:[h.map((i)=>{let r=`${n}:${i.value}`;return m("div",{className:H("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===i.value&&"bg-muted/60"),children:[o(A,{value:i.value,id:r}),m(v,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer",children:[o("div",{className:"text-foreground text-sm font-normal",children:i.label}),i.description&&o("div",{className:"text-muted-foreground text-xs font-normal",children:i.description})]})]},i.value)}),m("div",{className:H("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[o(A,{value:c,id:`${n}:other`,className:"mt-0.5"}),o(v,{htmlFor:`${n}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&o("div",{className:"ps-7",children:o(s,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(i)=>b((r)=>({...r,[t]:{...r[t],otherText:i.target.value}}))})})]}),!f&&d&&d!==c&&(()=>{let i=h.find((r)=>r.value===d)?.preview;if(!i)return null;return o("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:i})})(),h.some((i)=>i.preview)&&o(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(i)=>b((r)=>({...r,[t]:{...r[t],notes:i.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[o(e,{variant:"ghost",size:"sm",onClick:()=>void B(),children:p("askUserQuestion.cancel")}),o(e,{size:"sm",disabled:!U,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fn,St,ae,Ke}from"../chunk-egqxz6f8.js";export{fn as elicitationFields,St as elicitationLabels,Ke as elicitationOptions,ae as isMultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{br,no,mi,pi}from"../chunk-e1gwprwe.js";export{br as PERMISSION_KIND_GROUP_ORDER,mi as isAllowKind,pi as isAlwaysKind,no as sortPermissionOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn}from"../chunk-
|
|
1
|
+
import{Jn}from"../chunk-a6b2vhmb.js";import"../chunk-e1gwprwe.js";export{Jn as PermissionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ar,
|
|
1
|
+
import{Ar,yr,Lr,eo}from"../chunk-x7jtngzd.js";import"../chunk-2a3tezgr.js";import"../chunk-c493d8ay.js";import"../chunk-1fm5vx1n.js";import"../chunk-n5xqjct2.js";import"../chunk-4s1rhts0.js";import"../chunk-96x0d2vd.js";import"../chunk-0nkvfecf.js";import"../chunk-kjtd3wc3.js";import"../chunk-da6d6wze.js";import"../chunk-wpdn3rx8.js";export{eo as SchemaElicitationForm,Ar as elicitationFields,yr as initialValues,Lr as isAnswered};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{to}from"../chunk-m2xmz1ag.js";import"../chunk-mr1azhef.js";import"../chunk-wpdn3rx8.js";export{to as UrlElicitationCard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as t}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as r}from"react/jsx-runtime";function Y({className:i,...a}){return r(t,{"data-slot":"radio-group",className:o("grid w-full gap-3",i),...a})}function A({className:i,...a}){return r(e.Root,{"data-slot":"radio-group-item",className:o("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 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",i),...a,children:r(e.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:r("span",{className:"absolute top-1/2 start-1/2 size-2 -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}export{Y,A};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{$e}from"./chunk-h2gng003.js";import{or}from"./chunk-kq8kz0jn.js";import{t}from"./chunk-q6km9nha.js";import{B}from"./chunk-y6afvrnv.js";import{on}from"./chunk-g5gz25jy.js";import{isContentEntry as f,isEmbeddedResource as y,isResourceLink as g}from"@nyssance/codex-acp-v2/client";import{memo as k,useMemo as v}from"react";import{jsx as l,jsxs as u,Fragment as T}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(f).filter((o)=>y(o.content)||g(o.content));if(r.length===0)return null;return u("fieldset",{className:"mt-1 min-w-0",children:[l("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((o,s)=>l(B,{block:o.content},`${n.id}:${s}`))]})}var Jt=k(function({sessionId:r,items:o,terminals:s,streamingThoughtId:d}){let p=t(),i=o.every(on),c=p.toolBlock,a=v(()=>o.map((e)=>{let m={...or(e,s,e.kind==="thought"&&e.id===d),id:JSON.stringify([r,i?"history":"live",e.id])};return m.type==="tool_use"&&e.kind==="tool"&&c!==void 0?c(m,e):m}),[r,i,o,s,d,c]);return u(T,{children:[l($e,{blocks:a,defaultExpanded:!i}),o.map((e)=>e.kind==="tool"&&l(R,{item:e},e.id))]})});
|
|
2
|
+
export{Jt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ht,
|
|
1
|
+
import{Ht,Mn}from"./chunk-4andq00q.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function _t(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=Ht(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Jr(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Mn(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
|
|
2
2
|
export{_t,Jr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{l,r}from"./chunk-da4m33bg.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function pr(e,o){let s=l(),a=r((t)=>t.connection),i=r((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),c=r((t)=>v(t.sessions[e]?.items)),u=r((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(a!=="ready"||u||i)return;let t=!1,f,n=0,m=async()=>{try{let d=await s.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(o==="running"||n>0&&n<3))f=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(f)}},[s,e,a,u,i,o]),i?c:p??c}
|
|
2
|
+
export{pr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Dn}from"./chunk-nt224frq.js";import{o,C}from"./chunk-6acs2hzs.js";import{N,c}from"./chunk-n1tjf64a.js";import{createLucideIcon as w,HandIcon as y,ShieldAlertIcon as S,ShieldCheckIcon as r}from"lucide-react";import{jsx as t}from"react/jsx-runtime";var O=w("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),u={"read-only":y,"workspace-write":r,agent:O,"agent-full-access":S},b={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function ut({sessionId:g,options:m,disabled:f,onConfigChange:l}){let{host:p,client:h}=o(),{t:a}=p,s=c(m,"mode");if(!s)return null;let n=s.currentValue,d=N(s).map((e)=>{let i=b[e.value];return i?{...e,name:a(`permissionModes.${i}.name`),description:a(`permissionModes.${i}.description`)}:e}),I=d.find((e)=>e.value===n),M=u[n]??r,v=(e)=>{if(e===n)return;C(p,l?l(s.configId,e):h.setConfig(g,s.configId,e))};return t(Dn,{value:n,warning:n==="agent-full-access",currentName:I?.name??n,icon:t(M,{className:"size-3.5 shrink-0"}),header:a("permissionModes.heading"),disabled:f,label:a("composer.switchPermissionMode"),onValueChange:v,options:d.map((e)=>{let i=u[e.value]??r,k=e.value==="agent-full-access";return{value:e.value,label:t("span",{"data-permission-warning":k?"":void 0,children:e.name}),description:e.description?t("span",{className:"whitespace-normal",children:e.description}):void 0,icon:t(i,{className:"size-3.5 shrink-0"})}})})}
|
|
2
2
|
export{ut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Separator as o}from"@base-ui/react/separator";import{cn as i}from"cn";import{jsx as e}from"react/jsx-runtime";function j({className:a,orientation:r="horizontal",...t}){return e(o,{"data-slot":"separator",orientation:r,className:i("bg-border
|
|
1
|
+
import{Separator as o}from"@base-ui/react/separator";import{cn as i}from"cn";import{jsx as e}from"react/jsx-runtime";function j({className:a,orientation:r="horizontal",...t}){return e(o,{"data-slot":"separator",orientation:r,className:i("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...t})}export{j};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function Mr(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function
|
|
2
|
-
export{Mr,Pn,
|
|
1
|
+
function Mr(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function In(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(Mr(n,i))}return{imageFiles:e,sawNonImageFile:o}}function Pn(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function Rr(t){return[...t].filter((e)=>!s(e)).join("")}function vr(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function lt(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=Rr(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-vr(e,o)),r=Math.max(0,i-vr(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
|
|
2
|
+
export{Mr,In,Pn,Rr,vr,lt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Menu as n}from"@base-ui/react/menu";import{cn as i}from"cn";import{ChevronRightIcon as p,CheckIcon as c}from"lucide-react";import{jsx as t,jsxs as u}from"react/jsx-runtime";function H({...e}){return t(n.Root,{"data-slot":"dropdown-menu",...e})}function ei({...e}){return t(n.Portal,{"data-slot":"dropdown-menu-portal",...e})}function O({...e}){return t(n.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function S({align:e="start",alignOffset:o=0,side:a="bottom",sideOffset:r=4,className:d,...s}){return t(n.Portal,{children:t(n.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:o,side:a,sideOffset:r,children:t(n.Popup,{"data-slot":"dropdown-menu-content",className:i("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",d),...s})})})}function F({...e}){return t(n.Group,{"data-slot":"dropdown-menu-group",...e})}function te({className:e,inset:o,...a}){return t(n.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:i("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:ps-8",e),...a})}function I({className:e,inset:o,variant:a="default",...r}){return t(n.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a,className:i("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function Re({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e})}function Ee({className:e,inset:o,children:a,...r}){return u(n.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:i("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,t(p,{className:"rtl:rotate-180 ms-auto"})]})}function Ae({align:e="start",alignOffset:o=-3,side:a="inline-end",sideOffset:r=0,className:d,...s}){return t(S,{"data-slot":"dropdown-menu-sub-content",className:i("w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",d),align:e,alignOffset:o,side:a,sideOffset:r,...s})}function Bt({className:e,children:o,checked:a,inset:r,...d}){return u(n.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:i("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...d,children:[t("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:t(n.CheckboxItemIndicator,{children:t(c,{})})}),o]})}function Hn({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function On({className:e,children:o,inset:a,...r}){return u(n.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":a,className:i("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[t("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:t(n.RadioItemIndicator,{children:t(c,{})})}),o]})}function P({className:e,...o}){return t(n.Separator,{"data-slot":"dropdown-menu-separator",className:i("-mx-1 my-1 h-px bg-border",e),...o})}function ti({className:e,...o}){return t("span",{"data-slot":"dropdown-menu-shortcut",className:i("ms-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",e),...o})}export{H,ei,O,S,F,te,I,Re,Ee,Ae,Bt,Hn,On,P,ti};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Checkbox as e}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsx as i}from"react/jsx-runtime";function fe({className:r,...a}){return i(e.Root,{"data-slot":"checkbox",className:o("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 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",r),...a,children:i(e.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:i(t,{})})})}export{fe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{H,O,S,F,te,I}from"./chunk-25bzk1wv.js";import{q}from"./chunk-djmnmbm2.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var u=["requires_action","running","done","idle"];function mr({sessions:l,onSelect:p,t:o}){return t("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":o("sessionList.states.title"),children:u.map((s)=>{let a=l.filter((n)=>n.state===s),i=o(`sessionList.states.${s}`);return r(H,{children:[r(O,{render:t(e,{variant:"ghost",size:"xs"}),"aria-label":`${i}: ${a.length}`,children:[t(q,{state:s,pulse:!1}),t("span",{className:"tabular-nums",children:a.length})]}),t(S,{"aria-label":i,className:"w-72 max-w-[calc(100vw-1rem)]",children:r(F,{children:[t(te,{children:i}),a.length===0?t(I,{disabled:!0,children:o("sessionList.states.empty")}):a.map((n)=>r(I,{onClick:()=>p(n),children:[t(q,{state:n.state,pulse:!1}),t("span",{className:"min-w-0 flex-1 truncate",children:n.title||o("sessionList.untitled")})]},n.sessionId))]})})]},s)})})}
|
|
2
2
|
export{mr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{y}from"./chunk-7zrnt6zw.js";import{e}from"./chunk-wpdn3rx8.js";import{o}from"./chunk-6acs2hzs.js";import{Le}from"./chunk-61944cv6.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ln({data:s,sessionId:m}){let{host:a}=o(),{t:n}=a,p=y(),{text:c,status:r}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(e,{type:"button",variant:"ghost",disabled:r!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:r==="ready"?n("composer.pastedTextCharacters",{count:c.length}):n(r==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),r==="error"&&a.writeTextAttachment&&t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("composer.pastedTextRetry"),onClick:()=>Le(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
+
export{Ln};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-6acs2hzs.js";import{ge,Fe,ft}from"./chunk-
|
|
1
|
+
import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-6acs2hzs.js";import{ge,Fe,ft}from"./chunk-9zmkj0dp.js";import{Oe}from"./chunk-vzy4vwqr.js";import{inSessionTree as d}from"@nyssance/codex-acp-v2/client";import{jsx as t,jsxs as c,Fragment as p}from"react/jsx-runtime";var u=[];function at({sessionId:e}){let l=n((s)=>s.sessions),{host:f}=o(),a=n((s)=>s.actions),r=a.some((s)=>d(l,e,s.sessionId))?a.filter((s)=>d(l,e,s.sessionId)):u,i=r.filter(ge),m=r.filter((s)=>!ge(s));return c(p,{children:[t("div",{className:"mx-auto max-h-[50vh] w-full max-w-3xl shrink-0 overflow-y-auto px-3","data-subagent-shelf":!0,children:t(Oe,{sessionId:e})}),m.length>0&&t("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:m.map((s)=>c("div",{children:[s.sessionId!==e&&t("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:s.sessionId===null?"":l[s.sessionId]?.title??f.t("subagents.untitled")}),t(ft,{action:s})]},s.id))}),i[0]!==void 0&&t(Fe,{action:i[0],total:i.length},i[0].id)]})}
|
|
2
2
|
export{at};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{qo}from"./chunk-54941m0z.js";function $o(t,o){if(qo(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
|
|
2
|
+
export{$o};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as o,useContext as n,useEffect as r}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as o,useContext as n,useEffect as r}from"react";var bn=o(null);function ee(t){let e=n(bn);r(()=>{if(t&&e!==null)return e()},[t,e])}
|
|
2
|
+
export{bn,ee};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{x}from"./chunk-qxabrz98.js";import{t}from"./chunk-q6km9nha.js";import{B}from"./chunk-
|
|
1
|
+
import{x}from"./chunk-qxabrz98.js";import{t}from"./chunk-q6km9nha.js";import{B}from"./chunk-y6afvrnv.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(x,{text:e.text,streaming:o})})}if(i.isImage(e))return n(B,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(B,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function oe({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
|
|
2
2
|
export{oe};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{V,W}from"./chunk-5cnw6yc7.js";import{e}from"./chunk-
|
|
2
|
-
`));else y(null)}finally{S.current=!1,j(!1)}}return a("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":n("sessionList.archives.title"),children:[a("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[a("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[i("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:n("sessionList.archives.title")}),a(e,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:E||N.length===0,onClick:()=>{T(null),M(!0),y([...N])},children:[i(ee,{className:"size-4","aria-hidden":"true"}),n("sessionList.archives.deleteAll")]})]}),a("div",{className:"flex shrink-0 flex-wrap gap-3",children:[a("div",{className:"relative min-w-48 flex-1",children:[i(xe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(
|
|
1
|
+
import{V,W}from"./chunk-5cnw6yc7.js";import{e}from"./chunk-wpdn3rx8.js";import{u,m,b,K,p,w}from"./chunk-n5xqjct2.js";import{s}from"./chunk-96x0d2vd.js";import{Nt,Mt,Rt,hn,Z}from"./chunk-aarvddmn.js";import{le}from"./chunk-pv35kspb.js";import{g,l,r}from"./chunk-da4m33bg.js";import{se,z,D}from"./chunk-x8kxqtva.js";import{sessionGroup as F}from"@nyssance/codex-acp-v2/client";import{cn as fe}from"cn";import{ArchiveIcon as ve,FolderIcon as Y,ListFilterIcon as ge,SearchIcon as xe,Trash2Icon as ee}from"lucide-react";import{useEffect as Se,useRef as ye,useState as h}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function te({className:f,...n}){return i(hn,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...n,className:fe("max-w-(--available-width) min-w-0 p-1",f)})}function H(f){return f instanceof Error?f.message:String(f)}function Le({children:f}){return i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"flex flex-col gap-8",children:f})})}function dr({Scroll:f=Le}){let{t:n,i18n:B}=g(),v=l(),N=r((t)=>t.archivedSessions),A=r((t)=>t.connection),[O,ie]=h(""),[C,ne]=h("all"),[x,ae]=h("all"),[re,oe]=h(0),[G,Q]=h(!0),[q,U]=h(null),[_,R]=h(null),[I,j]=h(!1),S=ye(!1),[P,y]=h(null),[J,T]=h(null),[ce,M]=h(!1);Se(()=>{if(A!=="ready")return;let t=!1;Q(!0),U(null);async function d(){try{await v.listArchived({reset:!0});let o=new Set;while(!t&&v.state.archivedCursor!==null){let L=v.state.archivedCursor;if(o.has(L))throw Error("Archive pagination returned a repeated cursor");o.add(L),await v.listArchived()}}catch(o){if(!t)U(H(o))}finally{if(!t)Q(!1)}}return d(),()=>{t=!0}},[v,A,re]);let c=r((t)=>t.projectContext),E=!(c!==null&&A==="ready"&&!G&&q===null)||I,k=(t)=>t.title??n("sessionList.untitled"),de=[...new Set(N.filter((t)=>c&&F(c,t).id!==D).map((t)=>c?F(c,t).id:t.cwd))].toSorted(),ue=O.trim().toLocaleLowerCase(B.language),X=N.filter((t)=>{let d=c?F(c,t).id:null,o=d===D;return k(t).toLocaleLowerCase(B.language).includes(ue)&&(C==="all"||(C==="quick"?o:!o))&&(x==="all"||(x==="quick"?o:d===x))}),me=new Intl.DateTimeFormat(B.language,{dateStyle:"medium",timeStyle:"short"});async function pe(t){if(S.current)return;S.current=!0,j(!0),R(null);try{await v.unarchive(t.sessionId)}catch(d){R(H(d))}finally{S.current=!1,j(!1)}}async function he(){if(S.current||!P)return;S.current=!0,j(!0),T(null);let t=[],d=[];try{for(let o of P){if(!v.state.archivedSessions.some((L)=>L.sessionId===o.sessionId))continue;try{await v.delete(o.sessionId)}catch(L){t.push(o),d.push(`${k(o)}: ${H(L)}`)}}if(t.length)y(t),T(d.join(`
|
|
2
|
+
`));else y(null)}finally{S.current=!1,j(!1)}}return a("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":n("sessionList.archives.title"),children:[a("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[a("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[i("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:n("sessionList.archives.title")}),a(e,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:E||N.length===0,onClick:()=>{T(null),M(!0),y([...N])},children:[i(ee,{className:"size-4","aria-hidden":"true"}),n("sessionList.archives.deleteAll")]})]}),a("div",{className:"flex shrink-0 flex-wrap gap-3",children:[a("div",{className:"relative min-w-48 flex-1",children:[i(xe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(s,{"aria-label":n("sessionList.archives.search"),placeholder:n("sessionList.archives.search"),value:O,onChange:(t)=>ie(t.target.value),className:"rounded-md ps-9"})]}),a(Nt,{value:C,onValueChange:(t)=>{if(t===null)throw Error("Archive chat type cannot be empty");ne(t)},children:[a(Rt,{"aria-label":n("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[i(ge,{"aria-hidden":"true"}),i(Mt,{children:n(`sessionList.archives.${C==="all"?"allChats":C==="quick"?"quickChats":"projectChats"}`)})]}),a(te,{children:[i(Z,{value:"all",children:n("sessionList.archives.allChats")}),i(Z,{value:"quick",children:n("sessionList.archives.quickChats")}),i(Z,{value:"project",children:n("sessionList.archives.projectChats")})]})]}),a(Nt,{value:x,onValueChange:(t)=>{if(t===null)throw Error("Archive project filter cannot be empty");ae(t)},children:[a(Rt,{"aria-label":n("sessionList.archives.project"),className:"w-48 rounded-md",children:[i(Y,{"aria-hidden":"true"}),i(Mt,{className:"truncate",children:x==="all"?n("sessionList.archives.allProjects"):x==="quick"?n("sessionList.archives.noProject"):z(x,c??void 0)})]}),a(te,{children:[i(Z,{value:"all",children:n("sessionList.archives.allProjects")}),i(Z,{value:"quick",children:n("sessionList.archives.noProject")}),de.map((t)=>i(Z,{value:t,title:t,children:z(t,c??void 0)},t))]})]})]}),a(f,{children:[A!=="ready"?i("p",{role:"status",className:"text-muted-foreground",children:n("sessionList.archives.connecting")}):G?a("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[i(le,{}),n("sessionList.archives.loading")]}):q?i(V,{variant:"destructive",children:a(W,{className:"flex items-center justify-between gap-4",children:[i("span",{children:q}),i(e,{variant:"outline",onClick:()=>oe((t)=>t+1),children:n("sessionList.archives.retry")})]})}):N.length===0?a("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[i(ve,{"aria-hidden":"true",className:"size-8"}),i("p",{children:n("sessionList.archives.empty")})]}):X.length===0?i("p",{className:"text-muted-foreground py-12 text-center",children:n("sessionList.archives.noResults")}):(c?se(X,c):[]).filter(([,t])=>t.length>0).map(([t,d])=>a("section",{className:"flex flex-col gap-3",children:[a("div",{className:"flex items-center justify-between gap-3",children:[a("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:t===D?void 0:t,children:[i(Y,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("span",{className:"truncate",children:t===D?n("sessionList.archives.noProject"):z(t,c??void 0)})]}),i("span",{className:"text-muted-foreground shrink-0 text-sm",children:n("sessionList.archives.count",{count:d.length})})]}),i("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:d.map((o)=>a("article",{"aria-label":k(o),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[a("div",{className:"min-w-0 flex-1 basis-40",children:[i("h3",{className:"truncate text-sm font-medium",title:k(o),children:k(o)}),o.updatedAt!==null&&i("time",{dateTime:o.updatedAt,title:n("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:me.format(new Date(o.updatedAt))})]}),a("div",{className:"flex shrink-0 items-center gap-2",children:[i(e,{variant:"ghost",size:"icon-sm","aria-label":n("sessionList.delete"),title:n("sessionList.delete"),disabled:E,className:"text-muted-foreground hover:text-destructive",onClick:()=>{T(null),M(!1),y([o])},children:i(ee,{"aria-hidden":"true"})}),i(e,{variant:"secondary",size:"sm",disabled:E,onClick:()=>void pe(o),children:n("sessionList.archives.unarchive")})]})]},o.sessionId))})]},t)),_&&i(V,{variant:"destructive",children:i(W,{children:_})})]})]}),i(u,{open:P!==null,onOpenChange:(t)=>{if(!t&&!S.current)y(null)},children:a(m,{showCloseButton:!I,children:[a(b,{children:[i(p,{children:n("sessionList.archives.deleteTitle")}),i(w,{children:n(ce?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:P?.length??0})})]}),J&&i(V,{variant:"destructive",children:i(W,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:J})}),a(K,{children:[i(e,{variant:"outline",disabled:I,onClick:()=>y(null),children:n("sessionList.cancel")}),a(e,{variant:"destructive",className:"text-sm font-normal",disabled:E,onClick:()=>void he(),children:[I&&i(le,{}),n("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
3
|
export{dr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function Ht(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function
|
|
2
|
-
export{Ht,
|
|
1
|
+
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function Ht(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function Mn(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=Ht(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
|
|
2
|
+
export{Ht,Mn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tt}from"./chunk-b9hjn4a5.js";async function
|
|
2
|
-
export{
|
|
1
|
+
import{Tt}from"./chunk-b9hjn4a5.js";async function pn(i,c){let s=new WeakSet;while(!c.aborted){let r=Array.from(i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')).filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function je(i,c){if(!c)return[];let s=[],r="",e=[],o=()=>{let t=0,n=0;for(let{start:a,end:l}of Tt(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<l)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,l-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let l=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+l.length}),r+=l;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){o();return}if(t.tagName==="BR"){o();return}let n=m.has(t.tagName);if(n)o();for(let a of t.childNodes)u(a);if(n)o()};return u(i),o(),s}
|
|
2
|
+
export{pn,je};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsx as t}from"react/jsx-runtime";function ze({className:e,size:i="default",...r}){return t(a.Root,{"data-slot":"switch","data-size":i,className:d("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...r,children:t(a.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] rtl:group-data-[size=default]/switch:data-checked:-translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] rtl:group-data-[size=sm]/switch:data-checked:-translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 rtl:group-data-[size=default]/switch:data-unchecked:-translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 rtl:group-data-[size=sm]/switch:data-unchecked:-translate-x-0 dark:data-unchecked:bg-foreground"})})}export{ze};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{G}from"./chunk-r9p03chx.js";import{t}from"./chunk-q6km9nha.js";import{SquareSlashIcon as s}from"lucide-react";import{useRef as l}from"react";import{jsx as r}from"react/jsx-runtime";function En({textareaRef:a,onOpenChange:p,menuOpen:e,disabled:m}){let{t:o}=t(),n=l(!1);return r(G,{"aria-label":o("composer.commands"),title:o("composer.commands"),disabled:m,"aria-pressed":e,onPointerDown:()=>{n.current=e},onClick:()=>{p(!n.current),a.current?.getTextarea()?.focus()},children:r(s,{className:"size-4"})})}
|
|
2
|
+
export{En};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function
|
|
3
|
-
export{
|
|
1
|
+
var Ri=["full","compact","codexUI"];function qo(t){return t==="compact"||t==="codexUI"}var zr=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function E(t){let o=zr.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
|
|
2
|
+
`)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function Ei(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
|
|
3
|
+
export{Ri,qo,zr,E,Ei};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{j}from"./chunk-1fm5vx1n.js";import{_t}from"./chunk-10j68dch.js";import{Sn}from"./chunk-w38vbf7h.js";import{_e}from"./chunk-7zrnt6zw.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as X}from"cn";import{BookOpenTextIcon as st,FileIcon as it,StoreIcon as lt}from"lucide-react";import{useCallback as ut,useEffect as v,useLayoutEffect as Y,useMemo as Z,useRef as _,useState as g}from"react";import{createPortal as at}from"react-dom";import{jsx as p,jsxs as E,Fragment as ct}from"react/jsx-runtime";function Tn({handleRef:a,anchorRef:c,commands:C,searchFiles:u,onMention:R,onSearchError:H,fileSearchDebounceMs:M=0,bashMode:A=!1,forcedOpen:i=!1,onForcedOpenChange:f,emptyLabel:F,fileStatusLabels:h,morePlugins:D}){let z=_e(),l=z.textInput.value,[K,U]=g(0),[y,P]=g(null),[b,L]=g(0),V=_(null);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>U(t.selectionStart??0),o=()=>{if(document.activeElement===t)n()};return t.addEventListener("keyup",n),t.addEventListener("click",n),t.addEventListener("input",n),t.addEventListener("select",n),t.addEventListener("focus",n),document.addEventListener("selectionchange",o),()=>{t.removeEventListener("keyup",n),t.removeEventListener("click",n),t.removeEventListener("input",n),t.removeEventListener("select",n),t.removeEventListener("focus",n),document.removeEventListener("selectionchange",o)}});let W=Z(()=>A&&l.startsWith("!")?null:Sn(l,K),[l,K,A]),r=W?.kind==="at"&&!u?null:W,q=`${r?.kind??"forced"}:${r?.query??""}:${i}`,[O,tt]=g(q);if(O!==q)tt(q),L(0);let I=_(null);v(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=l;else if(l!==I.current)f?.(!1)},[i,l,f]);let x=r?.kind==="at"?r.query:null;v(()=>{if(x===null||!u){P(null);return}let t=!0,n=()=>{u(x).then((s)=>{if(t)P({query:x,search:u,items:s})},(s)=>{if(t)P({query:x,search:u,items:[]}),H(s)})},o=M>0?window.setTimeout(n,M):null;if(o===null)n();return()=>{if(t=!1,o!==null)window.clearTimeout(o)}},[x,u,M,H]);let d=Z(()=>{if(r?.kind==="at")return y?.query===r.query&&y.search===u?y.items:[];if(r)return _t(C,r.query);if(i)return _t(C,"");return[]},[r,i,C,y,u]),[et,N]=g(!1);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>N(!0),o=()=>{if(N(!1),i)f?.(!1)};return N(document.activeElement===t),t.addEventListener("focus",n),t.addEventListener("blur",o),()=>{t.removeEventListener("focus",n),t.removeEventListener("blur",o)}},[a,i,f]),v(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let m=et&&(r!==null?r.kind==="slash"||d.length>0||!!h:i);v(()=>{if(!m)return;V.current?.querySelector(`[data-idx="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,m]);function Q(t){let n=a.current?.getTextarea();if(!n)return;let o,s;if(r){let B=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(o=l.slice(0,r.start)+B+l.slice(r.end),r.kind==="at")R?.(t.payload);s=r.start+B.length}else if(i)o=`${l.length===0||l.endsWith(`
|
|
2
2
|
`)?l:`${l}
|
|
3
3
|
`}/${t.payload} `,s=o.length,f?.(!1);else return;z.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)Q(s)}else if(o.key==="Escape")if(o.preventDefault(),o.stopPropagation(),r)U(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",n,!0),()=>t.removeEventListener("keydown",n,!0)});let[k,G]=g(null),[S,nt]=g(null),T=ut(()=>{let t=c?.current;if(!t)return;let n=t.getBoundingClientRect();G({left:n.left,width:n.width,bottom:window.innerHeight-n.top+8})},[c]);if(Y(()=>{if(!m){G(null);return}T()},[m,T]),Y(()=>{let t=c?.current;if(!m||!t||!S)return;return rt(t,S,T,{animationFrame:!0})},[m,S,c,T]),!m||c&&!k)return null;let w=r?r.kind==="slash":i,ot=w?st:it,J=p("div",{ref:nt,className:c?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:c&&k?{left:k.left,width:k.width,bottom:k.bottom}:void 0,children:E("div",{ref:V,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[d.length===0&&w&&p("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:F}),d.length===0&&!w&&h&&p("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:y?.query===x&&y.search===u?h.empty:h.loading}),d.map((t,n)=>E(e,{type:"button",variant:"ghost",role:"option","aria-selected":n===b,"data-idx":n,onMouseDown:(o)=>{o.preventDefault(),Q(t)},onMouseEnter:()=>L(n),className:X("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",n===b&&"bg-muted"),children:[p(ot,{className:X("size-4 shrink-0",w?"text-blue-500":"text-muted-foreground")}),p("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&p("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),w&&D&&E(ct,{children:[p(j,{}),E(e,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[p(lt,{"data-icon":"inline-start"}),D.label]})]})]})});return c?at(J,document.body):J}
|
|
4
|
-
export{
|
|
4
|
+
export{Tn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{l,r}from"./chunk-da4m33bg.js";import{QUICK_CHATS_GROUP as m,sessionGroup as a}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function gr(i){let t=l(),e=r((s)=>s.projectContext),c=i===null?m:e?a(e,{cwd:t.projectPath(i)}).id:null,u=r((s)=>s.sessionList),d=r((s)=>s.connection),n=r((s)=>s.sessionListLoaded),o=r((s)=>s.sessionListError),f=()=>t.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(d==="ready"&&!n&&o===null)t.listSessions().catch(()=>{return})},[t,d,n,o]),{result:L(()=>{if(n&&e)return{status:"ready",sessionRows:u.filter((s)=>a(e,{...s,cwd:t.projectPath(s.cwd)}).id===c).toSorted((s,p)=>(p.updatedAt??"").localeCompare(s.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[t,u,n,o,c,e]),retry:f}}
|
|
2
|
+
export{gr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i,L,yt}from"./chunk-40d5the9.js";var
|
|
2
|
-
export{
|
|
1
|
+
import{i,L,yt}from"./chunk-40d5the9.js";var Fn=5000;function de(t){return"pastedText"in t}function Er(t){return`file://${encodeURI(t).replaceAll("#","%23").replaceAll("?","%3F")}`}function Le(t,e,o){let n=(r,s)=>{for(let[a,x]of i){if(!x.attachments.some((p)=>p.id===e.id))continue;L(a,(p)=>p.map((d)=>d.id===e.id?{...e,url:s===void 0?"":Er(s),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!i.get(t)?.attachments.some((r)=>r.id===e.id))return;n("pending"),yt(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>n("ready",r)).catch(()=>n("error")))}function gt(t,e,o,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((a)=>a.kind==="file"&&a.type.startsWith("image/")))return;let r=t.clipboardData.getData("text/plain");if(r.length<Fn)return;t.preventDefault(),t.stopPropagation();let s={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};L(e,(a)=>[...a,s]),Le(e,s,n)}
|
|
2
|
+
export{Fn,de,Er,Le,gt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Go}from"./chunk-vk36fprb.js";import{t}from"./chunk-q6km9nha.js";import{To,So}from"./chunk-1wpdb17m.js";import{B}from"./chunk-y6afvrnv.js";import{Q}from"./chunk-g5gz25jy.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var Co=p(function({item:s,messageTime:c}){let l=t(),o=So(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
2
|
${e.text}`).join(`
|
|
3
|
-
`):Q(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=To(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(B,{block:e},`${s.id}:${n}`))}),r(
|
|
3
|
+
`):Q(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=To(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(B,{block:e},`${s.id}:${n}`))}),r(Go,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
|
|
4
4
|
export{Co};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{s}from"./chunk-96x0d2vd.js";import{cn as h}from"cn";import{ChevronDownIcon as g,ChevronUpIcon as b,XIcon as z}from"lucide-react";import{useEffect as B,useImperativeHandle as N,useRef as E}from"react";import{jsx as n,jsxs as k}from"react/jsx-runtime";function gn({ref:p,value:o,onChange:d,onFind:i,onClose:a,placeholder:m,autoFocusOpen:l=!0,prevTitle:c,nextTitle:u,className:v}){let r=E(null);N(p,()=>{if(r.current===null)throw Error("FindBar input is not mounted");return r.current},[]),B(()=>{if(!l)return;let t=r.current;if(t===null)throw Error("FindBar input is not mounted");t.focus({preventScroll:!0}),t.select()},[l]);let f=!o;return k("div",{className:h("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",v),children:[n(s,{ref:r,value:o,onChange:(t)=>d(t.target.value),placeholder:m,className:"h-7 text-xs",onKeyDown:(t)=>{if(t.key==="Escape"){t.preventDefault(),a();return}if(t.key==="Enter"){if(t.preventDefault(),o)i(t.shiftKey)}}}),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:f,onClick:()=>i(!0),title:c?`${c} (⇧↵)`:"⇧↵",children:n(b,{className:"size-3.5"})}),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:f,onClick:()=>i(!1),title:u?`${u} (↵)`:"↵",children:n(g,{className:"size-3.5"})}),n(e,{size:"icon",variant:"ghost",className:"size-6",onClick:a,title:"Esc",children:n(z,{className:"size-3.5"})})]})}
|
|
2
2
|
export{gn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PreviewCard as i}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsx as r}from"react/jsx-runtime";function Pe({...e}){return r(i.Root,{"data-slot":"hover-card",...e})}function Ne({...e}){return r(i.Trigger,{"data-slot":"hover-card-trigger",...e})}function Me({className:e,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(i.Portal,{"data-slot":"hover-card-portal",children:r(i.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(i.Popup,{"data-slot":"hover-card-content",className:s("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-
|
|
1
|
+
import{PreviewCard as i}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsx as r}from"react/jsx-runtime";function Pe({...e}){return r(i.Root,{"data-slot":"hover-card",...e})}function Ne({...e}){return r(i.Trigger,{"data-slot":"hover-card-trigger",...e})}function Me({className:e,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(i.Portal,{"data-slot":"hover-card-portal",children:r(i.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(i.Popup,{"data-slot":"hover-card-content",className:s("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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",e),...n})})})}export{Pe,Ne,Me};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{Pe,Ne,Me}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{n}from"./chunk-q6km9nha.js";import{Pe,Ne,Me}from"./chunk-6wqbetcx.js";import{o}from"./chunk-6acs2hzs.js";import{c,M}from"./chunk-n1tjf64a.js";import{hasAccount as L,isGroupedSelect as H}from"@nyssance/codex-acp-v2/client";import{cn as W}from"cn";import{useEffect as T,useState as F}from"react";import{jsx as r,jsxs as u}from"react/jsx-runtime";var p=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),z=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),O=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function g(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function A(a,t){let e=Math.min(100,a/t*100),f=e>=90?"text-destructive":e>=70?"text-foreground":"text-muted-foreground";return{pct:e,className:f}}function I(a){let t=c(a.configOptions,"model");return t===void 0?void 0:M(t)}function An(a,t){let e=a.windowDurationMins;if(e===null)return t("usage.usage");if(e%1440===0)return t("usage.windowDays",{count:e/1440});return t("usage.windowHours",{count:Math.round(e/60)})}function U(a){let{client:t}=o(),e=n((s)=>a&&s.connection==="ready"&&L(s.agent)),[f,l]=F(null);return T(()=>{if(!e){l(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)l(m)},()=>{return});let d=t.onRateLimits((m)=>{if(s)l(m)});return()=>{s=!1,d()}},[e,t]),e?f:null}function ct({session:a}){let{t}=o().host,e=c(a.configOptions,"model"),f=e!==void 0&&(H(e.options)?e.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===e.currentValue)):!e.currentValue.startsWith("gateway:")&&e.options.some((i)=>i.value===e.currentValue)),l=U(f),{usage:s,lastTurnUsage:d}=a;if(s===null&&d===null)return null;let m=s&&s.size>0?A(s.used,s.size):null,h=7,b=2*Math.PI*h,N=g(d?.inputTokens),k=g(d?.outputTokens),x=g(d?.cachedReadTokens),w=g(d?.cachedWriteTokens),S=g(d?.totalTokens)||N+k+x+w,R=N+x,C=R>0?z.format(x/R):t("tokens.notAvailable"),D=[[t("tokens.input"),p.format(N)],[t("tokens.output"),p.format(k)],[t("tokens.cachedRead"),p.format(x)],[t("tokens.cachedWrite"),p.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),p.format(S)]],v=I(a);return u(Pe,{children:[r(Ne,{delay:100,closeDelay:100,render:u("button",{type:"button",className:W("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(Me,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[d!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:D.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:p.format(s.used),limit:p.format(s.size),percent:O.format(s.used/s.size*100)})})]}),l!==null&&(l.primary!==null||l.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[l.primary,l.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:An(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{An,ct};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Zn,y}from"./chunk-
|
|
1
|
+
import{Zn,y}from"./chunk-7zrnt6zw.js";import{Tn}from"./chunk-56e8naj1.js";import{ne}from"./chunk-bj5ma2sv.js";import{Un,$n,qn,Vn,Wn,G}from"./chunk-r9p03chx.js";import{kn,Cn}from"./chunk-nact4a4b.js";import{Dt}from"./chunk-8e3wcvkd.js";import{t,n}from"./chunk-q6km9nha.js";import{o}from"./chunk-6acs2hzs.js";import{Ot}from"./chunk-afd3bq7v.js";import{i,sr,L,bt}from"./chunk-40d5the9.js";import{dt}from"./chunk-mzh48e09.js";import{de,gt}from"./chunk-61944cv6.js";import{wt,Ct}from"./chunk-4r3ch7fk.js";import{lr}from"./chunk-nbkkfyss.js";import{pt}from"./chunk-cjmjv7pv.js";import{Ln}from"./chunk-2ecx1xed.js";import{ut}from"./chunk-1aeswxaf.js";import{mt}from"./chunk-20mzyay7.js";import{En}from"./chunk-4tff1nyj.js";import{Bn}from"./chunk-zjmqne2f.js";import{ct}from"./chunk-7eje3z81.js";import{hasFuzzyFileSearch as Lt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as zt}from"lucide-react";import{useCallback as O,useEffect as Ut,useLayoutEffect as Q,useMemo as Z,useRef as V,useState as S}from"react";import{jsx as c,jsxs as I}from"react/jsx-runtime";var Wt=["image/png","image/jpeg","image/webp","image/gif"],tt=[];async function jt(e){let d=await(await fetch(e.url)).blob();return new Promise((l,E)=>{let T=new FileReader;T.onerror=()=>E(T.error),T.onload=()=>{let _=T.result;l(_.slice(_.indexOf(",")+1))},T.readAsDataURL(d)})}function Ht(e){let{t:d}=t(),l=y();return c(G,{"aria-label":d("composer.attachImage"),title:d("composer.attachImage"),onClick:()=>l.openFileDialog(),...e,children:c(zt,{className:"size-4"})})}function st({session:e,onSubmit:d,onShellCommand:l,onHandOff:E,modelSelector:T,modelMenu:_,inputHeader:et,actions:vt,children:It,attachmentPolicy:Tt,predictions:At=!0,disabled:Mt=!1,preparing:rt=!1,allowPendingInput:Et=!1}){let{host:F,client:R}=o(),{t:p}=F,k=O((r)=>{if(F.reportError)F.reportError(r);else console.error(r)},[F]),[nt,D]=S(()=>({text:i.get(e.id)?.text??"",revision:0})),{text:b}=nt,[A,Rt]=S(()=>i.get(e.id)?.attachments??tt),[u,z]=S(()=>i.get(e.id)?.mentions??[]),X=A.some((r)=>de(r)&&r.pastedText.status!=="ready"),[M,ot]=S(!1),[U,Nt]=S(!1),[q,at]=S(!1),f=V(null),it=V(null),a=V(nt),W=O((r)=>{it.current?.(),a.current={text:r,revision:a.current.revision+1},D(a.current)},[]),lt=Z(()=>({read:()=>{let s=f.current?.getTextarea(),g=s===null||s===void 0?[a.current.text.length,a.current.text.length]:[s.selectionStart,s.selectionEnd];return{target:e.id,...a.current,selection:g}},compareAndSet(s,g,C){if(s.target!==e.id||s.revision!==a.current.revision)return null;a.current={text:g,revision:a.current.revision+1},D(a.current);let x=f.current?.getTextarea();if(x!==null&&x!==void 0)x.value=g,x.setSelectionRange(C[0],C[1]);return{target:e.id,...a.current,selection:C}}}),[e.id]),B=V(null),ft=O((r)=>(B.current=r,()=>{if(B.current===r)B.current=null}),[]),j=e.state!=="idle",v=l!==void 0&&b.startsWith("!"),h=!Mt&&!rt&&e.attached&&!e.restoring&&!e.readOnly,N=!e.readOnly&&(Et||h),H=mt(e,h&&!M&&!U&&!X&&!q,b.length>0||A.length>0||u.length>0,At&&!v),ht=H.invalidate;Q(()=>{i.set(e.id,{text:b,attachments:A,mentions:u,modelId:i.get(e.id)?.modelId??null})},[e.id,b,A,u]),Q(()=>sr(e.id,Rt),[e.id]),Q(()=>bt(e.id,(r)=>{if(!N||M)throw Error("The composer cannot take text now; try again later");if(b.length||A.length||u.length)throw Error("The composer already has a draft; send or clear it first");W(r)}),[e.id,N,M,b,A,u,W]);let xt=n((r)=>Lt(r.agent)),St=Z(()=>xt&&h?async(r)=>dt((await R.fuzzyFileSearch({query:r,roots:[e.cwd]})).files):void 0,[R,xt,h,e.cwd]),J=O((r)=>{z((s)=>s.includes(r)?s:[...s,r])},[]);Ut(()=>{f.current?.focus()},[]);let yt=O(async({text:r,files:s})=>{let g=l!==void 0&&r.startsWith("!")?r.slice(1):null;if(g!==null){if(g.trim().length===0)return;if(s.length||u.length)throw Error("Shell commands cannot include file references or attachments");if(e.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let C=r.trim();if(C.length===0&&s.length===0&&u.length===0)return;let x=B.current;ot(!0);let w=i.get(e.id),_t=a.current.revision,K=null;try{let P=[];for(let m of u){let Y={kind:"file",absPath:m};P.push({type:"resource_link",uri:wt(Y),name:Ct(Y)})}if(C.length>0)P.push({type:"text",text:C});for(let m of s)if(de(m)){if(m.pastedText.status!=="ready")throw Error("Text attachment is not ready");P.push({type:"resource_link",uri:m.url,name:m.filename??"pasted-text.txt"})}else P.push({type:"image",data:await jt(m),mimeType:m.mediaType});if(a.current.revision===_t&&i.get(e.id)===w)a.current={text:"",revision:a.current.revision+1},K=a.current.revision,D(a.current),z([]),L(e.id,()=>tt),i.set(e.id,{text:"",attachments:tt,mentions:[],modelId:w?.modelId??null}),f.current?.resetHeight();if(g!==null&&l)await l(g);else if(d)if(x===null)await d(P);else await d(P,(m)=>{if(x.signal.aborted||B.current!==x)return;x.accept(m),E?.(e.id,m)});else if(x===null)await R.prompt(e.id,P);else{let m=await R.prompt(e.id,P);x.accept(m)}ht();for(let m of w?.attachments??[])if(m.url.startsWith("blob:")&&!i.get(e.id)?.attachments.some((Y)=>Y.id===m.id))URL.revokeObjectURL(m.url)}catch(P){if(w&&K!==null&&a.current.revision===K&&i.get(e.id)?.attachments.length===0&&i.get(e.id)?.mentions.length===0)a.current={text:w.text,revision:K+1},D(a.current),z(w.mentions),i.set(e.id,w),L(e.id,()=>w.attachments);throw P}finally{ot(!1),f.current?.focus()}},[R,e.id,e.state,u,d,l,E,ht]),Ft=()=>{R.cancel(e.id).catch(k)},kt=O((r)=>{let s=r.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:ne})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});k(s)},[k,p]),Bt=Z(()=>({session:e,ready:h,inputReady:N,sending:M,textareaRef:f,draft:lt,interruptRef:it,observeReceipts:ft,addMention:J,setAdding:Nt,shellMode:v,handsFree:!v&&(d===void 0||E!==void 0)}),[e,h,N,M,lt,ft,J,d,E,v]),Pt=F.writeTextAttachment;return c(Ot,{value:Bt,children:c("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:I("div",{className:"relative",children:[et&&c("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:et}),I(Zn,{attachmentPolicy:Tt,value:b,revision:a.current.revision,onValueChange:W,onSubmittedClear:()=>{a.current={text:"",revision:a.current.revision+1},D(a.current)},attachments:A,onAttachmentsChange:(r)=>L(e.id,()=>r),children:[c(Tn,{bashMode:l!==void 0,handleRef:f,commands:e.commands,searchFiles:St,onMention:J,onSearchError:k,forcedOpen:q,onForcedOpenChange:at,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),I(Un,{"data-shell-mode":v||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:Wt.join(","),onError:kt,onSubmit:yt,onSubmitAsync:yt,onSubmitError:k,canSubmit:()=>h&&!M&&!U&&!X&&(!v||!j&&b.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[It,I(qn,{className:"px-3 pt-3 pb-0 empty:hidden",children:[U&&c("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),c(lr,{mentions:u,onRemove:(r)=>z((s)=>s.filter((g)=>g!==r))}),c(Cn,{children:(r)=>de(r)?c(Ln,{data:r,sessionId:e.id}):c(kn,{data:r,t:p})})]}),I($n,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(r)=>{if(!H.text||f.current?.isComposing()||r.nativeEvent.isComposing||r.nativeEvent.keyCode===229||r.shiftKey||r.ctrlKey||r.altKey||r.metaKey||r.target!==f.current?.getTextarea())return;if(r.key==="Tab")r.preventDefault(),r.stopPropagation(),W(H.text)},children:[v&&c("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),c(Dt,{className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,bashMode:l!==void 0,disabled:!N,onPasteCapture:Pt?(r)=>gt(r,e.id,p("composer.pastedTextFilename"),Pt):void 0,placeholder:v?"! command":H.text||(j?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),c(Vn,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:I("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[I("div",{className:"flex min-w-0 items-center gap-[5px]",children:[c(Ht,{className:"text-foreground",disabled:!N}),c(En,{textareaRef:f,menuOpen:q,onOpenChange:at,disabled:!h||e.commands.length===0}),c(ut,{sessionId:e.id,options:e.configOptions,disabled:!h})]}),I(Wn,{className:"w-full min-w-0 items-center justify-end gap-1",children:[c(ct,{session:e}),T??c(pt,{..._,sessionId:e.id,options:e.configOptions,disabled:!h}),vt,c(Bn,{active:j,sending:M||rt||U,ready:h&&!X&&(!v||!j&&b.slice(1).trim().length>0),hasMentions:u.length>0,onStop:Ft})]})]})})]})]})]})})})}
|
|
2
2
|
export{st};
|
|
@@ -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 Kt=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function wo(e){Kt.setState({...e,terminals:e.terminals??{}})}function ko(e){if(Kt.getState().sessionId===e)Kt.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function Ci(e,n,t){let i=Kt.getState();if(t.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(n,void 0,{align:"top"})}
|
|
2
|
+
export{Kt,wo,ko,Ci};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{sn
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{t}from"./chunk-q6km9nha.js";import{codexTurnError as h}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as R}from"lucide-react";import{useEffect as C,useRef as u,useState as i}from"react";import{jsx as o,jsxs as m}from"react/jsx-runtime";function an({children:c}){return m("div",{className:"codex-error-message",role:"alert",children:[o(R,{"aria-hidden":"true"}),o("div",{className:"min-w-0 flex-1",children:c})]})}function sn({error:c,retry:r}){let{t:f}=t(),p=h(c),[l]=i(()=>r?.delaySeconds==null?null:Date.now()+r.delaySeconds*1000),[v,y]=i(r?.delaySeconds??null),[T,x]=i(!1),[g,w]=i(null),a=u(!1),E=u(!1),S=u(r?.run);S.current=r?.run;let b=u((N)=>{let s=S.current;if(a.current||s===void 0)return;a.current=!0,x(!0),w(null),s(N).catch((n)=>{E.current=!0,a.current=!1,y(null),x(!1),w(n instanceof Error?n.message:String(n))})}),d=r!==void 0&&p.retryable;return C(()=>{if(!d||l===null)return;let s=setInterval(()=>{if(E.current||a.current)return;let n=Math.max(0,Math.ceil((l-Date.now())/1000));if(y(n),n===0)b.current("automatic")},1000);return()=>clearInterval(s)},[l,d]),m(an,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:p.message}),d&&o(e,{variant:"outline",size:"sm",disabled:T,onClick:()=>b.current("manual"),children:v===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:v})})]}),g!==null&&o("div",{className:"text-muted-foreground mt-2 text-sm",children:g})]})}
|
|
2
|
+
export{an,sn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null)
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),$t=d(null);function li(){return i($t)}var qt=d(null);function ci(){return i(qt)}var De=d(null);function _e(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var He=()=>i(C);function di(){let r=i(De);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(De);function Zn({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,attachments:U,onAttachmentsChange:L,children:B}){let S=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),T=A!==void 0,[G,J]=z(r),p=A??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,T)R?.(t);else J(t)},[T,R]),g=n(()=>P(""),[P]),x=U!==void 0,[K,N]=z([]),v=U??K,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)L?.(e);else N(e)},[x,L]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:S(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[f,S,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let k=n(()=>{w.current?.()},[]),b=q(()=>({files:v,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[v,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:W,clearSubmitted:c??g},attachments:b,__registerFileInput:H}),[p,P,g,W,c,b,H]);return D(C.Provider,{value:Q,children:D(De.Provider,{value:b,children:B})})}var Vt=d(null);function y(){let r=X(),l=i(Vt),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
+
export{$t,li,qt,ci,De,_e,He,di,Zn,Vt,y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Yn}from"./chunk-qpmjezsw.js";import{In,Pn,lt}from"./chunk-1hzdqep7.js";import{He,y}from"./chunk-7zrnt6zw.js";import{cn as w}from"cn";import{forwardRef as A,useCallback as D,useEffect as M,useImperativeHandle as K,useRef as f}from"react";import{jsx as F}from"react/jsx-runtime";var L=(i)=>!i.shiftKey,R=()=>!1,Dt=A(({onChange:i,onCompositionStart:g,onCompositionEnd:v,className:x,placeholder:T,bashMode:b=!1,isSendShortcut:E=L,isNewlineShortcut:I=R,...C},H)=>{let n=He(),l=y(),o=f(!1),u=f(!1),r=f(null),s=D(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);M(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=b&&(n?.textInput.value??"").startsWith("!"),P=(e)=>{if(o.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||u.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
|
|
2
2
|
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:a,selectionEnd:m,value:p}=t,d=`${p.slice(0,a)}
|
|
3
|
-
${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(E(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},S=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=
|
|
3
|
+
${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(E(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},S=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=In(t),p=Pn(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},k=n?{value:o.current&&r.current?r.current.value:c?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=o.current?e.currentTarget.value:lt(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)lt(e.currentTarget);s(),i?.(e)}};return K(H,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),F(Yn,{"data-chat-input":!0,ref:r,rows:3,className:w("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",x),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=lt(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),v?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,g?.(e)},onKeyDown:P,onPaste:S,placeholder:T,...C,...k})});Dt.displayName="PromptInputTextarea";
|
|
4
4
|
export{Dt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function s({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",i),...r})}export{s};
|