@alwith/module-chat 0.6.1 → 0.6.2

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.
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-bt01an6h.js";import{Jt,e,f}from"./chunk-xecs5c6a.js";import{Ht}from"./chunk-030esp62.js";import{Qt}from"./chunk-v0h2wsj4.js";import{Xt}from"./chunk-vkc6mwyb.js";import{Rt,Ft}from"./chunk-0fmepk2y.js";import{Dt}from"./chunk-eryds6y3.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function Er({host:o,client:c,...s}){let m=O(()=>o.openDiff?o:{...o,openDiff:Rt},[o]);return i(Jt,{host:m,client:c,children:[r(I,{...s}),!o.openDiff&&r(Ft,{})]})}function I({session:o,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,v=t((a)=>a.connection==="ready"),y=t((a)=>a.historyPages[o.id]?.error),u=()=>f(d,R.open(o.id,o.cwd)),x=o.items.length===0&&o.attached&&!o.restoring&&o.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!x&&r(Xt,{sessionId:o.id,rootRef:p}),s,v&&!o.attached&&!o.restoring&&!o.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:u,children:n("conversation.reconnect")})})]})}),x?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(Qt,{session:o,timeline:m}),r(Dt,{sessionId:o.id}),o.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),y&&r("p",{role:"alert",className:"text-destructive break-words",children:y})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:u,disabled:!v||o.restoring,children:n(o.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Ht,{session:o})]}),T]})}
1
+ import{t}from"./chunk-bt01an6h.js";import{Jt,e,f}from"./chunk-xecs5c6a.js";import{Ht}from"./chunk-e4h6f6dh.js";import{Qt}from"./chunk-v0h2wsj4.js";import{Xt}from"./chunk-vkc6mwyb.js";import{Rt,Ft}from"./chunk-0fmepk2y.js";import{Dt}from"./chunk-eryds6y3.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function Er({host:o,client:c,...s}){let m=O(()=>o.openDiff?o:{...o,openDiff:Rt},[o]);return i(Jt,{host:m,client:c,children:[r(I,{...s}),!o.openDiff&&r(Ft,{})]})}function I({session:o,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,v=t((a)=>a.connection==="ready"),y=t((a)=>a.historyPages[o.id]?.error),u=()=>f(d,R.open(o.id,o.cwd)),x=o.items.length===0&&o.attached&&!o.restoring&&o.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!x&&r(Xt,{sessionId:o.id,rootRef:p}),s,v&&!o.attached&&!o.restoring&&!o.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:u,children:n("conversation.reconnect")})})]})}),x?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(Qt,{session:o,timeline:m}),r(Dt,{sessionId:o.id}),o.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),y&&r("p",{role:"alert",className:"text-destructive break-words",children:y})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:u,disabled:!v||o.restoring,children:n(o.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Ht,{session:o})]}),T]})}
2
2
  export{Er};
@@ -0,0 +1,2 @@
1
+ import{t}from"./chunk-bt01an6h.js";import{e}from"./chunk-xecs5c6a.js";import{codexExtensionCapabilities as w,codexTurnId as M,composerPrediction as j,isBooleanOption as B,isSelectOption as F}from"@nyssance/codex-acp-v2/client";import{useEffect as b,useMemo as C,useRef as O,useState as R}from"react";function Gt(r,g,s,y){let{client:S}=e(),P=t((n)=>w(n.agent).composerPredictions),k=C(()=>r.items.findLast((n)=>n.kind==="user"),[r.items]),i=M(k?._meta),_=C(()=>r.configOptions.flatMap((n)=>F(n)||B(n)?[[n.configId,n.currentValue]]:[]).toSorted(([n],[c])=>String(n).localeCompare(String(c))),[r.configOptions]),o=JSON.stringify([r.id,i,_]),u=j(r._meta),d=r._meta?.codex,m=typeof d==="object"&&d!==null&&"prediction"in d?d.prediction:null,l=O(null),f=O(!1);b(()=>(f.current=!0,()=>{f.current=!1}),[]);let[a,q]=R(null),[v,x]=R(null),p=y&&P&&g&&r.state==="idle"&&r.lastStopReason==="end_turn"&&!k?.replayed&&i!==null;b(()=>{if(!p||s||a===o||l.current?.key===o||i===null)return;let n={key:o,previousResult:m};l.current=n,x(null),S.requestPrediction(r.id,i).catch((c)=>{if(f.current&&l.current===n)x({key:o,message:c instanceof Error?c.message:String(c)})})},[S,p,s,a,o,m,r.id,i]);let I=p&&!s&&a!==o&&l.current?.key===o&&l.current.previousResult!==m&&u?.sourceTurnId===i,E=I&&u.result.type==="completed"?u.result.text:null,T=y&&g&&r.state==="idle"&&!s&&a!==o?v?.key===o?v.message:I&&u.result.type==="failed"?u.result.message:null:null;return{text:E,error:T,invalidate:()=>{if(p)q(o)}}}
2
+ export{Gt};
@@ -0,0 +1,2 @@
1
+ import{be}from"./chunk-g3snk3nb.js";import{Uo,N}from"./chunk-cm5rcd9q.js";import{Mo,Ao,Eo,Lo,Ro,R}from"./chunk-6pwy0ncf.js";import{n,t}from"./chunk-bt01an6h.js";import{e}from"./chunk-xecs5c6a.js";import{zo}from"./chunk-4xjzvwg4.js";import{_o}from"./chunk-3stf1tm2.js";import{ho}from"./chunk-zn9xn0pj.js";import{go,fo}from"./chunk-bb1y2fy7.js";import{ln}from"./chunk-abjr18n6.js";import{fn}from"./chunk-p9ra3xxb.js";import{s,Bo,z,$t}from"./chunk-az434tgy.js";import{Bt}from"./chunk-ce3wg766.js";import{Le,Vt}from"./chunk-v7dyjpv3.js";import{Kt,Wt}from"./chunk-zr2a9z0m.js";import{Vo}from"./chunk-0ag4ewq9.js";import{zt}from"./chunk-enr3j794.js";import{ko}from"./chunk-ksyb8hyt.js";import{Zt}from"./chunk-j5engcds.js";import{Gt}from"./chunk-cn9g220k.js";import{So}from"./chunk-qznyjv2c.js";import{No}from"./chunk-9g7qvbhx.js";import{Io}from"./chunk-v4cf374m.js";import{Ut}from"./chunk-sqwscqfk.js";import{hasFuzzyFileSearch as Nt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as St}from"lucide-react";import{useCallback as O,useEffect as kt,useLayoutEffect as Z,useMemo as tt,useRef as V,useState as F}from"react";import{jsx as i,jsxs as v,Fragment as _t}from"react/jsx-runtime";var Ot=["image/png","image/jpeg","image/webp","image/gif"],et=[];async function Ft(r){let h=await(await fetch(r.url)).blob();return new Promise((l,C)=>{let T=new FileReader;T.onerror=()=>C(T.error),T.onload=()=>{let U=T.result;l(U.slice(U.indexOf(",")+1))},T.readAsDataURL(h)})}function Dt(r){let{t:h}=n(),l=N();return i(R,{"aria-label":h("composer.attachImage"),title:h("composer.attachImage"),onClick:()=>l.openFileDialog(),...r,children:i(St,{className:"size-4"})})}function Ht({session:r,onSubmit:h,onShellCommand:l,onHandOff:C,modelSelector:T,modelMenu:U,inputHeader:rt,actions:ft,leadingTools:ht,agentControls:X=!0,placeholder:gt,children:xt,attachmentPolicy:yt,predictions:Pt=!0,disabled:bt=!1,preparing:ot=!1,allowPendingInput:vt=!1}){let{host:D,client:E}=e(),{t:p}=D,B=O((o)=>{if(D.reportError)D.reportError(o);else console.error(o)},[D]),[nt,_]=F(()=>({text:s.get(r.id)?.text??"",revision:0})),{text:d}=nt,[A,wt]=F(()=>s.get(r.id)?.attachments??et),[g,H]=F(()=>s.get(r.id)?.mentions??[]),q=A.some((o)=>Le(o)&&o.pastedText.status!=="ready"),[M,at]=F(!1),[K,It]=F(!1),[J,it]=F(!1),u=V(null),ct=V(null),a=V(nt),S=O((o)=>{ct.current?.(),a.current={text:o,revision:a.current.revision+1},_(a.current)},[]),Tt=So(r,S),st=tt(()=>({read:()=>{let c=u.current?.getTextarea(),x=c===null||c===void 0?[a.current.text.length,a.current.text.length]:[c.selectionStart,c.selectionEnd];return{target:r.id,...a.current,selection:x}},compareAndSet(c,x,w){if(c.target!==r.id||c.revision!==a.current.revision)return null;a.current={text:x,revision:a.current.revision+1},_(a.current);let y=u.current?.getTextarea();if(y!==null&&y!==void 0)y.value=x,y.setSelectionRange(w[0],w[1]);return{target:r.id,...a.current,selection:w}}}),[r.id]),L=V(null),mt=O((o)=>(L.current=o,()=>{if(L.current===o)L.current=null}),[]),W=r.state!=="idle",P=l!==void 0&&d.startsWith("!"),f=!bt&&!ot&&r.attached&&!r.restoring&&!r.readOnly,k=!r.readOnly&&(vt||f),j=Gt(r,f&&!M&&!K&&!q&&!J,d.length>0||A.length>0||g.length>0,Pt&&!P),pt=j.invalidate;Z(()=>{s.set(r.id,{text:d,attachments:A,mentions:g,modelId:s.get(r.id)?.modelId??null})},[r.id,d,A,g]),Z(()=>Bo(r.id,wt),[r.id]),Z(()=>$t(r.id,(o)=>{if(!k||M)throw Error("The composer cannot take text now; try again later");if(d.length||A.length||g.length)throw Error("The composer already has a draft; send or clear it first");S(o)}),[r.id,k,M,d,A,g,S]);let lt=t((o)=>Nt(o.agent)),At=tt(()=>lt&&f?async(o)=>Bt((await E.fuzzyFileSearch({query:o,roots:[r.cwd],cancellationToken:null})).files):void 0,[E,lt,f,r.cwd]),Q=O((o)=>{H((c)=>c.includes(o)?c:[...c,o])},[]);kt(()=>{u.current?.focus()},[]);let dt=O(async({text:o,files:c})=>{let x=l!==void 0&&o.startsWith("!")?o.slice(1):null;if(x!==null){if(x.trim().length===0)return;if(c.length||g.length)throw Error("Shell commands cannot include file references or attachments");if(r.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let w=o.trim();if(w.length===0&&c.length===0&&g.length===0)return;let y=L.current;at(!0);let I=s.get(r.id),Rt=a.current.revision,G=null;try{let b=zo(w);for(let m of g){let Y={kind:"file",absPath:m};b.push({type:"resource_link",uri:Kt(Y),name:Wt(Y)})}if(w.length>0)b.push({type:"text",text:w});for(let m of c)if(Le(m)){if(m.pastedText.status!=="ready")throw Error("Text attachment is not ready");b.push({type:"resource_link",uri:m.url,name:m.filename??"pasted-text.txt"})}else b.push({type:"image",data:await Ft(m),mimeType:m.mediaType});if(a.current.revision===Rt&&s.get(r.id)===I)a.current={text:"",revision:a.current.revision+1},G=a.current.revision,_(a.current),H([]),z(r.id,()=>et),s.set(r.id,{text:"",attachments:et,mentions:[],modelId:I?.modelId??null}),u.current?.resetHeight();if(x!==null&&l)await l(x);else if(h)if(y===null)await h(b);else await h(b,(m)=>{if(y.signal.aborted||L.current!==y)return;y.accept(m),C?.(r.id,m)});else if(y===null)await E.prompt(r.id,b);else{let m=await E.prompt(r.id,b);y.accept(m)}pt();for(let m of I?.attachments??[])if(m.url.startsWith("blob:")&&!s.get(r.id)?.attachments.some((Y)=>Y.id===m.id))URL.revokeObjectURL(m.url)}catch(b){if(I&&G!==null&&a.current.revision===G&&s.get(r.id)?.attachments.length===0&&s.get(r.id)?.mentions.length===0)a.current={text:I.text,revision:G+1},_(a.current),H(I.mentions),s.set(r.id,I),z(r.id,()=>I.attachments);throw b}finally{at(!1),u.current?.focus()}},[E,r.id,r.state,g,h,l,C,pt]),Mt=()=>{E.cancel(r.id).catch(B)},Ct=O((o)=>{let c=o.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:be})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});B(c)},[B,p]),Et=tt(()=>({session:r,ready:f,inputReady:k,sending:M,textareaRef:u,draft:st,interruptRef:ct,observeReceipts:mt,addMention:Q,setAdding:It,shellMode:P,handsFree:!P&&(h===void 0||C!==void 0)}),[r,f,k,M,st,mt,Q,h,C,P]),ut=D.writeTextAttachment;return i(fn,{value:Et,children:i("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:v("div",{className:"relative",children:[rt&&i("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:rt}),v(Uo,{attachmentPolicy:yt,value:d,revision:a.current.revision,onValueChange:S,onSubmittedClear:()=>{a.current={text:"",revision:a.current.revision+1},_(a.current)},attachments:A,onAttachmentsChange:(o)=>z(r.id,()=>o),children:[X&&i(ho,{bashMode:l!==void 0,handleRef:u,commands:r.commands,searchFiles:At,onMention:Q,onSearchError:B,forcedOpen:J,onForcedOpenChange:it,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),v(Mo,{"data-shell-mode":P||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:Ot.join(","),onError:Ct,onSubmit:dt,onSubmitAsync:dt,onSubmitError:B,canSubmit:()=>f&&!M&&!K&&!q&&(!P||!W&&d.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[xt,v(Eo,{className:"px-3 pt-3 pb-0 empty:hidden",children:[K&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),i(Vo,{mentions:g,onRemove:(o)=>H((c)=>c.filter((x)=>x!==o))}),i(fo,{children:(o)=>Le(o)?i(ko,{data:o,sessionId:r.id}):i(go,{data:o,t:p})})]}),v(Ao,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(o)=>{if(!j.text||u.current?.isComposing()||o.nativeEvent.isComposing||o.nativeEvent.keyCode===229||o.shiftKey||o.ctrlKey||o.altKey||o.metaKey||o.target!==u.current?.getTextarea())return;if(o.key==="Tab")o.preventDefault(),o.stopPropagation(),S(j.text)},children:[P&&i("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),i(ln,{className:"min-h-10 bg-transparent text-sm font-normal",ref:u,rows:2,onKeyDown:Tt,bashMode:l!==void 0,disabled:!k,onPasteCapture:ut?(o)=>Vt(o,r.id,p("composer.pastedTextFilename"),ut):void 0,placeholder:P?"! command":j.text||gt||(W?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),i(Lo,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:v("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[v("div",{className:"flex min-w-0 items-center gap-[5px]",children:[i(Dt,{className:"text-foreground",disabled:!k}),ht,X&&v(_t,{children:[i(No,{textareaRef:u,menuOpen:J,onOpenChange:it,disabled:!f||r.commands.length===0}),i(_o,{disabled:!f||P,onSelect:(o)=>{S(`${d}${d&&!/\s$/.test(d)?" ":""}${o} `),u.current?.getTextarea()?.focus()}}),i(Zt,{sessionId:r.id,options:r.configOptions,disabled:!f})]})]}),v(Ro,{className:"w-full min-w-0 items-center justify-end gap-1",children:[X&&i(Ut,{session:r}),T??i(zt,{...U,sessionId:r.id,options:r.configOptions,disabled:!f}),ft,i(Io,{active:W,sending:M||ot||K,ready:f&&!q&&(!P||!W&&d.slice(1).trim().length>0),hasMentions:g.length>0,onStop:Mt})]})]})})]})]})]})})})}
2
+ export{Ht};
@@ -1 +1 @@
1
- import{Ht}from"../../chunk-030esp62.js";import"../../chunk-bb1y2fy7.js";import"../../chunk-zn9xn0pj.js";import"../../chunk-abjr18n6.js";import"../../chunk-j6mkqhey.js";import"../../chunk-n9fwnebe.js";import"../../chunk-hfzt777k.js";import"../../chunk-wnsk4tw5.js";import"../../chunk-aarpb5np.js";import"../../chunk-6d5c94rn.js";import"../../chunk-sqwscqfk.js";import"../../chunk-ksyb8hyt.js";import"../../chunk-ce3wg766.js";import"../../chunk-4crj8dac.js";import"../../chunk-qznyjv2c.js";import"../../chunk-3stf1tm2.js";import"../../chunk-enr3j794.js";import"../../chunk-n6dbc0md.js";import"../../chunk-m33eg346.js";import"../../chunk-v7dyjpv3.js";import"../../chunk-v4cf374m.js";import"../../chunk-9g7qvbhx.js";import"../../chunk-6pwy0ncf.js";import"../../chunk-g3snk3nb.js";import"../../chunk-35z0nr4v.js";import"../../chunk-brqgdzhr.js";import"../../chunk-cm5rcd9q.js";import"../../chunk-az434tgy.js";import"../../chunk-4xjzvwg4.js";import"../../chunk-0ag4ewq9.js";import"../../chunk-zr2a9z0m.js";import"../../chunk-p9ra3xxb.js";import"../../chunk-j5engcds.js";import"../../chunk-vwzkw97t.js";import"../../chunk-4jh2wk80.js";import"../../chunk-w0dfvr05.js";import"../../chunk-xecs5c6a.js";import"../../chunk-bt01an6h.js";import"../../chunk-teg61ef5.js";export{Ht as Composer};
1
+ import{Ht}from"../../chunk-e4h6f6dh.js";import"../../chunk-bb1y2fy7.js";import"../../chunk-zn9xn0pj.js";import"../../chunk-abjr18n6.js";import"../../chunk-j6mkqhey.js";import"../../chunk-n9fwnebe.js";import"../../chunk-hfzt777k.js";import"../../chunk-wnsk4tw5.js";import"../../chunk-aarpb5np.js";import"../../chunk-6d5c94rn.js";import"../../chunk-sqwscqfk.js";import"../../chunk-ksyb8hyt.js";import"../../chunk-ce3wg766.js";import"../../chunk-cn9g220k.js";import"../../chunk-qznyjv2c.js";import"../../chunk-3stf1tm2.js";import"../../chunk-enr3j794.js";import"../../chunk-n6dbc0md.js";import"../../chunk-m33eg346.js";import"../../chunk-v7dyjpv3.js";import"../../chunk-v4cf374m.js";import"../../chunk-9g7qvbhx.js";import"../../chunk-6pwy0ncf.js";import"../../chunk-g3snk3nb.js";import"../../chunk-35z0nr4v.js";import"../../chunk-brqgdzhr.js";import"../../chunk-cm5rcd9q.js";import"../../chunk-az434tgy.js";import"../../chunk-4xjzvwg4.js";import"../../chunk-0ag4ewq9.js";import"../../chunk-zr2a9z0m.js";import"../../chunk-p9ra3xxb.js";import"../../chunk-j5engcds.js";import"../../chunk-vwzkw97t.js";import"../../chunk-4jh2wk80.js";import"../../chunk-w0dfvr05.js";import"../../chunk-xecs5c6a.js";import"../../chunk-bt01an6h.js";import"../../chunk-teg61ef5.js";export{Ht as Composer};
@@ -1 +1 @@
1
- import{Gt}from"../../chunk-4crj8dac.js";import"../../chunk-xecs5c6a.js";import"../../chunk-bt01an6h.js";import"../../chunk-teg61ef5.js";export{Gt as useComposerPrediction};
1
+ import{Gt}from"../../chunk-cn9g220k.js";import"../../chunk-xecs5c6a.js";import"../../chunk-bt01an6h.js";import"../../chunk-teg61ef5.js";export{Gt as useComposerPrediction};
@@ -1 +1 @@
1
- import{Er}from"../chunk-h3mrbbsm.js";import"../chunk-0fmepk2y.js";import"../chunk-eryds6y3.js";import"../chunk-030esp62.js";import"../chunk-bb1y2fy7.js";import"../chunk-zn9xn0pj.js";import"../chunk-abjr18n6.js";import"../chunk-j6mkqhey.js";import"../chunk-n9fwnebe.js";import"../chunk-hfzt777k.js";import"../chunk-wnsk4tw5.js";import"../chunk-aarpb5np.js";import"../chunk-6d5c94rn.js";import"../chunk-sqwscqfk.js";import"../chunk-ksyb8hyt.js";import"../chunk-ce3wg766.js";import"../chunk-4crj8dac.js";import"../chunk-qznyjv2c.js";import"../chunk-3stf1tm2.js";import"../chunk-enr3j794.js";import"../chunk-n6dbc0md.js";import"../chunk-m33eg346.js";import"../chunk-v7dyjpv3.js";import"../chunk-v4cf374m.js";import"../chunk-9g7qvbhx.js";import"../chunk-6pwy0ncf.js";import"../chunk-g3snk3nb.js";import"../chunk-35z0nr4v.js";import"../chunk-brqgdzhr.js";import"../chunk-cm5rcd9q.js";import"../chunk-az434tgy.js";import"../chunk-4xjzvwg4.js";import"../chunk-0ag4ewq9.js";import"../chunk-zr2a9z0m.js";import"../chunk-p9ra3xxb.js";import"../chunk-j5engcds.js";import"../chunk-vwzkw97t.js";import"../chunk-4jh2wk80.js";import"../chunk-31t5ap7s.js";import"../chunk-3mrdv5yq.js";import"../chunk-d67ypca2.js";import"../chunk-753z0tkd.js";import"../chunk-hp1w7xrp.js";import"../chunk-4xp0q7vs.js";import"../chunk-v0h2wsj4.js";import"../chunk-g7v2xgfh.js";import"../chunk-6m54xxts.js";import"../chunk-9w4fg6bn.js";import"../chunk-9yrctk84.js";import"../chunk-dbrs7sen.js";import"../chunk-rch4xpj1.js";import"../chunk-yjk5a037.js";import"../chunk-9b8y72yf.js";import"../chunk-6wtrmxev.js";import"../chunk-dj8e2ymr.js";import"../chunk-y7v0ghc9.js";import"../chunk-c11c29rv.js";import"../chunk-7nb0qea6.js";import"../chunk-z4nv1j97.js";import"../chunk-a45jg9xv.js";import"../chunk-7jx2k96e.js";import"../chunk-57p1s7hy.js";import"../chunk-601kr76a.js";import"../chunk-fkpmrb5t.js";import"../chunk-gha517v4.js";import"../chunk-e24d6hfs.js";import"../chunk-8hgrrycr.js";import"../chunk-h3hzsg0s.js";import"../chunk-xvzz0xh6.js";import"../chunk-hrgtpvkw.js";import"../chunk-76a04a6j.js";import"../chunk-2bbspcb4.js";import"../chunk-mmm1rq2a.js";import"../chunk-vpm5ddtt.js";import"../chunk-bjfcyfp5.js";import"../chunk-yq55kqn1.js";import"../chunk-yf39xswe.js";import"../chunk-y2g8d94r.js";import"../chunk-ehcpnhfw.js";import"../chunk-gyps0vc5.js";import"../chunk-yd6ae6py.js";import"../chunk-5azv8vz6.js";import"../chunk-ezhzktjg.js";import"../chunk-9hskky1n.js";import"../chunk-6wv99fdt.js";import"../chunk-nk266xxm.js";import"../chunk-8wdkc41j.js";import"../chunk-be7ja8gh.js";import"../chunk-w0dfvr05.js";import"../chunk-g4frp0r0.js";import"../chunk-vkc6mwyb.js";import"../chunk-p0egvanw.js";import"../chunk-7bcm8mpx.js";import"../chunk-npsgbfh2.js";import"../chunk-db0g8rr1.js";import"../chunk-mhnhkg65.js";import"../chunk-b5ywqwnr.js";import"../chunk-xecs5c6a.js";import"../chunk-bt01an6h.js";import"../chunk-teg61ef5.js";export{Er as ConversationView};
1
+ import{Er}from"../chunk-718drhrv.js";import"../chunk-0fmepk2y.js";import"../chunk-eryds6y3.js";import"../chunk-e4h6f6dh.js";import"../chunk-bb1y2fy7.js";import"../chunk-zn9xn0pj.js";import"../chunk-abjr18n6.js";import"../chunk-j6mkqhey.js";import"../chunk-n9fwnebe.js";import"../chunk-hfzt777k.js";import"../chunk-wnsk4tw5.js";import"../chunk-aarpb5np.js";import"../chunk-6d5c94rn.js";import"../chunk-sqwscqfk.js";import"../chunk-ksyb8hyt.js";import"../chunk-ce3wg766.js";import"../chunk-cn9g220k.js";import"../chunk-qznyjv2c.js";import"../chunk-3stf1tm2.js";import"../chunk-enr3j794.js";import"../chunk-n6dbc0md.js";import"../chunk-m33eg346.js";import"../chunk-v7dyjpv3.js";import"../chunk-v4cf374m.js";import"../chunk-9g7qvbhx.js";import"../chunk-6pwy0ncf.js";import"../chunk-g3snk3nb.js";import"../chunk-35z0nr4v.js";import"../chunk-brqgdzhr.js";import"../chunk-cm5rcd9q.js";import"../chunk-az434tgy.js";import"../chunk-4xjzvwg4.js";import"../chunk-0ag4ewq9.js";import"../chunk-zr2a9z0m.js";import"../chunk-p9ra3xxb.js";import"../chunk-j5engcds.js";import"../chunk-vwzkw97t.js";import"../chunk-4jh2wk80.js";import"../chunk-31t5ap7s.js";import"../chunk-3mrdv5yq.js";import"../chunk-d67ypca2.js";import"../chunk-753z0tkd.js";import"../chunk-hp1w7xrp.js";import"../chunk-4xp0q7vs.js";import"../chunk-v0h2wsj4.js";import"../chunk-g7v2xgfh.js";import"../chunk-6m54xxts.js";import"../chunk-9w4fg6bn.js";import"../chunk-9yrctk84.js";import"../chunk-dbrs7sen.js";import"../chunk-rch4xpj1.js";import"../chunk-yjk5a037.js";import"../chunk-9b8y72yf.js";import"../chunk-6wtrmxev.js";import"../chunk-dj8e2ymr.js";import"../chunk-y7v0ghc9.js";import"../chunk-c11c29rv.js";import"../chunk-7nb0qea6.js";import"../chunk-z4nv1j97.js";import"../chunk-a45jg9xv.js";import"../chunk-7jx2k96e.js";import"../chunk-57p1s7hy.js";import"../chunk-601kr76a.js";import"../chunk-fkpmrb5t.js";import"../chunk-gha517v4.js";import"../chunk-e24d6hfs.js";import"../chunk-8hgrrycr.js";import"../chunk-h3hzsg0s.js";import"../chunk-xvzz0xh6.js";import"../chunk-hrgtpvkw.js";import"../chunk-76a04a6j.js";import"../chunk-2bbspcb4.js";import"../chunk-mmm1rq2a.js";import"../chunk-vpm5ddtt.js";import"../chunk-bjfcyfp5.js";import"../chunk-yq55kqn1.js";import"../chunk-yf39xswe.js";import"../chunk-y2g8d94r.js";import"../chunk-ehcpnhfw.js";import"../chunk-gyps0vc5.js";import"../chunk-yd6ae6py.js";import"../chunk-5azv8vz6.js";import"../chunk-ezhzktjg.js";import"../chunk-9hskky1n.js";import"../chunk-6wv99fdt.js";import"../chunk-nk266xxm.js";import"../chunk-8wdkc41j.js";import"../chunk-be7ja8gh.js";import"../chunk-w0dfvr05.js";import"../chunk-g4frp0r0.js";import"../chunk-vkc6mwyb.js";import"../chunk-p0egvanw.js";import"../chunk-7bcm8mpx.js";import"../chunk-npsgbfh2.js";import"../chunk-db0g8rr1.js";import"../chunk-mhnhkg65.js";import"../chunk-b5ywqwnr.js";import"../chunk-xecs5c6a.js";import"../chunk-bt01an6h.js";import"../chunk-teg61ef5.js";export{Er as ConversationView};
@@ -1 +1 @@
1
- import"../chunk-teg61ef5.js";import"../chunk-bt01an6h.js";import"../chunk-g3snk3nb.js";import"../chunk-brqgdzhr.js";import"../chunk-35z0nr4v.js";import"../chunk-cm5rcd9q.js";import"../chunk-6pwy0ncf.js";import{Jt,e}from"../chunk-xecs5c6a.js";import"../chunk-4xjzvwg4.js";import"../chunk-3stf1tm2.js";import"../chunk-6d5c94rn.js";import"../chunk-n9fwnebe.js";import"../chunk-hfzt777k.js";import"../chunk-zn9xn0pj.js";import"../chunk-aarpb5np.js";import"../chunk-wnsk4tw5.js";import"../chunk-bb1y2fy7.js";import"../chunk-j6mkqhey.js";import"../chunk-abjr18n6.js";import{Hr}from"../chunk-p9ra3xxb.js";import{s,z,jt,Rr,Fr,$t,Dr}from"../chunk-az434tgy.js";import{Bt}from"../chunk-ce3wg766.js";import{To,Le,We,Vt}from"../chunk-v7dyjpv3.js";import{Kt,Wt}from"../chunk-zr2a9z0m.js";import"../chunk-0ag4ewq9.js";import"../chunk-m33eg346.js";import"../chunk-4jh2wk80.js";import"../chunk-n6dbc0md.js";import{j,g,K}from"../chunk-w0dfvr05.js";import{zt}from"../chunk-enr3j794.js";import"../chunk-ksyb8hyt.js";import"../chunk-vwzkw97t.js";import{Zt}from"../chunk-j5engcds.js";import{Gt}from"../chunk-4crj8dac.js";import"../chunk-qznyjv2c.js";import"../chunk-9g7qvbhx.js";import"../chunk-v4cf374m.js";import{Ee,Ut}from"../chunk-sqwscqfk.js";import{Ht}from"../chunk-030esp62.js";import"../chunk-9yrctk84.js";import"../chunk-9w4fg6bn.js";import"../chunk-601kr76a.js";import"../chunk-dj8e2ymr.js";import"../chunk-fkpmrb5t.js";import"../chunk-57p1s7hy.js";import"../chunk-7jx2k96e.js";import"../chunk-76a04a6j.js";import"../chunk-a45jg9xv.js";import"../chunk-7nb0qea6.js";import"../chunk-yq55kqn1.js";import"../chunk-bjfcyfp5.js";import"../chunk-6wtrmxev.js";import"../chunk-be7ja8gh.js";import"../chunk-y7v0ghc9.js";import"../chunk-xvzz0xh6.js";import"../chunk-y2g8d94r.js";import"../chunk-8wdkc41j.js";import"../chunk-z4nv1j97.js";import"../chunk-h3hzsg0s.js";import"../chunk-8hgrrycr.js";import"../chunk-c11c29rv.js";import"../chunk-hrgtpvkw.js";import"../chunk-mmm1rq2a.js";import"../chunk-2bbspcb4.js";import"../chunk-e24d6hfs.js";import"../chunk-gha517v4.js";import"../chunk-9b8y72yf.js";import"../chunk-rch4xpj1.js";import"../chunk-9hskky1n.js";import"../chunk-nk266xxm.js";import"../chunk-6wv99fdt.js";import"../chunk-gyps0vc5.js";import"../chunk-ezhzktjg.js";import"../chunk-5azv8vz6.js";import"../chunk-yd6ae6py.js";import"../chunk-ehcpnhfw.js";import"../chunk-b5ywqwnr.js";import"../chunk-dbrs7sen.js";import"../chunk-yjk5a037.js";import"../chunk-yf39xswe.js";import"../chunk-vpm5ddtt.js";import"../chunk-6m54xxts.js";import"../chunk-g4frp0r0.js";import{Qo}from"../chunk-g7v2xgfh.js";import{Qt}from"../chunk-v0h2wsj4.js";import"../chunk-mhnhkg65.js";import"../chunk-db0g8rr1.js";import"../chunk-npsgbfh2.js";import"../chunk-7bcm8mpx.js";import"../chunk-p0egvanw.js";import{jr,Xt}from"../chunk-vkc6mwyb.js";import"../chunk-4xp0q7vs.js";import{Rt,mo,Ft}from"../chunk-0fmepk2y.js";import"../chunk-753z0tkd.js";import"../chunk-d67ypca2.js";import"../chunk-hp1w7xrp.js";import"../chunk-3mrdv5yq.js";import{Re,Xe,Ce}from"../chunk-31t5ap7s.js";import{Dt}from"../chunk-eryds6y3.js";import{Er}from"../chunk-h3mrbbsm.js";import{Or}from"../chunk-41nq4hjc.js";import{Ar}from"../chunk-eb12xkn0.js";export{Ce as ActionCard,Ht as Composer,Ar as ConnectionNotice,Qt as ConversationBody,Jt as ConversationProvider,Xt as ConversationSearch,Er as ConversationView,Ft as DiffModal,Or as DraftProjectPicker,Xe as ElicitationForm,To as LONG_TEXT_LENGTH,zt as ModelMenu,Zt as PermissionModeMenu,Dt as SessionActions,Qo as SubagentSessions,Ut as UsageMeter,K as currentName,s as drafts,Rr as exportDraft,Bt as fileItems,mo as filePatch,j as flattenSelectOptions,Kt as formatMentionUri,Fr as importDraft,Re as isFormAction,Le as isPastedTextAttachment,Ee as limitWindowLabel,Wt as mentionDisplayName,jr as openConversationSearch,Rt as openDiffModal,Vt as pasteLongText,$t as registerComposerWriter,g as selectOption,Dr as setComposerDraft,jt as trackDraftAttachmentWrite,z as updateDraftAttachments,Hr as useComposer,Gt as useComposerPrediction,e as useConversation,We as writePastedTextAttachment};
1
+ import"../chunk-teg61ef5.js";import"../chunk-bt01an6h.js";import"../chunk-g3snk3nb.js";import"../chunk-brqgdzhr.js";import"../chunk-35z0nr4v.js";import"../chunk-cm5rcd9q.js";import"../chunk-6pwy0ncf.js";import{Jt,e}from"../chunk-xecs5c6a.js";import"../chunk-4xjzvwg4.js";import"../chunk-3stf1tm2.js";import"../chunk-6d5c94rn.js";import"../chunk-n9fwnebe.js";import"../chunk-hfzt777k.js";import"../chunk-zn9xn0pj.js";import"../chunk-aarpb5np.js";import"../chunk-wnsk4tw5.js";import"../chunk-bb1y2fy7.js";import"../chunk-j6mkqhey.js";import"../chunk-abjr18n6.js";import{Hr}from"../chunk-p9ra3xxb.js";import{s,z,jt,Rr,Fr,$t,Dr}from"../chunk-az434tgy.js";import{Bt}from"../chunk-ce3wg766.js";import{To,Le,We,Vt}from"../chunk-v7dyjpv3.js";import{Kt,Wt}from"../chunk-zr2a9z0m.js";import"../chunk-0ag4ewq9.js";import"../chunk-m33eg346.js";import"../chunk-4jh2wk80.js";import"../chunk-n6dbc0md.js";import{j,g,K}from"../chunk-w0dfvr05.js";import{zt}from"../chunk-enr3j794.js";import"../chunk-ksyb8hyt.js";import"../chunk-vwzkw97t.js";import{Zt}from"../chunk-j5engcds.js";import{Gt}from"../chunk-cn9g220k.js";import"../chunk-qznyjv2c.js";import"../chunk-9g7qvbhx.js";import"../chunk-v4cf374m.js";import{Ee,Ut}from"../chunk-sqwscqfk.js";import{Ht}from"../chunk-e4h6f6dh.js";import"../chunk-9yrctk84.js";import"../chunk-9w4fg6bn.js";import"../chunk-601kr76a.js";import"../chunk-dj8e2ymr.js";import"../chunk-fkpmrb5t.js";import"../chunk-57p1s7hy.js";import"../chunk-7jx2k96e.js";import"../chunk-76a04a6j.js";import"../chunk-a45jg9xv.js";import"../chunk-7nb0qea6.js";import"../chunk-yq55kqn1.js";import"../chunk-bjfcyfp5.js";import"../chunk-6wtrmxev.js";import"../chunk-be7ja8gh.js";import"../chunk-y7v0ghc9.js";import"../chunk-xvzz0xh6.js";import"../chunk-y2g8d94r.js";import"../chunk-8wdkc41j.js";import"../chunk-z4nv1j97.js";import"../chunk-h3hzsg0s.js";import"../chunk-8hgrrycr.js";import"../chunk-c11c29rv.js";import"../chunk-hrgtpvkw.js";import"../chunk-mmm1rq2a.js";import"../chunk-2bbspcb4.js";import"../chunk-e24d6hfs.js";import"../chunk-gha517v4.js";import"../chunk-9b8y72yf.js";import"../chunk-rch4xpj1.js";import"../chunk-9hskky1n.js";import"../chunk-nk266xxm.js";import"../chunk-6wv99fdt.js";import"../chunk-gyps0vc5.js";import"../chunk-ezhzktjg.js";import"../chunk-5azv8vz6.js";import"../chunk-yd6ae6py.js";import"../chunk-ehcpnhfw.js";import"../chunk-b5ywqwnr.js";import"../chunk-dbrs7sen.js";import"../chunk-yjk5a037.js";import"../chunk-yf39xswe.js";import"../chunk-vpm5ddtt.js";import"../chunk-6m54xxts.js";import"../chunk-g4frp0r0.js";import{Qo}from"../chunk-g7v2xgfh.js";import{Qt}from"../chunk-v0h2wsj4.js";import"../chunk-mhnhkg65.js";import"../chunk-db0g8rr1.js";import"../chunk-npsgbfh2.js";import"../chunk-7bcm8mpx.js";import"../chunk-p0egvanw.js";import{jr,Xt}from"../chunk-vkc6mwyb.js";import"../chunk-4xp0q7vs.js";import{Rt,mo,Ft}from"../chunk-0fmepk2y.js";import"../chunk-753z0tkd.js";import"../chunk-d67ypca2.js";import"../chunk-hp1w7xrp.js";import"../chunk-3mrdv5yq.js";import{Re,Xe,Ce}from"../chunk-31t5ap7s.js";import{Dt}from"../chunk-eryds6y3.js";import{Er}from"../chunk-718drhrv.js";import{Or}from"../chunk-41nq4hjc.js";import{Ar}from"../chunk-eb12xkn0.js";export{Ce as ActionCard,Ht as Composer,Ar as ConnectionNotice,Qt as ConversationBody,Jt as ConversationProvider,Xt as ConversationSearch,Er as ConversationView,Ft as DiffModal,Or as DraftProjectPicker,Xe as ElicitationForm,To as LONG_TEXT_LENGTH,zt as ModelMenu,Zt as PermissionModeMenu,Dt as SessionActions,Qo as SubagentSessions,Ut as UsageMeter,K as currentName,s as drafts,Rr as exportDraft,Bt as fileItems,mo as filePatch,j as flattenSelectOptions,Kt as formatMentionUri,Fr as importDraft,Re as isFormAction,Le as isPastedTextAttachment,Ee as limitWindowLabel,Wt as mentionDisplayName,jr as openConversationSearch,Rt as openDiffModal,Vt as pasteLongText,$t as registerComposerWriter,g as selectOption,Dr as setComposerDraft,jt as trackDraftAttachmentWrite,z as updateDraftAttachments,Hr as useComposer,Gt as useComposerPrediction,e as useConversation,We as writePastedTextAttachment};
@@ -4,5 +4,5 @@
4
4
  "abi": 1,
5
5
  "target": "x86_64-pc-windows-msvc",
6
6
  "binary": "alwith_native_chat.dll",
7
- "sha256": "2a3886fca9134f725b788695cb7b946dae935f861c8f201ac449b8191356a800"
7
+ "sha256": "a9bad950abe75ed65f543c49b50d41bc0bfd6e155325160725f8364b9f4d1ead"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -401,7 +401,7 @@
401
401
  "@dnd-kit/sortable": "^10.0.0",
402
402
  "@dnd-kit/utilities": "^3.2.2",
403
403
  "@floating-ui/dom": "^1.8.0",
404
- "@nyssance/codex-acp-v2": "^0.7.53",
404
+ "@nyssance/codex-acp-v2": "^0.7.54",
405
405
  "@nyssance/shadcn": "^4.23.4",
406
406
  "@shadcn/react": "^0.3.1",
407
407
  "@solar-icons/react": "^2.3.4",
@@ -1,2 +0,0 @@
1
- import{be}from"./chunk-g3snk3nb.js";import{Uo,N}from"./chunk-cm5rcd9q.js";import{Mo,Ao,Eo,Lo,Ro,R}from"./chunk-6pwy0ncf.js";import{n,t}from"./chunk-bt01an6h.js";import{e}from"./chunk-xecs5c6a.js";import{zo}from"./chunk-4xjzvwg4.js";import{_o}from"./chunk-3stf1tm2.js";import{ho}from"./chunk-zn9xn0pj.js";import{go,fo}from"./chunk-bb1y2fy7.js";import{ln}from"./chunk-abjr18n6.js";import{fn}from"./chunk-p9ra3xxb.js";import{s,Bo,z,$t}from"./chunk-az434tgy.js";import{Bt}from"./chunk-ce3wg766.js";import{Le,Vt}from"./chunk-v7dyjpv3.js";import{Kt,Wt}from"./chunk-zr2a9z0m.js";import{Vo}from"./chunk-0ag4ewq9.js";import{zt}from"./chunk-enr3j794.js";import{ko}from"./chunk-ksyb8hyt.js";import{Zt}from"./chunk-j5engcds.js";import{Gt}from"./chunk-4crj8dac.js";import{So}from"./chunk-qznyjv2c.js";import{No}from"./chunk-9g7qvbhx.js";import{Io}from"./chunk-v4cf374m.js";import{Ut}from"./chunk-sqwscqfk.js";import{hasFuzzyFileSearch as Nt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as St}from"lucide-react";import{useCallback as k,useEffect as Ot,useLayoutEffect as Z,useMemo as tt,useRef as V,useState as F}from"react";import{jsx as i,jsxs as v,Fragment as _t}from"react/jsx-runtime";var kt=["image/png","image/jpeg","image/webp","image/gif"],et=[];async function Ft(r){let h=await(await fetch(r.url)).blob();return new Promise((l,C)=>{let T=new FileReader;T.onerror=()=>C(T.error),T.onload=()=>{let U=T.result;l(U.slice(U.indexOf(",")+1))},T.readAsDataURL(h)})}function Dt(r){let{t:h}=n(),l=N();return i(R,{"aria-label":h("composer.attachImage"),title:h("composer.attachImage"),onClick:()=>l.openFileDialog(),...r,children:i(St,{className:"size-4"})})}function Ht({session:r,onSubmit:h,onShellCommand:l,onHandOff:C,modelSelector:T,modelMenu:U,inputHeader:rt,actions:ft,leadingTools:ht,agentControls:X=!0,placeholder:gt,children:xt,attachmentPolicy:yt,predictions:Pt=!0,disabled:bt=!1,preparing:ot=!1,allowPendingInput:vt=!1}){let{host:D,client:E}=e(),{t:p}=D,B=k((o)=>{if(D.reportError)D.reportError(o);else console.error(o)},[D]),[nt,_]=F(()=>({text:s.get(r.id)?.text??"",revision:0})),{text:d}=nt,[A,wt]=F(()=>s.get(r.id)?.attachments??et),[g,H]=F(()=>s.get(r.id)?.mentions??[]),q=A.some((o)=>Le(o)&&o.pastedText.status!=="ready"),[M,at]=F(!1),[K,It]=F(!1),[J,it]=F(!1),u=V(null),ct=V(null),a=V(nt),S=k((o)=>{ct.current?.(),a.current={text:o,revision:a.current.revision+1},_(a.current)},[]),Tt=So(r,S),st=tt(()=>({read:()=>{let c=u.current?.getTextarea(),x=c===null||c===void 0?[a.current.text.length,a.current.text.length]:[c.selectionStart,c.selectionEnd];return{target:r.id,...a.current,selection:x}},compareAndSet(c,x,w){if(c.target!==r.id||c.revision!==a.current.revision)return null;a.current={text:x,revision:a.current.revision+1},_(a.current);let y=u.current?.getTextarea();if(y!==null&&y!==void 0)y.value=x,y.setSelectionRange(w[0],w[1]);return{target:r.id,...a.current,selection:w}}}),[r.id]),L=V(null),mt=k((o)=>(L.current=o,()=>{if(L.current===o)L.current=null}),[]),W=r.state!=="idle",P=l!==void 0&&d.startsWith("!"),f=!bt&&!ot&&r.attached&&!r.restoring&&!r.readOnly,O=!r.readOnly&&(vt||f),j=Gt(r,f&&!M&&!K&&!q&&!J,d.length>0||A.length>0||g.length>0,Pt&&!P),pt=j.invalidate;Z(()=>{s.set(r.id,{text:d,attachments:A,mentions:g,modelId:s.get(r.id)?.modelId??null})},[r.id,d,A,g]),Z(()=>Bo(r.id,wt),[r.id]),Z(()=>$t(r.id,(o)=>{if(!O||M)throw Error("The composer cannot take text now; try again later");if(d.length||A.length||g.length)throw Error("The composer already has a draft; send or clear it first");S(o)}),[r.id,O,M,d,A,g,S]);let lt=t((o)=>Nt(o.agent)),At=tt(()=>lt&&f?async(o)=>Bt((await E.fuzzyFileSearch({query:o,roots:[r.cwd]})).files):void 0,[E,lt,f,r.cwd]),Q=k((o)=>{H((c)=>c.includes(o)?c:[...c,o])},[]);Ot(()=>{u.current?.focus()},[]);let dt=k(async({text:o,files:c})=>{let x=l!==void 0&&o.startsWith("!")?o.slice(1):null;if(x!==null){if(x.trim().length===0)return;if(c.length||g.length)throw Error("Shell commands cannot include file references or attachments");if(r.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let w=o.trim();if(w.length===0&&c.length===0&&g.length===0)return;let y=L.current;at(!0);let I=s.get(r.id),Rt=a.current.revision,G=null;try{let b=zo(w);for(let m of g){let Y={kind:"file",absPath:m};b.push({type:"resource_link",uri:Kt(Y),name:Wt(Y)})}if(w.length>0)b.push({type:"text",text:w});for(let m of c)if(Le(m)){if(m.pastedText.status!=="ready")throw Error("Text attachment is not ready");b.push({type:"resource_link",uri:m.url,name:m.filename??"pasted-text.txt"})}else b.push({type:"image",data:await Ft(m),mimeType:m.mediaType});if(a.current.revision===Rt&&s.get(r.id)===I)a.current={text:"",revision:a.current.revision+1},G=a.current.revision,_(a.current),H([]),z(r.id,()=>et),s.set(r.id,{text:"",attachments:et,mentions:[],modelId:I?.modelId??null}),u.current?.resetHeight();if(x!==null&&l)await l(x);else if(h)if(y===null)await h(b);else await h(b,(m)=>{if(y.signal.aborted||L.current!==y)return;y.accept(m),C?.(r.id,m)});else if(y===null)await E.prompt(r.id,b);else{let m=await E.prompt(r.id,b);y.accept(m)}pt();for(let m of I?.attachments??[])if(m.url.startsWith("blob:")&&!s.get(r.id)?.attachments.some((Y)=>Y.id===m.id))URL.revokeObjectURL(m.url)}catch(b){if(I&&G!==null&&a.current.revision===G&&s.get(r.id)?.attachments.length===0&&s.get(r.id)?.mentions.length===0)a.current={text:I.text,revision:G+1},_(a.current),H(I.mentions),s.set(r.id,I),z(r.id,()=>I.attachments);throw b}finally{at(!1),u.current?.focus()}},[E,r.id,r.state,g,h,l,C,pt]),Mt=()=>{E.cancel(r.id).catch(B)},Ct=k((o)=>{let c=o.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:be})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});B(c)},[B,p]),Et=tt(()=>({session:r,ready:f,inputReady:O,sending:M,textareaRef:u,draft:st,interruptRef:ct,observeReceipts:mt,addMention:Q,setAdding:It,shellMode:P,handsFree:!P&&(h===void 0||C!==void 0)}),[r,f,O,M,st,mt,Q,h,C,P]),ut=D.writeTextAttachment;return i(fn,{value:Et,children:i("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:v("div",{className:"relative",children:[rt&&i("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:rt}),v(Uo,{attachmentPolicy:yt,value:d,revision:a.current.revision,onValueChange:S,onSubmittedClear:()=>{a.current={text:"",revision:a.current.revision+1},_(a.current)},attachments:A,onAttachmentsChange:(o)=>z(r.id,()=>o),children:[X&&i(ho,{bashMode:l!==void 0,handleRef:u,commands:r.commands,searchFiles:At,onMention:Q,onSearchError:B,forcedOpen:J,onForcedOpenChange:it,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),v(Mo,{"data-shell-mode":P||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:kt.join(","),onError:Ct,onSubmit:dt,onSubmitAsync:dt,onSubmitError:B,canSubmit:()=>f&&!M&&!K&&!q&&(!P||!W&&d.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[xt,v(Eo,{className:"px-3 pt-3 pb-0 empty:hidden",children:[K&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),i(Vo,{mentions:g,onRemove:(o)=>H((c)=>c.filter((x)=>x!==o))}),i(fo,{children:(o)=>Le(o)?i(ko,{data:o,sessionId:r.id}):i(go,{data:o,t:p})})]}),v(Ao,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(o)=>{if(!j.text||u.current?.isComposing()||o.nativeEvent.isComposing||o.nativeEvent.keyCode===229||o.shiftKey||o.ctrlKey||o.altKey||o.metaKey||o.target!==u.current?.getTextarea())return;if(o.key==="Tab")o.preventDefault(),o.stopPropagation(),S(j.text)},children:[P&&i("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),i(ln,{className:"min-h-10 bg-transparent text-sm font-normal",ref:u,rows:2,onKeyDown:Tt,bashMode:l!==void 0,disabled:!O,onPasteCapture:ut?(o)=>Vt(o,r.id,p("composer.pastedTextFilename"),ut):void 0,placeholder:P?"! command":j.text||gt||(W?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),i(Lo,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:v("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[v("div",{className:"flex min-w-0 items-center gap-[5px]",children:[i(Dt,{className:"text-foreground",disabled:!O}),ht,X&&v(_t,{children:[i(No,{textareaRef:u,menuOpen:J,onOpenChange:it,disabled:!f||r.commands.length===0}),i(_o,{disabled:!f||P,onSelect:(o)=>{S(`${d}${d&&!/\s$/.test(d)?" ":""}${o} `),u.current?.getTextarea()?.focus()}}),i(Zt,{sessionId:r.id,options:r.configOptions,disabled:!f})]})]}),v(Ro,{className:"w-full min-w-0 items-center justify-end gap-1",children:[X&&i(Ut,{session:r}),T??i(zt,{...U,sessionId:r.id,options:r.configOptions,disabled:!f}),ft,i(Io,{active:W,sending:M||ot||K,ready:f&&!q&&(!P||!W&&d.slice(1).trim().length>0),hasMentions:g.length>0,onStop:Mt})]})]})})]})]})]})})})}
2
- export{Ht};
@@ -1,2 +0,0 @@
1
- import{t}from"./chunk-bt01an6h.js";import{e}from"./chunk-xecs5c6a.js";import{codexExtensionCapabilities as w,codexTurnId as M,composerPrediction as j,isBooleanOption as B,isSelectOption as F}from"@nyssance/codex-acp-v2/client";import{useEffect as b,useMemo as C,useRef as O,useState as P}from"react";function Gt(r,g,c,y){let{client:S}=e(),R=t((n)=>w(n.agent).composerPredictions),k=C(()=>r.items.findLast((n)=>n.kind==="user"),[r.items]),i=M(k?._meta),_=C(()=>r.configOptions.flatMap((n)=>F(n)||B(n)?[[n.configId,n.currentValue]]:[]).toSorted(([n],[l])=>String(n).localeCompare(String(l))),[r.configOptions]),o=JSON.stringify([r.id,i,_]),s=j(r._meta),d=r._meta?.codex,m=typeof d==="object"&&d!==null&&"prediction"in d?d.prediction:null,u=O(null),f=O(!1);b(()=>(f.current=!0,()=>{f.current=!1}),[]);let[a,q]=P(null),[v,x]=P(null),p=y&&R&&g&&r.state==="idle"&&r.lastStopReason==="end_turn"&&!k?.replayed&&i!==null;b(()=>{if(!p||c||a===o||u.current?.key===o||i===null)return;let n={key:o,previousResult:m};u.current=n,x(null),S.requestPrediction(r.id,i).catch((l)=>{if(f.current&&u.current===n)x({key:o,message:l instanceof Error?l.message:String(l)})})},[S,p,c,a,o,m,r.id,i]);let I=p&&!c&&a!==o&&u.current?.key===o&&u.current.previousResult!==m&&s?.sourceTurnId===i,E=I&&s.result.type==="completed"?s.result.text:null,T=y&&g&&r.state==="idle"&&!c&&a!==o?v?.key===o?v.message:I&&s.result.type==="failed"?"Prediction failed":null:null;return{text:E,error:T,invalidate:()=>{if(p)q(o)}}}
2
- export{Gt};