@arcforge/axon 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -823,8 +823,8 @@ Expected: ${A}`);s=await vkt({entrypoint:n.entrypoint,maxMemoryMb:n.policy?.reso
|
|
|
823
823
|
\u2800\u2800\u2800\u28E4\u28C0\u2849\u281B\u281B\u280B\u28C9\u28E0\u28F4\u283F\u28BF\u28FF\u283F\u280B\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
824
824
|
\u2800\u2800\u2800\u2808\u283B\u28BF\u28FF\u28FF\u28FF\u28FF\u287F\u280B\u28E0\u281F\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
825
825
|
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28E4\u287E\u280B\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
826
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28B0\u287F\u2801`,k1t=uNa({__name:"axon-header",setup(e){let{agents:t,prefs:n,auth:a,capsuleer:r}=mc(),i=r.status,s=C_(),c=Gs(),u=bi.computed(()=>({color:n.theme.value?.ui?.primary??"#00B4D8"})),A=bi.computed(()=>t.selected.value?.name??"\u2014"),p=bi.computed(()=>a.user.value?.name??"\u2014"),d=bi.computed(()=>a.user.value?.email??"\u2014"),g=bi.computed(()=>{let E=c.cwd.value,I=process.env.HOME;return I&&E.startsWith(I)?E.replace(I,"~"):E}),f=bi.computed(()=>s.status.value),b=bi.computed(()=>{if(i.value==="installing")return"installing capsuleer...";if(i.value==="error")return"capsuleer error";switch(f.value){case"online":return"online";case"connected":return"connected";case"booting":return"booting...";case"connecting":return"connecting...";case"reconnecting":return"reconnecting...";case"idle":return"idle";case"error":return"error";default:return"offline"}}),w=bi.computed(()=>{if(i.value==="installing")return{color:"#f59e0b"};if(i.value==="error")return{color:"red"};switch(f.value){case"online":case"connected":return{color:"#22c55e"};case"booting":case"connecting":case"reconnecting":return{color:"#f59e0b"};case"error":return{color:"red"};default:return{color:"#6b7280"}}});return(E,I)=>{return lNa(),ANa("div",{class:"axon-header"},[Al("div",{class:"logo-section"},[Al("pre",{class:"logo",style:bj(fw(u))},fj(pNa),4)]),Al("div",{class:"stats-section"},[Al("div",{class:"divider"}),Al("div",{class:"title-line"},[Al("span",{class:"title-name",style:bj(fw(u))},fj(fw(A)),5)]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-value"},fj(fw(d)),1)]),Al("div",{class:"divider"}),Al("div",{class:"stat-line"},[Al("span",{class:"stat-label",style:bj(fw(u))},"agent",4),Al("span",{class:"stat-value"},fj(fw(A)),1)]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-label",style:bj(fw(u))},"status",4),Al("span",{class:"stat-value",style:bj(fw(w))},fj(fw(b)),5)]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-label",style:bj(fw(u))},"cwd",4),Al("span",{class:"stat-value"},fj(fw(g)),1)]),Al("div",{class:"divider"}),Al("div",{class:"info-line"},[Al("a",{class:"info-text",href:"https://axon.arclabs.it"},"https://axon.arclabs.it")]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-value"},"press ? for help")]),Al("div",{class:"divider"}),Al("div",{class:"stat-line"},[Al("span",{class:"tagline"},"Built different. Think different.")])])])}}});k1t.__scopeId="data-v-f2701251";var C1t=k1t;var _i=ko(Eo(),1);var dNa=_i.defineComponent,x1t=_i.toDisplayString,v1t=_i.createElementVNode;var mNa=_i.createCommentVNode,gNa=_i.openBlock,fNa=_i.createElementBlock;var bNa=_i.normalizeStyle;var EDe=_i.unref;var B1t={"data-v-6fa5372d\x00.status-bar":{height:2,display:"flex",gap:1},"data-v-6fa5372d\x00.spinner":{width:1},"data-v-6fa5372d\x00.label":{visualStyles:{fg:"grey"}}},E1t=dNa({__name:"status-bar",props:{active:{type:Boolean,required:!0},label:{type:String,required:!1}},setup(e){let{prefs:t}=mc(),n=e,a=_i.computed(()=>t.theme.value?.ui?.primary??"#00B4D8"),r=_i.computed(()=>n.label??"working"),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],s=_i.ref(0),c=null;_i.onMounted(()=>{c=setInterval(()=>{s.value++},80)}),_i.onUnmounted(()=>{if(c)clearInterval(c)});let u=_i.computed(()=>i[s.value%i.length]);return(A,p)=>{return e.active?(gNa(),fNa("div",{key:0,class:"status-bar"},[v1t("span",{class:"spinner",style:bNa({color:EDe(a)})},x1t(EDe(u)),5),v1t("span",{class:"label"},x1t(EDe(r)),1)])):mNa("v-if",!0)}}});E1t.__scopeId="data-v-6fa5372d";var D1t=E1t;var Ao=ko(Eo(),1);var Tr=ko(Eo(),1);var Ri=ko(Eo(),1);var hNa=Ri.defineComponent,HD=Ri.toDisplayString,KD=Ri.createElementVNode;var hj=Ri.createCommentVNode,G0=Ri.openBlock,U0=Ri.createElementBlock;var I1t=Ri.renderList,AU=Ri.Fragment,DDe=Ri.normalizeClass,pU=Ri.normalizeStyle;var Q1t={"data-v-6ad331e3\x00.palette":{display:"flex",flexDirection:"row"},"data-v-6ad331e3\x00.palette-items":{display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0},"data-v-6ad331e3\x00.palette-scrollbar":{display:"flex",flexDirection:"column",width:1,visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-scrollbar-track":{height:1},"data-v-6ad331e3\x00.palette-item":{display:"flex",height:1,hover:{visualStyles:{bg:"#272727"}}},"data-v-6ad331e3\x00.palette-item--header":{visualStyles:{fg:"grey"},hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-item--separator":{hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-item--invalid .palette-name":{visualStyles:{fg:"#dc3c3c"}},"data-v-6ad331e3\x00.palette-item--invalid .palette-desc":{visualStyles:{fg:"#b43c3c"}},"data-v-6ad331e3\x00.palette-item--invalid":{hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-item--dimmed .palette-name":{visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-working":{hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-working.working .working-message":{visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-working.error .working-message":{visualStyles:{fg:"#dc3c3c"}},"data-v-6ad331e3\x00.palette-status .status-message":{visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-status.error .status-message":{visualStyles:{fg:"#b43c3c"}},"data-v-6ad331e3\x00.selector":{width:2},"data-v-6ad331e3\x00.palette-breadcrumb":{scrollable:!1},"data-v-6ad331e3\x00.palette-name":{width:25,scrollable:!1},"data-v-6ad331e3\x00.palette-desc":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.header-label":{flexGrow:1,flexShrink:1,flexBasis:0,marginLeft:2,scrollable:!1,visualStyles:{fg:"grey"}}},F1t=hNa({__name:"palette",props:{items:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},scrollbar:{type:Array,required:!0},height:{type:Number,required:!0},status:{type:null,required:!0},working:{type:null,required:!0},primary:{type:String,required:!0},breadcrumb:{type:[String,null],required:!0},breadcrumbWidth:{type:Number,required:!0}},emits:["select","hover"],setup(e){return(t,n)=>{return G0(),U0("div",{class:"palette"},[KD("div",{class:"palette-items"},[hj(" Working state: replaces the item list while an async command runs "),e.working!==null?(G0(),U0("div",{key:0,class:DDe(["palette-item palette-working",e.working.kind])},[KD("div",{class:"selector",style:pU({color:e.primary})},">",4),KD("div",{class:"palette-name working-label",style:pU({color:e.primary})},HD(e.working.label),5),KD("div",{class:"palette-desc working-message"},HD(e.working.message),1)],2)):(G0(),U0(AU,{key:1},[hj(" Non-breadcrumb status row (loading, error) "),e.status!==null?(G0(),U0("div",{key:0,class:DDe(["palette-item palette-status",e.status.kind])},[KD("div",{class:"selector"}),KD("div",{class:"palette-name status-message"},HD(e.status.message),1)],2)):hj("v-if",!0),(G0(!0),U0(AU,null,I1t(e.items,({item:a,index:r},i)=>{return G0(),U0("div",{key:i,class:DDe(["palette-item",{"palette-item--header":a.header,"palette-item--separator":a.separator,"palette-item--invalid":a.invalid,"palette-item--dimmed":!a.invalid&&!a.header&&!a.separator&&e.items[0]?.item.invalid}]),onPress:()=>!a.invalid&&!a.header&&!a.separator&&t.$emit("select",r),onMouseover:()=>!a.invalid&&!a.header&&!a.separator&&t.$emit("hover",r)},[a.separator?(G0(),U0(AU,{key:0},[],64)):a.header?(G0(),U0("div",{key:1,class:"header-label"},HD(a.label),1)):(G0(),U0(AU,{key:2},[KD("div",{class:"selector",style:pU({color:e.primary})},HD(r===e.selectedIndex?">":" "),5),hj(" Breadcrumb prefix: first row shows the path in primary colour, rest just indent "),e.breadcrumb?(G0(),U0("div",{key:0,class:"palette-breadcrumb",style:pU({width:e.breadcrumbWidth,color:r===0?e.primary:""})},HD(r===0?e.breadcrumb:""),5)):hj("v-if",!0),KD("div",{class:"palette-name",style:pU({color:!a.invalid&&r===e.selectedIndex?e.primary:""})},HD(a.label),5),KD("div",{class:"palette-desc"},HD(a.description??""),1)],64))],42,["onPress","onMouseover"])}),128))],64))]),e.scrollbar.length>0&&e.working===null?(G0(),U0("div",{key:0,class:"palette-scrollbar"},[(G0(!0),U0(AU,null,I1t(e.scrollbar,(a,r)=>{return G0(),U0("div",{key:r,class:"palette-scrollbar-track"},HD(a),1)}),128))])):hj("v-if",!0)])}}});F1t.__scopeId="data-v-6ad331e3";var S1t=F1t;var to=ko(Eo(),1);var _Na=to.defineComponent,yNa=to.toDisplayString,wNa=to.createElementVNode;var kNa=to.openBlock,CNa=to.createElementBlock;var xNa=to.normalizeStyle;var vNa=to.unref;var T1t={"data-v-19173c57\x00.visualizer":{height:1,scrollable:!1},"data-v-19173c57\x00.waveform":{scrollable:!1}},N1t=_Na({__name:"voice-visualizer",props:{bars:{type:Array,required:!0},status:{type:String,required:!0},primary:{type:String,required:!0}},setup(e){let t=e,n=to.computed(()=>Kae(t.bars));return(a,r)=>{return kNa(),CNa("div",{class:"visualizer"},[wNa("div",{class:"waveform",style:xNa({color:e.primary})},yNa(vNa(n)),5)])}}});N1t.__scopeId="data-v-19173c57";var L1t=N1t;var dU={":":"command","/":"page","*":"model","\xAC":"devmodel","@":"skill",'"':"theme","#":"voice","?":"help"},P1t={command:"run app commands",page:"navigate to a page",model:"switch agent or model",devmodel:"switch model (local dev endpoint)",skill:"insert a skill into your message",theme:"pick a colour theme",voice:"voice input via microphone",help:"show this help"},BNa={normal:"\xBB",command:":",page:"/",model:"*",devmodel:"\xAC",skill:"@",theme:'"',voice:"#",help:"?",history:"\u2191",loading:"\u280B",escalation:"\u203C"},j1t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function M1t(e,t=()=>!0){let n=kt.ref("normal"),a=kt.ref(!1),r=kt.ref(0),i=null;kt.watch([n,a],([u,A])=>{if((u==="loading"||A)&&!i)i=setInterval(()=>{r.value++},80);else if(u!=="loading"&&!A&&i)clearInterval(i),i=null}),kt.onUnmounted(()=>{if(i)clearInterval(i)});let s=kt.computed(()=>{if(a.value||n.value==="loading")return j1t[r.value%j1t.length];return BNa[n.value]});function c(u){n.value=u}for(let[u,A]of Object.entries(dU)){if(A==="skill"){Oo(u,(p)=>{if(!t())return;if(n.value==="loading")return;n.value="skill"});continue}Oo(u,(p)=>{if(!t())return;if(n.value==="loading")return;if(e().length>0)return;n.value=n.value===A?"normal":A,p.consumed=!0})}return Oo("up",(u)=>{if(!t())return;if(n.value!=="normal")return;if(e().length>0)return;n.value="history",u.consumed=!0}),{mode:n,symbol:s,processing:a,setMode:c}}import{spawn as tre}from"child_process";import ENa from"fs";var q1t=[{kind:"action",label:"help",description:"show keyboard reference",action:({agent:e})=>e.injectHelp()},{kind:"action",label:"new",description:"start a fresh session",action:({agent:e})=>{e.newSession()}},{kind:"action",label:"reload",description:"reload the app",action:({term:e})=>e.reload()},{kind:"action",label:"logout",description:"log out of your account",_workingMessage:"logging out...",action:async({auth:e,router:t,signal:n})=>{if(n.aborted)return;if(await e.logout(),!n.aborted)t.push("/auth")}},{kind:"action",label:"docs",description:"open axon documentation in browser",action:()=>{let e=process.platform==="darwin"?"open":"xdg-open";tre(e,["https://axon.arclabs.it/docs"],{detached:!0,stdio:"ignore"}).unref()}},{kind:"action",label:"exit",description:"quit axon",action:({term:e})=>{e.exit(),e.exit()}},{kind:"group",label:"settings",description:"manage settings",children:[{kind:"action",label:"open",description:"open settings.json in $EDITOR",action:({auth:e})=>{let t=e.user.value?.id;if(!t)return;let n=GA(t).settings;tre("code",[n],{detached:!0,stdio:"ignore"}).unref()}}]},{kind:"group",label:"policy",description:"manage capsule access policy",children:[{kind:"action",label:"show",description:"print current policy",action:async({agent:e})=>{let t=await e.policy.get();console.log(JSON.stringify(t,null,2))}},{kind:"action",label:"reset",description:"restore default policy",action:async({agent:e})=>{await e.policy.set({fs:{read:!0,write:!0,delete:"escalate",list:!0,find:!0,grep:!0,mkdir:!0,cd:!0},shell:!1,network:{fetch:!0},proc:"escalate",resources:{maxMemoryMb:512,maxCommandTimeMs:30000}})}},{kind:"action",label:"open",description:"open policy.json in $EDITOR",action:({auth:e})=>{let t=e.user.value?.id;if(!t)return;let n=GA(t).policy;tre("code",[n],{detached:!0,stdio:"ignore"}).unref()}},{kind:"group",label:"fs",description:"filesystem access policy",children:[...["read","write","delete","list","find","grep","mkdir"].map((e)=>({kind:"group",label:e,description:`fs.${e} policy`,children:["allow","deny","escalate"].map((t)=>({kind:"action",label:t,description:`set fs.${e} to ${t}`,action:async({agent:n})=>{let a=await n.policy.get(),r=t==="allow"?!0:t==="deny"?!1:"escalate";await n.policy.set({...a,fs:{...a?.fs??{},[e]:r}})}}))}))]},{kind:"group",label:"shell",description:"shell execution policy",children:["allow","deny","escalate"].map((e)=>({kind:"action",label:e,description:`set shell to ${e}`,action:async({agent:t})=>{let n=await t.policy.get(),a=e==="allow"?!0:e==="deny"?!1:"escalate";await t.policy.set({...n,shell:a})}}))},{kind:"group",label:"network",description:"network access policy",children:[{kind:"group",label:"fetch",description:"network.fetch policy",children:["allow","deny","escalate"].map((e)=>({kind:"action",label:e,description:`set network.fetch to ${e}`,action:async({agent:t})=>{let n=await t.policy.get(),a=e==="allow"?!0:e==="deny"?!1:"escalate";await t.policy.set({...n,network:{...n?.network??{},fetch:a}})}}))}]},{kind:"group",label:"proc",description:"subprocess spawning policy",children:["allow","deny","escalate"].map((e)=>({kind:"action",label:e,description:`set proc to ${e}`,action:async({agent:t})=>{let n=await t.policy.get(),a=e==="allow"?!0:e==="deny"?!1:"escalate";await t.policy.set({...n,proc:a})}}))}]},{kind:"group",label:"session",description:"manage the current session",children:[{kind:"action",label:"open",description:"open the active session file in $EDITOR",action:({agent:e,agents:t,auth:n})=>{let a=n.user.value?.id,r=e.agentName.value,i=e.sessionId.value;if(!a||!r||!i)return;let s=GA(a),u=t.selected.value?.userOwned?s.agents.sessions.session(r,i):s.models.sessions.session(r,i);tre("code",[u],{detached:!0,stdio:"ignore"}).unref()}}]},{kind:"group",label:"theme",description:"manage colour themes",children:[{kind:"group",label:"set",description:"apply a theme",children:({prefs:e})=>e.themes.list.value.map((t)=>({kind:"action",label:t.id,description:t.id===e.theme.value?.id?`${t.name} (active)`:t.name,action:({prefs:n})=>n.setTheme(t.id)}))},{kind:"action",label:"reset",description:"reset to default theme (arc)",action:({prefs:e})=>e.setTheme("arc")}]},{kind:"group",label:"clear",description:"clear data",children:[{kind:"action",label:"history",description:"wipe input history",action:({history:e})=>e.clear()},{kind:"action",label:"session",description:"end current session and start fresh",action:({agent:e})=>{e.newSession()}},{kind:"action",label:"sessions",description:"delete all session data",action:({agent:e})=>e.clearAllSessions()},{kind:"action",label:"data",description:"wipe all local data and log out",_workingMessage:"wiping local data...",action:async({auth:e,router:t,signal:n})=>{if(n.aborted)return;let a=e.user.value?.id;if(a){let r=GA(a).root;try{ENa.rmSync(r,{recursive:!0,force:!0})}catch{}}if(n.aborted)return;if(await e.logout(),!n.aborted)t.push("/auth")}}]},{kind:"group",label:"capsule",description:"manage capsule modules",children:[{kind:"group",label:"install",description:"install a module from the registry",children:({capsuleModules:e,moduleRegistry:t})=>{let n=new Set(e.installed.value.map((r)=>r.id)),a=t.list.value.filter((r)=>!n.has(r.id));if(a.length===0)return[{kind:"action",label:"\u2014",description:"all registry modules are installed",action:()=>{}}];return a.map((r)=>({kind:"action",label:r.id,description:r.description,_workingMessage:`installing ${r.id}...`,action:({capsuleModules:i,signal:s})=>i.install(r.id,s)}))}},{kind:"group",label:"remove",description:"remove an installed module",children:({capsuleModules:e})=>{let t=e.installed.value;if(t.length===0)return[{kind:"action",label:"\u2014",description:"no modules installed",action:()=>{}}];return t.map((n)=>({kind:"action",label:n.id,description:`v${n.version}`,_workingMessage:`removing ${n.id}...`,action:({capsuleModules:a,signal:r})=>a.remove(n.id,r)}))}},{kind:"group",label:"upgrade",description:"upgrade installed modules",children:({capsuleModules:e})=>{let t=e.installed.value;if(t.length===0)return[{kind:"action",label:"\u2014",description:"no modules installed",action:()=>{}}];return[{kind:"action",label:"all",description:"upgrade all installed modules",_workingMessage:"upgrading all modules...",action:({capsuleModules:n,signal:a})=>n.upgrade(void 0,a)},...t.map((n)=>({kind:"action",label:n.id,description:`v${n.version}`,_workingMessage:`upgrading ${n.id}...`,action:({capsuleModules:a,signal:r})=>a.upgrade(n.id,r)}))]}}]},{kind:"group",label:"keys",description:"manage API keys for BYOK",children:[{kind:"group",label:"set",description:"set an API key",children:[{kind:"group",label:"openrouter",description:"set OpenRouter API key \xB7 type your key after openrouter",children:({query:e,credentials:t})=>{let n=e.match(/keys\s+set\s+openrouter\s+(.*)/i),a=n?n[1].trim():"";if(!a)return[{kind:"action",label:"\u2014",description:"type your key after openrouter",action:()=>{}}];let r=!!t.get().openrouter;return[{kind:"action",label:a,description:r?"save \xB7 replaces existing key":"save key and reconnect",_workingMessage:"saving key...",action:async({credentials:i})=>{let s=i.get();await i.setAndReconnect({...s,openrouter:a})}}]}}]},{kind:"action",label:"show",description:"show configured keys (masked)",action:({credentials:e,agent:t})=>{let n=e.get().openrouter;if(!n){t.injectKeyStatus("No API keys configured");return}let a=n.slice(0,16),r=n.length>16?"\u2022".repeat(Math.min(n.length-16,12)):"";t.injectKeyStatus(`OpenRouter: ${a}${r}`)}},{kind:"action",label:"clear",description:"remove all saved API keys",_workingMessage:"clearing keys...",action:async({credentials:e})=>{await e.setAndReconnect({})}}]},...[]];function $1t(e,t){return typeof e.children==="function"?e.children(t):e.children}function R1t(e,t,n){let a=e.endsWith(" "),r=e.split(" ").map((d)=>d.toLowerCase()),i=t,s=[],c=a?r.length:r.length-1;for(let d=0;d<c;d++){let g=r[d];if(!g)continue;let f=i.find((b)=>b.label.toLowerCase()===g);if(!f)return{nodes:[],breadcrumb:s,partial:g,exactMatch:null,noMatch:!0};if(f.kind==="action")return{nodes:[],breadcrumb:s,partial:"",exactMatch:f,noMatch:!1};s.push(f.label),i=$1t(f,n)}let u=a?"":r[r.length-1]??"",A=u?i.filter((d)=>d.label.toLowerCase().startsWith(u.toLowerCase())):i;if(u&&A.length===0)return{nodes:i,breadcrumb:s,partial:u,exactMatch:null,noMatch:!0};let p=u?A.find((d)=>d.label.toLowerCase()===u.toLowerCase())??null:null;if(p&&p.kind==="group")return{nodes:$1t(p,n),breadcrumb:[...s,p.label],partial:"",exactMatch:null,noMatch:!1};return{nodes:A,breadcrumb:s,partial:u,exactMatch:p,noMatch:!1}}function IDe(e,t){return[...e,t].join(" ")+" "}function O1t(e){if(e.length===0)return null;let t=3,n=e.length>t?e.slice(-t):e;return(e.length>t?"\u2026 \u203A ":"")+n.join(" \u203A ")+" \u203A"}function G1t(e,t,n,a){let{agents:r,prefs:i,auth:s,registries:c,history:u,capsuleModules:A,credentials:p}=mc(),d=C_(),g=uc(),f=Gs(),b=kt.ref([]);async function w(){try{let oe=await d.capsuleQuery({kind:"skills"});b.value=oe.items.map((me)=>({name:me.name,description:me.description}))}catch{}}w();let E=kt.ref(null),I=null;function x(){I?.abort(),I=null,E.value=null}let k=new AbortController,D=kt.computed(()=>({agents:r,prefs:i,history:u,capsuleModules:A,moduleRegistry:c.modules,agent:d,term:f,router:g,auth:s,setMode:n,setInputText:a,credentials:p,query:t.value,signal:k.signal})),B=kt.computed(()=>{if(e.value!=="command")return null;return R1t(t.value,q1t,D.value)});function Q(oe){switch(oe){case"command":{let me=B.value;if(!me)return[];let de=D.value,at=me.nodes.map((Je)=>({id:Je.label,label:Je.label,description:Je.kind==="group"?`${Je.description} \u203A`:Je.description,_nodeAction:Je.kind==="action"?(_n)=>{let Le=Je.action(_n);if(!(Le instanceof Promise))n("normal");return Le}:null,_workingMessage:Je.kind==="action"?Je._workingMessage:void 0,action:()=>{if(Je.kind==="group")a(IDe(me.breadcrumb,Je.label));else if(!(Je.action(de)instanceof Promise))n("normal")}}));if(at.length===0&&me.exactMatch?.kind==="action"){let Je=me.exactMatch;return[{id:Je.label,label:Je.label,description:Je.description,_nodeAction:(_n)=>{let Le=Je.action(_n);if(!(Le instanceof Promise))n("normal");return Le},_workingMessage:Je._workingMessage,action:()=>{if(!(Je.action(de)instanceof Promise))n("normal")}}]}if(me.noMatch)return[{id:"__invalid__",label:me.partial,description:"no match",invalid:!0,action:()=>{}},...at];return at}case"page":return[{id:"chat",label:"chat",description:"main chat view",preview:()=>g.push("/"),action:()=>g.push("/")},{id:"account",label:"account",description:"account & theme",preview:()=>g.push("/account"),action:()=>g.push("/account")}];case"model":{let me=r.selected.value?.name,de=(Ke,Ot)=>{return[Ke.name===me?"(active)":"",Ke.description||Ot].filter(Boolean).join(" ")},at=[],Je=r.owned.value.map((Ke)=>({id:Ke.name,label:Ke.name,description:de(Ke,"your agent"),action:()=>r.select(Ke.name)}));if(Je.length>0)at.push({id:"__header:agents",label:"agents",header:!0,action:()=>{}}),at.push(...Je),at.push({id:"__sep:agents",label:"",separator:!0,action:()=>{}});let _n={axon:"Axon",openrouter:"OpenRouter"},Le=new Map;for(let Ke of r.models.value){let Ot=Ke.provider??"axon";if(!Le.has(Ot))Le.set(Ot,[]);Le.get(Ot).push(Ke)}for(let[Ke,Ot]of Le){let nn=_n[Ke]??Ke;at.push({id:`__header:${Ke}`,label:nn,header:!0,action:()=>{}}),at.push(...Ot.map((zt)=>({id:zt.name,label:zt.name,description:de(zt,""),action:()=>r.select(zt.name)}))),at.push({id:`__sep:${Ke}`,label:"",separator:!0,action:()=>{}})}return at}case"devmodel":{let me=r.selected.value?.name;return r.devModels.value.map((de)=>({id:de.name,label:de.name,description:de.name===me?"(active) localhost:3010":"localhost:3010",action:()=>r.select(de.name)}))}case"skill":return b.value.map((me)=>({id:me.name,label:me.name,description:me.description,action:()=>{let de=t.value,at=de.lastIndexOf("@"),Je=at===-1?de:de.slice(0,at);a(Je+`@${me.name} `),n("normal")}}));case"theme":return i.themes.list.value.map((me)=>({id:me.id,label:me.name,description:me.id===i.theme.value?.id?"(active)":void 0,preview:()=>i.previewTheme(me.id),action:()=>i.setTheme(me.id)}));case"help":return Object.entries(dU).map(([me,de])=>({id:de,label:`${me} ${de}`,description:P1t[de],action:()=>n(de)}));case"history":return[...u.entries.value].reverse().map((de)=>{let at=de.text.length>80?de.text.slice(0,79)+"\u2026":de.text,Je=at.split(`
|
|
827
|
-
`)[0]??at;return{id:de.id,label:Je,preview:()=>a(Je),action:()=>a(de.text)}});case"escalation":{let Le=function(){if(!Je)return null;if(de==="fs"){let zt=Je.lastIndexOf("/"),lt=zt>0?Je.slice(0,zt):null;return lt?`${lt}/**`:Je}if(de==="proc"){let zt=Je.split(" ")[0];return zt?`${zt} *`:null}if(de==="network")try{return`${new URL(Je).origin}/*`}catch{return null}return null},me=d.escalation.value;if(!me)return[];let{module:de,fn:at}=me,Je=typeof me.args[0]==="string"?me.args[0]:null,_n=Je?`${de}.${at}("${Je.length>36?"\u2026"+Je.slice(-36):Je}")`:`${de}.${at}()`;async function Ke(zt){let lt=await d.policy.get();if(!lt)return;if(de==="shell"){await d.policy.set({...lt,shell:zt(lt.shell)});return}if(de==="proc"){await d.policy.set({...lt,proc:zt(lt.proc)});return}if(de==="fs"){let en=at,Fn=lt.fs??{};await d.policy.set({...lt,fs:{...Fn,[en]:zt(Fn[en])}});return}if(de==="network"){let en=at,Fn=lt.network??{};await d.policy.set({...lt,network:{...Fn,[en]:zt(Fn[en])}});return}}let Ot=[];Ot.push({id:"allow",label:"Allow",action:()=>{d.respondEscalation(!0)}}),Ot.push({id:"allow-always",label:"Allow always",description:"always permit \xB7 updates policy",action:async()=>{await Ke(()=>!0),d.respondEscalation(!0)}});let nn=Le();if(nn){let zt=nn.replace(/^\/home\/[^/]+/,"~"),lt=zt.length>42?"\u2026"+zt.slice(-42):zt;Ot.push({id:"allow-path",label:`Allow ${lt}`,description:"add to allow list \xB7 updates policy",action:async()=>{await Ke((en)=>{if(en===!0)return!0;if(!en||en===!1||en==="escalate")return{allow:[nn]};let Fn=en.allow??[];if(Fn.includes(nn))return en;return{...en,allow:[...Fn,nn]}}),d.respondEscalation(!0)}})}return Ot.push({id:"deny",label:"Deny",action:()=>{d.respondEscalation(!1)}}),Ot}default:return[]}}let T=kt.computed(()=>Q(e.value)),N=kt.computed(()=>{if(e.value!=="skill")return t.value;let oe=t.value.lastIndexOf("@");return oe===-1?"":t.value.slice(oe+1)}),j=kt.computed(()=>{if(e.value==="history"||e.value==="command")return T.value;let oe=N.value.toLowerCase();if(!oe)return T.value;let me=T.value.filter((at)=>at.header||at.separator||at.label.toLowerCase().includes(oe)||at.description?.toLowerCase().includes(oe)),de=[];for(let at=0;at<me.length;at++){let Je=me[at];if(Je.header){let _n=me[at+1];if(!_n||_n.header||_n.separator)continue}if(Je.separator){let _n=de[de.length-1],Le=me[at+1];if(!_n||_n.header||!Le)continue}de.push(Je)}return de}),R=7,$=kt.ref(0),H=kt.computed(()=>Math.max(0,$.value-R+1)),K=kt.computed(()=>j.value.slice(H.value,H.value+R).map((oe,me)=>({item:oe,index:me+H.value}))),Z=kt.computed(()=>Math.min(R,j.value.length)),X=kt.computed(()=>{let oe=j.value.length;if(oe<=R)return[];let me=R/oe,de=Math.max(1,Math.round(me*R)),at=Math.round(H.value/(oe-R)*(R-de));return Array.from({length:R},(Je,_n)=>_n>=at&&_n<at+de?"\u2588":"\u2591")}),se=kt.computed(()=>{let oe=j.value;for(let me=0;me<oe.length;me++)if(!oe[me].invalid&&!oe[me].header&&!oe[me].separator)return me;return 0});function Ce(oe,me){let de=oe[me];return!!de&&!de.header&&!de.separator&&!de.invalid}Oo("up",()=>{let oe=j.value,me=oe.length;if(me===0)return;let de=$.value;for(let at=1;at<=me;at++){let Je=(de-at+me)%me;if(Ce(oe,Je)){$.value=Je,oe[Je]?.preview?.();return}}}),Oo("down",()=>{let oe=j.value,me=oe.length;if(me===0)return;let de=$.value;for(let at=1;at<=me;at++){let Je=(de+at)%me;if(Ce(oe,Je)){$.value=Je,oe[Je]?.preview?.();return}}});async function Pe(oe){I=new AbortController;let me=I.signal,de={...D.value,signal:me},at=oe._nodeAction?oe._nodeAction(de):oe.action();if(at instanceof Promise){let Je=oe.label,_n=oe._workingMessage??oe.description??"working...";E.value={kind:"working",label:Je,message:_n};try{if(await at,!me.aborted)E.value=null,a(""),n("normal")}catch(Le){if(!me.aborted){let Ke=Le instanceof Error?Le.message:"failed";E.value={kind:"error",label:Je,message:Ke}}}finally{I=null}}else I=null}function Ye(){let oe=j.value[$.value];if(!oe||oe.invalid||oe.header||oe.separator)return;Pe(oe)}function Ve(oe){let me=j.value[oe];if(!me||me.invalid||me.header||me.separator)return;Pe(me)}function ve(oe){if(j.value[oe]?.invalid||j.value[oe]?.header||j.value[oe]?.separator)return;$.value=oe}function je(){if(e.value==="history")$.value=Math.max(0,j.value.length-1);else $.value=se.value}let we=kt.computed(()=>{if(e.value==="command")return null;if(e.value==="model"||e.value==="devmodel"){if(c.agents.isRefreshing.value)return{kind:"loading",message:"loading agents..."};if(c.agents.loadError.value)return{kind:"error",message:"failed to load agents"}}if(e.value==="history"&&u.entries.value.length===0)return{kind:"loading",message:"no history yet"};return null});Oo("tab",(oe)=>{if(e.value==="skill"){let Je=j.value[$.value];if(!Je)return;oe.consumed=!0,Je.action();return}if(e.value!=="command")return;let me=B.value;if(!me)return;let de=j.value[$.value];if(!de)return;oe.consumed=!0;let at=me.nodes.find((Je)=>Je.label===de.id);if(at?.kind==="group")a(IDe(me.breadcrumb,at.label));else a([...me.breadcrumb,de.label].join(" ")+" ")}),kt.watch(e,(oe)=>{if(je(),oe==="history")j.value[j.value.length-1]?.preview?.();if(oe==="skill")w()}),kt.watch(t,()=>{if(e.value!=="history"&&e.value!=="command")je()}),kt.watch(()=>e.value==="command"?`${j.value.length}:${j.value[0]?.invalid??!1}`:null,(oe,me)=>{if(e.value!=="command"||oe===null||oe===me)return;let[de,at]=oe.split(":"),[Je,_n]=(me??":").split(":"),Le=at==="true"&&_n!=="true",Ke=at!=="true"&&_n==="true";if(de!==Je&&!Le&&!Ke)$.value=0;else if(Le)$.value=Math.min($.value,j.value.length-1);else if(Ke)$.value=Math.max($.value-1,0)});let He=kt.computed(()=>{if(e.value!=="command")return null;return B.value?O1t(B.value.breadcrumb):null}),tt=kt.computed(()=>He.value?He.value.length+1:0),De=kt.computed(()=>e.value==="command"&&(B.value?.noMatch??!1));return{filtered:j,visible:K,height:Z,scrollbar:X,selectedIndex:$,status:we,breadcrumb:He,breadcrumbWidth:tt,isInvalidCommand:De,working:E,selectCurrent:Ye,selectAt:Ve,hoverAt:ve,reset:je,abortWorking:x}}function U1t(){let{_handle:e}=C_();return{isActive:kt.computed(()=>e.value?.voice.isActive.value??!1),bars:kt.computed(()=>e.value?.voice.bars.value??[]),braille:kt.computed(()=>e.value?.voice.braille.value??""),sttStatus:kt.computed(()=>e.value?.voice.stt.status.value??"idle"),transcript:kt.computed(()=>e.value?.voice.stt.transcript.value??null),async start(){await e.value?.voice.mic.on()},async stop(){await e.value?.voice.mic.stop()},async cancel(){await e.value?.voice.mic.cancel()},reset(){e.value?.voice.stt.reset()}}}var z1t=/@([\w-]+)/g;function DNa(e){let t=new Set,n=[];for(let a of e.matchAll(z1t)){let r=a[1];if(!t.has(r))t.add(r),n.push(r)}return n}function INa(e,t){return e.replace(z1t,(n,a)=>{let r=t.get(a);return r!==void 0?r:n})}async function H1t(e,t){let n=DNa(e);if(n.length===0)return e;let a=new Map;return await Promise.all(n.map(async(r)=>{let i=await t(r);if(i?.content)a.set(r,i.content)})),INa(e,a)}var QNa=Tr.defineComponent,nre=Tr.toDisplayString,qB=Tr.createElementVNode;var K1t=Tr.createCommentVNode,QDe=Tr.openBlock,J1t=Tr.createElementBlock,FNa=Tr.createBlock;var mU=Tr.normalizeStyle;var bs=Tr.unref,FDe=Tr.isRef;var SNa=Tr.createVNode,TNa=Tr.withDirectives;var NNa=tu;var W1t={"data-v-b974d559\x00.input-box":{width:"100%",display:"flex",flexDirection:"column"},"data-v-b974d559\x00.input-box .top":{display:"flex",flexDirection:"column"},"data-v-b974d559\x00.input-box .input-bar":{display:"flex",flexDirection:"column",gap:1},"data-v-b974d559\x00.input-box .input-section":{display:"flex"},"data-v-b974d559\x00textarea":{visualStyles:{bg:null}},"data-v-b974d559\x00.bottom":{height:1,display:"flex",width:"100%",justifyContent:"space-between"},"data-v-b974d559\x00.bottom .left":{visualStyles:{fg:"grey"},width:"100%"},"data-v-b974d559\x00.input-prefix":{marginRight:1},"data-v-b974d559\x00.error-strip":{height:1,display:"flex",width:"100%",visualStyles:{bg:"#1a0a0a",fg:"#ff4444"}},"data-v-b974d559\x00.error-strip .error-icon":{width:2,visualStyles:{fg:"#ff4444"}},"data-v-b974d559\x00.error-strip .error-text":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1},"data-v-b974d559\x00.error-strip .error-dismiss":{width:2,visualStyles:{fg:"grey"}}},LNa=400,jNa=12,Z1t=QNa({__name:"index",setup(e){let{prefs:t,notifications:n,history:a}=mc(),r=C_(),i=U1t(),s=Vc(),c=Gs(),u=i.bars,A=i.sttStatus,p=i.isActive,d=Tr.computed(()=>{let je=n.list.value.filter((we)=>we.kind==="error");return je[je.length-1]??null});function g(){if(d.value)n.dismiss(d.value.id)}let f=Tr.ref(""),b=Tr.ref(!1),w=Tr.computed(()=>t.theme.value?.ui?.primary??"#00B4D8"),E=Tr.computed(()=>b.value?"rgb(220, 60, 60)":""),I=uc(),x=Zc(),{mode:k,symbol:D,processing:B,setMode:Q}=M1t(()=>f.value,()=>x.value.path!=="/auth"),T=G1t(k,f,Q,(je)=>{f.value=je});Tr.watchEffect(()=>{B.value=T.working.value?.kind==="working"||A.value==="transcribing"}),Tr.watch(()=>r.escalation.value,(je)=>{if(je)Q("escalation");else if(k.value==="escalation")Q("normal")});let N=!1,j=!1;Tr.watch(k,async(je)=>{if(je==="voice")N=!1,j=!1,i.reset(),await i.start();else if(p.value&&!j){j=!0;let we=N;if(N=!1,we)await i.cancel();else if(await i.stop(),i.sttStatus.value==="done"){let He=i.transcript.value;if(He)f.value=He}j=!1}});let R=0,$=k.value,H=!1,K=null,Z=!1,X=null;Tr.watch(k,(je,we)=>{if($=we,je==="page")K=I.currentRoute.value.path;if(we==="page"&&je==="normal"&&K!==null)I.push(K),K=null;if(je==="theme")Z=!0;if(we==="theme"&&je==="normal"&&Z)t.cancelThemePreview(),Z=!1;if(we==="command"&&je==="normal")f.value="";if(je==="history")X=f.value;if(we==="history"&&je==="normal"&&X!==null)f.value=X,X=null},{flush:"sync"}),Oo("escape",(je)=>{if(je.consumed=!0,T.working.value?.kind==="working"){T.abortWorking();return}if(T.working.value!==null){T.abortWorking(),f.value="",Q("normal");return}if(k.value==="escalation"){r.respondEscalation(!1),Q("normal");return}if(r.isStreaming.value){r.abort();return}let we=Date.now(),He=we-R<LNa;if(R=we,He){if($==="voice"||k.value==="voice")N=!0,H=!0,Q("normal");else if(!H)f.value=""}else{if(H=!1,k.value==="command")f.value="";Q("normal")}}),Oo("enter",(je)=>{if(je?.shift)return;if(T.working.value!==null)return;if(T.isInvalidCommand.value){b.value=!0,setTimeout(()=>{b.value=!1},600);return}if(k.value!=="normal"&&T.height.value>0){K=null,Z=!1,X=null;let He=k.value;if(T.selectCurrent(),T.reset(),k.value===He&&T.working.value===null){if(He!=="history")f.value="";Q("normal")}return}if(k.value==="normal"&&f.value.trim()){let He=f.value;if(f.value="",T.reset(),a.append(He),I.currentRoute.value.path==="/")H1t(He,(tt)=>r.capsuleQuery({kind:"skills",name:tt}).then((De)=>De.items[0]??null)).then((tt)=>r.send(tt))}}),Oo("**",(je)=>{if(je.ctrl||je.meta)return;if(je.name==="escape")return;let we=je.name&&je.name in dU,He=s.getFocusedType(),tt=He==="input"||He==="textarea"||He==="editor";if(we&&f.value.length===0&&k.value!=="loading"){s.focusId("axon-input");return}if(tt)return;if(!(je.name?.length===1||je.name==="space"))return;if(s.focusId("axon-input"),we)return;let oe=je.name==="space"?" ":je.name;f.value+=oe,je.consumed=!0});let se=c.onDrop((je)=>{let we=f.value&&!f.value.endsWith(" ")?" ":"";f.value+=we+je});Tr.onUnmounted(se);let Ce=Tr.computed(()=>{if(k.value!=="normal")return 1;let je=c.width.value-2,we=f.value.split(`
|
|
826
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28B0\u287F\u2801`,k1t=uNa({__name:"axon-header",setup(e){let{agents:t,prefs:n,auth:a,capsuleer:r}=mc(),i=r.status,s=C_(),c=Gs(),u=bi.computed(()=>({color:n.theme.value?.ui?.primary??"#00B4D8"})),A=bi.computed(()=>t.selected.value?.name??"\u2014"),p=bi.computed(()=>a.user.value?.name??"\u2014"),d=bi.computed(()=>a.user.value?.email??"\u2014"),g=bi.computed(()=>{let E=c.cwd.value,I=process.env.HOME;return I&&E.startsWith(I)?E.replace(I,"~"):E}),f=bi.computed(()=>s.status.value),b=bi.computed(()=>{if(i.value==="installing")return"installing capsuleer...";if(i.value==="error")return"capsuleer error";switch(f.value){case"online":return"online";case"connected":return"connected";case"booting":return"booting...";case"connecting":return"connecting...";case"reconnecting":return"reconnecting...";case"idle":return"idle";case"error":return"error";default:return"offline"}}),w=bi.computed(()=>{if(i.value==="installing")return{color:"#f59e0b"};if(i.value==="error")return{color:"red"};switch(f.value){case"online":case"connected":return{color:"#22c55e"};case"booting":case"connecting":case"reconnecting":return{color:"#f59e0b"};case"error":return{color:"red"};default:return{color:"#6b7280"}}});return(E,I)=>{return lNa(),ANa("div",{class:"axon-header"},[Al("div",{class:"logo-section"},[Al("pre",{class:"logo",style:bj(fw(u))},fj(pNa),4)]),Al("div",{class:"stats-section"},[Al("div",{class:"divider"}),Al("div",{class:"title-line"},[Al("span",{class:"title-name",style:bj(fw(u))},fj(fw(A)),5)]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-value"},fj(fw(d)),1)]),Al("div",{class:"divider"}),Al("div",{class:"stat-line"},[Al("span",{class:"stat-label",style:bj(fw(u))},"agent",4),Al("span",{class:"stat-value"},fj(fw(A)),1)]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-label",style:bj(fw(u))},"status",4),Al("span",{class:"stat-value",style:bj(fw(w))},fj(fw(b)),5)]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-label",style:bj(fw(u))},"cwd",4),Al("span",{class:"stat-value"},fj(fw(g)),1)]),Al("div",{class:"divider"}),Al("div",{class:"info-line"},[Al("a",{class:"info-text",href:"https://axon.arclabs.it"},"https://axon.arclabs.it")]),Al("div",{class:"stat-line"},[Al("span",{class:"stat-value"},"press ? for help")]),Al("div",{class:"divider"}),Al("div",{class:"stat-line"},[Al("span",{class:"tagline"},"Built different. Think different.")])])])}}});k1t.__scopeId="data-v-f2701251";var C1t=k1t;var _i=ko(Eo(),1);var dNa=_i.defineComponent,x1t=_i.toDisplayString,v1t=_i.createElementVNode;var mNa=_i.createCommentVNode,gNa=_i.openBlock,fNa=_i.createElementBlock;var bNa=_i.normalizeStyle;var EDe=_i.unref;var B1t={"data-v-6fa5372d\x00.status-bar":{height:2,display:"flex",gap:1},"data-v-6fa5372d\x00.spinner":{width:1},"data-v-6fa5372d\x00.label":{visualStyles:{fg:"grey"}}},E1t=dNa({__name:"status-bar",props:{active:{type:Boolean,required:!0},label:{type:String,required:!1}},setup(e){let{prefs:t}=mc(),n=e,a=_i.computed(()=>t.theme.value?.ui?.primary??"#00B4D8"),r=_i.computed(()=>n.label??"working"),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],s=_i.ref(0),c=null;_i.onMounted(()=>{c=setInterval(()=>{s.value++},80)}),_i.onUnmounted(()=>{if(c)clearInterval(c)});let u=_i.computed(()=>i[s.value%i.length]);return(A,p)=>{return e.active?(gNa(),fNa("div",{key:0,class:"status-bar"},[v1t("span",{class:"spinner",style:bNa({color:EDe(a)})},x1t(EDe(u)),5),v1t("span",{class:"label"},x1t(EDe(r)),1)])):mNa("v-if",!0)}}});E1t.__scopeId="data-v-6fa5372d";var D1t=E1t;var Ao=ko(Eo(),1);var Tr=ko(Eo(),1);var Ri=ko(Eo(),1);var hNa=Ri.defineComponent,HD=Ri.toDisplayString,KD=Ri.createElementVNode;var hj=Ri.createCommentVNode,G0=Ri.openBlock,U0=Ri.createElementBlock;var I1t=Ri.renderList,AU=Ri.Fragment,DDe=Ri.normalizeClass,pU=Ri.normalizeStyle;var Q1t={"data-v-6ad331e3\x00.palette":{display:"flex",flexDirection:"row"},"data-v-6ad331e3\x00.palette-items":{display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0},"data-v-6ad331e3\x00.palette-scrollbar":{display:"flex",flexDirection:"column",width:1,visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-scrollbar-track":{height:1},"data-v-6ad331e3\x00.palette-item":{display:"flex",height:1,hover:{visualStyles:{bg:"#272727"}}},"data-v-6ad331e3\x00.palette-item--header":{visualStyles:{fg:"grey"},hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-item--separator":{hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-item--invalid .palette-name":{visualStyles:{fg:"#dc3c3c"}},"data-v-6ad331e3\x00.palette-item--invalid .palette-desc":{visualStyles:{fg:"#b43c3c"}},"data-v-6ad331e3\x00.palette-item--invalid":{hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-item--dimmed .palette-name":{visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-working":{hover:{visualStyles:{bg:null}}},"data-v-6ad331e3\x00.palette-working.working .working-message":{visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-working.error .working-message":{visualStyles:{fg:"#dc3c3c"}},"data-v-6ad331e3\x00.palette-status .status-message":{visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.palette-status.error .status-message":{visualStyles:{fg:"#b43c3c"}},"data-v-6ad331e3\x00.selector":{width:2},"data-v-6ad331e3\x00.palette-breadcrumb":{scrollable:!1},"data-v-6ad331e3\x00.palette-name":{width:25,scrollable:!1},"data-v-6ad331e3\x00.palette-desc":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"grey"}},"data-v-6ad331e3\x00.header-label":{flexGrow:1,flexShrink:1,flexBasis:0,marginLeft:2,scrollable:!1,visualStyles:{fg:"grey"}}},F1t=hNa({__name:"palette",props:{items:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},scrollbar:{type:Array,required:!0},height:{type:Number,required:!0},status:{type:null,required:!0},working:{type:null,required:!0},primary:{type:String,required:!0},breadcrumb:{type:[String,null],required:!0},breadcrumbWidth:{type:Number,required:!0}},emits:["select","hover"],setup(e){return(t,n)=>{return G0(),U0("div",{class:"palette"},[KD("div",{class:"palette-items"},[hj(" Working state: replaces the item list while an async command runs "),e.working!==null?(G0(),U0("div",{key:0,class:DDe(["palette-item palette-working",e.working.kind])},[KD("div",{class:"selector",style:pU({color:e.primary})},">",4),KD("div",{class:"palette-name working-label",style:pU({color:e.primary})},HD(e.working.label),5),KD("div",{class:"palette-desc working-message"},HD(e.working.message),1)],2)):(G0(),U0(AU,{key:1},[hj(" Non-breadcrumb status row (loading, error) "),e.status!==null?(G0(),U0("div",{key:0,class:DDe(["palette-item palette-status",e.status.kind])},[KD("div",{class:"selector"}),KD("div",{class:"palette-name status-message"},HD(e.status.message),1)],2)):hj("v-if",!0),(G0(!0),U0(AU,null,I1t(e.items,({item:a,index:r},i)=>{return G0(),U0("div",{key:i,class:DDe(["palette-item",{"palette-item--header":a.header,"palette-item--separator":a.separator,"palette-item--invalid":a.invalid,"palette-item--dimmed":!a.invalid&&!a.header&&!a.separator&&e.items[0]?.item.invalid}]),onPress:()=>!a.invalid&&!a.header&&!a.separator&&t.$emit("select",r),onMouseover:()=>!a.invalid&&!a.header&&!a.separator&&t.$emit("hover",r)},[a.separator?(G0(),U0(AU,{key:0},[],64)):a.header?(G0(),U0("div",{key:1,class:"header-label"},HD(a.label),1)):(G0(),U0(AU,{key:2},[KD("div",{class:"selector",style:pU({color:e.primary})},HD(r===e.selectedIndex?">":" "),5),hj(" Breadcrumb prefix: first row shows the path in primary colour, rest just indent "),e.breadcrumb?(G0(),U0("div",{key:0,class:"palette-breadcrumb",style:pU({width:e.breadcrumbWidth,color:r===0?e.primary:""})},HD(r===0?e.breadcrumb:""),5)):hj("v-if",!0),KD("div",{class:"palette-name",style:pU({color:!a.invalid&&r===e.selectedIndex?e.primary:""})},HD(a.label),5),KD("div",{class:"palette-desc"},HD(a.description??""),1)],64))],42,["onPress","onMouseover"])}),128))],64))]),e.scrollbar.length>0&&e.working===null?(G0(),U0("div",{key:0,class:"palette-scrollbar"},[(G0(!0),U0(AU,null,I1t(e.scrollbar,(a,r)=>{return G0(),U0("div",{key:r,class:"palette-scrollbar-track"},HD(a),1)}),128))])):hj("v-if",!0)])}}});F1t.__scopeId="data-v-6ad331e3";var S1t=F1t;var to=ko(Eo(),1);var _Na=to.defineComponent,yNa=to.toDisplayString,wNa=to.createElementVNode;var kNa=to.openBlock,CNa=to.createElementBlock;var xNa=to.normalizeStyle;var vNa=to.unref;var T1t={"data-v-19173c57\x00.visualizer":{height:1,scrollable:!1},"data-v-19173c57\x00.waveform":{scrollable:!1}},N1t=_Na({__name:"voice-visualizer",props:{bars:{type:Array,required:!0},status:{type:String,required:!0},primary:{type:String,required:!0}},setup(e){let t=e,n=to.computed(()=>Kae(t.bars));return(a,r)=>{return kNa(),CNa("div",{class:"visualizer"},[wNa("div",{class:"waveform",style:xNa({color:e.primary})},yNa(vNa(n)),5)])}}});N1t.__scopeId="data-v-19173c57";var L1t=N1t;var dU={":":"command","/":"page","*":"model","\xAC":"devmodel","@":"skill",'"':"theme","#":"voice","?":"help"},P1t={command:"run app commands",page:"navigate to a page",model:"switch agent or model",devmodel:"switch model (local dev endpoint)",skill:"insert a skill into your message",theme:"pick a colour theme",voice:"voice input via microphone",help:"show this help"},BNa={normal:"\xBB",command:":",page:"/",model:"*",devmodel:"\xAC",skill:"@",theme:'"',voice:"#",help:"?",history:"\u2191",loading:"\u280B",escalation:"\u203C"},j1t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function M1t(e,t=()=>!0){let n=kt.ref("normal"),a=kt.ref(!1),r=kt.ref(0),i=null;kt.watch([n,a],([u,A])=>{if((u==="loading"||A)&&!i)i=setInterval(()=>{r.value++},80);else if(u!=="loading"&&!A&&i)clearInterval(i),i=null}),kt.onUnmounted(()=>{if(i)clearInterval(i)});let s=kt.computed(()=>{if(a.value||n.value==="loading")return j1t[r.value%j1t.length];return BNa[n.value]});function c(u){n.value=u}for(let[u,A]of Object.entries(dU)){if(A==="skill"){Oo(u,(p)=>{if(!t())return;if(n.value==="loading")return;n.value="skill"});continue}Oo(u,(p)=>{if(!t())return;if(n.value==="loading")return;if(e().length>0)return;n.value=n.value===A?"normal":A,p.consumed=!0})}return Oo("up",(u)=>{if(!t())return;if(n.value!=="normal")return;if(e().length>0)return;n.value="history",u.consumed=!0}),{mode:n,symbol:s,processing:a,setMode:c}}import{spawn as tre}from"child_process";import ENa from"fs";var q1t=[{kind:"action",label:"help",description:"show keyboard reference",action:({agent:e})=>e.injectHelp()},{kind:"action",label:"new",description:"start a fresh session",action:({agent:e})=>{e.newSession()}},{kind:"action",label:"reload",description:"reload the app",action:({term:e})=>e.reload()},{kind:"action",label:"logout",description:"log out of your account",_workingMessage:"logging out...",action:async({auth:e,router:t,signal:n})=>{if(n.aborted)return;if(await e.logout(),!n.aborted)t.push("/auth")}},{kind:"action",label:"docs",description:"open axon documentation in browser",action:()=>{let e=process.platform==="darwin"?"open":"xdg-open";tre(e,["https://axon.arclabs.it/docs"],{detached:!0,stdio:"ignore"}).unref()}},{kind:"action",label:"exit",description:"quit axon",action:({term:e})=>{e.exit(),e.exit()}},{kind:"group",label:"skill",description:"insert a skill into your message",children:({skillItems:e,setInputText:t,setMode:n})=>{if(e.length===0)return[{kind:"action",label:"\u2014",description:"no skills installed \u2014 add .md files to ~/.capsuleer/skills/",action:()=>{}}];return e.map((a)=>({kind:"action",label:a.name,description:a.description??"",action:({setInputText:r,setMode:i})=>{r(`@${a.name} `),i("normal")}}))}},{kind:"group",label:"settings",description:"manage settings",children:[{kind:"action",label:"open",description:"open settings.json in $EDITOR",action:({auth:e})=>{let t=e.user.value?.id;if(!t)return;let n=GA(t).settings;tre("code",[n],{detached:!0,stdio:"ignore"}).unref()}}]},{kind:"group",label:"policy",description:"manage capsule access policy",children:[{kind:"action",label:"show",description:"print current policy",action:async({agent:e})=>{let t=await e.policy.get();console.log(JSON.stringify(t,null,2))}},{kind:"action",label:"reset",description:"restore default policy",action:async({agent:e})=>{await e.policy.set({fs:{read:!0,write:!0,delete:"escalate",list:!0,find:!0,grep:!0,mkdir:!0,cd:!0},shell:!1,network:{fetch:!0},proc:"escalate",resources:{maxMemoryMb:512,maxCommandTimeMs:30000}})}},{kind:"action",label:"open",description:"open policy.json in $EDITOR",action:({auth:e})=>{let t=e.user.value?.id;if(!t)return;let n=GA(t).policy;tre("code",[n],{detached:!0,stdio:"ignore"}).unref()}},{kind:"group",label:"fs",description:"filesystem access policy",children:[...["read","write","delete","list","find","grep","mkdir"].map((e)=>({kind:"group",label:e,description:`fs.${e} policy`,children:["allow","deny","escalate"].map((t)=>({kind:"action",label:t,description:`set fs.${e} to ${t}`,action:async({agent:n})=>{let a=await n.policy.get(),r=t==="allow"?!0:t==="deny"?!1:"escalate";await n.policy.set({...a,fs:{...a?.fs??{},[e]:r}})}}))}))]},{kind:"group",label:"shell",description:"shell execution policy",children:["allow","deny","escalate"].map((e)=>({kind:"action",label:e,description:`set shell to ${e}`,action:async({agent:t})=>{let n=await t.policy.get(),a=e==="allow"?!0:e==="deny"?!1:"escalate";await t.policy.set({...n,shell:a})}}))},{kind:"group",label:"network",description:"network access policy",children:[{kind:"group",label:"fetch",description:"network.fetch policy",children:["allow","deny","escalate"].map((e)=>({kind:"action",label:e,description:`set network.fetch to ${e}`,action:async({agent:t})=>{let n=await t.policy.get(),a=e==="allow"?!0:e==="deny"?!1:"escalate";await t.policy.set({...n,network:{...n?.network??{},fetch:a}})}}))}]},{kind:"group",label:"proc",description:"subprocess spawning policy",children:["allow","deny","escalate"].map((e)=>({kind:"action",label:e,description:`set proc to ${e}`,action:async({agent:t})=>{let n=await t.policy.get(),a=e==="allow"?!0:e==="deny"?!1:"escalate";await t.policy.set({...n,proc:a})}}))}]},{kind:"group",label:"session",description:"manage the current session",children:[{kind:"action",label:"open",description:"open the active session file in $EDITOR",action:({agent:e,agents:t,auth:n})=>{let a=n.user.value?.id,r=e.agentName.value,i=e.sessionId.value;if(!a||!r||!i)return;let s=GA(a),u=t.selected.value?.userOwned?s.agents.sessions.session(r,i):s.models.sessions.session(r,i);tre("code",[u],{detached:!0,stdio:"ignore"}).unref()}}]},{kind:"group",label:"theme",description:"manage colour themes",children:[{kind:"group",label:"set",description:"apply a theme",children:({prefs:e})=>e.themes.list.value.map((t)=>({kind:"action",label:t.id,description:t.id===e.theme.value?.id?`${t.name} (active)`:t.name,action:({prefs:n})=>n.setTheme(t.id)}))},{kind:"action",label:"reset",description:"reset to default theme (arc)",action:({prefs:e})=>e.setTheme("arc")}]},{kind:"group",label:"clear",description:"clear data",children:[{kind:"action",label:"history",description:"wipe input history",action:({history:e})=>e.clear()},{kind:"action",label:"session",description:"end current session and start fresh",action:({agent:e})=>{e.newSession()}},{kind:"action",label:"sessions",description:"delete all session data",action:({agent:e})=>e.clearAllSessions()},{kind:"action",label:"data",description:"wipe all local data and log out",_workingMessage:"wiping local data...",action:async({auth:e,router:t,signal:n})=>{if(n.aborted)return;let a=e.user.value?.id;if(a){let r=GA(a).root;try{ENa.rmSync(r,{recursive:!0,force:!0})}catch{}}if(n.aborted)return;if(await e.logout(),!n.aborted)t.push("/auth")}}]},{kind:"group",label:"capsule",description:"manage capsule modules",children:[{kind:"group",label:"install",description:"install a module from the registry",children:({capsuleModules:e,moduleRegistry:t})=>{let n=new Set(e.installed.value.map((r)=>r.id)),a=t.list.value.filter((r)=>!n.has(r.id));if(a.length===0)return[{kind:"action",label:"\u2014",description:"all registry modules are installed",action:()=>{}}];return a.map((r)=>({kind:"action",label:r.id,description:r.description,_workingMessage:`installing ${r.id}...`,action:({capsuleModules:i,signal:s})=>i.install(r.id,s)}))}},{kind:"group",label:"remove",description:"remove an installed module",children:({capsuleModules:e})=>{let t=e.installed.value;if(t.length===0)return[{kind:"action",label:"\u2014",description:"no modules installed",action:()=>{}}];return t.map((n)=>({kind:"action",label:n.id,description:`v${n.version}`,_workingMessage:`removing ${n.id}...`,action:({capsuleModules:a,signal:r})=>a.remove(n.id,r)}))}},{kind:"group",label:"upgrade",description:"upgrade installed modules",children:({capsuleModules:e})=>{let t=e.installed.value;if(t.length===0)return[{kind:"action",label:"\u2014",description:"no modules installed",action:()=>{}}];return[{kind:"action",label:"all",description:"upgrade all installed modules",_workingMessage:"upgrading all modules...",action:({capsuleModules:n,signal:a})=>n.upgrade(void 0,a)},...t.map((n)=>({kind:"action",label:n.id,description:`v${n.version}`,_workingMessage:`upgrading ${n.id}...`,action:({capsuleModules:a,signal:r})=>a.upgrade(n.id,r)}))]}}]},{kind:"group",label:"keys",description:"manage API keys for BYOK",children:[{kind:"group",label:"set",description:"set an API key",children:[{kind:"group",label:"openrouter",description:"set OpenRouter API key \xB7 type your key after openrouter",children:({query:e,credentials:t})=>{let n=e.match(/keys\s+set\s+openrouter\s+(.*)/i),a=n?n[1].trim():"";if(!a)return[{kind:"action",label:"\u2014",description:"type your key after openrouter",action:()=>{}}];let r=!!t.get().openrouter;return[{kind:"action",label:a,description:r?"save \xB7 replaces existing key":"save key and reconnect",_workingMessage:"saving key...",action:async({credentials:i})=>{let s=i.get();await i.setAndReconnect({...s,openrouter:a})}}]}}]},{kind:"action",label:"show",description:"show configured keys (masked)",action:({credentials:e,agent:t})=>{let n=e.get().openrouter;if(!n){t.injectKeyStatus("No API keys configured");return}let a=n.slice(0,16),r=n.length>16?"\u2022".repeat(Math.min(n.length-16,12)):"";t.injectKeyStatus(`OpenRouter: ${a}${r}`)}},{kind:"action",label:"clear",description:"remove all saved API keys",_workingMessage:"clearing keys...",action:async({credentials:e})=>{await e.setAndReconnect({})}}]},...[]];function $1t(e,t){return typeof e.children==="function"?e.children(t):e.children}function R1t(e,t,n){let a=e.endsWith(" "),r=e.split(" ").map((d)=>d.toLowerCase()),i=t,s=[],c=a?r.length:r.length-1;for(let d=0;d<c;d++){let g=r[d];if(!g)continue;let f=i.find((b)=>b.label.toLowerCase()===g);if(!f)return{nodes:[],breadcrumb:s,partial:g,exactMatch:null,noMatch:!0};if(f.kind==="action")return{nodes:[],breadcrumb:s,partial:"",exactMatch:f,noMatch:!1};s.push(f.label),i=$1t(f,n)}let u=a?"":r[r.length-1]??"",A=u?i.filter((d)=>d.label.toLowerCase().startsWith(u.toLowerCase())):i;if(u&&A.length===0)return{nodes:i,breadcrumb:s,partial:u,exactMatch:null,noMatch:!0};let p=u?A.find((d)=>d.label.toLowerCase()===u.toLowerCase())??null:null;if(p&&p.kind==="group")return{nodes:$1t(p,n),breadcrumb:[...s,p.label],partial:"",exactMatch:null,noMatch:!1};return{nodes:A,breadcrumb:s,partial:u,exactMatch:p,noMatch:!1}}function IDe(e,t){return[...e,t].join(" ")+" "}function O1t(e){if(e.length===0)return null;let t=3,n=e.length>t?e.slice(-t):e;return(e.length>t?"\u2026 \u203A ":"")+n.join(" \u203A ")+" \u203A"}function G1t(e,t,n,a){let{agents:r,prefs:i,auth:s,registries:c,history:u,capsuleModules:A,credentials:p}=mc(),d=C_(),g=uc(),f=Gs(),b=kt.ref([]);async function w(){try{let oe=await d.capsuleQuery({kind:"skills"});b.value=oe.items.map((me)=>({name:me.name,description:me.description}))}catch{}}w();let E=kt.ref(null),I=null;function x(){I?.abort(),I=null,E.value=null}let k=new AbortController,D=kt.computed(()=>({agents:r,prefs:i,history:u,capsuleModules:A,moduleRegistry:c.modules,agent:d,term:f,router:g,auth:s,setMode:n,setInputText:a,credentials:p,skillItems:b.value,query:t.value,signal:k.signal})),B=kt.computed(()=>{if(e.value!=="command")return null;return R1t(t.value,q1t,D.value)});function Q(oe){switch(oe){case"command":{let me=B.value;if(!me)return[];let de=D.value,at=me.nodes.map((Je)=>({id:Je.label,label:Je.label,description:Je.kind==="group"?`${Je.description} \u203A`:Je.description,_nodeAction:Je.kind==="action"?(_n)=>{let Le=Je.action(_n);if(!(Le instanceof Promise))n("normal");return Le}:null,_workingMessage:Je.kind==="action"?Je._workingMessage:void 0,action:()=>{if(Je.kind==="group")a(IDe(me.breadcrumb,Je.label));else if(!(Je.action(de)instanceof Promise))n("normal")}}));if(at.length===0&&me.exactMatch?.kind==="action"){let Je=me.exactMatch;return[{id:Je.label,label:Je.label,description:Je.description,_nodeAction:(_n)=>{let Le=Je.action(_n);if(!(Le instanceof Promise))n("normal");return Le},_workingMessage:Je._workingMessage,action:()=>{if(!(Je.action(de)instanceof Promise))n("normal")}}]}if(me.noMatch)return[{id:"__invalid__",label:me.partial,description:"no match",invalid:!0,action:()=>{}},...at];return at}case"page":return[{id:"chat",label:"chat",description:"main chat view",preview:()=>g.push("/"),action:()=>g.push("/")},{id:"account",label:"account",description:"account & theme",preview:()=>g.push("/account"),action:()=>g.push("/account")}];case"model":{let me=r.selected.value?.name,de=(Ke,Ot)=>{return[Ke.name===me?"(active)":"",Ke.description||Ot].filter(Boolean).join(" ")},at=[],Je=r.owned.value.map((Ke)=>({id:Ke.name,label:Ke.name,description:de(Ke,"your agent"),action:()=>r.select(Ke.name)}));if(Je.length>0)at.push({id:"__header:agents",label:"agents",header:!0,action:()=>{}}),at.push(...Je),at.push({id:"__sep:agents",label:"",separator:!0,action:()=>{}});let _n={axon:"Axon",openrouter:"OpenRouter"},Le=new Map;for(let Ke of r.models.value){let Ot=Ke.provider??"axon";if(!Le.has(Ot))Le.set(Ot,[]);Le.get(Ot).push(Ke)}for(let[Ke,Ot]of Le){let nn=_n[Ke]??Ke;at.push({id:`__header:${Ke}`,label:nn,header:!0,action:()=>{}}),at.push(...Ot.map((zt)=>({id:zt.name,label:zt.name,description:de(zt,""),action:()=>r.select(zt.name)}))),at.push({id:`__sep:${Ke}`,label:"",separator:!0,action:()=>{}})}return at}case"devmodel":{let me=r.selected.value?.name;return r.devModels.value.map((de)=>({id:de.name,label:de.name,description:de.name===me?"(active) localhost:3010":"localhost:3010",action:()=>r.select(de.name)}))}case"skill":return b.value.map((me)=>({id:me.name,label:me.name,description:me.description,action:()=>{let de=t.value,at=de.lastIndexOf("@"),Je=at===-1?de:de.slice(0,at);a(Je+`@${me.name} `),n("normal")}}));case"theme":return i.themes.list.value.map((me)=>({id:me.id,label:me.name,description:me.id===i.theme.value?.id?"(active)":void 0,preview:()=>i.previewTheme(me.id),action:()=>i.setTheme(me.id)}));case"help":return Object.entries(dU).map(([me,de])=>({id:de,label:`${me} ${de}`,description:P1t[de],action:()=>n(de)}));case"history":return[...u.entries.value].reverse().map((de)=>{let at=de.text.length>80?de.text.slice(0,79)+"\u2026":de.text,Je=at.split(`
|
|
827
|
+
`)[0]??at;return{id:de.id,label:Je,preview:()=>a(Je),action:()=>a(de.text)}});case"escalation":{let Le=function(){if(!Je)return null;if(de==="fs"){let zt=Je.lastIndexOf("/"),lt=zt>0?Je.slice(0,zt):null;return lt?`${lt}/**`:Je}if(de==="proc"){let zt=Je.split(" ")[0];return zt?`${zt} *`:null}if(de==="network")try{return`${new URL(Je).origin}/*`}catch{return null}return null},me=d.escalation.value;if(!me)return[];let{module:de,fn:at}=me,Je=typeof me.args[0]==="string"?me.args[0]:null,_n=Je?`${de}.${at}("${Je.length>36?"\u2026"+Je.slice(-36):Je}")`:`${de}.${at}()`;async function Ke(zt){let lt=await d.policy.get();if(!lt)return;if(de==="shell"){await d.policy.set({...lt,shell:zt(lt.shell)});return}if(de==="proc"){await d.policy.set({...lt,proc:zt(lt.proc)});return}if(de==="fs"){let en=at,Fn=lt.fs??{};await d.policy.set({...lt,fs:{...Fn,[en]:zt(Fn[en])}});return}if(de==="network"){let en=at,Fn=lt.network??{};await d.policy.set({...lt,network:{...Fn,[en]:zt(Fn[en])}});return}}let Ot=[];Ot.push({id:"allow",label:"Allow",action:()=>{d.respondEscalation(!0)}}),Ot.push({id:"allow-always",label:"Allow always",description:"always permit \xB7 updates policy",action:async()=>{await Ke(()=>!0),d.respondEscalation(!0)}});let nn=Le();if(nn){let zt=nn.replace(/^\/home\/[^/]+/,"~"),lt=zt.length>42?"\u2026"+zt.slice(-42):zt;Ot.push({id:"allow-path",label:`Allow ${lt}`,description:"add to allow list \xB7 updates policy",action:async()=>{await Ke((en)=>{if(en===!0)return!0;if(!en||en===!1||en==="escalate")return{allow:[nn]};let Fn=en.allow??[];if(Fn.includes(nn))return en;return{...en,allow:[...Fn,nn]}}),d.respondEscalation(!0)}})}return Ot.push({id:"deny",label:"Deny",action:()=>{d.respondEscalation(!1)}}),Ot}default:return[]}}let T=kt.computed(()=>Q(e.value)),N=kt.computed(()=>{if(e.value!=="skill")return t.value;let oe=t.value.lastIndexOf("@");return oe===-1?"":t.value.slice(oe+1)}),j=kt.computed(()=>{if(e.value==="history"||e.value==="command")return T.value;let oe=N.value.toLowerCase();if(!oe)return T.value;let me=T.value.filter((at)=>at.header||at.separator||at.label.toLowerCase().includes(oe)||at.description?.toLowerCase().includes(oe)),de=[];for(let at=0;at<me.length;at++){let Je=me[at];if(Je.header){let _n=me[at+1];if(!_n||_n.header||_n.separator)continue}if(Je.separator){let _n=de[de.length-1],Le=me[at+1];if(!_n||_n.header||!Le)continue}de.push(Je)}return de}),R=7,$=kt.ref(0),H=kt.computed(()=>Math.max(0,$.value-R+1)),K=kt.computed(()=>j.value.slice(H.value,H.value+R).map((oe,me)=>({item:oe,index:me+H.value}))),Z=kt.computed(()=>Math.min(R,j.value.length)),X=kt.computed(()=>{let oe=j.value.length;if(oe<=R)return[];let me=R/oe,de=Math.max(1,Math.round(me*R)),at=Math.round(H.value/(oe-R)*(R-de));return Array.from({length:R},(Je,_n)=>_n>=at&&_n<at+de?"\u2588":"\u2591")}),se=kt.computed(()=>{let oe=j.value;for(let me=0;me<oe.length;me++)if(!oe[me].invalid&&!oe[me].header&&!oe[me].separator)return me;return 0});function Ce(oe,me){let de=oe[me];return!!de&&!de.header&&!de.separator&&!de.invalid}Oo("up",()=>{let oe=j.value,me=oe.length;if(me===0)return;let de=$.value;for(let at=1;at<=me;at++){let Je=(de-at+me)%me;if(Ce(oe,Je)){$.value=Je,oe[Je]?.preview?.();return}}}),Oo("down",()=>{let oe=j.value,me=oe.length;if(me===0)return;let de=$.value;for(let at=1;at<=me;at++){let Je=(de+at)%me;if(Ce(oe,Je)){$.value=Je,oe[Je]?.preview?.();return}}});async function Pe(oe){I=new AbortController;let me=I.signal,de={...D.value,signal:me},at=oe._nodeAction?oe._nodeAction(de):oe.action();if(at instanceof Promise){let Je=oe.label,_n=oe._workingMessage??oe.description??"working...";E.value={kind:"working",label:Je,message:_n};try{if(await at,!me.aborted)E.value=null,a(""),n("normal")}catch(Le){if(!me.aborted){let Ke=Le instanceof Error?Le.message:"failed";E.value={kind:"error",label:Je,message:Ke}}}finally{I=null}}else I=null}function Ye(){let oe=j.value[$.value];if(!oe||oe.invalid||oe.header||oe.separator)return;Pe(oe)}function Ve(oe){let me=j.value[oe];if(!me||me.invalid||me.header||me.separator)return;Pe(me)}function ve(oe){if(j.value[oe]?.invalid||j.value[oe]?.header||j.value[oe]?.separator)return;$.value=oe}function je(){if(e.value==="history")$.value=Math.max(0,j.value.length-1);else $.value=se.value}let we=kt.computed(()=>{if(e.value==="command")return null;if(e.value==="model"||e.value==="devmodel"){if(c.agents.isRefreshing.value)return{kind:"loading",message:"loading agents..."};if(c.agents.loadError.value)return{kind:"error",message:"failed to load agents"}}if(e.value==="history"&&u.entries.value.length===0)return{kind:"loading",message:"no history yet"};return null});Oo("tab",(oe)=>{if(e.value==="skill"){let Je=j.value[$.value];if(!Je)return;oe.consumed=!0,Je.action();return}if(e.value!=="command")return;let me=B.value;if(!me)return;let de=j.value[$.value];if(!de)return;oe.consumed=!0;let at=me.nodes.find((Je)=>Je.label===de.id);if(at?.kind==="group")a(IDe(me.breadcrumb,at.label));else a([...me.breadcrumb,de.label].join(" ")+" ")}),kt.watch(e,(oe)=>{if(je(),oe==="history")j.value[j.value.length-1]?.preview?.();if(oe==="skill"||oe==="command")w()}),kt.watch(t,()=>{if(e.value!=="history"&&e.value!=="command")je()}),kt.watch(()=>e.value==="command"?`${j.value.length}:${j.value[0]?.invalid??!1}`:null,(oe,me)=>{if(e.value!=="command"||oe===null||oe===me)return;let[de,at]=oe.split(":"),[Je,_n]=(me??":").split(":"),Le=at==="true"&&_n!=="true",Ke=at!=="true"&&_n==="true";if(de!==Je&&!Le&&!Ke)$.value=0;else if(Le)$.value=Math.min($.value,j.value.length-1);else if(Ke)$.value=Math.max($.value-1,0)});let He=kt.computed(()=>{if(e.value!=="command")return null;return B.value?O1t(B.value.breadcrumb):null}),tt=kt.computed(()=>He.value?He.value.length+1:0),De=kt.computed(()=>e.value==="command"&&(B.value?.noMatch??!1));return{filtered:j,visible:K,height:Z,scrollbar:X,selectedIndex:$,status:we,breadcrumb:He,breadcrumbWidth:tt,isInvalidCommand:De,working:E,selectCurrent:Ye,selectAt:Ve,hoverAt:ve,reset:je,abortWorking:x}}function U1t(){let{_handle:e}=C_();return{isActive:kt.computed(()=>e.value?.voice.isActive.value??!1),bars:kt.computed(()=>e.value?.voice.bars.value??[]),braille:kt.computed(()=>e.value?.voice.braille.value??""),sttStatus:kt.computed(()=>e.value?.voice.stt.status.value??"idle"),transcript:kt.computed(()=>e.value?.voice.stt.transcript.value??null),async start(){await e.value?.voice.mic.on()},async stop(){await e.value?.voice.mic.stop()},async cancel(){await e.value?.voice.mic.cancel()},reset(){e.value?.voice.stt.reset()}}}var z1t=/@([\w-]+)/g;function DNa(e){let t=new Set,n=[];for(let a of e.matchAll(z1t)){let r=a[1];if(!t.has(r))t.add(r),n.push(r)}return n}function INa(e,t){return e.replace(z1t,(n,a)=>{let r=t.get(a);return r!==void 0?r:n})}async function H1t(e,t){let n=DNa(e);if(n.length===0)return e;let a=new Map;return await Promise.all(n.map(async(r)=>{let i=await t(r);if(i?.content)a.set(r,i.content)})),INa(e,a)}var QNa=Tr.defineComponent,nre=Tr.toDisplayString,qB=Tr.createElementVNode;var K1t=Tr.createCommentVNode,QDe=Tr.openBlock,J1t=Tr.createElementBlock,FNa=Tr.createBlock;var mU=Tr.normalizeStyle;var bs=Tr.unref,FDe=Tr.isRef;var SNa=Tr.createVNode,TNa=Tr.withDirectives;var NNa=tu;var W1t={"data-v-b974d559\x00.input-box":{width:"100%",display:"flex",flexDirection:"column"},"data-v-b974d559\x00.input-box .top":{display:"flex",flexDirection:"column"},"data-v-b974d559\x00.input-box .input-bar":{display:"flex",flexDirection:"column",gap:1},"data-v-b974d559\x00.input-box .input-section":{display:"flex"},"data-v-b974d559\x00textarea":{visualStyles:{bg:null}},"data-v-b974d559\x00.bottom":{height:1,display:"flex",width:"100%",justifyContent:"space-between"},"data-v-b974d559\x00.bottom .left":{visualStyles:{fg:"grey"},width:"100%"},"data-v-b974d559\x00.input-prefix":{marginRight:1},"data-v-b974d559\x00.error-strip":{height:1,display:"flex",width:"100%",visualStyles:{bg:"#1a0a0a",fg:"#ff4444"}},"data-v-b974d559\x00.error-strip .error-icon":{width:2,visualStyles:{fg:"#ff4444"}},"data-v-b974d559\x00.error-strip .error-text":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1},"data-v-b974d559\x00.error-strip .error-dismiss":{width:2,visualStyles:{fg:"grey"}}},LNa=400,jNa=12,Z1t=QNa({__name:"index",setup(e){let{prefs:t,notifications:n,history:a}=mc(),r=C_(),i=U1t(),s=Vc(),c=Gs(),u=i.bars,A=i.sttStatus,p=i.isActive,d=Tr.computed(()=>{let je=n.list.value.filter((we)=>we.kind==="error");return je[je.length-1]??null});function g(){if(d.value)n.dismiss(d.value.id)}let f=Tr.ref(""),b=Tr.ref(!1),w=Tr.computed(()=>t.theme.value?.ui?.primary??"#00B4D8"),E=Tr.computed(()=>b.value?"rgb(220, 60, 60)":""),I=uc(),x=Zc(),{mode:k,symbol:D,processing:B,setMode:Q}=M1t(()=>f.value,()=>x.value.path!=="/auth"),T=G1t(k,f,Q,(je)=>{f.value=je});Tr.watchEffect(()=>{B.value=T.working.value?.kind==="working"||A.value==="transcribing"}),Tr.watch(()=>r.escalation.value,(je)=>{if(je)Q("escalation");else if(k.value==="escalation")Q("normal")});let N=!1,j=!1;Tr.watch(k,async(je)=>{if(je==="voice")N=!1,j=!1,i.reset(),await i.start();else if(p.value&&!j){j=!0;let we=N;if(N=!1,we)await i.cancel();else if(await i.stop(),i.sttStatus.value==="done"){let He=i.transcript.value;if(He)f.value=He}j=!1}});let R=0,$=k.value,H=!1,K=null,Z=!1,X=null;Tr.watch(k,(je,we)=>{if($=we,je==="page")K=I.currentRoute.value.path;if(we==="page"&&je==="normal"&&K!==null)I.push(K),K=null;if(je==="theme")Z=!0;if(we==="theme"&&je==="normal"&&Z)t.cancelThemePreview(),Z=!1;if(we==="command"&&je==="normal"&&f.value.startsWith(":"))f.value="";if(je==="history")X=f.value;if(we==="history"&&je==="normal"&&X!==null)f.value=X,X=null},{flush:"sync"}),Oo("escape",(je)=>{if(je.consumed=!0,T.working.value?.kind==="working"){T.abortWorking();return}if(T.working.value!==null){T.abortWorking(),f.value="",Q("normal");return}if(k.value==="escalation"){r.respondEscalation(!1),Q("normal");return}if(r.isStreaming.value){r.abort();return}let we=Date.now(),He=we-R<LNa;if(R=we,He){if($==="voice"||k.value==="voice")N=!0,H=!0,Q("normal");else if(!H)f.value=""}else{if(H=!1,k.value==="command")f.value="";Q("normal")}}),Oo("enter",(je)=>{if(je?.shift)return;if(T.working.value!==null)return;if(T.isInvalidCommand.value){b.value=!0,setTimeout(()=>{b.value=!1},600);return}if(k.value!=="normal"&&T.height.value>0){K=null,Z=!1,X=null;let He=k.value;if(T.selectCurrent(),T.reset(),k.value===He&&T.working.value===null){if(He!=="history")f.value="";Q("normal")}return}if(k.value==="normal"&&f.value.trim()){let He=f.value;if(f.value="",T.reset(),a.append(He),I.currentRoute.value.path==="/")H1t(He,(tt)=>r.capsuleQuery({kind:"skills",name:tt}).then((De)=>De.items[0]??null)).then((tt)=>r.send(tt))}}),Oo("**",(je)=>{if(je.ctrl||je.meta)return;if(je.name==="escape")return;let we=je.name&&je.name in dU,He=s.getFocusedType(),tt=He==="input"||He==="textarea"||He==="editor";if(we&&f.value.length===0&&k.value!=="loading"){s.focusId("axon-input");return}if(tt)return;if(!(je.name?.length===1||je.name==="space"))return;if(s.focusId("axon-input"),we)return;let oe=je.name==="space"?" ":je.name;f.value+=oe,je.consumed=!0});let se=c.onDrop((je)=>{let we=f.value&&!f.value.endsWith(" ")?" ":"";f.value+=we+je});Tr.onUnmounted(se);let Ce=Tr.computed(()=>{if(k.value!=="normal")return 1;let je=c.width.value-2,we=f.value.split(`
|
|
828
828
|
`).reduce((He,tt)=>{return He+Math.max(1,Math.ceil(tt.length/je)||1)},0);return Math.min(jNa,Math.max(1,we))}),Pe=Tr.computed(()=>({height:`${Ce.value}`})),Ye=Tr.computed(()=>A.value!=="idle"||k.value==="voice"),Ve=Tr.computed(()=>{let je=T.working.value!==null?1:T.height.value>0?T.height.value:T.status.value!==null?1:0,we=je>0,He=we?je+1:0,tt=we?1:0,De=d.value?1:0;return He+tt+De+1+Ce.value+1+1}),ve=Tr.computed(()=>{let je=c.cwd.value,we=process.env.HOME;return we&&je.startsWith(we)?je.replace(we,"~"):je});return(je,we)=>{return QDe(),J1t("div",{class:"input-box",style:mU({height:bs(Ve)})},[qB("div",{class:"top"},[qB("div",{class:"input-bar",style:mU(bs(T).height.value>0||bs(T).status.value!==null||bs(T).working.value!==null?{"border-top":`1px solid ${bs(w)}`,"border-bottom":`1px solid ${bs(w)}`}:{"border-top":"0px","border-bottom":`1px solid ${bs(w)}`})},[bs(T).height.value>0||bs(T).status.value!==null||bs(T).working.value!==null?(QDe(),FNa(S1t,{key:0,style:mU({height:bs(T).working.value!==null?1:Math.max(bs(T).height.value,1)}),items:bs(T).visible.value,"selected-index":bs(T).selectedIndex.value,scrollbar:bs(T).scrollbar.value,height:bs(T).height.value,status:bs(T).status.value,primary:bs(w),breadcrumb:bs(T).breadcrumb.value,"breadcrumb-width":bs(T).breadcrumbWidth.value,working:bs(T).working.value,onSelect:we[0]||(we[0]=(He)=>{if(bs(T).working.value)return;FDe(K)?K.value=null:K=null,FDe(Z)?Z.value=!1:Z=!1;let tt=bs(k).value;if(bs(T).selectAt(He),bs(T).reset(),bs(k).value===tt&&tt!=="escalation")bs(Q)("normal")}),onHover:we[1]||(we[1]=(He)=>bs(T).hoverAt(He))},null,8,["style","items","selected-index","scrollbar","height","status","primary","breadcrumb","breadcrumb-width","working"])):K1t("v-if",!0),bs(d)?(QDe(),J1t("div",{key:1,class:"error-strip",onPress:g},[qB("span",{class:"error-icon"},"\u2717"),qB("span",{class:"error-text"},nre(bs(d).title)+": "+nre(bs(d).message),1),qB("span",{class:"error-dismiss"},"\u232B")],32)):K1t("v-if",!0),qB("div",{class:"input-section"},[qB("div",{class:"input-prefix",style:mU({color:bs(b)?"rgb(220, 60, 60)":bs(w)})},nre(bs(D)),5),TNa(qB("textarea",{id:"axon-input",placeholder:"ask me anything...",style:mU({...bs(Pe),color:bs(E)}),"onUpdate:modelValue":we[2]||(we[2]=(He)=>FDe(f)?f.value=He:null)},null,4),[[NNa,bs(f)]])])],4)]),qB("div",{class:"bottom"},[qB("div",{class:"left"},nre(bs(ve)),1)]),SNa(L1t,{bars:bs(u),status:bs(A),primary:bs(w)},null,8,["bars","status","primary"])],4)}}});Z1t.__scopeId="data-v-b974d559";var Y1t=Z1t;var PNa=Ao.defineComponent;var MNa=Ao.openBlock,qNa=Ao.createElementBlock;var $Na=Ao.unref;var V1t=Ao.createVNode;var X1t={"data-v-d72fab41\x00.bottom-region":{display:"flex",flexDirection:"column",width:"100%"}},eCt=PNa({__name:"index",setup(e){let t=C_(),n=Ao.computed(()=>t.isStreaming.value);return(a,r)=>{return MNa(),qNa("div",{class:"bottom-region"},[V1t(D1t,{active:$Na(n),label:"working"},null,8,["active"]),V1t(Y1t)])}}});eCt.__scopeId="data-v-d72fab41";var tCt=eCt;var mi=ko(Eo(),1);var RNa=mi.defineComponent,gU=mi.toDisplayString,JD=mi.createElementVNode;var AS=mi.createCommentVNode,_j=mi.openBlock,yj=mi.createElementBlock;var ONa=mi.normalizeStyle;var GNa=mi.resolveComponent;var bw=mi.unref;var UNa=mi.createVNode;var nCt={"data-v-2bf9d870\x00.fs-op":{display:"flex",flexDirection:"column",width:"100%"},"data-v-2bf9d870\x00.op-row":{height:1,width:"100%",display:"flex"},"data-v-2bf9d870\x00.bullet":{width:2},"data-v-2bf9d870\x00.label":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"#828282"}},"data-v-2bf9d870\x00.status":{width:10},"data-v-2bf9d870\x00.status.error":{visualStyles:{fg:"#b43c3c"}},"data-v-2bf9d870\x00.status.waiting":{visualStyles:{fg:"#a07828"}},"data-v-2bf9d870\x00.denied-row":{height:1,display:"flex"},"data-v-2bf9d870\x00.denied-indent":{width:2},"data-v-2bf9d870\x00.denied-glyph":{width:2,visualStyles:{fg:"#505050"}},"data-v-2bf9d870\x00.denied-text":{visualStyles:{fg:"#a03c3c"}},"data-v-2bf9d870\x00.diff-wrap":{display:"flex",flexDirection:"column",width:"100%",paddingLeft:2,paddingTop:1,paddingBottom:1},"data-v-2bf9d870\x00.diff-view":{width:"100%"},"data-v-2bf9d870\x00.footer-row":{height:1,display:"flex"},"data-v-2bf9d870\x00.footer-gap":{width:2},"data-v-2bf9d870\x00.footer-glyph":{width:2,visualStyles:{fg:"#3c3c3c"}},"data-v-2bf9d870\x00.footer-text":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"#3c3c3c"}}},aCt=RNa({__name:"tool-fs-op",props:{event:{type:null,required:!0},isLast:{type:Boolean,required:!0},status:{type:String,required:!0}},setup(e){let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=e,{prefs:a}=mc(),r=mi.computed(()=>a.theme.value?.ui?.primary??"#00B4D8"),i=mi.computed(()=>({color:r.value})),s=mi.ref(0),c=null,u=mi.computed(()=>t[s.value%t.length]);mi.onMounted(()=>{c=setInterval(()=>{s.value++},80)}),mi.onUnmounted(()=>{if(c)clearInterval(c)});let A=(()=>{let E=n.event;switch(E.type){case"fs:read":return"Read";case"fs:write":return"before"in E&&E.before!=null?"Write":"Create";case"fs:patch":case"fs:insert":case"fs:append":return"Update";case"fs:delete":return"Delete";case"fs:mkdir":return"mkdir";case"fs:move":return"Move";default:return E.type}})(),p=(()=>{let E=n.event,I=(x)=>x.split("/").pop()??x;switch(E.type){case"fs:read":case"fs:write":case"fs:append":case"fs:insert":case"fs:delete":case"fs:mkdir":case"fs:patch":return I(E.path);case"fs:move":return`${I(E.src)} \u2192 ${I(E.dest)}`;default:return""}})(),d=(()=>{let E=n.event;switch(E.type){case"fs:write":return!0;case"fs:patch":return!0;case"fs:append":return!0;case"fs:insert":return!0;case"fs:delete":return E.before!=null;default:return!1}})(),g=(()=>{let E=n.event;switch(E.type){case"fs:write":return E.before??"";case"fs:patch":return E.before;case"fs:delete":return E.before??"";default:return""}})(),f=(()=>{let E=n.event;switch(E.type){case"fs:write":return E.after;case"fs:patch":return E.after;case"fs:append":return E.after;case"fs:insert":return E.after;case"fs:delete":return"";default:return""}})(),b=mi.computed(()=>{let E=f||g;return E?E.split(`
|
|
829
829
|
`).filter(Boolean).length:0}),w=(()=>{let E=n.event,x=("path"in E?E.path:"").split(".").pop()??"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",json:"json",md:"markdown",sh:"bash",py:"python",rs:"rust",go:"go",css:"css",html:"html",yaml:"yaml",yml:"yaml",toml:"toml",txt:"text"}[x]??"text"})();return(E,I)=>{let x=GNa("diff");return _j(),yj("div",{class:"fs-op"},[JD("div",{class:"op-row"},[JD("span",{class:"bullet",style:ONa(bw(i))},gU(e.isLast&&(e.status==="running"||e.status==="waiting")?bw(u):"\u2022"),5),JD("code",{lang:"typescript",class:"label"},gU(bw(A))+'("'+gU(bw(p))+'")',1),e.isLast&&e.status==="error"?(_j(),yj("span",{key:0,class:"status error"}," exit 1")):e.isLast&&e.status==="waiting"?(_j(),yj("span",{key:1,class:"status waiting"}," waiting\u2026")):AS("v-if",!0)]),AS(" \u2500\u2500 Denied \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),e.isLast&&e.status==="denied"?(_j(),yj("div",{key:0,class:"denied-row"},[JD("span",{class:"denied-indent"}),JD("span",{class:"denied-glyph"},"\u23BF"),JD("span",{class:"denied-text"},"Denied")])):AS("v-if",!0),AS(" \u2500\u2500 Diff (write/create/update/delete only) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),bw(d)?(_j(),yj("div",{key:1,class:"diff-wrap"},[UNa(x,{before:bw(g),after:bw(f),lang:bw(w),class:"diff-view"},null,8,["before","after","lang"])])):AS("v-if",!0),AS(" \u2500\u2500 Footer row \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),bw(d)?(_j(),yj("div",{key:2,class:"footer-row"},[JD("span",{class:"footer-gap"}),JD("span",{class:"footer-glyph"},":"),JD("span",{class:"footer-text"},gU(bw(p))+" \xB7 "+gU(bw(b))+" lines",1)])):AS("v-if",!0)])}}});aCt.__scopeId="data-v-2bf9d870";var rCt=aCt;var ii=ko(Eo(),1);var zNa=ii.defineComponent,fU=ii.toDisplayString,x_=ii.createElementVNode;var wj=ii.createCommentVNode,bU=ii.openBlock,hU=ii.createElementBlock;var HNa=ii.renderList,KNa=ii.Fragment;var JNa=ii.normalizeStyle;var _U=ii.unref;var iCt={"data-v-22a907d2\x00.proc":{display:"flex",flexDirection:"column",width:"100%"},"data-v-22a907d2\x00.gap":{height:1},"data-v-22a907d2\x00.proc-row":{height:1,display:"flex"},"data-v-22a907d2\x00.indent":{width:2},"data-v-22a907d2\x00.glyph":{width:2,visualStyles:{fg:"#3c3c3c"}},"data-v-22a907d2\x00.dim":{visualStyles:{fg:"#323232"}},"data-v-22a907d2\x00.out-row":{width:"100%",height:1,display:"flex"},"data-v-22a907d2\x00.out-text":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"#505050"}},"data-v-22a907d2\x00.omitted":{visualStyles:{fg:"#373737"}},"data-v-22a907d2\x00.cmd":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"#3c3c3c"}},"data-v-22a907d2\x00.status":{width:10},"data-v-22a907d2\x00.status.error":{visualStyles:{fg:"#b43c3c"}}},SDe=10,WNa=zNa({__name:"tool-proc",props:{vm:{type:null,required:!0}},setup(e){let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=e,{prefs:a}=mc(),r=ii.computed(()=>a.theme.value?.ui?.primary??"#00B4D8"),i=ii.computed(()=>n.vm.status==="running"?{color:r.value}:{}),s=ii.ref(0),c=ii.computed(()=>t[s.value%t.length]),u=null;ii.onMounted(()=>{u=setInterval(()=>{s.value++},80)}),ii.onUnmounted(()=>{if(u)clearInterval(u)});let A=ii.computed(()=>[...n.vm.stdout,...n.vm.stderr]),p=ii.computed(()=>{let g=A.value;return g.length>SDe?g.slice(-SDe):g}),d=ii.computed(()=>Math.max(0,A.value.length-SDe));return(g,f)=>{return bU(),hU("div",{class:"proc"},[wj(" \u2500\u2500 gap \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),x_("div",{class:"gap"}),wj(" \u2500\u2500 Stdout tail \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),_U(d)>0?(bU(),hU("div",{key:0,class:"out-row"},[x_("span",{class:"indent"}),x_("span",{class:"glyph dim"},"\u2502"),x_("span",{class:"out-text omitted"},"+"+fU(_U(d))+" lines",1)])):wj("v-if",!0),(bU(!0),hU(KNa,null,HNa(_U(p),(b,w)=>{return bU(),hU("div",{key:w,class:"out-row"},[x_("span",{class:"indent"}),x_("span",{class:"glyph"},"\u2502"),x_("span",{class:"out-text"},fU(b),1)])}),128)),wj(" \u2500\u2500 gap \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),x_("div",{class:"gap"}),wj(" \u2500\u2500 Command row \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 "),x_("div",{class:"proc-row"},[x_("span",{class:"indent"}),x_("span",{class:"glyph",style:JNa(_U(i))},fU(e.vm.status==="running"?_U(c):"\u21B3"),5),x_("code",{lang:"bash",class:"cmd"},fU(e.vm.command),1),e.vm.status==="error"?(bU(),hU("span",{key:0,class:"status error"}," exit "+fU(e.vm.exitCode??1),1)):wj("v-if",!0)])])}}});WNa.__scopeId="data-v-22a907d2";var oo=ko(Eo(),1);var Oi=ko(Eo(),1);var ZNa=Oi.defineComponent,TDe=Oi.toDisplayString,kj=Oi.createElementVNode;var YNa=Oi.createCommentVNode,are=Oi.openBlock,rre=Oi.createElementBlock;var VNa=Oi.renderList,XNa=Oi.Fragment;var eLa=Oi.unref;var oCt={"data-v-f01ca3bc\x00.error-block":{display:"flex",flexDirection:"row",width:"100%"},"data-v-f01ca3bc\x00.border-col":{width:1,display:"flex",flexDirection:"column",marginRight:1},"data-v-f01ca3bc\x00.border-char":{visualStyles:{fg:"#a02828"},height:1},"data-v-f01ca3bc\x00.content":{display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0},"data-v-f01ca3bc\x00.header-row":{height:1,display:"flex",gap:2},"data-v-f01ca3bc\x00.label":{visualStyles:{fg:"#c83c3c",bold:!0},width:5},"data-v-f01ca3bc\x00.kind":{visualStyles:{fg:"#c83c3c"}},"data-v-f01ca3bc\x00.message":{visualStyles:{fg:"#bebebe"},width:"100%"},"data-v-f01ca3bc\x00.meta":{visualStyles:{fg:"grey"}}},sCt=ZNa({__name:"error-block",props:{kind:{type:String,required:!0},message:{type:String,required:!0},meta:{type:String,required:!1}},setup(e){let t=e,n=Oi.computed(()=>t.meta?3:2);return(a,r)=>{return are(),rre("div",{class:"error-block"},[kj("div",{class:"border-col"},[(are(!0),rre(XNa,null,VNa(eLa(n),(i)=>{return are(),rre("p",{class:"border-char"},"\u258E")}),256))]),kj("div",{class:"content"},[kj("div",{class:"header-row"},[kj("span",{class:"label"},"ERROR"),kj("span",{class:"kind"},TDe(e.kind),1)]),kj("p",{class:"message"},TDe(e.message),1),e.meta?(are(),rre("p",{key:0,class:"meta"},TDe(e.meta),1)):YNa("v-if",!0)])])}}});sCt.__scopeId="data-v-f01ca3bc";var Cj=sCt;var tLa=oo.defineComponent;var nLa=oo.openBlock;var aLa=oo.createBlock;var NDe=oo.unref;var cCt={},rLa=tLa({__name:"message-error",props:{entry:{type:Object,required:!0}},setup(e){let t=e,n=oo.computed(()=>t.entry.payload),a=oo.computed(()=>{let s=n.value;switch(s.kind){case"engine:error":return s.engine?`engine ${s.engine}${s.code?" "+s.code:""}`:`engine${s.code?" "+s.code:""}`;case"engine:not-found":return`engine not found ${s.engine}`;case"capsule:error":return"capsule";case"auth:error":return"session expired";case"rate:error":return"rate limited";case"balance:error":return"insufficient \u03A8";case"timeout:error":return s.operation?`timeout ${s.operation}`:"timeout";case"middleware:rejected":return s.middleware?`middleware rejected ${s.middleware}`:"middleware rejected";case"pathway:not-found":return`pathway not found ${s.pathway}`;case"pathway:error":return`pathway error ${s.pathway}`;default:return s.kind??"unknown"}}),r=oo.computed(()=>{let s=n.value;switch(s.kind){case"rate:error":return s.retryAfterMs?`retry after ${i(s.retryAfterMs)}`:void 0;case"balance:error":return s.topUpUrl??void 0;case"timeout:error":return s.limitMs?`limit ${i(s.limitMs)}`:void 0;case"engine:not-found":return s.available.length>0?`available: ${s.available.join(", ")}`:void 0;case"pathway:not-found":return s.available.length>0?`available: ${s.available.join(", ")}`:void 0;default:return}});function i(s){if(s<1000)return`${s}ms`;if(s<60000)return`${Math.round(s/1000)}s`;return`${Math.round(s/60000)}m`}return(s,c)=>{return nLa(),aLa(Cj,{kind:NDe(a),message:NDe(n).message,meta:NDe(r)??void 0},null,8,["kind","message","meta"])}}}),uCt=rLa;var po=ko(Eo(),1);var iLa=po.defineComponent;var oLa=po.openBlock;var sLa=po.createBlock;var lCt=po.unref;var ACt={},cLa=iLa({__name:"message-agent-error",props:{entry:{type:Object,required:!0}},setup(e){let t=e,n=po.computed(()=>{switch(t.entry.code){case"INSUFFICIENT_CREDITS":return"insufficient \u03A8";case"NOT_CONNECTED":return"not connected";case"AUTH_REQUIRED":return"auth required";case"ALREADY_STREAMING":return"busy";default:return t.entry.code.toLowerCase().replace(/_/g," ")}}),a=po.computed(()=>{if(t.entry.meta)return t.entry.meta;switch(t.entry.code){case"INSUFFICIENT_CREDITS":return"https://axon.arclabs.it/docs/billing";default:return null}});return(r,i)=>{return oLa(),sLa(Cj,{kind:lCt(n),message:e.entry.message,meta:lCt(a)??void 0},null,8,["kind","message","meta"])}}}),pCt=cLa;var Nr=ko(Eo(),1);var uLa=Nr.defineComponent,yf=Nr.toDisplayString,kc=Nr.createElementVNode;var wf=Nr.createCommentVNode,kd=Nr.openBlock,Cd=Nr.createElementBlock;var LDe=Nr.renderList,ire=Nr.Fragment,lLa=Nr.normalizeClass,jDe=Nr.normalizeStyle;var xd=Nr.unref;var mCt={"data-v-c58996bd\x00.tool-call":{width:"100%",display:"flex",flexDirection:"column"},"data-v-c58996bd\x00.header":{height:1,display:"flex",cursor:"pointer"},"data-v-c58996bd\x00.header-expanded":{display:"flex",flexDirection:"column",cursor:"pointer"},"data-v-c58996bd\x00.header-top":{height:1,display:"flex"},"data-v-c58996bd\x00.header-close":{height:1,display:"flex"},"data-v-c58996bd\x00.bullet":{width:2},"data-v-c58996bd\x00.bullet-gap":{width:2},"data-v-c58996bd\x00.label":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"#828282"}},"data-v-c58996bd\x00.status":{width:10},"data-v-c58996bd\x00.status.error":{visualStyles:{fg:"#b43c3c"}},"data-v-c58996bd\x00.waiting-text":{visualStyles:{fg:"#a07828"}},"data-v-c58996bd\x00.denied-text":{visualStyles:{fg:"#a03c3c"}},"data-v-c58996bd\x00.code-line":{height:1,display:"flex",paddingLeft:4},"data-v-c58996bd\x00.code-text":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1},"data-v-c58996bd\x00.indent":{width:2},"data-v-c58996bd\x00.glyph":{width:2,visualStyles:{fg:"#3c3c3c"}},"data-v-c58996bd\x00.connector":{visualStyles:{fg:"#505050"}},"data-v-c58996bd\x00.dim":{visualStyles:{fg:"#323232"}},"data-v-c58996bd\x00.output":{display:"flex",flexDirection:"column",width:"100%"},"data-v-c58996bd\x00.out-row":{width:"100%",height:1,display:"flex"},"data-v-c58996bd\x00.out-text":{flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1,visualStyles:{fg:"#505050"}},"data-v-c58996bd\x00.out-text.cmd":{visualStyles:{fg:"#3c3c3c"}},"data-v-c58996bd\x00.omitted":{visualStyles:{fg:"#3c3c3c"}},"data-v-c58996bd\x00.proc-block":{display:"flex",flexDirection:"column",width:"100%"},"data-v-c58996bd\x00.gap":{height:1},"data-v-c58996bd\x00.proc-row":{height:1,display:"flex"},"data-v-c58996bd\x00.proc-glyph":{width:2,visualStyles:{fg:"#3c3c3c"}}},xj=10,dCt=48,gCt=uLa({__name:"tool-call",props:{vm:{type:null,required:!0}},setup(e){let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=e,{prefs:a}=mc(),r=Nr.computed(()=>a.theme.value?.ui?.primary??"#00B4D8"),i=Nr.computed(()=>({color:r.value})),s=Nr.ref(!1),c=Nr.ref(0),u=Nr.computed(()=>t[c.value%t.length]),A=null;Nr.onMounted(()=>{A=setInterval(()=>{c.value++},80)}),Nr.onUnmounted(()=>{if(A)clearInterval(A)});let p=Nr.computed(()=>n.vm.proc?"Proc":"Run"),d=Nr.computed(()=>{let D=(n.vm.code.trim().split(`
|
|
830
830
|
`).find((B)=>B.trim())??"").trim();return`${p.value}("${D.length>dCt?D.slice(0,dCt)+"\u2026":D}")`}),g=Nr.computed(()=>n.vm.code.trim().split(`
|