@ai-accounts/vue-styled 0.3.12 → 0.3.13

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.
@@ -76,4 +76,4 @@ ${u.content}`).join(`
76
76
 
77
77
  ---
78
78
 
79
- `)}function d(){!e.allMessages||e.allMessages.length===0||i(s(e.allMessages))}function c(){if(!e.allMessages||e.allMessages.length===0)return;const _=s(e.allMessages),u=new Blob([_],{type:"text/plain;charset=utf-8"}),E=URL.createObjectURL(u),p=document.createElement("a");p.href=E,p.download=`conversation-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.txt`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(E)}return(_,u)=>(t.openBlock(),t.createElementBlock("div",Xf,[t.createElementVNode("button",{class:"action-btn action-copy",title:a.value==="success"?"Copied!":a.value==="error"?"Copy failed":"Copy message",onClick:t.withModifiers(l,["stop"])},[n.iconButtons?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[a.value==="success"?(t.openBlock(),t.createElementBlock("svg",Jf,[...u[0]||(u[0]=[t.createElementVNode("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):a.value==="error"?(t.openBlock(),t.createElementBlock("svg",jf,[...u[1]||(u[1]=[t.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):(t.openBlock(),t.createElementBlock("svg",eR,[...u[2]||(u[2]=[t.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),t.createElementVNode("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"},null,-1)])]))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[a.value==="idle"?(t.openBlock(),t.createElementBlock("span",tR,"Copy")):a.value==="success"?(t.openBlock(),t.createElementBlock("span",nR,"Copied")):(t.openBlock(),t.createElementBlock("span",aR,"Failed"))],64))],8,Zf),n.allMessages?(t.openBlock(),t.createElementBlock("button",{key:0,class:"action-btn action-copy-all",title:"Copy conversation",onClick:t.withModifiers(d,["stop"])},[n.iconButtons?(t.openBlock(),t.createElementBlock("svg",rR,[...u[3]||(u[3]=[t.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),t.createElementVNode("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"},null,-1),t.createElementVNode("line",{x1:"14",y1:"14",x2:"18",y2:"14"},null,-1),t.createElementVNode("line",{x1:"14",y1:"17",x2:"18",y2:"17"},null,-1)])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Copy All")],64))])):t.createCommentVNode("",!0),n.allMessages?(t.openBlock(),t.createElementBlock("button",{key:1,class:"action-btn action-export",title:"Export conversation",onClick:t.withModifiers(c,["stop"])},[n.iconButtons?(t.openBlock(),t.createElementBlock("svg",iR,[...u[4]||(u[4]=[t.createElementVNode("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"},null,-1),t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1),t.createElementVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"},null,-1)])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Export")],64))])):t.createCommentVNode("",!0)]))}}),go=Me(oR,[["__scopeId","data-v-519341e8"]]),sR={class:"aia-bubble__avatar"},lR={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},cR=["d"],_R={class:"aia-bubble__body"},dR={class:"aia-bubble__header"},uR={class:"aia-bubble__role"},pR={key:0,class:"aia-bubble__backend"},mR={key:1,class:"aia-bubble__time"},ER=["innerHTML"],gR=t.defineComponent({__name:"ChatBubble",props:{role:{},content:{},backend:{},timestamp:{},streaming:{type:Boolean,default:!1},showActions:{type:Boolean,default:!1},allMessages:{},avatarPaths:{},assistantName:{},skipTransition:{type:Boolean,default:!1}},setup(n){const e={code({text:o,lang:s}){let d;return s&&zi.getLanguage(s)?d=zi.highlight(o,{language:s}).value:d=zi.highlightAuto(o).value,`<pre><code${s?` class="language-${s}"`:""}>${d}</code></pre>`}};se.use({renderer:e});const a=n,r=t.computed(()=>Qf.sanitize(se.parse(a.content||""))),i=t.computed(()=>{if(!a.timestamp)return"";const o=new Date(a.timestamp);return Number.isNaN(o.getTime())?"":o.toLocaleTimeString()});function l(o){var c;const s=o.target.closest(".aia-copy-btn");if(!s)return;const d=(c=s.closest(".aia-code-block"))==null?void 0:c.querySelector("code");d&&navigator.clipboard.writeText(d.textContent||"")}return(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["aia-bubble",[`aia-bubble--${n.role}`,{"aia-bubble--streaming":n.streaming,"aia-bubble--fade-in":!n.skipTransition}]])},[t.createElementVNode("div",sR,[n.avatarPaths&&n.avatarPaths.length>0?(t.openBlock(),t.createElementBlock("svg",lR,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.avatarPaths,(d,c)=>(t.openBlock(),t.createElementBlock("path",{key:c,d},null,8,cR))),128))])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(n.role==="user"?"U":n.role==="tool"?"T":"AI"),1)],64))]),t.createElementVNode("div",_R,[t.createElementVNode("div",dR,[t.createElementVNode("span",uR,t.toDisplayString(n.role==="user"?"You":n.assistantName??n.role),1),n.backend?(t.openBlock(),t.createElementBlock("span",pR,t.toDisplayString(n.backend),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("span",mR,t.toDisplayString(i.value),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:"aia-bubble__content",onClick:l,innerHTML:r.value},null,8,ER)]),n.showActions?(t.openBlock(),t.createBlock(go,t.mergeProps({key:0,content:n.content},n.allMessages!==void 0?{allMessages:n.allMessages}:{}),null,16,["content"])):t.createCommentVNode("",!0)],2))}}),$t=Me(gR,[["__scopeId","data-v-b97631f7"]]),SR={class:"aia-controls"},TR={class:"aia-controls__group"},bR=["value"],fR=["value"],RR={class:"aia-controls__group"},CR=["disabled","value"],NR={value:""},hR=["value"],vR={class:"aia-controls__group"},OR=["disabled","value"],yR={value:""},AR=["value"],IR={class:"aia-controls__group aia-controls__group--mode"},DR={class:"aia-controls__modes"},MR=["onClick"],LR=t.defineComponent({__name:"ChatControls",props:{chatMode:{},selectedBackend:{},selectedAccount:{},selectedModel:{},backends:{}},emits:["update:chatMode","update:selectedBackend","update:selectedAccount","update:selectedModel"],setup(n,{emit:e}){const a=n,r=e,i=[{value:"single",label:"Single"},{value:"all",label:"All"},{value:"compound",label:"Compound"}],l=t.computed(()=>!a.selectedBackend),o=t.computed(()=>a.backends.find(c=>c.kind===a.selectedBackend)),s=t.computed(()=>{var c;return((c=o.value)==null?void 0:c.accounts)??[]}),d=t.computed(()=>{var c;return((c=o.value)==null?void 0:c.models)??[]});return(c,_)=>(t.openBlock(),t.createElementBlock("div",SR,[t.createElementVNode("div",TR,[_[4]||(_[4]=t.createElementVNode("label",{class:"aia-controls__label"},"Backend",-1)),t.createElementVNode("select",{class:"aia-controls__select",value:n.selectedBackend??"",onChange:_[0]||(_[0]=u=>r("update:selectedBackend",u.target.value||null))},[_[3]||(_[3]=t.createElementVNode("option",{value:""},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.backends,u=>(t.openBlock(),t.createElementBlock("option",{key:u.kind,value:u.kind},t.toDisplayString(u.displayName),9,fR))),128))],40,bR)]),t.createElementVNode("div",RR,[_[5]||(_[5]=t.createElementVNode("label",{class:"aia-controls__label"},"Account",-1)),t.createElementVNode("select",{class:"aia-controls__select",disabled:l.value,value:n.selectedAccount??"",onChange:_[1]||(_[1]=u=>r("update:selectedAccount",u.target.value||null))},[t.createElementVNode("option",NR,t.toDisplayString(l.value?"--":"Default"),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,u=>(t.openBlock(),t.createElementBlock("option",{key:u.id,value:u.id},t.toDisplayString(u.label),9,hR))),128))],40,CR)]),t.createElementVNode("div",vR,[_[6]||(_[6]=t.createElementVNode("label",{class:"aia-controls__label"},"Model",-1)),t.createElementVNode("select",{class:"aia-controls__select",disabled:l.value,value:n.selectedModel??"",onChange:_[2]||(_[2]=u=>r("update:selectedModel",u.target.value||null))},[t.createElementVNode("option",yR,t.toDisplayString(l.value?"--":"Default"),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,u=>(t.openBlock(),t.createElementBlock("option",{key:u,value:u},t.toDisplayString(u),9,AR))),128))],40,OR)]),t.createElementVNode("div",IR,[_[7]||(_[7]=t.createElementVNode("label",{class:"aia-controls__label"},"Mode",-1)),t.createElementVNode("div",DR,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,u=>t.createElementVNode("button",{key:u.value,class:t.normalizeClass(["aia-controls__mode-btn",{"aia-controls__mode-btn--active":n.chatMode===u.value}]),onClick:E=>r("update:chatMode",u.value)},t.toDisplayString(u.label),11,MR)),64))])])]))}}),rd=Me(LR,[["__scopeId","data-v-a9f4b1df"]]),xR={class:"aia-input"},kR=["placeholder","disabled"],wR=["disabled"],PR=t.defineComponent({__name:"ChatInput",props:{placeholder:{default:"Type a message..."},disabled:{type:Boolean},isStreaming:{type:Boolean}},emits:["send"],setup(n,{emit:e}){const a=n,r=e,i=t.ref(""),l=t.ref(null);function o(){const c=i.value.trim();!c||a.disabled||a.isStreaming||(r("send",c),i.value="",t.nextTick(d))}function s(c){c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),o())}function d(){const c=l.value;c&&(c.style.height="auto",c.style.height=Math.min(c.scrollHeight,120)+"px")}return t.watch(i,()=>t.nextTick(d)),(c,_)=>(t.openBlock(),t.createElementBlock("div",xR,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textareaRef",ref:l,"onUpdate:modelValue":_[0]||(_[0]=u=>i.value=u),class:"aia-input__textarea",placeholder:n.placeholder,rows:"1",disabled:n.disabled||n.isStreaming,onKeydown:s,onInput:d},null,40,kR),[[t.vModelText,i.value]]),t.createElementVNode("button",{class:"aia-input__send",disabled:!i.value.trim()||n.disabled||n.isStreaming,onClick:o},t.toDisplayString(n.isStreaming?"...":"Send"),9,wR)]))}}),id=Me(PR,[["__scopeId","data-v-51976e76"]]),BR={class:"aia-responses"},UR={class:"aia-responses__summary-count"},FR=["open"],GR={class:"aia-resp__header"},YR={key:0,class:"aia-resp__account"},VR=["innerHTML"],qR={key:1,class:"aia-resp__error",role:"alert"},zR={key:0,class:"aia-resp__error-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16","aria-hidden":"true"},HR={key:1,class:"aia-resp__error-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16","aria-hidden":"true"},WR={class:"aia-resp__error-text"},$R={class:"aia-resp__error-title"},KR={key:0,class:"aia-resp__error-hint"},QR={class:"aia-resp__error-detail"},XR=t.defineComponent({__name:"AllModeResponses",props:{responses:{},collapsible:{type:Boolean,default:!1},summaryHeader:{type:Boolean,default:!1},waitingPlaceholder:{default:null}},setup(n){const e=n,a={claude:{bg:"rgba(139,92,246,0.15)",fg:"#a78bfa",label:"Claude"},codex:{bg:"rgba(16,185,129,0.15)",fg:"#34d399",label:"Codex"},gemini:{bg:"rgba(96,165,250,0.15)",fg:"#60a5fa",label:"Gemini"},opencode:{bg:"rgba(251,191,36,0.15)",fg:"#fbbf24",label:"OpenCode"}};function r(E){return E?a[E]??{bg:"rgba(161,161,170,0.15)",fg:"#a1a1aa",label:E}:{bg:"rgba(161,161,170,0.15)",fg:"#a1a1aa",label:"Backend"}}function i(E){switch(E){case"streaming":return{text:"Streaming",cls:"aia-resp__badge--streaming"};case"complete":return{text:"Done",cls:"aia-resp__badge--complete"};case"error":return{text:"Error",cls:"aia-resp__badge--error"};case"timeout":return{text:"Timeout",cls:"aia-resp__badge--timeout"};default:return{text:E,cls:""}}}function l(E){const p=E||"";if(/^no models available/i.test(p))return{title:"No models available",hint:"CLIProxyAPI advertises zero models for this backend. Make sure cliproxyapi is running and this backend’s account is registered."};if(/^could not enumerate models/i.test(p))return{title:"Could not list models",hint:"Failed to fetch the model list for this backend."};if(/^no account available/i.test(p))return{title:"No account available",hint:"No ready account is registered for this backend kind."};const g=p.match(/'([^']+)' (?:model )?is not supported when using (\w+) with a ([^']+?) account/i);return g?{title:`${g[1]} not available`,hint:`Your ${g[2]} account is authenticated via ${g[3]}, which doesn't expose this model. Switch to an API-key login or pick a different model.`}:/^Proxy error/i.test(p)?{title:"Upstream proxy error",hint:null}:/timed?\s*out/i.test(p)?{title:"Backend timed out",hint:null}:{title:"Backend error",hint:null}}const o=t.computed(()=>Array.from(e.responses.entries()));function s(E){return se.parse(E||"")}const d=t.ref(!1),c=t.computed(()=>{const E=o.value.length,p=o.value.filter(([,T])=>T.status==="complete").length;return E-p>0?`${p}/${E} backends responded`:`${E} backend responses`});t.watch(()=>e.summaryHeader,E=>{E||(d.value=!1)});function _(E){return(E.status==="error"||E.status==="timeout")&&!E.content?!1:(e.waitingPlaceholder&&E.status==="streaming"&&!E.content,!0)}function u(E){return!E.content&&e.waitingPlaceholder&&E.status==="streaming"?`<em class="aia-resp__waiting">${e.waitingPlaceholder}</em>`:s(E.content)}return(E,p)=>(t.openBlock(),t.createElementBlock("div",BR,[n.summaryHeader&&o.value.length>0?(t.openBlock(),t.createElementBlock("button",{key:0,class:"aia-responses__summary",onClick:p[0]||(p[0]=g=>d.value=!d.value)},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["aia-responses__summary-chevron",{"is-open":d.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14","aria-hidden":"true"},[...p[1]||(p[1]=[t.createElementVNode("polyline",{points:"9 18 15 12 9 6"},null,-1)])],2)),p[2]||(p[2]=t.createElementVNode("span",{class:"aia-responses__summary-label"},"Individual Responses",-1)),t.createElementVNode("span",UR,t.toDisplayString(c.value),1)])):t.createCommentVNode("",!0),!n.summaryHeader||d.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(o.value,([g,T])=>(t.openBlock(),t.createElementBlock("div",{key:g,class:t.normalizeClass(["aia-resp",{"aia-resp--error":T.status==="error","aia-resp--timeout":T.status==="timeout"}]),style:t.normalizeStyle({"--resp-bg":r(T.backendKind).bg,"--resp-fg":r(T.backendKind).fg})},[t.createElementVNode("details",{open:!n.collapsible||void 0},[t.createElementVNode("summary",GR,[t.createElementVNode("span",{class:"aia-resp__name",style:t.normalizeStyle({color:r(T.backendKind).fg})},t.toDisplayString(r(T.backendKind).label),5),T.accountLabel?(t.openBlock(),t.createElementBlock("span",YR,t.toDisplayString(T.accountLabel),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["aia-resp__badge",i(T.status).cls])},t.toDisplayString(i(T.status).text),3)]),_(T)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"aia-resp__body",innerHTML:u(T)},null,8,VR)):t.createCommentVNode("",!0),T.error?(t.openBlock(),t.createElementBlock("div",qR,[T.status==="timeout"?(t.openBlock(),t.createElementBlock("svg",zR,[...p[3]||(p[3]=[t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1),t.createElementVNode("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(t.openBlock(),t.createElementBlock("svg",HR,[...p[4]||(p[4]=[t.createElementVNode("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"},null,-1),t.createElementVNode("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),t.createElementVNode("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])])),t.createElementVNode("div",WR,[t.createElementVNode("strong",$R,t.toDisplayString(l(T.error).title),1),l(T.error).hint?(t.openBlock(),t.createElementBlock("p",KR,t.toDisplayString(l(T.error).hint),1)):t.createCommentVNode("",!0),t.createElementVNode("code",QR,t.toDisplayString(T.error),1)])])):t.createCommentVNode("",!0)],8,FR)],6))),128)):t.createCommentVNode("",!0)]))}}),So=Me(XR,[["__scopeId","data-v-4387b339"]]),ZR={class:"aia-synth__header"},JR={key:0,class:"aia-synth__sparkle","aria-hidden":"true"},jR={key:1,class:"aia-synth__via"},eC={key:0,class:"aia-synth__sources"},tC={key:1,class:"aia-synth__placeholder"},nC=["innerHTML"],aC={key:3,class:"aia-synth__error"},rC=t.defineComponent({__name:"CompoundSynthesis",props:{state:{},sparkleIcon:{type:Boolean,default:!1},loadingPlaceholders:{type:Boolean,default:!1}},setup(n){const e=n,a=t.computed(()=>se.parse(e.state.content||"")),r=t.computed(()=>e.state.status==="streaming"),i=t.computed(()=>!!(e.state.content&&e.state.content.length>0)),l=t.computed(()=>e.loadingPlaceholders&&!i.value&&(e.state.status==="streaming"||e.state.status==="waiting")),o=t.computed(()=>e.state.status==="streaming"?"Generating synthesis...":"Waiting for backend responses...");function s(d){switch(d){case"waiting":return{text:"Waiting...",cls:"aia-synth__badge--waiting"};case"streaming":return{text:"Synthesizing",cls:"aia-synth__badge--streaming"};case"complete":return{text:"Complete",cls:"aia-synth__badge--complete"};case"error":return{text:"Error",cls:"aia-synth__badge--error"};default:return{text:d,cls:""}}}return(d,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["aia-synth",{"aia-synth--streaming":r.value}])},[t.createElementVNode("div",ZR,[n.sparkleIcon?(t.openBlock(),t.createElementBlock("span",JR,"✨")):t.createCommentVNode("",!0),c[0]||(c[0]=t.createElementVNode("span",{class:"aia-synth__label"},"Compound Synthesis",-1)),n.state.primaryBackend?(t.openBlock(),t.createElementBlock("span",jR,"via "+t.toDisplayString(n.state.primaryBackend),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["aia-synth__badge",s(n.state.status).cls])},t.toDisplayString(s(n.state.status).text),3)]),n.state.backendsCollected.length?(t.openBlock(),t.createElementBlock("div",eC," Sources: "+t.toDisplayString(n.state.backendsCollected.join(", ")),1)):t.createCommentVNode("",!0),l.value?(t.openBlock(),t.createElementBlock("div",tC,t.toDisplayString(o.value),1)):(t.openBlock(),t.createElementBlock("div",{key:2,class:"aia-synth__content",innerHTML:a.value},null,8,nC)),n.state.error?(t.openBlock(),t.createElementBlock("div",aC,t.toDisplayString(n.state.error),1)):t.createCommentVNode("",!0)],2))}}),To=Me(rC,[["__scopeId","data-v-93a21588"]]),iC={class:"finalization-banner"},oC={class:"banner-content"},sC={class:"banner-title"},lC={class:"banner-description"},cC=["disabled"],_C=t.defineComponent({__name:"FinalizationBanner",props:{title:{},buttonLabel:{},entityLabel:{},entityName:{},isFinalizing:{type:Boolean,default:!1}},emits:["finalize"],setup(n,{emit:e}){const a=e;return(r,i)=>(t.openBlock(),t.createElementBlock("div",iC,[t.createElementVNode("div",oC,[t.createElementVNode("h3",sC,t.toDisplayString(n.title),1),t.createElementVNode("p",lC," Your "+t.toDisplayString(n.entityLabel)+t.toDisplayString(n.entityName?": "+n.entityName:"")+" is ready. Click the button to finalize. ",1)]),t.createElementVNode("button",{class:"banner-button",disabled:n.isFinalizing,onClick:i[0]||(i[0]=l=>a("finalize"))},t.toDisplayString(n.isFinalizing?"Creating...":n.buttonLabel),9,cC)]))}}),od=Me(_C,[["__scopeId","data-v-bde99def"]]),dC={key:0,class:"process-group-badge-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},uC={key:1,class:"process-group-badge-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},pC={key:2,class:"process-group-badge-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},mC={class:"process-group-label"},EC={key:0,class:"process-group-time"},gC={class:"process-group-chevron"},SC={key:0,class:"process-group-body"},TC=t.defineComponent({__name:"ProcessGroup",props:{id:{},type:{},label:{},timestamp:{},isExpanded:{type:Boolean,default:!0},autoCollapseMs:{default:0},iconBadges:{type:Boolean,default:!1}},emits:["toggle"],setup(n,{emit:e}){const a=n,r=e,i={tool_call:"Tool",reasoning:"Thinking",code_execution:"Code"},l={tool_call:"var(--aia-cyan, #22d3ee)",reasoning:"var(--aia-violet, #a78bfa)",code_execution:"var(--aia-amber, #fbbf24)"};function o(p){if(!p)return"";const g=new Date(p);return Number.isNaN(g.getTime())?"":g.toLocaleTimeString()}const s=t.ref(!1);let d=null;function c(){d!==null&&(clearTimeout(d),d=null)}function _(){c(),a.autoCollapseMs>0&&!s.value&&a.isExpanded&&(d=setTimeout(()=>{a.isExpanded&&r("toggle")},a.autoCollapseMs))}function u(){s.value=!0,c()}function E(){s.value=!1,_()}return t.onMounted(()=>{_()}),t.onUnmounted(()=>{c()}),t.watch(()=>a.isExpanded,p=>{p?_():c()}),(p,g)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["process-group",[`process-group--${n.type}`]]),onMouseenter:u,onMouseleave:E},[t.createElementVNode("div",{class:"process-group-header",onClick:g[0]||(g[0]=T=>r("toggle"))},[t.createElementVNode("span",{class:t.normalizeClass(["process-group-badge",[`process-group-badge--${n.type}`,{"process-group-badge--with-icon":n.iconBadges}]]),style:t.normalizeStyle({background:l[n.type]})},[n.iconBadges&&n.type==="tool_call"?(t.openBlock(),t.createElementBlock("svg",dC,[...g[1]||(g[1]=[t.createElementVNode("path",{d:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"},null,-1)])])):n.iconBadges&&n.type==="reasoning"?(t.openBlock(),t.createElementBlock("svg",uC,[...g[2]||(g[2]=[t.createElementVNode("path",{d:"M12 2a8 8 0 018 8c0 3-2 5.5-4 7l-1 4H9l-1-4c-2-1.5-4-4-4-7a8 8 0 018-8z"},null,-1),t.createElementVNode("path",{d:"M9 21h6M10 17h4"},null,-1)])])):n.iconBadges&&n.type==="code_execution"?(t.openBlock(),t.createElementBlock("svg",pC,[...g[3]||(g[3]=[t.createElementVNode("polyline",{points:"4 17 10 11 4 5"},null,-1),t.createElementVNode("line",{x1:"12",y1:"19",x2:"20",y2:"19"},null,-1)])])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(i[n.type]),1)],6),t.createElementVNode("span",mC,t.toDisplayString(n.label),1),n.timestamp&&o(n.timestamp)?(t.openBlock(),t.createElementBlock("span",EC,t.toDisplayString(o(n.timestamp)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",gC,t.toDisplayString(n.isExpanded?"▼":"▶"),1)]),n.isExpanded?(t.openBlock(),t.createElementBlock("div",SC,[t.renderSlot(p.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0)],34))}}),bo=Me(TC,[["__scopeId","data-v-c351adfa"]]),bC={class:"aia-smart-panel"},fC={ref:"scroll.containerRef",class:"aia-smart-panel__messages"},RC={key:0,class:"aia-smart-panel__welcome"},CC={class:"aia-smart-panel__welcome-title"},NC={class:"aia-smart-panel__welcome-sub"},hC={key:4,class:"process-groups"},vC={key:2,class:"aia-smart-panel__error"},OC=t.defineComponent({__name:"AiChatPanel",props:{density:{default:"minimal"},defaultBackend:{},defaultModel:{},placeholder:{default:"Type a message..."},welcomeTitle:{default:"AI Chat"},welcomeSubtitle:{default:"Send a message to get started"},readOnly:{type:Boolean},entityLabel:{},bannerTitle:{},bannerButtonLabel:{},configParser:{},showProcessGroups:{type:Boolean,default:void 0},showActions:{type:Boolean,default:void 0}},emits:["finalize"],setup(n,{emit:e}){const a=n,r=t.computed(()=>a.showProcessGroups??a.density==="detailed"),i=t.computed(()=>a.showActions??a.density==="detailed"),l=e,o=st.useSmartChat(),s=st.useSmartScroll(),{client:d}=st.useAiAccounts(),c=t.ref([]),_=t.ref({}),u=t.computed(()=>Array.from(new Set(c.value.map(h=>h.kind))).map(h=>{const O=c.value.filter(C=>C.kind===h);return{kind:h,displayName:h,accounts:O.map(C=>({id:C.id,label:C.display_name||C.id})),models:_.value[h]??[]}}));async function E(h){if(!_.value[h.kind])try{const{items:O}=await d.listModels(h.id);_.value={..._.value,[h.kind]:O.map(C=>C.id)}}catch{}}async function p(){if(await Promise.all(c.value.filter(h=>h.status==="ready").map(E)),!o.selectedModel.value){for(const h of u.value)if(h.models.length>0){o.selectedModel.value=h.models[0],o.selectedBackend.value||(o.selectedBackend.value=h.kind);break}}}t.watchEffect(()=>{o.setConfigParser(a.configParser??null)}),t.onMounted(async()=>{try{const h=await d.listBackends();c.value=h.items??[],await p()}catch{}}),t.watch(()=>[o.selectedBackend.value,o.selectedAccount.value],([h,O],[C,b])=>{o.sessionId.value&&(h!==C||O!==b)&&o.resetSession()});function g(h,O=null){if(O){const b=c.value.find(N=>N.id===O);if(b)return b}const C=h?c.value.filter(b=>b.kind===h):c.value;return C.find(b=>b.status==="ready")??C[0]??null}async function T(h){if(!o.sessionId.value){if(c.value.length===0)try{const v=await d.listBackends();c.value=v.items??[],await p()}catch{o.error.value="Unable to load backends from sidecar";return}const O=o.selectedBackend.value??a.defaultBackend??null,C=o.selectedAccount.value,b=g(O,C);if(!b){o.error.value="No backend available — add an account first";return}let N=o.selectedModel.value??a.defaultModel??"";if(!N){await E(b);const v=_.value[b.kind]??[];v.length>0&&(N=v[0],o.selectedModel.value=N)}if(!N){o.error.value=`No models available for ${b.kind}`;return}try{await o.createSession(b.id,N)}catch(v){o.error.value=v instanceof Error?v.message:String(v);return}}await o.send(h)}async function f(){const h=await o.finalize();l("finalize",h)}return(h,O)=>(t.openBlock(),t.createElementBlock("div",bC,[n.density==="detailed"?(t.openBlock(),t.createBlock(rd,{key:0,"chat-mode":t.unref(o).chatMode.value,"selected-backend":t.unref(o).selectedBackend.value,"selected-account":t.unref(o).selectedAccount.value,"selected-model":t.unref(o).selectedModel.value,backends:u.value,"onUpdate:chatMode":t.unref(o).setMode,"onUpdate:selectedBackend":t.unref(o).selectBackend,"onUpdate:selectedAccount":O[0]||(O[0]=C=>t.unref(o).selectedAccount.value=C),"onUpdate:selectedModel":O[1]||(O[1]=C=>t.unref(o).selectedModel.value=C)},null,8,["chat-mode","selected-backend","selected-account","selected-model","backends","onUpdate:chatMode","onUpdate:selectedBackend"])):t.createCommentVNode("",!0),t.createElementVNode("div",fC,[t.unref(o).messages.value.length===0&&!t.unref(o).isStreaming.value?(t.openBlock(),t.createElementBlock("div",RC,[O[3]||(O[3]=t.createElementVNode("div",{class:"aia-smart-panel__welcome-icon"},"AI",-1)),t.createElementVNode("h3",CC,t.toDisplayString(n.welcomeTitle),1),t.createElementVNode("p",NC,t.toDisplayString(n.welcomeSubtitle),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).messages.value,C=>(t.openBlock(),t.createBlock($t,{key:C.id,role:C.role,content:C.content,timestamp:C.created_at,"show-actions":i.value,"all-messages":t.unref(o).messages.value},null,8,["role","content","timestamp","show-actions","all-messages"]))),128)),t.unref(o).isStreaming.value&&t.unref(o).chatMode.value==="single"&&t.unref(o).streamingContent.value?(t.openBlock(),t.createBlock($t,{key:1,role:"assistant",content:t.unref(o).streamingContent.value,streaming:!0},null,8,["content"])):t.createCommentVNode("",!0),t.unref(o).backendResponses.value.size>0?(t.openBlock(),t.createBlock(So,{key:2,responses:t.unref(o).backendResponses.value,collapsible:t.unref(o).chatMode.value==="compound"},null,8,["responses","collapsible"])):t.createCommentVNode("",!0),t.unref(o).synthesisState.value?(t.openBlock(),t.createBlock(To,{key:3,state:t.unref(o).synthesisState.value},null,8,["state"])):t.createCommentVNode("",!0),r.value&&t.unref(o).processGroups.groups.value.size>0?(t.openBlock(),t.createElementBlock("div",hC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).processGroups.groups.value,([C,b])=>(t.openBlock(),t.createBlock(bo,{key:C,id:b.id,type:b.type,label:b.label,timestamp:b.timestamp,"is-expanded":b.isExpanded,onToggle:N=>t.unref(o).processGroups.toggleGroup(C)},{default:t.withCtx(()=>[t.createElementVNode("pre",null,t.toDisplayString(b.content),1)]),_:2},1032,["id","type","label","timestamp","is-expanded","onToggle"]))),128))])):t.createCommentVNode("",!0),h.$slots.finalization?t.renderSlot(h.$slots,"finalization",{key:5,state:{canFinalize:t.unref(o).canFinalize,isFinalizing:t.unref(o).isFinalizing}},void 0,!0):t.unref(o).canFinalize.value&&n.entityLabel?(t.openBlock(),t.createBlock(od,{key:6,title:n.bannerTitle??"Ready to finalize","button-label":n.bannerButtonLabel??"Finalize","entity-label":n.entityLabel,"is-finalizing":t.unref(o).isFinalizing.value,onFinalize:f},null,8,["title","button-label","entity-label","is-finalizing"])):t.createCommentVNode("",!0),O[4]||(O[4]=t.createElementVNode("div",{class:"aia-smart-panel__anchor"},null,-1))],512),t.unref(s).showScrollButton.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"aia-smart-panel__scroll-btn",onClick:O[2]||(O[2]=(...C)=>t.unref(s).scrollToBottom&&t.unref(s).scrollToBottom(...C))}," ↓ ")):t.createCommentVNode("",!0),t.unref(o).error.value?(t.openBlock(),t.createElementBlock("div",vC,t.toDisplayString(t.unref(o).error.value),1)):t.createCommentVNode("",!0),n.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(id,{key:3,placeholder:n.placeholder,"is-streaming":t.unref(o).isStreaming.value,onSend:T},null,8,["placeholder","is-streaming"]))]))}}),yC=Me(OC,[["__scopeId","data-v-389e137a"]]),AC={class:"aia-chat-selector"},IC={class:"aia-chat-selector__group"},DC=["value","disabled"],MC=["value"],LC={class:"aia-chat-selector__group"},xC=["value","disabled"],kC=["value"],wC={class:"aia-chat-selector__group"},PC=["value","disabled"],BC=["value"],UC={key:0,class:"aia-chat-selector__group aia-chat-selector__mode-group"},FC=["value","checked","onChange"],GC=t.defineComponent({__name:"AiChatSelector",props:{backend:{},accountId:{},model:{},chatMode:{}},emits:["update:backend","update:accountId","update:model","update:chatMode"],setup(n,{emit:e}){const a=n,r=e,i=[{value:"single",label:"Single"},{value:"all",label:"All"},{value:"compound",label:"Compound"}],{client:l}=st.useAiAccounts(),o=t.ref([]),s=t.ref({}),d=t.ref(!0),c=t.computed(()=>{const C=new Map;for(const b of o.value)C.has(b.kind)||C.set(b.kind,{kind:b.kind,label:_(b)});return Array.from(C.values())});function _(C){return{claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"}[C.kind]??C.kind}const u=t.computed(()=>a.backend==="auto"?[]:o.value.filter(C=>C.kind===a.backend)),E=t.computed(()=>u.value.map(C=>({id:C.id,label:C.display_name||C.id}))),p=t.computed(()=>s.value[a.backend]??[]),g=t.computed(()=>a.backend==="auto");async function T(C){if(s.value[C])return;const b=o.value.find(N=>N.kind===C);if(b)try{const{items:N}=await l.listModels(b.id);s.value={...s.value,[C]:N.map(v=>v.id)}}catch{}}t.onMounted(async()=>{try{const C=await l.listBackends();o.value=C.items??[],a.backend&&a.backend!=="auto"&&await T(a.backend)}catch{}finally{d.value=!1}}),t.watch(()=>a.backend,C=>{r("update:accountId",null),r("update:model",null),C&&C!=="auto"&&T(C)});function f(C){const b=C.target.value;r("update:backend",b),b!=="auto"&&a.chatMode&&a.chatMode!=="single"&&r("update:chatMode","single")}function h(C){const b=C.target.value;r("update:accountId",b||null)}function O(C){const b=C.target.value;r("update:model",b||null)}return(C,b)=>(t.openBlock(),t.createElementBlock("div",AC,[t.createElementVNode("div",IC,[b[1]||(b[1]=t.createElementVNode("label",{class:"aia-chat-selector__label"},"Backend:",-1)),t.createElementVNode("select",{class:"aia-chat-selector__select aia-chat-selector__select--backend",value:n.backend,disabled:d.value,onChange:f},[b[0]||(b[0]=t.createElementVNode("option",{value:"auto"},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,N=>(t.openBlock(),t.createElementBlock("option",{key:N.kind,value:N.kind},t.toDisplayString(N.label),9,MC))),128))],40,DC)]),t.createElementVNode("div",LC,[b[3]||(b[3]=t.createElementVNode("label",{class:"aia-chat-selector__label"},"Account:",-1)),t.createElementVNode("select",{class:"aia-chat-selector__select aia-chat-selector__select--account",value:n.accountId||"",disabled:g.value||E.value.length===0,onChange:h},[b[2]||(b[2]=t.createElementVNode("option",{value:""},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.value,N=>(t.openBlock(),t.createElementBlock("option",{key:N.id,value:N.id},t.toDisplayString(N.label),9,kC))),128))],40,xC)]),t.createElementVNode("div",wC,[b[5]||(b[5]=t.createElementVNode("label",{class:"aia-chat-selector__label"},"Model:",-1)),t.createElementVNode("select",{class:"aia-chat-selector__select aia-chat-selector__select--model",value:n.model||"",disabled:g.value||p.value.length===0,onChange:O},[b[4]||(b[4]=t.createElementVNode("option",{value:""},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,N=>(t.openBlock(),t.createElementBlock("option",{key:N,value:N},t.toDisplayString(N),9,BC))),128))],40,PC)]),n.chatMode?(t.openBlock(),t.createElementBlock("div",UC,[b[6]||(b[6]=t.createElementVNode("span",{class:"aia-chat-selector__mode-separator","aria-hidden":"true"},null,-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,N=>t.createElementVNode("label",{key:N.value,class:t.normalizeClass(["aia-chat-selector__mode-radio",{"aia-chat-selector__mode-radio--active":n.chatMode===N.value}])},[t.createElementVNode("input",{type:"radio",name:"aia-chat-selector-mode",value:N.value,checked:n.chatMode===N.value,onChange:v=>r("update:chatMode",N.value)},null,40,FC),t.createTextVNode(" "+t.toDisplayString(N.label),1)],2)),64))])):t.createCommentVNode("",!0),t.renderSlot(C.$slots,"trailing",{},void 0,!0)]))}}),sd=Me(GC,[["__scopeId","data-v-4182e3c5"]]),YC={class:"chat-panel"},VC={key:1,class:"cli-runner-toggle"},qC=["aria-pressed","title"],zC={class:"cli-runner-toggle__label"},HC={key:0,class:"chat-welcome"},WC={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},$C=["d"],KC={class:"process-group-content"},QC={key:4,class:"processing-indicator"},XC={key:2,class:"convert-banner"},ZC={class:"banner-icon"},JC={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},jC=["d"],eN={class:"banner-content"},tN=["disabled"],nN={key:3,class:"input-area"},aN={class:"input-wrapper"},rN=["value","placeholder","disabled"],iN=["disabled"],oN=32,sN=t.defineComponent({__name:"AiChatPanelManaged",props:{messages:{default:()=>[]},isProcessing:{type:Boolean,default:!1},streamingContent:{default:""},inputMessage:{default:""},conversationId:{default:null},canFinalize:{type:Boolean,default:!1},isFinalizing:{type:Boolean,default:!1},assistantIconPaths:{default:()=>[]},inputPlaceholder:{default:"Type a message..."},entityLabel:{default:""},bannerTitle:{default:""},bannerButtonLabel:{default:""},detectedEntityName:{default:""},showBackendSelector:{type:Boolean,default:!1},selectedBackend:{default:"auto"},selectedAccountId:{default:null},selectedModel:{default:null},readOnly:{type:Boolean,default:!1},useSmartScroll:{type:Boolean,default:!1},processGroups:{},chatMode:{default:"single"},backendResponses:{},synthesisState:{default:null},isAllModeActive:{type:Boolean,default:!1},useCliRunner:{type:Boolean,default:!1},hideCliRunnerToggle:{type:Boolean,default:!1}},emits:["update:inputMessage","send","keydown","finalize","update:selectedBackend","update:selectedAccountId","update:selectedModel","update:chatMode","update:useCliRunner"],setup(n,{emit:e}){const a=n,r=e,i=t.ref(null),l={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},o=t.computed(()=>l[a.selectedBackend??"auto"]??"AI");function s(b){return b.backend&&l[b.backend]||"AI"}const d=t.computed(()=>a.messages??[]),c=t.computed(()=>a.inputMessage??""),_=t.computed(()=>a.assistantIconPaths??[]),u=t.computed(()=>d.value.map(b=>{const N={role:b.role,content:b.content};return b.timestamp&&(N.timestamp=b.timestamp),N})),E=t.ref(!0);function p(){const b=i.value;return b?b.scrollHeight-b.scrollTop-b.clientHeight<=oN:!0}function g(){a.useSmartScroll&&(E.value=p())}function T(){t.nextTick(()=>{if(i.value){if(a.useSmartScroll&&!E.value)return;i.value.scrollTop=i.value.scrollHeight}})}function f(){E.value=!0,t.nextTick(()=>{i.value&&i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})})}const h=t.computed(()=>a.useSmartScroll&&!E.value);t.watch(()=>d.value.length,T),t.watch(()=>a.streamingContent,T),t.watch(()=>a.isProcessing,b=>{b&&T()}),t.watch(()=>{if(!a.backendResponses)return 0;let b=0;for(const N of a.backendResponses.values())b+=N.content.length;return b},T),t.watch(()=>{var b,N;return((N=(b=a.synthesisState)==null?void 0:b.content)==null?void 0:N.length)??0},T);function O(b){const N=b.target;r("update:inputMessage",N.value),N.style.height="auto",N.style.height=Math.min(N.scrollHeight,120)+"px"}const C=t.computed(()=>a.processGroups?Array.from(a.processGroups.entries()):[]);return(b,N)=>(t.openBlock(),t.createElementBlock("div",YC,[n.showBackendSelector?(t.openBlock(),t.createBlock(sd,{key:0,backend:n.selectedBackend??"auto","account-id":n.selectedAccountId??null,model:n.selectedModel??null,"chat-mode":n.chatMode??"single","onUpdate:backend":N[0]||(N[0]=v=>r("update:selectedBackend",v)),"onUpdate:accountId":N[1]||(N[1]=v=>r("update:selectedAccountId",v)),"onUpdate:model":N[2]||(N[2]=v=>r("update:selectedModel",v)),"onUpdate:chatMode":N[3]||(N[3]=v=>r("update:chatMode",v))},{trailing:t.withCtx(()=>[t.renderSlot(b.$slots,"selector-trailing",{},void 0,!0)]),_:3},8,["backend","account-id","model","chat-mode"])):t.createCommentVNode("",!0),t.renderSlot(b.$slots,"header-extra",{},void 0,!0),n.hideCliRunnerToggle?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",VC,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cli-runner-toggle__btn",{"cli-runner-toggle__btn--active":n.useCliRunner}]),"aria-pressed":n.useCliRunner?"true":"false",title:n.useCliRunner?"CLI runner mode — agent uses tools (filesystem, shell, edits) in the project worktree":"CLIProxy mode — pure token chat, no tool use",onClick:N[4]||(N[4]=v=>r("update:useCliRunner",!n.useCliRunner))},[N[9]||(N[9]=t.createElementVNode("span",{class:"cli-runner-toggle__dot"},null,-1)),t.createElementVNode("span",zC,t.toDisplayString(n.useCliRunner?"CLI runner":"CLIProxy"),1)],10,qC)])),t.createElementVNode("div",{class:"chat-container",ref_key:"chatContainer",ref:i,onScroll:g},[t.renderSlot(b.$slots,"welcome",{},()=>[d.value.length===0&&!n.isProcessing?(t.openBlock(),t.createElementBlock("div",HC,[t.createElementVNode("div",{class:t.normalizeClass(["welcome-icon",{connecting:!n.conversationId}])},[(t.openBlock(),t.createElementBlock("svg",WC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(v,w)=>(t.openBlock(),t.createElementBlock("path",{key:w,d:v},null,8,$C))),128))]))],2),t.createElementVNode("h2",null,t.toDisplayString(n.conversationId?"Ready to chat":`Connecting to ${o.value}...`),1),t.createElementVNode("p",null,t.toDisplayString(o.value)+" will guide you through designing your "+t.toDisplayString(n.entityLabel),1)])):t.createCommentVNode("",!0)],!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,(v,w)=>(t.openBlock(),t.createElementBlock("div",{key:w,class:t.normalizeClass(["message-wrapper",v.role])},[t.createVNode($t,{role:v.role,content:v.content,timestamp:v.timestamp??null,backend:v.backend??null,"avatar-paths":_.value,"assistant-name":s(v),"skip-transition":d.value.length>10&&w<d.value.length-5},null,8,["role","content","timestamp","backend","avatar-paths","assistant-name","skip-transition"]),!n.isProcessing||w<d.value.length-1?(t.openBlock(),t.createBlock(go,{key:0,content:v.content,"all-messages":w===d.value.length-1?u.value:[]},null,8,["content","all-messages"])):t.createCommentVNode("",!0)],2))),128)),n.isProcessing&&(n.chatMode==="single"||!n.chatMode)&&n.streamingContent?(t.openBlock(),t.createBlock($t,{key:0,role:"assistant",content:n.streamingContent??"",backend:n.selectedBackend??null,"avatar-paths":_.value,"assistant-name":o.value,streaming:!0},null,8,["content","backend","avatar-paths","assistant-name"])):t.createCommentVNode("",!0),(n.chatMode==="all"||n.chatMode==="compound")&&n.backendResponses&&n.backendResponses.size>0?(t.openBlock(),t.createBlock(So,{key:1,responses:n.backendResponses,collapsible:n.chatMode==="compound"},null,8,["responses","collapsible"])):t.createCommentVNode("",!0),n.synthesisState&&n.synthesisState.status!=="waiting"?(t.openBlock(),t.createBlock(To,{key:2,state:n.synthesisState},null,8,["state"])):t.createCommentVNode("",!0),C.value.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:3},t.renderList(C.value,([v,w])=>(t.openBlock(),t.createBlock(bo,{key:v,id:v,type:w.type,label:w.label,timestamp:w.timestamp??"","auto-collapse-ms":w.type==="tool_call"?4e3:2e3},{default:t.withCtx(()=>[t.createElementVNode("pre",KC,t.toDisplayString(w.content),1)]),_:2},1032,["id","type","label","timestamp","auto-collapse-ms"]))),128)):t.createCommentVNode("",!0),n.isProcessing&&!n.streamingContent?(t.openBlock(),t.createElementBlock("div",QC,[N[10]||(N[10]=t.createElementVNode("div",{class:"dots"},[t.createElementVNode("span"),t.createElementVNode("span"),t.createElementVNode("span")],-1)),t.createElementVNode("span",null,t.toDisplayString(o.value)+" is thinking...",1)])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("button",{key:5,class:"scroll-to-bottom-btn",onClick:f,title:"Scroll to bottom"},[...N[11]||(N[11]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1)])])):t.createCommentVNode("",!0)],544),n.canFinalize?(t.openBlock(),t.createElementBlock("div",XC,[t.createElementVNode("div",ZC,[(t.openBlock(),t.createElementBlock("svg",JC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(v,w)=>(t.openBlock(),t.createElementBlock("path",{key:w,d:v},null,8,jC))),128)),N[12]||(N[12]=t.createElementVNode("path",{d:"M20 6L9 17l-5-5","stroke-width":"2.5"},null,-1))]))]),t.createElementVNode("div",eN,[t.createElementVNode("h3",null,t.toDisplayString(n.bannerTitle),1),t.createElementVNode("p",null,t.toDisplayString(o.value)+" has designed your "+t.toDisplayString(n.entityLabel)+t.toDisplayString(n.detectedEntityName?": "+n.detectedEntityName:"")+". Click the button to finalize. ",1)]),t.createElementVNode("button",{class:"btn btn-primary btn-convert",disabled:n.isFinalizing,onClick:N[5]||(N[5]=v=>r("finalize"))},[N[13]||(N[13]=t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M20 6L9 17l-5-5"})],-1)),t.createTextVNode(" "+t.toDisplayString(n.isFinalizing?"Creating...":n.bannerButtonLabel),1)],8,tN)])):t.createCommentVNode("",!0),n.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",nN,[t.createElementVNode("div",aN,[t.createElementVNode("textarea",{value:c.value,onInput:N[6]||(N[6]=v=>O(v)),placeholder:n.inputPlaceholder,disabled:n.isProcessing,onKeydown:N[7]||(N[7]=v=>r("keydown",v)),rows:"1"},null,40,rN),t.createElementVNode("button",{class:"btn-send",disabled:!c.value.trim()||n.isProcessing,onClick:N[8]||(N[8]=v=>r("send"))},[...N[14]||(N[14]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],8,iN)])]))]))}}),lN=Me(sN,[["__scopeId","data-v-ada7b5b1"]]),cN={class:"aia-chat-mode-selector",role:"radiogroup","aria-label":"Chat mode"},_N=["aria-checked","title","onClick"],dN=t.defineComponent({__name:"ChatModeSelector",props:{mode:{}},emits:["update:mode"],setup(n,{emit:e}){const a=e,r=[{value:"single",label:"Single",description:"Send to one backend"},{value:"all",label:"All",description:"Send to all backends simultaneously"},{value:"compound",label:"Compound",description:"All backends + AI synthesis"}];return(i,l)=>(t.openBlock(),t.createElementBlock("div",cN,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,o=>t.createElementVNode("button",{key:o.value,type:"button",role:"radio","aria-checked":n.mode===o.value,class:t.normalizeClass(["aia-chat-mode-selector__btn",{"aia-chat-mode-selector__btn--active":n.mode===o.value}]),title:o.description,onClick:s=>a("update:mode",o.value)},t.toDisplayString(o.label),11,_N)),64))]))}}),uN=Me(dN,[["__scopeId","data-v-c2599533"]]),pN="0.3.12";exports.AccountEditForm=Zm;exports.AccountWizard=hm;exports.AiChatPanel=yC;exports.AiChatPanelManaged=lN;exports.AiChatSelector=sd;exports.AllModeResponses=So;exports.BackendPicker=M_;exports.ChatBubble=$t;exports.ChatControls=rd;exports.ChatInput=id;exports.ChatMessage=Xi;exports.ChatModeSelector=uN;exports.ChatPanel=dE;exports.CompoundSynthesis=To;exports.FinalizationBanner=od;exports.LoginStream=D_;exports.MessageActions=go;exports.OnboardingFlow=Hm;exports.ProcessGroup=bo;exports.forceFreshAccountPrompt=I_;exports.version=pN;
79
+ `)}function d(){!e.allMessages||e.allMessages.length===0||i(s(e.allMessages))}function c(){if(!e.allMessages||e.allMessages.length===0)return;const _=s(e.allMessages),u=new Blob([_],{type:"text/plain;charset=utf-8"}),E=URL.createObjectURL(u),p=document.createElement("a");p.href=E,p.download=`conversation-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.txt`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(E)}return(_,u)=>(t.openBlock(),t.createElementBlock("div",Xf,[t.createElementVNode("button",{class:"action-btn action-copy",title:a.value==="success"?"Copied!":a.value==="error"?"Copy failed":"Copy message",onClick:t.withModifiers(l,["stop"])},[n.iconButtons?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[a.value==="success"?(t.openBlock(),t.createElementBlock("svg",Jf,[...u[0]||(u[0]=[t.createElementVNode("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):a.value==="error"?(t.openBlock(),t.createElementBlock("svg",jf,[...u[1]||(u[1]=[t.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):(t.openBlock(),t.createElementBlock("svg",eR,[...u[2]||(u[2]=[t.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),t.createElementVNode("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"},null,-1)])]))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[a.value==="idle"?(t.openBlock(),t.createElementBlock("span",tR,"Copy")):a.value==="success"?(t.openBlock(),t.createElementBlock("span",nR,"Copied")):(t.openBlock(),t.createElementBlock("span",aR,"Failed"))],64))],8,Zf),n.allMessages?(t.openBlock(),t.createElementBlock("button",{key:0,class:"action-btn action-copy-all",title:"Copy conversation",onClick:t.withModifiers(d,["stop"])},[n.iconButtons?(t.openBlock(),t.createElementBlock("svg",rR,[...u[3]||(u[3]=[t.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),t.createElementVNode("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"},null,-1),t.createElementVNode("line",{x1:"14",y1:"14",x2:"18",y2:"14"},null,-1),t.createElementVNode("line",{x1:"14",y1:"17",x2:"18",y2:"17"},null,-1)])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Copy All")],64))])):t.createCommentVNode("",!0),n.allMessages?(t.openBlock(),t.createElementBlock("button",{key:1,class:"action-btn action-export",title:"Export conversation",onClick:t.withModifiers(c,["stop"])},[n.iconButtons?(t.openBlock(),t.createElementBlock("svg",iR,[...u[4]||(u[4]=[t.createElementVNode("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"},null,-1),t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1),t.createElementVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"},null,-1)])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Export")],64))])):t.createCommentVNode("",!0)]))}}),go=Me(oR,[["__scopeId","data-v-519341e8"]]),sR={class:"aia-bubble__avatar"},lR={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},cR=["d"],_R={class:"aia-bubble__body"},dR={class:"aia-bubble__header"},uR={class:"aia-bubble__role"},pR={key:0,class:"aia-bubble__backend"},mR={key:1,class:"aia-bubble__time"},ER=["innerHTML"],gR=t.defineComponent({__name:"ChatBubble",props:{role:{},content:{},backend:{},timestamp:{},streaming:{type:Boolean,default:!1},showActions:{type:Boolean,default:!1},allMessages:{},avatarPaths:{},assistantName:{},skipTransition:{type:Boolean,default:!1}},setup(n){const e={code({text:o,lang:s}){let d;return s&&zi.getLanguage(s)?d=zi.highlight(o,{language:s}).value:d=zi.highlightAuto(o).value,`<pre><code${s?` class="language-${s}"`:""}>${d}</code></pre>`}};se.use({renderer:e});const a=n,r=t.computed(()=>Qf.sanitize(se.parse(a.content||""))),i=t.computed(()=>{if(!a.timestamp)return"";const o=new Date(a.timestamp);return Number.isNaN(o.getTime())?"":o.toLocaleTimeString()});function l(o){var c;const s=o.target.closest(".aia-copy-btn");if(!s)return;const d=(c=s.closest(".aia-code-block"))==null?void 0:c.querySelector("code");d&&navigator.clipboard.writeText(d.textContent||"")}return(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["aia-bubble",[`aia-bubble--${n.role}`,{"aia-bubble--streaming":n.streaming,"aia-bubble--fade-in":!n.skipTransition}]])},[t.createElementVNode("div",sR,[n.avatarPaths&&n.avatarPaths.length>0?(t.openBlock(),t.createElementBlock("svg",lR,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.avatarPaths,(d,c)=>(t.openBlock(),t.createElementBlock("path",{key:c,d},null,8,cR))),128))])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(n.role==="user"?"U":n.role==="tool"?"T":"AI"),1)],64))]),t.createElementVNode("div",_R,[t.createElementVNode("div",dR,[t.createElementVNode("span",uR,t.toDisplayString(n.role==="user"?"You":n.assistantName??n.role),1),n.backend?(t.openBlock(),t.createElementBlock("span",pR,t.toDisplayString(n.backend),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("span",mR,t.toDisplayString(i.value),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:"aia-bubble__content",onClick:l,innerHTML:r.value},null,8,ER)]),n.showActions?(t.openBlock(),t.createBlock(go,t.mergeProps({key:0,content:n.content},n.allMessages!==void 0?{allMessages:n.allMessages}:{}),null,16,["content"])):t.createCommentVNode("",!0)],2))}}),$t=Me(gR,[["__scopeId","data-v-b97631f7"]]),SR={class:"aia-controls"},TR={class:"aia-controls__group"},bR=["value"],fR=["value"],RR={class:"aia-controls__group"},CR=["disabled","value"],NR={value:""},hR=["value"],vR={class:"aia-controls__group"},OR=["disabled","value"],yR={value:""},AR=["value"],IR={class:"aia-controls__group aia-controls__group--mode"},DR={class:"aia-controls__modes"},MR=["onClick"],LR=t.defineComponent({__name:"ChatControls",props:{chatMode:{},selectedBackend:{},selectedAccount:{},selectedModel:{},backends:{}},emits:["update:chatMode","update:selectedBackend","update:selectedAccount","update:selectedModel"],setup(n,{emit:e}){const a=n,r=e,i=[{value:"single",label:"Single"},{value:"all",label:"All"},{value:"compound",label:"Compound"}],l=t.computed(()=>!a.selectedBackend),o=t.computed(()=>a.backends.find(c=>c.kind===a.selectedBackend)),s=t.computed(()=>{var c;return((c=o.value)==null?void 0:c.accounts)??[]}),d=t.computed(()=>{var c;return((c=o.value)==null?void 0:c.models)??[]});return(c,_)=>(t.openBlock(),t.createElementBlock("div",SR,[t.createElementVNode("div",TR,[_[4]||(_[4]=t.createElementVNode("label",{class:"aia-controls__label"},"Backend",-1)),t.createElementVNode("select",{class:"aia-controls__select",value:n.selectedBackend??"",onChange:_[0]||(_[0]=u=>r("update:selectedBackend",u.target.value||null))},[_[3]||(_[3]=t.createElementVNode("option",{value:""},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.backends,u=>(t.openBlock(),t.createElementBlock("option",{key:u.kind,value:u.kind},t.toDisplayString(u.displayName),9,fR))),128))],40,bR)]),t.createElementVNode("div",RR,[_[5]||(_[5]=t.createElementVNode("label",{class:"aia-controls__label"},"Account",-1)),t.createElementVNode("select",{class:"aia-controls__select",disabled:l.value,value:n.selectedAccount??"",onChange:_[1]||(_[1]=u=>r("update:selectedAccount",u.target.value||null))},[t.createElementVNode("option",NR,t.toDisplayString(l.value?"--":"Default"),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,u=>(t.openBlock(),t.createElementBlock("option",{key:u.id,value:u.id},t.toDisplayString(u.label),9,hR))),128))],40,CR)]),t.createElementVNode("div",vR,[_[6]||(_[6]=t.createElementVNode("label",{class:"aia-controls__label"},"Model",-1)),t.createElementVNode("select",{class:"aia-controls__select",disabled:l.value,value:n.selectedModel??"",onChange:_[2]||(_[2]=u=>r("update:selectedModel",u.target.value||null))},[t.createElementVNode("option",yR,t.toDisplayString(l.value?"--":"Default"),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,u=>(t.openBlock(),t.createElementBlock("option",{key:u,value:u},t.toDisplayString(u),9,AR))),128))],40,OR)]),t.createElementVNode("div",IR,[_[7]||(_[7]=t.createElementVNode("label",{class:"aia-controls__label"},"Mode",-1)),t.createElementVNode("div",DR,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,u=>t.createElementVNode("button",{key:u.value,class:t.normalizeClass(["aia-controls__mode-btn",{"aia-controls__mode-btn--active":n.chatMode===u.value}]),onClick:E=>r("update:chatMode",u.value)},t.toDisplayString(u.label),11,MR)),64))])])]))}}),rd=Me(LR,[["__scopeId","data-v-a9f4b1df"]]),xR={class:"aia-input"},kR=["placeholder","disabled"],wR=["disabled"],PR=t.defineComponent({__name:"ChatInput",props:{placeholder:{default:"Type a message..."},disabled:{type:Boolean},isStreaming:{type:Boolean}},emits:["send"],setup(n,{emit:e}){const a=n,r=e,i=t.ref(""),l=t.ref(null);function o(){const c=i.value.trim();!c||a.disabled||a.isStreaming||(r("send",c),i.value="",t.nextTick(d))}function s(c){c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),o())}function d(){const c=l.value;c&&(c.style.height="auto",c.style.height=Math.min(c.scrollHeight,120)+"px")}return t.watch(i,()=>t.nextTick(d)),(c,_)=>(t.openBlock(),t.createElementBlock("div",xR,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textareaRef",ref:l,"onUpdate:modelValue":_[0]||(_[0]=u=>i.value=u),class:"aia-input__textarea",placeholder:n.placeholder,rows:"1",disabled:n.disabled||n.isStreaming,onKeydown:s,onInput:d},null,40,kR),[[t.vModelText,i.value]]),t.createElementVNode("button",{class:"aia-input__send",disabled:!i.value.trim()||n.disabled||n.isStreaming,onClick:o},t.toDisplayString(n.isStreaming?"...":"Send"),9,wR)]))}}),id=Me(PR,[["__scopeId","data-v-51976e76"]]),BR={class:"aia-responses"},UR={class:"aia-responses__summary-count"},FR=["open"],GR={class:"aia-resp__header"},YR={key:0,class:"aia-resp__account"},VR=["innerHTML"],qR={key:1,class:"aia-resp__error",role:"alert"},zR={key:0,class:"aia-resp__error-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16","aria-hidden":"true"},HR={key:1,class:"aia-resp__error-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16","aria-hidden":"true"},WR={class:"aia-resp__error-text"},$R={class:"aia-resp__error-title"},KR={key:0,class:"aia-resp__error-hint"},QR={class:"aia-resp__error-detail"},XR=t.defineComponent({__name:"AllModeResponses",props:{responses:{},collapsible:{type:Boolean,default:!1},summaryHeader:{type:Boolean,default:!1},waitingPlaceholder:{default:null}},setup(n){const e=n,a={claude:{bg:"rgba(139,92,246,0.15)",fg:"#a78bfa",label:"Claude"},codex:{bg:"rgba(16,185,129,0.15)",fg:"#34d399",label:"Codex"},gemini:{bg:"rgba(96,165,250,0.15)",fg:"#60a5fa",label:"Gemini"},opencode:{bg:"rgba(251,191,36,0.15)",fg:"#fbbf24",label:"OpenCode"}};function r(E){return E?a[E]??{bg:"rgba(161,161,170,0.15)",fg:"#a1a1aa",label:E}:{bg:"rgba(161,161,170,0.15)",fg:"#a1a1aa",label:"Backend"}}function i(E){switch(E){case"streaming":return{text:"Streaming",cls:"aia-resp__badge--streaming"};case"complete":return{text:"Done",cls:"aia-resp__badge--complete"};case"error":return{text:"Error",cls:"aia-resp__badge--error"};case"timeout":return{text:"Timeout",cls:"aia-resp__badge--timeout"};default:return{text:E,cls:""}}}function l(E){const p=E||"";if(/^no models available/i.test(p))return{title:"No models available",hint:"CLIProxyAPI advertises zero models for this backend. Make sure cliproxyapi is running and this backend’s account is registered."};if(/^could not enumerate models/i.test(p))return{title:"Could not list models",hint:"Failed to fetch the model list for this backend."};if(/^no account available/i.test(p))return{title:"No account available",hint:"No ready account is registered for this backend kind."};const g=p.match(/'([^']+)' (?:model )?is not supported when using (\w+) with a ([^']+?) account/i);return g?{title:`${g[1]} not available`,hint:`Your ${g[2]} account is authenticated via ${g[3]}, which doesn't expose this model. Switch to an API-key login or pick a different model.`}:/^Proxy error/i.test(p)?{title:"Upstream proxy error",hint:null}:/timed?\s*out/i.test(p)?{title:"Backend timed out",hint:null}:{title:"Backend error",hint:null}}const o=t.computed(()=>Array.from(e.responses.entries()));function s(E){return se.parse(E||"")}const d=t.ref(!1),c=t.computed(()=>{const E=o.value.length,p=o.value.filter(([,T])=>T.status==="complete").length;return E-p>0?`${p}/${E} backends responded`:`${E} backend responses`});t.watch(()=>e.summaryHeader,E=>{E||(d.value=!1)});function _(E){return(E.status==="error"||E.status==="timeout")&&!E.content?!1:(e.waitingPlaceholder&&E.status==="streaming"&&!E.content,!0)}function u(E){return!E.content&&e.waitingPlaceholder&&E.status==="streaming"?`<em class="aia-resp__waiting">${e.waitingPlaceholder}</em>`:s(E.content)}return(E,p)=>(t.openBlock(),t.createElementBlock("div",BR,[n.summaryHeader&&o.value.length>0?(t.openBlock(),t.createElementBlock("button",{key:0,class:"aia-responses__summary",onClick:p[0]||(p[0]=g=>d.value=!d.value)},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["aia-responses__summary-chevron",{"is-open":d.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14","aria-hidden":"true"},[...p[1]||(p[1]=[t.createElementVNode("polyline",{points:"9 18 15 12 9 6"},null,-1)])],2)),p[2]||(p[2]=t.createElementVNode("span",{class:"aia-responses__summary-label"},"Individual Responses",-1)),t.createElementVNode("span",UR,t.toDisplayString(c.value),1)])):t.createCommentVNode("",!0),!n.summaryHeader||d.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(o.value,([g,T])=>(t.openBlock(),t.createElementBlock("div",{key:g,class:t.normalizeClass(["aia-resp",{"aia-resp--error":T.status==="error","aia-resp--timeout":T.status==="timeout"}]),style:t.normalizeStyle({"--resp-bg":r(T.backendKind).bg,"--resp-fg":r(T.backendKind).fg})},[t.createElementVNode("details",{open:!n.collapsible||void 0},[t.createElementVNode("summary",GR,[t.createElementVNode("span",{class:"aia-resp__name",style:t.normalizeStyle({color:r(T.backendKind).fg})},t.toDisplayString(r(T.backendKind).label),5),T.accountLabel?(t.openBlock(),t.createElementBlock("span",YR,t.toDisplayString(T.accountLabel),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["aia-resp__badge",i(T.status).cls])},t.toDisplayString(i(T.status).text),3)]),_(T)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"aia-resp__body",innerHTML:u(T)},null,8,VR)):t.createCommentVNode("",!0),T.error?(t.openBlock(),t.createElementBlock("div",qR,[T.status==="timeout"?(t.openBlock(),t.createElementBlock("svg",zR,[...p[3]||(p[3]=[t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1),t.createElementVNode("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(t.openBlock(),t.createElementBlock("svg",HR,[...p[4]||(p[4]=[t.createElementVNode("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"},null,-1),t.createElementVNode("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),t.createElementVNode("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])])),t.createElementVNode("div",WR,[t.createElementVNode("strong",$R,t.toDisplayString(l(T.error).title),1),l(T.error).hint?(t.openBlock(),t.createElementBlock("p",KR,t.toDisplayString(l(T.error).hint),1)):t.createCommentVNode("",!0),t.createElementVNode("code",QR,t.toDisplayString(T.error),1)])])):t.createCommentVNode("",!0)],8,FR)],6))),128)):t.createCommentVNode("",!0)]))}}),So=Me(XR,[["__scopeId","data-v-4387b339"]]),ZR={class:"aia-synth__header"},JR={key:0,class:"aia-synth__sparkle","aria-hidden":"true"},jR={key:1,class:"aia-synth__via"},eC={key:0,class:"aia-synth__sources"},tC={key:1,class:"aia-synth__placeholder"},nC=["innerHTML"],aC={key:3,class:"aia-synth__error"},rC=t.defineComponent({__name:"CompoundSynthesis",props:{state:{},sparkleIcon:{type:Boolean,default:!1},loadingPlaceholders:{type:Boolean,default:!1}},setup(n){const e=n,a=t.computed(()=>se.parse(e.state.content||"")),r=t.computed(()=>e.state.status==="streaming"),i=t.computed(()=>!!(e.state.content&&e.state.content.length>0)),l=t.computed(()=>e.loadingPlaceholders&&!i.value&&(e.state.status==="streaming"||e.state.status==="waiting")),o=t.computed(()=>e.state.status==="streaming"?"Generating synthesis...":"Waiting for backend responses...");function s(d){switch(d){case"waiting":return{text:"Waiting...",cls:"aia-synth__badge--waiting"};case"streaming":return{text:"Synthesizing",cls:"aia-synth__badge--streaming"};case"complete":return{text:"Complete",cls:"aia-synth__badge--complete"};case"error":return{text:"Error",cls:"aia-synth__badge--error"};default:return{text:d,cls:""}}}return(d,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["aia-synth",{"aia-synth--streaming":r.value}])},[t.createElementVNode("div",ZR,[n.sparkleIcon?(t.openBlock(),t.createElementBlock("span",JR,"✨")):t.createCommentVNode("",!0),c[0]||(c[0]=t.createElementVNode("span",{class:"aia-synth__label"},"Compound Synthesis",-1)),n.state.primaryBackend?(t.openBlock(),t.createElementBlock("span",jR,"via "+t.toDisplayString(n.state.primaryBackend),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["aia-synth__badge",s(n.state.status).cls])},t.toDisplayString(s(n.state.status).text),3)]),n.state.backendsCollected.length?(t.openBlock(),t.createElementBlock("div",eC," Sources: "+t.toDisplayString(n.state.backendsCollected.join(", ")),1)):t.createCommentVNode("",!0),l.value?(t.openBlock(),t.createElementBlock("div",tC,t.toDisplayString(o.value),1)):(t.openBlock(),t.createElementBlock("div",{key:2,class:"aia-synth__content",innerHTML:a.value},null,8,nC)),n.state.error?(t.openBlock(),t.createElementBlock("div",aC,t.toDisplayString(n.state.error),1)):t.createCommentVNode("",!0)],2))}}),To=Me(rC,[["__scopeId","data-v-93a21588"]]),iC={class:"finalization-banner"},oC={class:"banner-content"},sC={class:"banner-title"},lC={class:"banner-description"},cC=["disabled"],_C=t.defineComponent({__name:"FinalizationBanner",props:{title:{},buttonLabel:{},entityLabel:{},entityName:{},isFinalizing:{type:Boolean,default:!1}},emits:["finalize"],setup(n,{emit:e}){const a=e;return(r,i)=>(t.openBlock(),t.createElementBlock("div",iC,[t.createElementVNode("div",oC,[t.createElementVNode("h3",sC,t.toDisplayString(n.title),1),t.createElementVNode("p",lC," Your "+t.toDisplayString(n.entityLabel)+t.toDisplayString(n.entityName?": "+n.entityName:"")+" is ready. Click the button to finalize. ",1)]),t.createElementVNode("button",{class:"banner-button",disabled:n.isFinalizing,onClick:i[0]||(i[0]=l=>a("finalize"))},t.toDisplayString(n.isFinalizing?"Creating...":n.buttonLabel),9,cC)]))}}),od=Me(_C,[["__scopeId","data-v-bde99def"]]),dC={key:0,class:"process-group-badge-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},uC={key:1,class:"process-group-badge-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},pC={key:2,class:"process-group-badge-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},mC={class:"process-group-label"},EC={key:0,class:"process-group-time"},gC={class:"process-group-chevron"},SC={key:0,class:"process-group-body"},TC=t.defineComponent({__name:"ProcessGroup",props:{id:{},type:{},label:{},timestamp:{},isExpanded:{type:Boolean,default:!0},autoCollapseMs:{default:0},iconBadges:{type:Boolean,default:!1}},emits:["toggle"],setup(n,{emit:e}){const a=n,r=e,i={tool_call:"Tool",reasoning:"Thinking",code_execution:"Code"},l={tool_call:"var(--aia-cyan, #22d3ee)",reasoning:"var(--aia-violet, #a78bfa)",code_execution:"var(--aia-amber, #fbbf24)"};function o(p){if(!p)return"";const g=new Date(p);return Number.isNaN(g.getTime())?"":g.toLocaleTimeString()}const s=t.ref(!1);let d=null;function c(){d!==null&&(clearTimeout(d),d=null)}function _(){c(),a.autoCollapseMs>0&&!s.value&&a.isExpanded&&(d=setTimeout(()=>{a.isExpanded&&r("toggle")},a.autoCollapseMs))}function u(){s.value=!0,c()}function E(){s.value=!1,_()}return t.onMounted(()=>{_()}),t.onUnmounted(()=>{c()}),t.watch(()=>a.isExpanded,p=>{p?_():c()}),(p,g)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["process-group",[`process-group--${n.type}`]]),onMouseenter:u,onMouseleave:E},[t.createElementVNode("div",{class:"process-group-header",onClick:g[0]||(g[0]=T=>r("toggle"))},[t.createElementVNode("span",{class:t.normalizeClass(["process-group-badge",[`process-group-badge--${n.type}`,{"process-group-badge--with-icon":n.iconBadges}]]),style:t.normalizeStyle({background:l[n.type]})},[n.iconBadges&&n.type==="tool_call"?(t.openBlock(),t.createElementBlock("svg",dC,[...g[1]||(g[1]=[t.createElementVNode("path",{d:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"},null,-1)])])):n.iconBadges&&n.type==="reasoning"?(t.openBlock(),t.createElementBlock("svg",uC,[...g[2]||(g[2]=[t.createElementVNode("path",{d:"M12 2a8 8 0 018 8c0 3-2 5.5-4 7l-1 4H9l-1-4c-2-1.5-4-4-4-7a8 8 0 018-8z"},null,-1),t.createElementVNode("path",{d:"M9 21h6M10 17h4"},null,-1)])])):n.iconBadges&&n.type==="code_execution"?(t.openBlock(),t.createElementBlock("svg",pC,[...g[3]||(g[3]=[t.createElementVNode("polyline",{points:"4 17 10 11 4 5"},null,-1),t.createElementVNode("line",{x1:"12",y1:"19",x2:"20",y2:"19"},null,-1)])])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(i[n.type]),1)],6),t.createElementVNode("span",mC,t.toDisplayString(n.label),1),n.timestamp&&o(n.timestamp)?(t.openBlock(),t.createElementBlock("span",EC,t.toDisplayString(o(n.timestamp)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",gC,t.toDisplayString(n.isExpanded?"▼":"▶"),1)]),n.isExpanded?(t.openBlock(),t.createElementBlock("div",SC,[t.renderSlot(p.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0)],34))}}),bo=Me(TC,[["__scopeId","data-v-c351adfa"]]),bC={class:"aia-smart-panel"},fC={ref:"scroll.containerRef",class:"aia-smart-panel__messages"},RC={key:0,class:"aia-smart-panel__welcome"},CC={class:"aia-smart-panel__welcome-title"},NC={class:"aia-smart-panel__welcome-sub"},hC={key:4,class:"process-groups"},vC={key:2,class:"aia-smart-panel__error"},OC=t.defineComponent({__name:"AiChatPanel",props:{density:{default:"minimal"},defaultBackend:{},defaultModel:{},placeholder:{default:"Type a message..."},welcomeTitle:{default:"AI Chat"},welcomeSubtitle:{default:"Send a message to get started"},readOnly:{type:Boolean},entityLabel:{},bannerTitle:{},bannerButtonLabel:{},configParser:{},showProcessGroups:{type:Boolean,default:void 0},showActions:{type:Boolean,default:void 0}},emits:["finalize"],setup(n,{emit:e}){const a=n,r=t.computed(()=>a.showProcessGroups??a.density==="detailed"),i=t.computed(()=>a.showActions??a.density==="detailed"),l=e,o=st.useSmartChat(),s=st.useSmartScroll(),{client:d}=st.useAiAccounts(),c=t.ref([]),_=t.ref({}),u=t.computed(()=>Array.from(new Set(c.value.map(h=>h.kind))).map(h=>{const O=c.value.filter(C=>C.kind===h);return{kind:h,displayName:h,accounts:O.map(C=>({id:C.id,label:C.display_name||C.id})),models:_.value[h]??[]}}));async function E(h){if(!_.value[h.kind])try{const{items:O}=await d.listModels(h.id);_.value={..._.value,[h.kind]:O.map(C=>C.id)}}catch{}}async function p(){if(await Promise.all(c.value.filter(h=>h.status==="ready").map(E)),!o.selectedModel.value){for(const h of u.value)if(h.models.length>0){o.selectedModel.value=h.models[0],o.selectedBackend.value||(o.selectedBackend.value=h.kind);break}}}t.watchEffect(()=>{o.setConfigParser(a.configParser??null)}),t.onMounted(async()=>{try{const h=await d.listBackends();c.value=h.items??[],await p()}catch{}}),t.watch(()=>[o.selectedBackend.value,o.selectedAccount.value],([h,O],[C,b])=>{o.sessionId.value&&(h!==C||O!==b)&&o.resetSession()});function g(h,O=null){if(O){const b=c.value.find(N=>N.id===O);if(b)return b}const C=h?c.value.filter(b=>b.kind===h):c.value;return C.find(b=>b.status==="ready")??C[0]??null}async function T(h){if(!o.sessionId.value){if(c.value.length===0)try{const v=await d.listBackends();c.value=v.items??[],await p()}catch{o.error.value="Unable to load backends from sidecar";return}const O=o.selectedBackend.value??a.defaultBackend??null,C=o.selectedAccount.value,b=g(O,C);if(!b){o.error.value="No backend available — add an account first";return}let N=o.selectedModel.value??a.defaultModel??"";if(!N){await E(b);const v=_.value[b.kind]??[];v.length>0&&(N=v[0],o.selectedModel.value=N)}if(!N){o.error.value=`No models available for ${b.kind}`;return}try{await o.createSession(b.id,N)}catch(v){o.error.value=v instanceof Error?v.message:String(v);return}}await o.send(h)}async function f(){const h=await o.finalize();l("finalize",h)}return(h,O)=>(t.openBlock(),t.createElementBlock("div",bC,[n.density==="detailed"?(t.openBlock(),t.createBlock(rd,{key:0,"chat-mode":t.unref(o).chatMode.value,"selected-backend":t.unref(o).selectedBackend.value,"selected-account":t.unref(o).selectedAccount.value,"selected-model":t.unref(o).selectedModel.value,backends:u.value,"onUpdate:chatMode":t.unref(o).setMode,"onUpdate:selectedBackend":t.unref(o).selectBackend,"onUpdate:selectedAccount":O[0]||(O[0]=C=>t.unref(o).selectedAccount.value=C),"onUpdate:selectedModel":O[1]||(O[1]=C=>t.unref(o).selectedModel.value=C)},null,8,["chat-mode","selected-backend","selected-account","selected-model","backends","onUpdate:chatMode","onUpdate:selectedBackend"])):t.createCommentVNode("",!0),t.createElementVNode("div",fC,[t.unref(o).messages.value.length===0&&!t.unref(o).isStreaming.value?(t.openBlock(),t.createElementBlock("div",RC,[O[3]||(O[3]=t.createElementVNode("div",{class:"aia-smart-panel__welcome-icon"},"AI",-1)),t.createElementVNode("h3",CC,t.toDisplayString(n.welcomeTitle),1),t.createElementVNode("p",NC,t.toDisplayString(n.welcomeSubtitle),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).messages.value,C=>(t.openBlock(),t.createBlock($t,{key:C.id,role:C.role,content:C.content,timestamp:C.created_at,"show-actions":i.value,"all-messages":t.unref(o).messages.value},null,8,["role","content","timestamp","show-actions","all-messages"]))),128)),t.unref(o).isStreaming.value&&t.unref(o).chatMode.value==="single"&&t.unref(o).streamingContent.value?(t.openBlock(),t.createBlock($t,{key:1,role:"assistant",content:t.unref(o).streamingContent.value,streaming:!0},null,8,["content"])):t.createCommentVNode("",!0),t.unref(o).backendResponses.value.size>0?(t.openBlock(),t.createBlock(So,{key:2,responses:t.unref(o).backendResponses.value,collapsible:t.unref(o).chatMode.value==="compound"},null,8,["responses","collapsible"])):t.createCommentVNode("",!0),t.unref(o).synthesisState.value?(t.openBlock(),t.createBlock(To,{key:3,state:t.unref(o).synthesisState.value},null,8,["state"])):t.createCommentVNode("",!0),r.value&&t.unref(o).processGroups.groups.value.size>0?(t.openBlock(),t.createElementBlock("div",hC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).processGroups.groups.value,([C,b])=>(t.openBlock(),t.createBlock(bo,{key:C,id:b.id,type:b.type,label:b.label,timestamp:b.timestamp,"is-expanded":b.isExpanded,onToggle:N=>t.unref(o).processGroups.toggleGroup(C)},{default:t.withCtx(()=>[t.createElementVNode("pre",null,t.toDisplayString(b.content),1)]),_:2},1032,["id","type","label","timestamp","is-expanded","onToggle"]))),128))])):t.createCommentVNode("",!0),h.$slots.finalization?t.renderSlot(h.$slots,"finalization",{key:5,state:{canFinalize:t.unref(o).canFinalize,isFinalizing:t.unref(o).isFinalizing}},void 0,!0):t.unref(o).canFinalize.value&&n.entityLabel?(t.openBlock(),t.createBlock(od,{key:6,title:n.bannerTitle??"Ready to finalize","button-label":n.bannerButtonLabel??"Finalize","entity-label":n.entityLabel,"is-finalizing":t.unref(o).isFinalizing.value,onFinalize:f},null,8,["title","button-label","entity-label","is-finalizing"])):t.createCommentVNode("",!0),O[4]||(O[4]=t.createElementVNode("div",{class:"aia-smart-panel__anchor"},null,-1))],512),t.unref(s).showScrollButton.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"aia-smart-panel__scroll-btn",onClick:O[2]||(O[2]=(...C)=>t.unref(s).scrollToBottom&&t.unref(s).scrollToBottom(...C))}," ↓ ")):t.createCommentVNode("",!0),t.unref(o).error.value?(t.openBlock(),t.createElementBlock("div",vC,t.toDisplayString(t.unref(o).error.value),1)):t.createCommentVNode("",!0),n.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(id,{key:3,placeholder:n.placeholder,"is-streaming":t.unref(o).isStreaming.value,onSend:T},null,8,["placeholder","is-streaming"]))]))}}),yC=Me(OC,[["__scopeId","data-v-389e137a"]]),AC={class:"aia-chat-selector"},IC={class:"aia-chat-selector__group"},DC=["value","disabled"],MC=["value"],LC={class:"aia-chat-selector__group"},xC=["value","disabled"],kC=["value"],wC={class:"aia-chat-selector__group"},PC=["value","disabled"],BC=["value"],UC={key:0,class:"aia-chat-selector__group aia-chat-selector__mode-group"},FC=["value","checked","onChange"],GC=t.defineComponent({__name:"AiChatSelector",props:{backend:{},accountId:{},model:{},chatMode:{}},emits:["update:backend","update:accountId","update:model","update:chatMode"],setup(n,{emit:e}){const a=n,r=e,i=[{value:"single",label:"Single"},{value:"all",label:"All"},{value:"compound",label:"Compound"}],{client:l}=st.useAiAccounts(),o=t.ref([]),s=t.ref({}),d=t.ref(!0),c=t.computed(()=>{const C=new Map;for(const b of o.value)C.has(b.kind)||C.set(b.kind,{kind:b.kind,label:_(b)});return Array.from(C.values())});function _(C){return{claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"}[C.kind]??C.kind}const u=t.computed(()=>a.backend==="auto"?[]:o.value.filter(C=>C.kind===a.backend)),E=t.computed(()=>u.value.map(C=>({id:C.id,label:C.display_name||C.id}))),p=t.computed(()=>s.value[a.backend]??[]),g=t.computed(()=>a.backend==="auto");async function T(C){if(s.value[C])return;const b=o.value.find(N=>N.kind===C);if(b)try{const{items:N}=await l.listModels(b.id);s.value={...s.value,[C]:N.map(v=>v.id)}}catch{}}t.onMounted(async()=>{try{const C=await l.listBackends();o.value=C.items??[],a.backend&&a.backend!=="auto"&&await T(a.backend)}catch{}finally{d.value=!1}}),t.watch(()=>a.backend,C=>{r("update:accountId",null),r("update:model",null),C&&C!=="auto"&&T(C)});function f(C){const b=C.target.value;r("update:backend",b),b!=="auto"&&a.chatMode&&a.chatMode!=="single"&&r("update:chatMode","single")}function h(C){const b=C.target.value;r("update:accountId",b||null)}function O(C){const b=C.target.value;r("update:model",b||null)}return(C,b)=>(t.openBlock(),t.createElementBlock("div",AC,[t.createElementVNode("div",IC,[b[1]||(b[1]=t.createElementVNode("label",{class:"aia-chat-selector__label"},"Backend:",-1)),t.createElementVNode("select",{class:"aia-chat-selector__select aia-chat-selector__select--backend",value:n.backend,disabled:d.value,onChange:f},[b[0]||(b[0]=t.createElementVNode("option",{value:"auto"},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,N=>(t.openBlock(),t.createElementBlock("option",{key:N.kind,value:N.kind},t.toDisplayString(N.label),9,MC))),128))],40,DC)]),t.createElementVNode("div",LC,[b[3]||(b[3]=t.createElementVNode("label",{class:"aia-chat-selector__label"},"Account:",-1)),t.createElementVNode("select",{class:"aia-chat-selector__select aia-chat-selector__select--account",value:n.accountId||"",disabled:g.value||E.value.length===0,onChange:h},[b[2]||(b[2]=t.createElementVNode("option",{value:""},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.value,N=>(t.openBlock(),t.createElementBlock("option",{key:N.id,value:N.id},t.toDisplayString(N.label),9,kC))),128))],40,xC)]),t.createElementVNode("div",wC,[b[5]||(b[5]=t.createElementVNode("label",{class:"aia-chat-selector__label"},"Model:",-1)),t.createElementVNode("select",{class:"aia-chat-selector__select aia-chat-selector__select--model",value:n.model||"",disabled:g.value||p.value.length===0,onChange:O},[b[4]||(b[4]=t.createElementVNode("option",{value:""},"Auto",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,N=>(t.openBlock(),t.createElementBlock("option",{key:N,value:N},t.toDisplayString(N),9,BC))),128))],40,PC)]),n.chatMode?(t.openBlock(),t.createElementBlock("div",UC,[b[6]||(b[6]=t.createElementVNode("span",{class:"aia-chat-selector__mode-separator","aria-hidden":"true"},null,-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,N=>t.createElementVNode("label",{key:N.value,class:t.normalizeClass(["aia-chat-selector__mode-radio",{"aia-chat-selector__mode-radio--active":n.chatMode===N.value}])},[t.createElementVNode("input",{type:"radio",name:"aia-chat-selector-mode",value:N.value,checked:n.chatMode===N.value,onChange:v=>r("update:chatMode",N.value)},null,40,FC),t.createTextVNode(" "+t.toDisplayString(N.label),1)],2)),64))])):t.createCommentVNode("",!0),t.renderSlot(C.$slots,"trailing",{},void 0,!0)]))}}),sd=Me(GC,[["__scopeId","data-v-4182e3c5"]]),YC={class:"chat-panel"},VC={key:1,class:"cli-runner-toggle"},qC=["aria-pressed","title"],zC={class:"cli-runner-toggle__label"},HC={key:0,class:"chat-welcome"},WC={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},$C=["d"],KC={class:"process-group-content"},QC={key:4,class:"processing-indicator"},XC={key:2,class:"convert-banner"},ZC={class:"banner-icon"},JC={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},jC=["d"],eN={class:"banner-content"},tN=["disabled"],nN={key:3,class:"input-area"},aN={class:"input-wrapper"},rN=["value","placeholder","disabled"],iN=["disabled"],oN=32,sN=t.defineComponent({__name:"AiChatPanelManaged",props:{messages:{default:()=>[]},isProcessing:{type:Boolean,default:!1},streamingContent:{default:""},inputMessage:{default:""},conversationId:{default:null},canFinalize:{type:Boolean,default:!1},isFinalizing:{type:Boolean,default:!1},assistantIconPaths:{default:()=>[]},inputPlaceholder:{default:"Type a message..."},entityLabel:{default:""},bannerTitle:{default:""},bannerButtonLabel:{default:""},detectedEntityName:{default:""},showBackendSelector:{type:Boolean,default:!1},selectedBackend:{default:"auto"},selectedAccountId:{default:null},selectedModel:{default:null},readOnly:{type:Boolean,default:!1},useSmartScroll:{type:Boolean,default:!1},processGroups:{},chatMode:{default:"single"},backendResponses:{},synthesisState:{default:null},isAllModeActive:{type:Boolean,default:!1},useCliRunner:{type:Boolean,default:!1},hideCliRunnerToggle:{type:Boolean,default:!1}},emits:["update:inputMessage","send","keydown","finalize","update:selectedBackend","update:selectedAccountId","update:selectedModel","update:chatMode","update:useCliRunner"],setup(n,{emit:e}){const a=n,r=e,i=t.ref(null),l={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},o=t.computed(()=>l[a.selectedBackend??"auto"]??"AI");function s(b){return b.backend&&l[b.backend]||"AI"}const d=t.computed(()=>a.messages??[]),c=t.computed(()=>a.inputMessage??""),_=t.computed(()=>a.assistantIconPaths??[]),u=t.computed(()=>d.value.map(b=>{const N={role:b.role,content:b.content};return b.timestamp&&(N.timestamp=b.timestamp),N})),E=t.ref(!0);function p(){const b=i.value;return b?b.scrollHeight-b.scrollTop-b.clientHeight<=oN:!0}function g(){a.useSmartScroll&&(E.value=p())}function T(){t.nextTick(()=>{if(i.value){if(a.useSmartScroll&&!E.value)return;i.value.scrollTop=i.value.scrollHeight}})}function f(){E.value=!0,t.nextTick(()=>{i.value&&i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})})}const h=t.computed(()=>a.useSmartScroll&&!E.value);t.watch(()=>d.value.length,T),t.watch(()=>a.streamingContent,T),t.watch(()=>a.isProcessing,b=>{b&&T()}),t.watch(()=>{if(!a.backendResponses)return 0;let b=0;for(const N of a.backendResponses.values())b+=N.content.length;return b},T),t.watch(()=>{var b,N;return((N=(b=a.synthesisState)==null?void 0:b.content)==null?void 0:N.length)??0},T);function O(b){const N=b.target;r("update:inputMessage",N.value),N.style.height="auto",N.style.height=Math.min(N.scrollHeight,120)+"px"}const C=t.computed(()=>a.processGroups?Array.from(a.processGroups.entries()):[]);return(b,N)=>(t.openBlock(),t.createElementBlock("div",YC,[n.showBackendSelector?(t.openBlock(),t.createBlock(sd,{key:0,backend:n.selectedBackend??"auto","account-id":n.selectedAccountId??null,model:n.selectedModel??null,"chat-mode":n.chatMode??"single","onUpdate:backend":N[0]||(N[0]=v=>r("update:selectedBackend",v)),"onUpdate:accountId":N[1]||(N[1]=v=>r("update:selectedAccountId",v)),"onUpdate:model":N[2]||(N[2]=v=>r("update:selectedModel",v)),"onUpdate:chatMode":N[3]||(N[3]=v=>r("update:chatMode",v))},{trailing:t.withCtx(()=>[t.renderSlot(b.$slots,"selector-trailing",{},void 0,!0)]),_:3},8,["backend","account-id","model","chat-mode"])):t.createCommentVNode("",!0),t.renderSlot(b.$slots,"header-extra",{},void 0,!0),n.hideCliRunnerToggle?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",VC,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cli-runner-toggle__btn",{"cli-runner-toggle__btn--active":n.useCliRunner}]),"aria-pressed":n.useCliRunner?"true":"false",title:n.useCliRunner?"CLI runner mode — agent uses tools (filesystem, shell, edits) in the project worktree":"CLIProxy mode — pure token chat, no tool use",onClick:N[4]||(N[4]=v=>r("update:useCliRunner",!n.useCliRunner))},[N[9]||(N[9]=t.createElementVNode("span",{class:"cli-runner-toggle__dot"},null,-1)),t.createElementVNode("span",zC,t.toDisplayString(n.useCliRunner?"CLI runner":"CLIProxy"),1)],10,qC)])),t.createElementVNode("div",{class:"chat-container",ref_key:"chatContainer",ref:i,onScroll:g},[t.renderSlot(b.$slots,"welcome",{},()=>[d.value.length===0&&!n.isProcessing?(t.openBlock(),t.createElementBlock("div",HC,[t.createElementVNode("div",{class:t.normalizeClass(["welcome-icon",{connecting:!n.conversationId}])},[(t.openBlock(),t.createElementBlock("svg",WC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(v,w)=>(t.openBlock(),t.createElementBlock("path",{key:w,d:v},null,8,$C))),128))]))],2),t.createElementVNode("h2",null,t.toDisplayString(n.conversationId?"Ready to chat":`Connecting to ${o.value}...`),1),t.createElementVNode("p",null,t.toDisplayString(o.value)+" will guide you through designing your "+t.toDisplayString(n.entityLabel),1)])):t.createCommentVNode("",!0)],!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,(v,w)=>(t.openBlock(),t.createElementBlock("div",{key:w,class:t.normalizeClass(["message-wrapper",v.role])},[t.createVNode($t,{role:v.role,content:v.content,timestamp:v.timestamp??null,backend:v.backend??null,"avatar-paths":_.value,"assistant-name":s(v),"skip-transition":d.value.length>10&&w<d.value.length-5},null,8,["role","content","timestamp","backend","avatar-paths","assistant-name","skip-transition"]),!n.isProcessing||w<d.value.length-1?(t.openBlock(),t.createBlock(go,{key:0,content:v.content,"all-messages":w===d.value.length-1?u.value:[]},null,8,["content","all-messages"])):t.createCommentVNode("",!0)],2))),128)),n.isProcessing&&(n.chatMode==="single"||!n.chatMode)&&n.streamingContent?(t.openBlock(),t.createBlock($t,{key:0,role:"assistant",content:n.streamingContent??"",backend:n.selectedBackend??null,"avatar-paths":_.value,"assistant-name":o.value,streaming:!0},null,8,["content","backend","avatar-paths","assistant-name"])):t.createCommentVNode("",!0),(n.chatMode==="all"||n.chatMode==="compound")&&n.backendResponses&&n.backendResponses.size>0?(t.openBlock(),t.createBlock(So,{key:1,responses:n.backendResponses,collapsible:n.chatMode==="compound"},null,8,["responses","collapsible"])):t.createCommentVNode("",!0),n.synthesisState&&n.synthesisState.status!=="waiting"?(t.openBlock(),t.createBlock(To,{key:2,state:n.synthesisState},null,8,["state"])):t.createCommentVNode("",!0),C.value.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:3},t.renderList(C.value,([v,w])=>(t.openBlock(),t.createBlock(bo,{key:v,id:v,type:w.type,label:w.label,timestamp:w.timestamp??"","auto-collapse-ms":w.type==="tool_call"?4e3:2e3},{default:t.withCtx(()=>[t.createElementVNode("pre",KC,t.toDisplayString(w.content),1)]),_:2},1032,["id","type","label","timestamp","auto-collapse-ms"]))),128)):t.createCommentVNode("",!0),n.isProcessing&&!n.streamingContent?(t.openBlock(),t.createElementBlock("div",QC,[N[10]||(N[10]=t.createElementVNode("div",{class:"dots"},[t.createElementVNode("span"),t.createElementVNode("span"),t.createElementVNode("span")],-1)),t.createElementVNode("span",null,t.toDisplayString(o.value)+" is thinking...",1)])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("button",{key:5,class:"scroll-to-bottom-btn",onClick:f,title:"Scroll to bottom"},[...N[11]||(N[11]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1)])])):t.createCommentVNode("",!0)],544),n.canFinalize?(t.openBlock(),t.createElementBlock("div",XC,[t.createElementVNode("div",ZC,[(t.openBlock(),t.createElementBlock("svg",JC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(v,w)=>(t.openBlock(),t.createElementBlock("path",{key:w,d:v},null,8,jC))),128)),N[12]||(N[12]=t.createElementVNode("path",{d:"M20 6L9 17l-5-5","stroke-width":"2.5"},null,-1))]))]),t.createElementVNode("div",eN,[t.createElementVNode("h3",null,t.toDisplayString(n.bannerTitle),1),t.createElementVNode("p",null,t.toDisplayString(o.value)+" has designed your "+t.toDisplayString(n.entityLabel)+t.toDisplayString(n.detectedEntityName?": "+n.detectedEntityName:"")+". Click the button to finalize. ",1)]),t.createElementVNode("button",{class:"btn btn-primary btn-convert",disabled:n.isFinalizing,onClick:N[5]||(N[5]=v=>r("finalize"))},[N[13]||(N[13]=t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M20 6L9 17l-5-5"})],-1)),t.createTextVNode(" "+t.toDisplayString(n.isFinalizing?"Creating...":n.bannerButtonLabel),1)],8,tN)])):t.createCommentVNode("",!0),n.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",nN,[t.createElementVNode("div",aN,[t.createElementVNode("textarea",{value:c.value,onInput:N[6]||(N[6]=v=>O(v)),placeholder:n.inputPlaceholder,disabled:n.isProcessing,onKeydown:N[7]||(N[7]=v=>r("keydown",v)),rows:"1"},null,40,rN),t.createElementVNode("button",{class:"btn-send",disabled:!c.value.trim()||n.isProcessing,onClick:N[8]||(N[8]=v=>r("send"))},[...N[14]||(N[14]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],8,iN)])]))]))}}),lN=Me(sN,[["__scopeId","data-v-ada7b5b1"]]),cN={class:"aia-chat-mode-selector",role:"radiogroup","aria-label":"Chat mode"},_N=["aria-checked","title","onClick"],dN=t.defineComponent({__name:"ChatModeSelector",props:{mode:{}},emits:["update:mode"],setup(n,{emit:e}){const a=e,r=[{value:"single",label:"Single",description:"Send to one backend"},{value:"all",label:"All",description:"Send to all backends simultaneously"},{value:"compound",label:"Compound",description:"All backends + AI synthesis"}];return(i,l)=>(t.openBlock(),t.createElementBlock("div",cN,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,o=>t.createElementVNode("button",{key:o.value,type:"button",role:"radio","aria-checked":n.mode===o.value,class:t.normalizeClass(["aia-chat-mode-selector__btn",{"aia-chat-mode-selector__btn--active":n.mode===o.value}]),title:o.description,onClick:s=>a("update:mode",o.value)},t.toDisplayString(o.label),11,_N)),64))]))}}),uN=Me(dN,[["__scopeId","data-v-c2599533"]]),pN="0.3.13";exports.AccountEditForm=Zm;exports.AccountWizard=hm;exports.AiChatPanel=yC;exports.AiChatPanelManaged=lN;exports.AiChatSelector=sd;exports.AllModeResponses=So;exports.BackendPicker=M_;exports.ChatBubble=$t;exports.ChatControls=rd;exports.ChatInput=id;exports.ChatMessage=Xi;exports.ChatModeSelector=uN;exports.ChatPanel=dE;exports.CompoundSynthesis=To;exports.FinalizationBanner=od;exports.LoginStream=D_;exports.MessageActions=go;exports.OnboardingFlow=Hm;exports.ProcessGroup=bo;exports.forceFreshAccountPrompt=I_;exports.version=pN;
@@ -54950,7 +54950,7 @@ ${u.content}`).join(`
54950
54950
  }, y(i.label), 11, HN)), 64))
54951
54951
  ]));
54952
54952
  }
54953
- }), gv = /* @__PURE__ */ He(VN, [["__scopeId", "data-v-c2599533"]]), Sv = "0.3.12";
54953
+ }), gv = /* @__PURE__ */ He(VN, [["__scopeId", "data-v-c2599533"]]), Sv = "0.3.13";
54954
54954
  export {
54955
54955
  uv as AccountEditForm,
54956
54956
  _v as AccountWizard,
package/dist/index.d.ts CHANGED
@@ -19,5 +19,5 @@ export { default as ProcessGroup } from './components/ProcessGroup.vue';
19
19
  export { default as MessageActions } from './components/MessageActions.vue';
20
20
  export { default as FinalizationBanner } from './components/FinalizationBanner.vue';
21
21
  export { forceFreshAccountPrompt } from './components/forceFreshAccountPrompt';
22
- export declare const version = "0.3.12";
22
+ export declare const version = "0.3.13";
23
23
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-accounts/vue-styled",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Vue 3 styled components for ai-accounts",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -27,8 +27,8 @@
27
27
  "dompurify": "^3.4.2",
28
28
  "highlight.js": "^11.11.1",
29
29
  "marked": "^18.0.0",
30
- "@ai-accounts/vue-headless": "0.3.12",
31
- "@ai-accounts/ts-core": "0.3.12"
30
+ "@ai-accounts/ts-core": "0.3.13",
31
+ "@ai-accounts/vue-headless": "0.3.13"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@vitejs/plugin-vue": "^5.1.0",