llmxray 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AITrainingPage-BmiTLvwB.js +1 -0
- package/dist/assets/{BenchmarkPage-yZ1Kt8KK.js → BenchmarkPage-CwCXzzrb.js} +2 -2
- package/dist/assets/ComparisonPage-nfG681cT.js +1 -0
- package/dist/assets/DashboardPage-CKQaBKDw.js +101 -0
- package/dist/assets/EmbeddingsPage-DJdyD65Q.js +1 -0
- package/dist/assets/EmbeddingsPage-DtEKy4qg.css +1 -0
- package/dist/assets/{GoogleCallbackPage-DqfqxXhg.js → GoogleCallbackPage-2hfuqKEi.js} +1 -1
- package/dist/assets/{JsonTreeNode-BE6Ps90W.js → JsonTreeNode-DckR4Nv8.js} +2 -2
- package/dist/assets/ModelCapabilityIcons.vue_vue_type_script_setup_true_lang-DUHfiPBt.js +1 -0
- package/dist/assets/RAGPage-jMq_Sg9F.js +1 -0
- package/dist/assets/SessionPage-C6jIbcq2.js +14 -0
- package/dist/assets/SettingsPage-CpDVuxxG.js +1 -0
- package/dist/assets/StatusBadge.vue_vue_type_script_setup_true_lang-D24kGmB6.js +1 -0
- package/dist/assets/StorageGauge.vue_vue_type_style_index_0_lang-CLdARZMv.js +1 -0
- package/dist/assets/SystemPage-BbfTFebq.js +2 -0
- package/dist/assets/{TabBar.vue_vue_type_script_setup_true_lang-CnQ8vq8x.js → TabBar.vue_vue_type_script_setup_true_lang-BV7bRKLd.js} +1 -1
- package/dist/assets/{TokenStreamDisplay.vue_vue_type_script_setup_true_lang-CJW7ndOY.js → TokenStreamDisplay.vue_vue_type_script_setup_true_lang-Cilrzwrg.js} +1 -1
- package/dist/assets/{ToolWorkshopPage-gO5DvECk.css → ToolWorkshopPage-7TRbWVVL.css} +1 -1
- package/dist/assets/{ToolWorkshopPage-DoVwZp_3.js → ToolWorkshopPage-BEFjvNVE.js} +88 -88
- package/dist/assets/{agent-store-_RIMRfEn.js → agent-store-tglPObkH.js} +1 -1
- package/dist/assets/generate-service-UqpNGQas.js +3 -0
- package/dist/assets/{google-auth-store-BnEs-xLw.js → google-auth-store-pjk41Wop.js} +1 -1
- package/dist/assets/index-CCnJ2vPZ.css +1 -0
- package/dist/assets/{index-D87kMEMb.js → index-Cq76cPsM.js} +1 -1
- package/dist/assets/index-DVvWJgFn.js +6 -0
- package/dist/assets/{metrics-store-HzdMIV8O.js → metrics-store-oAZX_4PZ.js} +1 -1
- package/dist/assets/{rag-store-VWnttX_x.js → rag-store-D6KNr_hW.js} +1 -1
- package/dist/assets/{storage-store-B1XevdC4.js → storage-store-D4WuNdQB.js} +1 -1
- package/dist/assets/{stream-handler-29OjEvbo.js → stream-handler-_fccIkW6.js} +2 -2
- package/dist/assets/{tool-workshop-store-Btx8DDqg.js → tool-workshop-store-Dz7QH2FM.js} +1 -1
- package/dist/assets/{toolcall-store-BumXt8DE.js → toolcall-store-BFoy2Mdx.js} +1 -1
- package/dist/assets/trash-2-CbznmmWI.js +1 -0
- package/dist/index.html +2 -2
- package/dist/social-card.svg +150 -0
- package/package.json +5 -2
- package/dist/assets/AITrainingPage-BbRryhHe.js +0 -1
- package/dist/assets/ComparisonPage-BnBp-VsC.js +0 -1
- package/dist/assets/DashboardPage-DTXPIpEx.js +0 -101
- package/dist/assets/EmbeddingsPage-Bo3g8-qN.css +0 -1
- package/dist/assets/EmbeddingsPage-CghkdGEr.js +0 -1
- package/dist/assets/ModelCapabilityIcons.vue_vue_type_script_setup_true_lang-CsL7aDHj.js +0 -1
- package/dist/assets/RAGPage-B_c1Nogo.js +0 -1
- package/dist/assets/SessionPage-lWGESxx3.js +0 -14
- package/dist/assets/SettingsPage-k9HWgy9B.js +0 -1
- package/dist/assets/StatusBadge.vue_vue_type_script_setup_true_lang-f9O-U2FX.js +0 -1
- package/dist/assets/StorageGauge.vue_vue_type_style_index_0_lang-hO4dId5t.js +0 -1
- package/dist/assets/SystemPage-BgwBHFJB.js +0 -2
- package/dist/assets/generate-service-mPYQA7Xh.js +0 -3
- package/dist/assets/index-BqB3FY2M.js +0 -4
- package/dist/assets/index-C0qd34Zo.css +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{a as pe,u as xe}from"./toolcall-store-BumXt8DE.js";import{u as fe}from"./metrics-store-HzdMIV8O.js";import{_ as ve}from"./TabBar.vue_vue_type_script_setup_true_lang-CnQ8vq8x.js";import{b as be,_ as ee,n as ge,s as O,u as ye}from"./StatusBadge.vue_vue_type_script_setup_true_lang-f9O-U2FX.js";import{_ as he}from"./TokenStreamDisplay.vue_vue_type_script_setup_true_lang-CJW7ndOY.js";import{c as R,a as ke,f as X,e as _e}from"./format-BqVZ9rwM.js";import{C as G,a as K,L as J,P as we,b as $e,p as te,c as U,d as se,i as Ce,e as Me,B as oe,f as ne}from"./index-D87kMEMb.js";import{a as T,e as r,f as e,t as m,p as S,u as z,c as _,b as s,F as N,j as A,m as I,g as B,h as C,d as Te,r as M,z as re,i as g,x as P,k as q,I as Se,J as ze,A as Q,w as E,B as V,E as Ne,v as ae,T as Ae,C as Y,D as je}from"./index-BqB3FY2M.js";import{b as Ie,a as Le,u as Pe}from"./agent-store-_RIMRfEn.js";import{u as Be}from"./tool-workshop-store-Btx8DDqg.js";import{s as De,J as Oe,g as Re}from"./JsonTreeNode-BE6Ps90W.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const Fe={class:"rounded-lg border border-border-default bg-surface-raised p-4"},qe={class:"mb-3 text-sm font-medium text-text-secondary"},He={class:"h-40"},Ee=T({__name:"LatencyChart",props:{tokenLatencies:{},title:{}},setup(t){G.register(K,J,we,$e,te,U,se,Ce);const a=t,n=_(()=>({labels:a.tokenLatencies.map((d,c)=>`${c}`),datasets:[{label:"Token Latency (ms)",data:a.tokenLatencies,borderColor:"#a855f7",backgroundColor:"rgba(168, 85, 247, 0.1)",borderWidth:1.5,pointRadius:0,fill:!0,tension:.3}]})),o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},title:{display:!1}},scales:{x:{display:!1},y:{ticks:{color:"#94a3b8",font:{size:10}},grid:{color:"rgba(71, 85, 105, 0.3)"}}}};return(d,c)=>(s(),r("div",Fe,[e("h3",qe,m(t.title??"Token Latency"),1),e("div",He,[S(z(Me),{data:n.value,options:o},null,8,["data"])])]))}}),Ve={class:"rounded-lg border border-border-default bg-surface-raised p-4"},We={class:"h-20"},Ge={class:"mt-2 flex gap-4 text-xs text-text-muted"},Ke=T({__name:"TokenCountBar",props:{promptTokens:{},completionTokens:{}},setup(t){G.register(K,J,oe,te,U,se);const a=t,n=_(()=>({labels:["Tokens"],datasets:[{label:"Prompt",data:[a.promptTokens],backgroundColor:"#818cf8"},{label:"Completion",data:[a.completionTokens],backgroundColor:"#a855f7"}]})),o={indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{color:"#94a3b8",font:{size:11}}}},scales:{x:{stacked:!0,ticks:{color:"#94a3b8",font:{size:10}},grid:{color:"rgba(71, 85, 105, 0.3)"}},y:{stacked:!0,display:!1}}};return(d,c)=>(s(),r("div",Ve,[c[0]||(c[0]=e("h3",{class:"mb-3 text-sm font-medium text-text-secondary"},"Token Distribution",-1)),e("div",We,[S(z(ne),{data:n.value,options:o},null,8,["data"])]),e("div",Ge,[e("span",null,"Total: "+m(t.promptTokens+t.completionTokens),1)])]))}}),Je={key:0,class:"space-y-4"},Ue={class:"grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-6"},Qe={class:"grid grid-cols-1 gap-3 lg:grid-cols-2"},Xe={key:1,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center text-sm text-text-muted"},Ye=T({__name:"MetricsDashboard",props:{metrics:{}},setup(t){const a=t,n=_(()=>{const o=a.metrics;return o?[{label:"Time to First Token",value:R(o.ttftMs),unit:""},{label:"Tokens/Second",value:ke(o.tokensPerSecond),unit:""},{label:"Total Duration",value:R(o.totalDurationMs),unit:""},{label:"Prompt Tokens",value:X(o.promptTokenCount),unit:"tok"},{label:"Completion Tokens",value:X(o.completionTokenCount),unit:"tok"},{label:"Model Load",value:R(o.loadDurationMs),unit:""}]:[]});return(o,d)=>t.metrics?(s(),r("div",Je,[e("div",Ue,[(s(!0),r(N,null,A(n.value,c=>(s(),I(be,{key:c.label,label:c.label,value:c.value,unit:c.unit},null,8,["label","value","unit"]))),128))]),e("div",Qe,[S(Ee,{"token-latencies":t.metrics.tokenLatencies},null,8,["token-latencies"]),S(Ke,{"prompt-tokens":t.metrics.promptTokenCount,"completion-tokens":t.metrics.completionTokenCount},null,8,["prompt-tokens","completion-tokens"])])])):(s(),r("div",Xe," Metrics will appear after generation completes. "))}}),Ze={class:"flex gap-3"},et={class:"flex flex-col items-center"},tt={class:"flex h-8 w-8 items-center justify-center rounded-full bg-surface-overlay text-sm"},st={class:"flex-1 pb-4"},ot={class:"flex items-center gap-2 mb-1"},nt={class:"text-xs text-text-muted"},rt={class:"rounded-lg border border-border-default bg-surface p-3 text-sm text-text-primary leading-relaxed"},at=T({__name:"ReasoningStep",props:{step:{}},setup(t){const a={thought:{color:"text-accent",icon:"💭"},observation:{color:"text-success",icon:"👁"},action:{color:"text-warning",icon:"⚡"},conclusion:{color:"text-[#a78bfa]",icon:"✓"},reflection:{color:"text-[#f472b6]",icon:"↻"}};return(n,o)=>(s(),r("div",Ze,[e("div",et,[e("div",tt,m(a[t.step.type]?.icon??"•"),1),o[0]||(o[0]=e("div",{class:"flex-1 w-px bg-border-default"},null,-1))]),e("div",st,[e("div",ot,[e("span",{class:B(["text-xs font-semibold uppercase tracking-wide",a[t.step.type]?.color??"text-text-secondary"])},m(t.step.type),3),e("span",nt," Step "+m(t.step.index+1)+" · "+m(z(R)(t.step.durationMs)),1)]),e("div",rt,m(t.step.content),1)])]))}}),lt={class:"space-y-4"},it={class:"flex items-center gap-4 rounded-lg border border-border-default bg-surface-raised p-4"},dt={class:"text-sm text-text-secondary"},ut={class:"font-semibold text-text-primary"},ct={class:"flex gap-2"},mt={key:0,class:"space-y-0"},pt={key:1,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center text-sm text-text-muted"},xt=T({__name:"ReasoningViewer",props:{sessionId:{}},setup(t){const a=t,n=Ie(),o=_(()=>n.getSteps(a.sessionId)),d=_(()=>{const c={};for(const x of o.value)c[x.type]=(c[x.type]??0)+1;return c});return(c,x)=>(s(),r("div",lt,[e("div",it,[e("div",dt,[e("span",ut,m(o.value.length),1),x[0]||(x[0]=C(" reasoning steps detected ",-1))]),e("div",ct,[(s(!0),r(N,null,A(d.value,(l,u)=>(s(),r("span",{key:u,class:"rounded-full bg-surface-overlay px-2.5 py-0.5 text-xs text-text-secondary"},m(u)+": "+m(l),1))),128))])]),o.value.length>0?(s(),r("div",mt,[(s(!0),r(N,null,A(o.value,l=>(s(),I(at,{key:l.id,step:l},null,8,["step"]))),128))])):(s(),r("div",pt,[...x[1]||(x[1]=[e("p",null,"No reasoning steps detected.",-1),e("p",{class:"mt-1"},"Use a model with chain-of-thought support (e.g., DeepSeek-R1) or structured reasoning patterns.",-1)])]))]))}}),le=Te("introspection",()=>{const t=M(new Map),a=M(new Map),n=M(new Map);function o(p){return t.value.get(p)??null}function d(p,f){t.value.set(p,f)}function c(p){return a.value.get(p)??[]}function x(p,f){a.value.set(p,f)}function l(p){return n.value.get(p)??[]}function u(p,f){n.value.set(p,f)}return{architectureByModel:t,attentionPatterns:a,layerActivations:n,getArchitecture:o,setArchitecture:d,getAttentionPatterns:c,setAttentionPatterns:x,getLayerActivations:l,setLayerActivations:u}});function ft(t,a){const n=a.model_info,o=a.details.family||"unknown",d=D(n,"block_count")??32,c=D(n,"embedding_length")??4096,x=D(n,"attention.head_count")??32,l=D(n,"attention.head_count_kv")??x,u=D(n,"context_length")??4096,p=D(n,"feed_forward_length")??c*4,f=a.details.parameter_size||"0",v=gt(f),b=yt(d);return{family:o,blockCount:d,embeddingLength:c,attentionHeadCount:x,kvHeadCount:l,contextLength:u,feedForwardLength:p,layers:b,totalParameters:v,quantization:a.details.quantization_level||"unknown"}}function vt(t,a,n){const o=[],d=t.length,c=Math.min(a,2),x=Math.min(n,2);for(let l=0;l<x;l++)for(let u=0;u<c;u++){const p=[];for(let f=0;f<d;f++){const v=[];for(let k=0;k<d;k++)if(k>f)v.push(0);else{const w=f-k,i=Math.exp(-w*(.1+l*.05)),y=Math.random()*.15,L=k===f?.3:0;v.push(Math.min(1,i+y+L))}const b=v.reduce((k,w)=>k+w,0);p.push(b>0?v.map(k=>k/b):v)}o.push({tokenLabels:t,matrix:p,headIndex:u,layerIndex:l})}return o}function bt(t){const a=[];for(const n of t.layers){const o=Math.sqrt(t.embeddingLength)*(1+Math.random()*.5),d=n.type==="attention"?1:n.type==="feed_forward"?1.3:.8;a.push({layerIndex:n.index,layerName:n.name,meanActivation:(.5+Math.random()*.5)*d,maxActivation:(2+Math.random()*3)*d,norm:o*d*(.8+Math.random()*.4)})}return a}function D(t,a){for(const[n,o]of Object.entries(t))if(n.endsWith(a)&&typeof o=="number")return o}function gt(t){const a=t.match(/([\d.]+)\s*([BMK])?/i);if(!a)return 0;const n=parseFloat(a[1]),o=(a[2]??"").toUpperCase();return o==="B"?n*1e9:o==="M"?n*1e6:o==="K"?n*1e3:n}function yt(t){const a=[];let n=0;a.push({index:n++,name:"token_embedding",type:"embedding",parameterCount:0});for(let o=0;o<t;o++)a.push({index:n++,name:`block_${o}_attention`,type:"attention",parameterCount:0}),a.push({index:n++,name:`block_${o}_ffn`,type:"feed_forward",parameterCount:0}),a.push({index:n++,name:`block_${o}_norm`,type:"norm",parameterCount:0});return a.push({index:n++,name:"output",type:"output",parameterCount:0}),a}async function ht(t){const a=re(),n=le();await a.fetchModelInfo(t);const o=a.getModelDetails(t);if(o){const d=ft(t,o);n.setArchitecture(t,d)}}const kt={class:"space-y-4"},_t={key:0,class:"rounded-lg bg-surface p-4"},wt={class:"flex items-center gap-2 flex-wrap"},$t=["onMouseenter"],Ct=["d"],Mt={key:1,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Tt={class:"grid grid-cols-2 gap-3 lg:grid-cols-4"},St={class:"text-sm font-medium text-text-primary"},zt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Nt={class:"text-sm font-medium text-text-primary"},At={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},jt={class:"text-sm font-medium text-text-primary"},It={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-64 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Lt={class:"text-sm font-medium text-text-primary"},Pt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-64 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Bt={class:"rounded-lg bg-surface p-4"},Dt={class:"flex items-center gap-1 mb-3"},Ot={class:"text-xs font-medium text-text-muted uppercase tracking-wide"},Rt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-64 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Ft={class:"flex items-center gap-2 flex-wrap"},qt=["onMouseenter"],Ht={class:"text-xs text-text-primary"},Et={class:"text-xs text-text-muted"},Vt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-60 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Wt={class:"grid grid-cols-2 gap-3 text-xs"},Gt={class:"ml-1 text-text-primary"},Kt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-60 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Jt={class:"ml-1 text-text-primary"},Ut={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-64 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Qt={class:"ml-1 text-text-primary"},Xt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-60 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},Yt={class:"ml-1 text-text-primary"},Zt={key:0,class:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-64 rounded-lg border border-border-default bg-surface-overlay px-3 py-2 text-xs text-text-secondary shadow-lg z-10"},es={key:1,class:"rounded-lg bg-surface"},ts={key:0,class:"border-t border-border-default px-4 pb-4 pt-2"},ss={class:"w-full text-xs"},os={class:"py-1.5 pr-4 text-text-muted font-mono"},ns={class:"py-1.5 text-text-primary font-mono"},rs={key:2,class:"rounded-lg bg-surface"},as={key:0,class:"border-t border-border-default px-4 pb-4 pt-2"},ls={class:"overflow-auto rounded-lg bg-surface-raised p-3 text-xs text-text-secondary font-mono leading-relaxed"},is=T({__name:"ModelArchitectureDiagram",props:{architecture:{},modelName:{}},setup(t){const a=t,n=re(),o=_(()=>a.modelName?n.getModelDetails(a.modelName)??null:null),d=_(()=>{if(!o.value?.parameters)return null;const w=Se(o.value.parameters);return Object.keys(w).length>0?w:null}),c=_(()=>o.value?.template??null),x=M(!1),l=M(!1),u=_(()=>a.modelName?ze(n.getCapabilities(a.modelName)):[]),p={embedding:"#818cf8",attention:"#a855f7",feed_forward:"#fb923c",norm:"#94a3b8",output:"#4ade80"},f=_(()=>{const w=a.architecture;return[{label:"Embedding",color:p.embedding,count:1,desc:"Converts input tokens into dense numerical vectors the model can process"},{label:"Attention",color:p.attention,count:w.blockCount,desc:"Lets each token attend to every other token to capture relationships and context"},{label:"FFN",color:p.feed_forward,count:w.blockCount,desc:"Feed-Forward Network — applies non-linear transformations to refine representations"},{label:"LayerNorm",color:p.norm,count:w.blockCount,desc:"Normalizes activations between layers to stabilize and speed up training"},{label:"Output",color:p.output,count:1,desc:"Projects the final hidden state back to vocabulary size to predict the next token"}]}),v=M(null);function b(w){v.value=w}function k(){v.value=null}return(w,i)=>(s(),r("div",kt,[u.value.length>0?(s(),r("div",_t,[i[12]||(i[12]=e("h4",{class:"text-xs font-medium text-text-muted uppercase tracking-wide mb-3"},"Capabilities",-1)),e("div",wt,[(s(!0),r(N,null,A(u.value,y=>(s(),r("div",{key:y.key,class:"relative flex items-center gap-1.5 rounded-lg border border-border-default px-3 py-1.5",onMouseenter:L=>b("cap-"+y.key),onMouseleave:k},[y.svg?(s(),r("svg",{key:0,class:B(["h-3.5 w-3.5 shrink-0",y.color]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:y.svg},null,8,Ct)],2)):g("",!0),e("span",{class:B(["text-xs font-medium",y.color])},m(y.label),3),v.value==="cap-"+y.key?(s(),r("div",Mt,[C(m(y.desc)+" ",1),i[11]||(i[11]=e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1))])):g("",!0)],40,$t))),128))])])):g("",!0),e("div",Tt,[e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[0]||(i[0]=y=>b("family")),onMouseleave:k},[i[14]||(i[14]=P('<div class="flex items-center gap-1 text-xs text-text-muted"> Family <svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg></div>',1)),e("div",St,m(t.architecture.family),1),v.value==="family"?(s(),r("div",zt,[...i[13]||(i[13]=[C(" The base model architecture family (e.g. llama, qwen). Models in the same family share the same neural network design. ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32),e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[1]||(i[1]=y=>b("params")),onMouseleave:k},[i[16]||(i[16]=P('<div class="flex items-center gap-1 text-xs text-text-muted"> Parameters <svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg></div>',1)),e("div",Nt,m(z(_e)(t.architecture.totalParameters)),1),v.value==="params"?(s(),r("div",At,[...i[15]||(i[15]=[C(" Total number of trainable weights in the model. More parameters generally means greater capability but requires more memory and compute. ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32),e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[2]||(i[2]=y=>b("ctx")),onMouseleave:k},[i[18]||(i[18]=P('<div class="flex items-center gap-1 text-xs text-text-muted"> Context Length <svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg></div>',1)),e("div",jt,m(t.architecture.contextLength.toLocaleString()),1),v.value==="ctx"?(s(),r("div",It,[...i[17]||(i[17]=[C(" Maximum number of tokens (prompt + response) the model can process in a single conversation. Longer context allows more detailed instructions and longer conversations. ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32),e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[3]||(i[3]=y=>b("quant")),onMouseleave:k},[i[20]||(i[20]=P('<div class="flex items-center gap-1 text-xs text-text-muted"> Quantization <svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg></div>',1)),e("div",Lt,m(t.architecture.quantization),1),v.value==="quant"?(s(),r("div",Pt,[...i[19]||(i[19]=[C(" How model weights are compressed. Q4_K_M means 4-bit quantization with K-quant medium quality — smaller file size and faster inference with a small quality trade-off vs full precision (F16/F32). ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32)]),e("div",Bt,[e("div",Dt,[e("h4",Ot,"Layer Structure ("+m(t.architecture.blockCount)+" blocks)",1),e("div",{class:"relative",onMouseenter:i[4]||(i[4]=y=>b("layers")),onMouseleave:k},[i[22]||(i[22]=e("svg",{class:"h-3 w-3 text-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"12",cy:"12",r:"10"}),e("path",{d:"M12 16v-4"}),e("path",{d:"M12 8h.01"})],-1)),v.value==="layers"?(s(),r("div",Rt,[...i[21]||(i[21]=[C(" Transformer models are built from repeated blocks. Each block contains attention, feed-forward, and normalization layers. More blocks = deeper model. ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32)]),e("div",Ft,[(s(!0),r(N,null,A(f.value,y=>(s(),r("div",{key:y.label,class:"relative flex items-center gap-2 rounded-lg border border-border-default px-3 py-2",onMouseenter:L=>b("block-"+y.label),onMouseleave:k},[e("div",{class:"h-3 w-3 rounded-sm",style:q({backgroundColor:y.color})},null,4),e("span",Ht,m(y.label),1),e("span",Et,"×"+m(y.count),1),v.value==="block-"+y.label?(s(),r("div",Vt,[C(m(y.desc)+" ",1),i[23]||(i[23]=e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1))])):g("",!0)],40,qt))),128))])]),e("div",Wt,[e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[5]||(i[5]=y=>b("aheads")),onMouseleave:k},[i[25]||(i[25]=P('<span class="text-text-muted">Attention Heads</span><svg class="inline ml-1 h-3 w-3 text-text-muted align-text-top" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>',2)),e("span",Gt,m(t.architecture.attentionHeadCount),1),v.value==="aheads"?(s(),r("div",Kt,[...i[24]||(i[24]=[C(" Number of parallel attention computations per layer. Each head learns to focus on different patterns (syntax, semantics, position, etc.). ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32),e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[6]||(i[6]=y=>b("kvheads")),onMouseleave:k},[i[27]||(i[27]=P('<span class="text-text-muted">KV Heads</span><svg class="inline ml-1 h-3 w-3 text-text-muted align-text-top" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>',2)),e("span",Jt,m(t.architecture.kvHeadCount),1),v.value==="kvheads"?(s(),r("div",Ut,[...i[26]||(i[26]=[C(" Key-Value heads used in Grouped Query Attention (GQA). Fewer KV heads than attention heads means memory savings — multiple query heads share the same key/value projections. ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32),e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[7]||(i[7]=y=>b("embdim")),onMouseleave:k},[i[29]||(i[29]=P('<span class="text-text-muted">Embedding Dim</span><svg class="inline ml-1 h-3 w-3 text-text-muted align-text-top" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>',2)),e("span",Qt,m(t.architecture.embeddingLength),1),v.value==="embdim"?(s(),r("div",Xt,[...i[28]||(i[28]=[C(" Size of the vector representing each token inside the model. Larger dimensions can capture richer semantic information but increase memory and compute. ",-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32),e("div",{class:"relative rounded-lg bg-surface p-3",onMouseenter:i[8]||(i[8]=y=>b("ffndim")),onMouseleave:k},[i[31]||(i[31]=P('<span class="text-text-muted">FFN Dim</span><svg class="inline ml-1 h-3 w-3 text-text-muted align-text-top" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>',2)),e("span",Yt,m(t.architecture.feedForwardLength),1),v.value==="ffndim"?(s(),r("div",Zt,[...i[30]||(i[30]=[C(` Width of the feed-forward network's hidden layer. Typically 2-4x the embedding dimension. This is where much of the model's "knowledge" is stored as learned patterns. `,-1),e("div",{class:"absolute bottom-full left-1/2 -translate-x-1/2 -mb-px border-4 border-transparent border-b-surface-overlay"},null,-1)])])):g("",!0)],32)]),d.value?(s(),r("div",es,[e("button",{class:"flex w-full items-center justify-between p-4 text-left",onClick:i[9]||(i[9]=y=>x.value=!x.value)},[i[33]||(i[33]=e("h4",{class:"text-xs font-medium text-text-muted uppercase tracking-wide"},"Model Defaults",-1)),(s(),r("svg",{class:B(["h-4 w-4 text-text-muted transition-transform",x.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...i[32]||(i[32]=[e("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))]),x.value?(s(),r("div",ts,[e("table",ss,[(s(!0),r(N,null,A(d.value,(y,L)=>(s(),r("tr",{key:L,class:"border-b border-border-default/50 last:border-0"},[e("td",os,m(L),1),e("td",ns,m(y),1)]))),128))])])):g("",!0)])):g("",!0),c.value?(s(),r("div",rs,[e("button",{class:"flex w-full items-center justify-between p-4 text-left",onClick:i[10]||(i[10]=y=>l.value=!l.value)},[i[35]||(i[35]=e("h4",{class:"text-xs font-medium text-text-muted uppercase tracking-wide"},"Chat Template",-1)),(s(),r("svg",{class:B(["h-4 w-4 text-text-muted transition-transform",l.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...i[34]||(i[34]=[e("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))]),l.value?(s(),r("div",as,[e("pre",ls,m(c.value),1)])):g("",!0)])):g("",!0)]))}}),ds={class:"space-y-3"},us={class:"flex items-center justify-between"},cs=["value"],ms={key:0,class:"overflow-auto rounded-lg border border-border-default bg-surface p-2"},ps=T({__name:"AttentionHeatmap",props:{patterns:{}},setup(t){const a=t,n=M(0),o=M(null),d=_(()=>a.patterns[n.value]??null);function c(){const x=o.value,l=d.value;if(!x||!l)return;const u=x.getContext("2d");if(!u)return;const p=l.matrix.length,f=Math.min(Math.floor(400/p),20),v=p*f;x.width=v,x.height=v;for(let b=0;b<p;b++)for(let k=0;k<p;k++){const w=l.matrix[b]?.[k]??0,i=Math.floor(w*255);u.fillStyle=`rgb(${Math.floor(56+w*100)}, ${Math.floor(100+i*.5)}, ${i})`,u.fillRect(k*f,b*f,f,f)}}return Q(c),E([d],c),(x,l)=>(s(),r("div",ds,[e("div",us,[l[1]||(l[1]=e("div",{class:"flex items-center gap-2"},[e("h4",{class:"text-sm font-medium text-text-secondary"},"Attention Pattern"),e("span",{class:"rounded-full bg-warning/20 px-2 py-0.5 text-xs text-warning"},"Illustrative")],-1)),t.patterns.length>1?V((s(),r("select",{key:0,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),class:"rounded border border-border-default bg-surface px-2 py-1 text-xs text-text-primary"},[(s(!0),r(N,null,A(t.patterns,(u,p)=>(s(),r("option",{key:p,value:p}," Layer "+m(u.layerIndex)+" / Head "+m(u.headIndex),9,cs))),128))],512)),[[Ne,n.value,void 0,{number:!0}]]):g("",!0)]),d.value?(s(),r("div",ms,[e("canvas",{ref_key:"canvasRef",ref:o,class:"max-w-full"},null,512)])):g("",!0),l[2]||(l[2]=e("p",{class:"text-xs text-text-muted leading-relaxed"},[C(" This is a "),e("strong",{class:"text-warning"},"synthetic illustration"),C(" of how attention patterns work in transformer models — it shows causal masking (tokens can only attend to previous tokens) and positional decay (nearby tokens get more attention). Real attention weights are not available through the Ollama API, so this visualization demonstrates the concept rather than reflecting actual model behavior. ")],-1))]))}}),xs={class:"space-y-3"},fs={class:"h-48 rounded-lg border border-border-default bg-surface-raised p-4"},vs=T({__name:"LayerActivationChart",props:{activations:{}},setup(t){G.register(K,J,oe,U);const a=t,n=_(()=>({labels:a.activations.map(d=>d.layerName.replace(/^block_\d+_/,"")),datasets:[{label:"Norm",data:a.activations.map(d=>d.norm),backgroundColor:"#a855f7"}]})),o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{display:!1},y:{ticks:{color:"#94a3b8",font:{size:10}},grid:{color:"rgba(71, 85, 105, 0.3)"}}}};return(d,c)=>(s(),r("div",xs,[c[0]||(c[0]=e("div",{class:"flex items-center gap-2"},[e("h4",{class:"text-sm font-medium text-text-secondary"},"Layer Activation Norms"),e("span",{class:"rounded-full bg-warning/20 px-2 py-0.5 text-xs text-warning"},"Simulated")],-1)),e("div",fs,[S(z(ne),{data:n.value,options:o},null,8,["data"])]),c[1]||(c[1]=e("p",{class:"text-xs text-text-muted leading-relaxed"},[C(" This is a "),e("strong",{class:"text-warning"},"simulated visualization"),C(" of activation norms across the model's layers. In a real model, these norms reveal how much each layer contributes to the output — unusually high norms can indicate exploding gradients or bottleneck layers, while low norms may suggest underutilized capacity. Actual activation data requires hooking into the inference engine, which the Ollama API does not expose. ")],-1))]))}}),bs={class:"space-y-6"},gs={key:0},ys={key:1},hs={key:2},ks={key:3,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center text-sm text-text-muted"},_s=T({__name:"IntrospectionPanel",props:{sessionId:{},modelName:{}},setup(t){const a=t,n=le(),o=Le(),d=_(()=>n.getArchitecture(a.modelName)),c=_(()=>n.getAttentionPatterns(a.sessionId)),x=_(()=>n.getLayerActivations(a.sessionId));return Q(async()=>{d.value||await ht(a.modelName);const l=d.value;if(l){if(c.value.length===0){const p=o.getTokens(a.sessionId).slice(0,30).map(f=>f.text);if(p.length>0){const f=vt(p,l.attentionHeadCount,l.blockCount);n.setAttentionPatterns(a.sessionId,f)}}if(x.value.length===0){const u=bt(l);n.setLayerActivations(a.sessionId,u)}}}),(l,u)=>(s(),r("div",bs,[d.value?(s(),r("div",gs,[u[0]||(u[0]=e("h3",{class:"mb-3 text-sm font-medium text-text-secondary"},"Model Architecture",-1)),S(is,{architecture:d.value,"model-name":t.modelName},null,8,["architecture","model-name"])])):g("",!0),c.value.length>0?(s(),r("div",ys,[S(ps,{patterns:c.value},null,8,["patterns"])])):g("",!0),x.value.length>0?(s(),r("div",hs,[S(vs,{activations:x.value},null,8,["activations"])])):g("",!0),d.value?g("",!0):(s(),r("div",ks," Loading model introspection data... "))]))}}),ws={class:"overflow-auto rounded-lg bg-surface p-3 text-xs text-text-secondary font-mono max-h-80"},W=T({__name:"JsonViewer",props:{data:{},maxDepth:{}},setup(t){const a=t,n=_(()=>{try{return JSON.stringify(a.data,null,2)}catch{return String(a.data)}});return(o,d)=>(s(),r("pre",ws,m(n.value),1))}}),$s={class:"rounded-lg border border-border-default bg-surface-raised"},Cs={class:"flex items-center gap-3"},Ms={class:"text-sm font-medium text-text-primary"},Ts={class:"ml-2 text-xs text-text-muted"},Ss={class:"flex items-center gap-2"},zs={key:0,class:"border-t border-border-default p-4 space-y-3"},Ns={key:0},As={key:1},js={class:"rounded-lg bg-error/10 p-3 text-xs text-error"},Is=T({__name:"ToolCallCard",props:{entry:{}},emits:["optimize"],setup(t,{emit:a}){const n=t,o=a,d=_(()=>n.entry.status==="completed"&&n.entry.result!=null&&typeof n.entry.result=="object"),c=M(!1);return(x,l)=>(s(),r("div",$s,[e("button",{class:"flex w-full items-center justify-between px-4 py-3 text-left hover:bg-surface-overlay transition-colors",onClick:l[0]||(l[0]=u=>c.value=!c.value)},[e("div",Cs,[l[2]||(l[2]=e("span",{class:"text-base"},"⚡",-1)),e("div",null,[e("span",Ms,m(t.entry.functionName),1),e("span",Ts,m(t.entry.durationMs!=null?z(R)(t.entry.durationMs):"pending"),1)])]),e("div",Ss,[S(ee,{status:t.entry.status},null,8,["status"]),e("span",{class:B(["text-text-muted transition-transform text-xs",{"rotate-180":c.value}])},"▾",2)])]),c.value?(s(),r("div",zs,[e("div",null,[l[3]||(l[3]=e("div",{class:"text-xs font-medium text-text-muted uppercase tracking-wide mb-1"},"Arguments",-1)),S(W,{data:t.entry.arguments},null,8,["data"])]),t.entry.result!==void 0?(s(),r("div",Ns,[l[4]||(l[4]=e("div",{class:"text-xs font-medium text-text-muted uppercase tracking-wide mb-1"},"Result",-1)),S(W,{data:t.entry.result},null,8,["data"])])):g("",!0),t.entry.error?(s(),r("div",As,[l[5]||(l[5]=e("div",{class:"text-xs font-medium text-error uppercase tracking-wide mb-1"},"Error",-1)),e("pre",js,m(t.entry.error),1)])):g("",!0),d.value?(s(),r("button",{key:2,class:"mt-1 rounded-md border border-border-default px-3 py-1.5 text-xs font-medium text-accent hover:bg-surface-overlay transition-colors",onClick:l[1]||(l[1]=ae(u=>o("optimize",t.entry),["stop"]))}," Optimize this Tool ")):g("",!0)])):g("",!0)]))}}),Ls={class:"space-y-4"},Ps={class:"flex items-center gap-4 rounded-lg border border-border-default bg-surface-raised p-4"},Bs={class:"text-sm text-text-secondary"},Ds={class:"font-semibold text-text-primary"},Os={key:0,class:"text-sm text-text-secondary"},Rs={class:"text-text-primary"},Fs={key:0,class:"space-y-3"},qs={key:1,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center text-sm text-text-muted"},Hs=T({__name:"ToolCallTimeline",props:{sessionId:{}},emits:["optimize"],setup(t,{emit:a}){const n=t,o=a,d=pe(),c=_(()=>d.getToolCalls(n.sessionId)),x=_(()=>c.value.reduce((l,u)=>l+(u.durationMs??0),0));return(l,u)=>(s(),r("div",Ls,[e("div",Ps,[e("div",Bs,[e("span",Ds,m(c.value.length),1),u[1]||(u[1]=C(" tool calls ",-1))]),x.value>0?(s(),r("div",Os,[u[2]||(u[2]=C(" Total: ",-1)),e("span",Rs,m(z(R)(x.value)),1)])):g("",!0)]),c.value.length>0?(s(),r("div",Fs,[(s(!0),r(N,null,A(c.value,p=>(s(),I(Is,{key:p.id,entry:p,onOptimize:u[0]||(u[0]=f=>o("optimize",f))},null,8,["entry"]))),128))])):(s(),r("div",qs,[...u[3]||(u[3]=[e("p",null,"No tool calls in this session.",-1),e("p",{class:"mt-1"},"Use chat mode with tool definitions to see tool call activity.",-1)])]))]))}});function Es(t){const a=Pe(),n=_(()=>a.getGraph(t.value)),o=M(800),d=M(400),c=_(()=>{const l=n.value?.nodes??[];if(l.length===0)return[];const u=180,p=60,f=60,v=d.value/2,b=l.length*(u+f);return o.value=Math.max(800,b+100),l.map((k,w)=>({...k,x:50+w*(u+f),y:v-p/2}))}),x=_(()=>{const l=n.value?.edges??[],u=new Map(c.value.map(p=>[p.id,p]));return l.map(p=>{const f=u.get(p.source),v=u.get(p.target);return!f||!v?null:{...p,x1:f.x+180,y1:f.y+30,x2:v.x,y2:v.y+30}}).filter(p=>p!==null)});return{graph:n,layoutNodes:c,layoutEdges:x,svgWidth:o,svgHeight:d}}const Vs=["transform"],Ws=["stroke"],Gs={x:"12",y:"24",class:"fill-text-primary text-xs font-medium","font-size":"12"},Ks={x:"12",y:"44",class:"fill-text-secondary text-xs","font-size":"11"},Js=T({__name:"AgentNode",props:{node:{},selected:{type:Boolean}},emits:["select"],setup(t){const a=t,n=_(()=>ge[a.node.type]??"#94a3b8"),o={start:"▶",llm_call:"◈",tool_call:"⚡",decision:"◇",output:"■",error:"✕"};return(d,c)=>(s(),r("g",{transform:`translate(${t.node.x}, ${t.node.y})`,class:"cursor-pointer",onClick:c[0]||(c[0]=x=>d.$emit("select",t.node.id))},[e("rect",{width:"180",height:"60",rx:"8",class:B(["fill-surface-raised stroke-2",{"stroke-[3]":t.selected}]),stroke:n.value},null,10,Ws),e("text",Gs,m(o[t.node.type]??"•")+" "+m(t.node.type),1),e("text",Ks,m(t.node.label.slice(0,22))+m(t.node.label.length>22?"...":""),1)],8,Vs))}}),Us={key:0,class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},Qs={class:"text-sm font-medium text-text-primary"},Xs={class:"grid grid-cols-2 gap-2 text-xs text-text-secondary"},Ys={class:"text-text-primary"},Zs={class:"text-text-primary"},eo={key:0},to=T({__name:"AgentStateDiff",props:{node:{}},setup(t){return(a,n)=>t.node?(s(),r("div",Us,[e("h4",Qs,m(t.node.label),1),e("div",Xs,[e("div",null,[n[0]||(n[0]=C("Type: ",-1)),e("span",Ys,m(t.node.type),1)]),e("div",null,[n[1]||(n[1]=C("Step: ",-1)),e("span",Zs,m(t.node.stepIndex),1)])]),Object.keys(t.node.state).length>0?(s(),r("div",eo,[n[2]||(n[2]=e("div",{class:"text-xs font-medium text-text-muted uppercase tracking-wide mb-1"},"State",-1)),S(W,{data:t.node.state},null,8,["data"])])):g("",!0)])):g("",!0)}}),so={class:"space-y-4"},oo={key:0,class:"flex gap-4"},no={class:"flex-1 overflow-auto rounded-lg border border-border-default bg-surface"},ro=["width","height"],ao=["x1","y1","x2","y2"],lo={class:"w-72 shrink-0"},io={key:0,class:"rounded-lg border border-border-default bg-surface-raised p-4 text-center text-sm text-text-muted"},uo={key:1,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center text-sm text-text-muted"},co=T({__name:"AgentGraphView",props:{sessionId:{}},setup(t){const a=t,n=_(()=>a.sessionId),{layoutNodes:o,layoutEdges:d,svgWidth:c,svgHeight:x}=Es(n),l=M(null),u=_(()=>l.value?o.value.find(p=>p.id===l.value)??null:null);return(p,f)=>(s(),r("div",so,[z(o).length>0?(s(),r("div",oo,[e("div",no,[(s(),r("svg",{width:z(c),height:z(x),class:"min-w-full"},[(s(!0),r(N,null,A(z(d),v=>(s(),r("line",{key:v.id,x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,class:"stroke-border-default","stroke-width":"2","marker-end":"url(#arrowhead)"},null,8,ao))),128)),f[1]||(f[1]=e("defs",null,[e("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto"},[e("polygon",{points:"0 0, 10 3.5, 0 7",class:"fill-border-default"})])],-1)),(s(!0),r(N,null,A(z(o),v=>(s(),I(Js,{key:v.id,node:v,selected:l.value===v.id,onSelect:f[0]||(f[0]=b=>l.value=b)},null,8,["node","selected"]))),128))],8,ro))]),e("div",lo,[S(to,{node:u.value},null,8,["node"]),u.value?g("",!0):(s(),r("div",io," Click a node to inspect its state. "))])])):(s(),r("div",uo,[...f[2]||(f[2]=[e("p",null,"No agent graph data for this session.",-1),e("p",{class:"mt-1"},"Agent graph nodes are created during generation.",-1)])]))]))}}),mo={class:"rounded-lg border border-border-default bg-surface-raised overflow-hidden"},po={class:"flex items-center justify-between px-4 py-2 border-b border-border-default"},xo={class:"flex items-center gap-2"},fo={class:"text-sm font-medium text-text-primary"},vo={class:"rounded-full bg-surface-overlay px-2 py-0.5 text-xs text-text-muted"},bo={class:"flex items-center gap-3 text-xs text-text-secondary"},go={class:"text-text-muted"},yo={class:"h-1 bg-surface"},ho={class:"px-4 py-3 text-xs text-text-secondary font-mono whitespace-pre-wrap max-h-40 overflow-auto"},ko=T({__name:"PromptSection",props:{section:{},totalTokens:{}},setup(t){const n=O[t.section.type]??O.unknown;return(o,d)=>(s(),r("div",mo,[e("div",po,[e("div",xo,[e("div",{class:"h-3 w-3 rounded-sm",style:q({backgroundColor:z(n)})},null,4),e("span",fo,m(t.section.label),1),e("span",vo,m(t.section.type),1)]),e("div",bo,[e("span",null,"~"+m(t.section.tokenCount)+" tokens",1),e("span",go,m(t.section.percentage.toFixed(1))+"%",1)])]),e("div",yo,[e("div",{class:"h-full transition-all",style:q({width:`${t.section.percentage}%`,backgroundColor:z(n)})},null,4)]),e("pre",ho,m(t.section.content),1)]))}}),_o={class:"rounded-lg border border-border-default bg-surface-raised p-4"},wo={class:"text-xs font-medium text-text-muted uppercase tracking-wide mb-3"},$o={class:"flex h-6 overflow-hidden rounded-lg"},Co=["title"],Mo={class:"mt-3 flex flex-wrap gap-3 text-xs"},To={class:"text-text-secondary"},So={class:"text-text-muted"},zo=T({__name:"PromptTokenCount",props:{sections:{},totalTokens:{}},setup(t){return(a,n)=>(s(),r("div",_o,[e("h4",wo," Token Distribution (~"+m(t.totalTokens)+" total) ",1),e("div",$o,[(s(!0),r(N,null,A(t.sections,o=>(s(),r("div",{key:o.id,class:"transition-all",style:q({width:`${o.percentage}%`,backgroundColor:z(O)[o.type]??z(O).unknown,minWidth:o.percentage>0?"2px":"0"}),title:`${o.label}: ~${o.tokenCount} tokens (${o.percentage.toFixed(1)}%)`},null,12,Co))),128))]),e("div",Mo,[(s(!0),r(N,null,A(t.sections,o=>(s(),r("div",{key:o.id,class:"flex items-center gap-1.5"},[e("div",{class:"h-2.5 w-2.5 rounded-sm",style:q({backgroundColor:z(O)[o.type]??z(O).unknown})},null,4),e("span",To,m(o.label),1),e("span",So,"("+m(o.percentage.toFixed(0))+"%)",1)]))),128))])]))}}),No={key:0,class:"space-y-4"},Ao={class:"space-y-3"},jo={key:0,class:"rounded-lg border border-border-default bg-surface-raised p-4"},Io={class:"space-y-2"},Lo={class:"flex items-center gap-2"},Po={class:"rounded-full bg-surface-overlay px-2 py-0.5 text-xs text-text-muted"},Bo={class:"text-text-secondary truncate max-w-md"},Do={class:"text-xs text-text-muted"},Oo={key:1,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center text-sm text-text-muted"},Ro=T({__name:"PromptInspector",props:{sessionId:{}},setup(t){const a=t,n=ye(),o=_(()=>n.getAnatomy(a.sessionId)),d=_(()=>n.getSections(a.sessionId));return(c,x)=>o.value?(s(),r("div",No,[S(zo,{sections:d.value,"total-tokens":o.value.totalTokenCount},null,8,["sections","total-tokens"]),e("div",Ao,[(s(!0),r(N,null,A(d.value,l=>(s(),I(ko,{key:l.id,section:l,"total-tokens":o.value.totalTokenCount},null,8,["section","total-tokens"]))),128))]),o.value.messages&&o.value.messages.length>0?(s(),r("div",jo,[x[0]||(x[0]=e("h4",{class:"text-xs font-medium text-text-muted uppercase tracking-wide mb-3"},"Message Breakdown",-1)),e("div",Io,[(s(!0),r(N,null,A(o.value.messages,(l,u)=>(s(),r("div",{key:u,class:"flex items-center justify-between rounded-lg bg-surface px-3 py-2 text-sm"},[e("div",Lo,[e("span",Po,m(l.role),1),e("span",Bo,m(l.content.slice(0,80))+m(l.content.length>80?"...":""),1)]),e("span",Do,"~"+m(l.tokenCount)+" tok",1)]))),128))])])):g("",!0)])):(s(),r("div",Oo," No prompt anatomy data available. "))}});function Fo(t,a){if(a.length===0)return t;const n=De(a,"__raw"),o=t.split(`
|
|
2
|
-
`);let d=-1;for(let b=o.length-1;b>=0;b--)if(/^\s*return\s+/.test(o[b]??"")){d=b;break}if(d===-1)return`${t}
|
|
3
|
-
|
|
4
|
-
// Optimized: return selected fields only
|
|
5
|
-
const __raw = args
|
|
6
|
-
${n}`;const c=o[d],l=c.match(/^(\s*)return\s+/)?.[1]??" ";let u=c.replace(/^\s*return\s+/,"").trim(),p=d;if(u.includes("{")&&!Z(u))for(let b=d+1;b<o.length&&(u+=`
|
|
7
|
-
`+o[b],p=b,!Z(u));b++);const f=[`${l}const __raw = ${u.trim()}`,`${l}${n}`].join(`
|
|
8
|
-
`);return[...o.slice(0,d),"",`${l}// Optimized: return selected fields only`,f,...o.slice(p+1)].join(`
|
|
9
|
-
`)}function Z(t){let a=0;for(const n of t)if(n==="{"&&a++,n==="}"&&a--,a<0)return!1;return a===0}const qo={class:"relative flex h-full w-full max-w-2xl flex-col border-l border-border-default bg-bg-base shadow-xl"},Ho={class:"flex items-center justify-between border-b border-border-default px-5 py-4"},Eo={class:"text-base font-semibold text-text-primary"},Vo={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},Wo={class:"text-sm text-text-secondary"},Go={class:"font-mono text-accent"},Ko={class:"flex-1 overflow-y-auto"},Jo={class:"grid grid-cols-3 gap-0 border-b border-border-default"},Uo={class:"col-span-2 border-r border-border-default p-4"},Qo={class:"max-h-64 overflow-auto rounded-lg border border-border-default bg-surface-raised p-3"},Xo={class:"p-4"},Yo={class:"mb-2 text-xs font-medium uppercase tracking-wide text-text-muted"},Zo={key:0,class:"text-xs text-text-muted italic"},en={key:1,class:"space-y-1"},tn=["title"],sn=["onClick"],on={class:"border-b border-border-default p-4"},nn={class:"mb-2 flex items-center justify-between"},rn=["value"],an={class:"space-y-3 p-4"},ln={key:0,class:"rounded-lg bg-warning/10 p-3 text-xs text-warning"},dn={class:"flex items-center justify-end gap-3 border-t border-border-default px-5 py-4"},un=["disabled"],cn=T({__name:"ResponseOptimizerDrawer",props:{entry:{}},emits:["close"],setup(t,{emit:a}){const n=t,o=a,d=je(),c=Be(),x=M(new Set),l=M(`${n.entry.functionName}_optimized`),u=M(""),p=M(""),f=M(!1),v=M(!1),b=M(null),k=_(()=>c.findByFunctionName(n.entry.functionName)),w=_(()=>k.value?.implementation.code??""),i=_(()=>Array.from(x.value));E(i,$=>{if($.length>0){const h=$.map(j=>j.split(".").pop()??j).join(", ");u.value=`Optimized ${n.entry.functionName} returning only: ${h}`}else u.value=""}),E(i,$=>{f.value||(p.value=y($))});function y($){return $.length===0?w.value:w.value?Fo(w.value,$):` // No original code found — filtering raw result
|
|
10
|
-
const fullResult = await args
|
|
11
|
-
return {
|
|
12
|
-
${Re($).map(H=>` ${H.returnKey}: args.${H.jsonPath}`).join(`,
|
|
13
|
-
`)}
|
|
14
|
-
}`}function L($){const h=new Set(x.value);h.has($)?h.delete($):h.add($),x.value=h}function ie($){const h=new Set(x.value);h.delete($),x.value=h}function de($){p.value=$.target.value,f.value=!0}function ue(){p.value=y(i.value),f.value=!1}function ce(){const $=k.value,h=$?JSON.parse(JSON.stringify($.definition)):{type:"function",function:{name:l.value,description:u.value,parameters:{type:"object",properties:{},required:[]}}};h.function.name=l.value,h.function.description=u.value;const j=c.addTool({definition:h,implementation:{mode:"code",blocks:[],code:p.value},category:$?.category??"custom",optimizedFrom:{originalToolName:n.entry.functionName,selectedPaths:i.value,sampleResponse:n.entry.result}});b.value=j,v.value=!0}function me(){b.value&&c.selectTool(b.value),d.push("/tools"),o("close")}function F(){o("close")}return($,h)=>(s(),I(Ae,{to:"body"},[e("div",{class:"fixed inset-0 z-50 flex justify-end",onClick:ae(F,["self"])},[e("div",{class:"absolute inset-0 bg-black/50",onClick:F}),e("div",qo,[e("div",Ho,[e("h3",Eo," Optimize: "+m(t.entry.functionName),1),e("button",{class:"rounded p-1 text-text-muted hover:bg-surface-overlay hover:text-text-primary transition-colors",onClick:F},[...h[2]||(h[2]=[e("svg",{class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),v.value?(s(),r("div",Vo,[h[4]||(h[4]=e("div",{class:"text-4xl"},"✓",-1)),h[5]||(h[5]=e("p",{class:"text-lg font-medium text-text-primary"},"Tool created successfully",-1)),e("p",Wo,[e("span",Go,m(l.value),1),h[3]||(h[3]=C(" has been added to your workshop. ",-1))]),e("div",{class:"mt-4 flex gap-3"},[e("button",{class:"rounded-lg border border-border-default px-4 py-2 text-sm text-text-secondary hover:bg-surface-overlay transition-colors",onClick:F}," Stay Here "),e("button",{class:"rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover transition-colors",onClick:me}," Go to Workshop ")])])):(s(),r(N,{key:1},[e("div",Ko,[e("div",Jo,[e("div",Uo,[h[6]||(h[6]=e("div",{class:"mb-2 text-xs font-medium uppercase tracking-wide text-text-muted"}," Response (click fields to select) ",-1)),e("div",Qo,[S(Oe,{label:"result",value:t.entry.result,path:"","selected-paths":x.value,onTogglePath:L},null,8,["value","selected-paths"])])]),e("div",Xo,[e("div",Yo," Selected ("+m(x.value.size)+") ",1),x.value.size===0?(s(),r("div",Zo," Click fields in the tree to select them ")):(s(),r("div",en,[(s(!0),r(N,null,A(i.value,j=>(s(),r("div",{key:j,class:"flex items-center justify-between rounded px-2 py-1 text-xs font-mono bg-surface-raised"},[e("span",{class:"truncate text-text-secondary",title:j},m(j),9,tn),e("button",{class:"ml-2 flex-shrink-0 text-text-muted hover:text-error transition-colors",onClick:H=>ie(j)}," × ",8,sn)]))),128))]))])]),e("div",on,[e("div",nn,[h[7]||(h[7]=e("span",{class:"text-xs font-medium uppercase tracking-wide text-text-muted"}," Code (editable) ",-1)),f.value?(s(),r("button",{key:0,class:"rounded px-2 py-0.5 text-xs text-accent hover:bg-surface-overlay transition-colors",onClick:ue}," Regenerate ")):g("",!0)]),e("textarea",{value:p.value,onInput:de,class:"w-full rounded-lg border border-border-default bg-surface-raised p-3 font-mono text-xs text-text-primary placeholder-text-muted focus:border-accent focus:outline-none resize-y",rows:"10",spellcheck:"false",placeholder:"Select fields above to generate code..."},null,40,rn)]),e("div",an,[e("div",null,[h[8]||(h[8]=e("label",{class:"mb-1 block text-xs font-medium text-text-muted"},"Tool Name",-1)),V(e("input",{"onUpdate:modelValue":h[0]||(h[0]=j=>l.value=j),class:"w-full rounded-lg border border-border-default bg-surface-raised px-3 py-2 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:outline-none"},null,512),[[Y,l.value]])]),e("div",null,[h[9]||(h[9]=e("label",{class:"mb-1 block text-xs font-medium text-text-muted"},"Description",-1)),V(e("input",{"onUpdate:modelValue":h[1]||(h[1]=j=>u.value=j),class:"w-full rounded-lg border border-border-default bg-surface-raised px-3 py-2 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:outline-none",placeholder:"What does this optimized tool return?"},null,512),[[Y,u.value]])]),k.value?g("",!0):(s(),r("div",ln,' Original tool "'+m(t.entry.functionName)+'" not found in workshop. The optimized tool will be created with a blank parameter schema. ',1))])]),e("div",dn,[e("button",{class:"rounded-lg border border-border-default px-4 py-2 text-sm text-text-secondary hover:bg-surface-overlay transition-colors",onClick:F}," Cancel "),e("button",{class:"rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:x.value.size===0||!l.value.trim(),onClick:ce}," Create Optimized Tool ",8,un)])],64))])])]))}}),mn={key:0,class:"space-y-4"},pn={class:"flex items-center justify-between"},xn={class:"flex items-center gap-3"},fn={class:"text-lg font-semibold"},vn={class:"text-xs text-text-muted"},bn={class:"mt-4"},gn={key:0,class:"space-y-4"},yn={key:1,class:"flex items-center justify-center py-20 text-text-muted"},jn=T({__name:"SessionPage",props:{id:{}},setup(t){const a=t,n=xe(),o=fe(),d=M("stream"),c=[{key:"stream",label:"Stream"},{key:"reasoning",label:"Reasoning"},{key:"introspection",label:"Introspection"},{key:"tools",label:"Tools"},{key:"agent",label:"Agent Graph"},{key:"prompt",label:"Prompt"}],x=_(()=>n.sessionById(a.id)??null),l=_(()=>o.getMetrics(a.id)),u=M(null);return Q(()=>{n.setActiveSession(a.id)}),(p,f)=>(s(),r(N,null,[x.value?(s(),r("div",mn,[e("div",pn,[e("div",xn,[e("h2",fn,m(x.value.model),1),S(ee,{status:x.value.status},null,8,["status"])]),e("div",vn,"Session "+m(x.value.id.slice(0,8)),1)]),S(ve,{tabs:c,"active-tab":d.value,"onUpdate:activeTab":f[0]||(f[0]=v=>d.value=v)},null,8,["active-tab"]),e("div",bn,[d.value==="stream"?(s(),r("div",gn,[S(he,{"session-id":t.id},null,8,["session-id"]),S(Ye,{metrics:l.value},null,8,["metrics"])])):d.value==="reasoning"?(s(),I(xt,{key:1,"session-id":t.id},null,8,["session-id"])):d.value==="introspection"?(s(),I(_s,{key:2,"session-id":t.id,"model-name":x.value.model},null,8,["session-id","model-name"])):d.value==="tools"?(s(),I(Hs,{key:3,"session-id":t.id,onOptimize:f[1]||(f[1]=v=>u.value=v)},null,8,["session-id"])):d.value==="agent"?(s(),I(co,{key:4,"session-id":t.id},null,8,["session-id"])):d.value==="prompt"?(s(),I(Ro,{key:5,"session-id":t.id},null,8,["session-id"])):g("",!0)])])):(s(),r("div",yn," Session not found. ")),u.value?(s(),I(cn,{key:2,entry:u.value,onClose:f[2]||(f[2]=v=>u.value=null)},null,8,["entry"])):g("",!0)],64))}});export{jn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as D,A as Q,b as s,e as n,f as e,B as C,C as S,g as q,t as d,x as z,k as E,E as K,r as g,o as P,c as I,z as X,h as V,u as m,i as b,F as k,j as $,p as W,M as Y,m as T,ai as Z}from"./index-BqB3FY2M.js";import{_ as ee}from"./TabBar.vue_vue_type_script_setup_true_lang-CnQ8vq8x.js";import{b as te}from"./format-BqVZ9rwM.js";import{_ as se}from"./ModelCapabilityIcons.vue_vue_type_script_setup_true_lang-CsL7aDHj.js";import{u as ae}from"./google-auth-store-BnEs-xLw.js";import{_ as oe}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./google-auth-CfEcVMA7.js";const ne={class:"space-y-6"},le={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-4"},re={class:"flex gap-3"},ie={class:"flex items-center gap-2 text-sm"},de={class:"text-text-secondary"},ce={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-4"},ue={class:"space-y-6"},pe={class:"flex items-center gap-1.5 mb-3"},me={class:"ml-auto text-xs text-text-primary font-medium"},xe={class:"rounded-full bg-surface-overlay px-2 py-0.5 text-[10px] text-text-secondary"},ge={class:"relative h-1.5 mt-1"},ve={class:"flex items-center gap-3"},be={class:"text-[10px] text-text-muted"},fe=D({__name:"SettingsGeneralTab",setup(A){const a=g("http://localhost:11434"),c=g(.7),x=g(4096),v=g("disconnected");function h(){const f=localStorage.getItem("llmxray-settings");if(f)try{const r=JSON.parse(f);typeof r.ollamaUrl=="string"&&(a.value=r.ollamaUrl,P.setBaseUrl(r.ollamaUrl+"/api")),typeof r.defaultTemperature=="number"&&(c.value=r.defaultTemperature),typeof r.defaultContextLength=="number"&&(x.value=r.defaultContextLength)}catch{}}function i(){localStorage.setItem("llmxray-settings",JSON.stringify({ollamaUrl:a.value,defaultTemperature:c.value,defaultContextLength:x.value}))}async function _(){v.value="testing";try{const f=await fetch(`${a.value}/api/tags`);v.value=f.ok?"connected":"disconnected"}catch{v.value="disconnected"}}function M(){i(),P.setBaseUrl(a.value+"/api")}const G=I(()=>{const f=c.value;return f===0?"Deterministic":f<=.3?"Focused":f<=.7?"Balanced":f<=1.2?"Creative":"Very random"}),y=I(()=>c.value/2*100);return Q(()=>{h(),_()}),(f,r)=>(s(),n("div",ne,[e("div",le,[r[3]||(r[3]=e("h3",{class:"text-sm font-medium text-text-primary"},"Ollama Connection",-1)),e("div",re,[C(e("input",{"onUpdate:modelValue":r[0]||(r[0]=p=>a.value=p),class:"flex-1 rounded-lg border border-border-default bg-surface px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",placeholder:"http://localhost:11434"},null,512),[[S,a.value]]),e("button",{class:"rounded-lg bg-surface-overlay px-4 py-2 text-sm text-text-primary hover:bg-border-default transition-colors",onClick:_}," Test "),e("button",{class:"rounded-lg bg-accent px-4 py-2 text-sm text-surface hover:bg-accent-hover transition-colors",onClick:M}," Save ")]),e("div",ie,[e("span",{class:q(["inline-block h-2 w-2 rounded-full",{"bg-success":v.value==="connected","bg-error":v.value==="disconnected","bg-warning animate-pulse":v.value==="testing"}])},null,2),e("span",de,d(v.value==="connected"?"Connected":v.value==="testing"?"Testing...":"Disconnected"),1)])]),e("div",ce,[r[9]||(r[9]=e("h3",{class:"text-sm font-medium text-text-primary"},"Default Parameters",-1)),e("div",ue,[e("div",null,[e("div",pe,[r[4]||(r[4]=z('<label class="text-xs text-text-muted">Temperature</label><div class="group relative"><span class="inline-flex h-4 w-4 items-center justify-center rounded-full border border-border-default text-[10px] text-text-muted cursor-help">?</span><div class="pointer-events-none absolute left-full top-1/2 z-10 ml-2 w-72 -translate-y-1/2 rounded-lg border border-border-default bg-surface-raised p-3 text-xs text-text-secondary opacity-0 shadow-lg transition-opacity group-hover:pointer-events-auto group-hover:opacity-100"><p class="font-medium text-text-primary mb-1">What is Temperature?</p><p class="mb-2">Temperature controls how "creative" or "random" the model's answers are.</p><ul class="space-y-1 text-[11px]"><li><strong>0</strong> — Always picks the most likely word. Great for facts, math, and code.</li><li><strong>0.7</strong> — A good balance. This is the default.</li><li><strong>1.0+</strong> — More surprising and creative.</li></ul></div></div>',2)),e("span",me,d(c.value),1),e("span",xe,d(G.value),1)]),C(e("input",{"onUpdate:modelValue":r[1]||(r[1]=p=>c.value=p),type:"range",min:"0",max:"2",step:"0.1",class:"w-full",onChange:i},null,544),[[S,c.value,void 0,{number:!0}]]),r[6]||(r[6]=z('<div class="relative mt-1 h-4"><span class="absolute left-0 text-[10px] text-text-muted">0</span><span class="absolute text-[10px] text-text-muted" style="left:15%;">0.3</span><span class="absolute text-[10px] text-accent font-medium" style="left:35%;">0.7</span><span class="absolute text-[10px] text-text-muted" style="left:50%;">1.0</span><span class="absolute text-[10px] text-text-muted" style="left:75%;">1.5</span><span class="absolute right-0 text-[10px] text-text-muted">2.0</span></div><div class="relative mt-0.5 h-3"><div class="absolute inset-0 flex"><div class="flex-[15] text-center text-[9px] text-text-muted border-r border-border-default/30">Focused</div><div class="flex-[20] text-center text-[9px] text-text-muted border-r border-border-default/30">Balanced</div><div class="flex-[25] text-center text-[9px] text-text-muted border-r border-border-default/30">Creative</div><div class="flex-[40] text-center text-[9px] text-text-muted">Wild</div></div></div>',2)),e("div",ge,[r[5]||(r[5]=e("div",{class:"absolute h-1.5 rounded-full bg-border-default/30 w-full"},null,-1)),e("div",{class:"absolute h-1.5 rounded-full bg-accent/60 transition-all duration-150",style:E({width:`${y.value}%`})},null,4)])]),e("div",null,[r[8]||(r[8]=z('<div class="flex items-center gap-1.5 mb-2"><label class="text-xs text-text-muted">Context Length</label><div class="group relative"><span class="inline-flex h-4 w-4 items-center justify-center rounded-full border border-border-default text-[10px] text-text-muted cursor-help">?</span><div class="pointer-events-none absolute left-full top-1/2 z-10 ml-2 w-72 -translate-y-1/2 rounded-lg border border-border-default bg-surface-raised p-3 text-xs text-text-secondary opacity-0 shadow-lg transition-opacity group-hover:pointer-events-auto group-hover:opacity-100"><p class="font-medium text-text-primary mb-1">What is Context Length?</p><p class="mb-2">How much of the conversation the model can see at once, measured in tokens.</p><div class="mt-2 text-[10px] text-text-muted">Larger context uses more RAM/VRAM.</div></div></div></div>',1)),e("div",ve,[C(e("select",{"onUpdate:modelValue":r[2]||(r[2]=p=>x.value=p),class:"rounded-lg border border-border-default bg-surface px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",onChange:i},[...r[7]||(r[7]=[e("option",{value:2048},"2,048",-1),e("option",{value:4096},"4,096",-1),e("option",{value:8192},"8,192",-1),e("option",{value:16384},"16,384",-1),e("option",{value:32768},"32,768",-1),e("option",{value:65536},"65,536",-1),e("option",{value:131072},"131,072",-1)])],544),[[K,x.value,void 0,{number:!0}]]),e("span",be," ≈ "+d(Math.round(x.value*.75).toLocaleString())+" words ",1)])])])])]))}}),F=[{key:"chat",label:"Chat",entries:[{name:"llama3.2",description:"Meta Llama 3.2 -- fast general-purpose chat",variants:[{tag:"1b",params:"1B",size:"1.3 GB"},{tag:"3b",params:"3B",size:"2.0 GB"}]},{name:"llama3.1",description:"Meta Llama 3.1 -- strong reasoning and instruction following",variants:[{tag:"8b",params:"8B",size:"4.7 GB"}]},{name:"gemma3",description:"Google Gemma 3 -- efficient and multilingual",variants:[{tag:"1b",params:"1B",size:"815 MB"},{tag:"4b",params:"4B",size:"3.0 GB"},{tag:"12b",params:"12B",size:"8.1 GB"}]},{name:"gemma2",description:"Google Gemma 2 -- balanced performance",variants:[{tag:"2b",params:"2B",size:"1.6 GB"},{tag:"9b",params:"9B",size:"5.5 GB"}]},{name:"mistral",description:"Mistral 7B -- strong European model",variants:[{tag:"7b",params:"7B",size:"4.1 GB"}]},{name:"phi4",description:"Microsoft Phi-4 -- small but capable",variants:[{tag:"14b",params:"14B",size:"9.1 GB"}]},{name:"qwen2.5",description:"Alibaba Qwen 2.5 -- multilingual powerhouse",variants:[{tag:"0.5b",params:"0.5B",size:"397 MB"},{tag:"1.5b",params:"1.5B",size:"986 MB"},{tag:"3b",params:"3B",size:"1.9 GB"},{tag:"7b",params:"7B",size:"4.7 GB"}]},{name:"tinyllama",description:"TinyLlama -- ultra-lightweight for constrained systems",variants:[{tag:"1.1b",params:"1.1B",size:"637 MB"}]}]},{key:"code",label:"Code",entries:[{name:"qwen2.5-coder",description:"Qwen 2.5 Coder -- strong code generation and completion",variants:[{tag:"1.5b",params:"1.5B",size:"986 MB"},{tag:"3b",params:"3B",size:"1.9 GB"},{tag:"7b",params:"7B",size:"4.7 GB"}]},{name:"codellama",description:"Meta Code Llama -- code-specialized Llama",variants:[{tag:"7b",params:"7B",size:"3.8 GB"},{tag:"13b",params:"13B",size:"7.4 GB"}]},{name:"deepseek-coder-v2",description:"DeepSeek Coder V2 -- strong coding with MoE architecture",variants:[{tag:"16b",params:"16B",size:"8.9 GB"}]},{name:"starcoder2",description:"BigCode StarCoder 2 -- trained on The Stack v2",variants:[{tag:"3b",params:"3B",size:"1.7 GB"},{tag:"7b",params:"7B",size:"4.0 GB"}]},{name:"codegemma",description:"Google CodeGemma -- code completion and generation",variants:[{tag:"2b",params:"2B",size:"1.6 GB"},{tag:"7b",params:"7B",size:"5.0 GB"}]}]},{key:"embedding",label:"Embedding",entries:[{name:"nomic-embed-text",description:"Nomic -- 137M params, fast and good quality",variants:[{tag:"latest",params:"137M",size:"274 MB"}]},{name:"mxbai-embed-large",description:"mixedbread.ai -- 335M params, high quality",variants:[{tag:"latest",params:"335M",size:"670 MB"}]},{name:"all-minilm",description:"MiniLM -- 23M params, very lightweight",variants:[{tag:"latest",params:"23M",size:"46 MB"}]},{name:"snowflake-arctic-embed",description:"Snowflake -- 110M params, balanced",variants:[{tag:"latest",params:"110M",size:"229 MB"}]},{name:"bge-m3",description:"BAAI BGE-M3 -- multilingual, multi-granularity",variants:[{tag:"latest",params:"567M",size:"1.2 GB"}]}]},{key:"vision",label:"Vision",entries:[{name:"llava",description:"LLaVA -- multimodal vision-language model",variants:[{tag:"7b",params:"7B",size:"4.7 GB"},{tag:"13b",params:"13B",size:"8.0 GB"}]},{name:"llama3.2-vision",description:"Meta Llama 3.2 Vision -- image understanding",variants:[{tag:"11b",params:"11B",size:"7.9 GB"}]},{name:"minicpm-v",description:"MiniCPM-V -- lightweight vision model",variants:[{tag:"latest",params:"8B",size:"5.5 GB"}]},{name:"moondream",description:"Moondream -- tiny vision model, runs anywhere",variants:[{tag:"latest",params:"1.9B",size:"1.7 GB"}]}]},{key:"thinking",label:"Thinking",entries:[{name:"deepseek-r1",description:"DeepSeek R1 -- chain-of-thought reasoning",variants:[{tag:"1.5b",params:"1.5B",size:"1.1 GB"},{tag:"7b",params:"7B",size:"4.7 GB"},{tag:"8b",params:"8B",size:"4.9 GB"},{tag:"14b",params:"14B",size:"9.0 GB"}]},{name:"qwq",description:"Alibaba QwQ -- strong reasoning with thinking traces",variants:[{tag:"32b",params:"32B",size:"20 GB"}]},{name:"phi4-reasoning",description:"Microsoft Phi-4 Reasoning -- compact thinking model",variants:[{tag:"14b",params:"14B",size:"9.1 GB"}]},{name:"command-r",description:"Cohere Command R -- reasoning with RAG strengths",variants:[{tag:"35b",params:"35B",size:"20 GB"}]}]}],he={class:"space-y-6"},ye={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-4"},_e={class:"flex items-center justify-between"},ke={class:"text-sm font-medium text-text-primary"},Be={class:"ml-1 text-text-muted"},we={key:0,class:"text-xs text-error"},Ce={key:1,class:"py-4 text-center text-sm text-text-muted"},Me={key:2,class:"space-y-1"},Ge={class:"flex-1 min-w-0"},$e={class:"flex items-center gap-2"},ze={class:"font-medium text-text-primary truncate"},Se={class:"flex gap-3 text-[10px] text-text-muted mt-0.5"},Ae={key:0},Le={key:1},Te={key:2},Ve={class:"shrink-0 text-[10px] text-text-muted"},Ie=["onClick"],De=["onClick"],Ue={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-4"},Ee={class:"flex flex-wrap gap-1.5"},Pe=["onClick"],qe={key:0,class:"text-xs text-error"},Ne={key:1,class:"py-4 text-center text-sm text-text-muted"},Re={key:2,class:"space-y-2"},je={class:"flex items-start gap-3"},Oe={class:"flex-1 min-w-0"},Fe={class:"flex items-center gap-2"},Qe={class:"text-xs font-medium text-text-primary"},We={key:0,class:"rounded-full bg-success/10 px-1.5 py-0.5 text-[9px] text-success"},He={class:"text-[10px] text-text-muted mt-0.5"},Je={class:"flex items-center gap-2 shrink-0"},Ke=["value","onChange"],Xe=["value"],Ye={key:1,class:"text-[10px] text-text-muted"},Ze=["disabled","onClick"],et={key:0,class:"mt-2 space-y-1"},tt={class:"h-1.5 rounded-full bg-surface-overlay overflow-hidden"},st={class:"text-[9px] text-text-muted"},at={class:"border-t border-border-default pt-4"},ot={class:"flex gap-2"},nt=["disabled"],lt={key:0,class:"mt-2 space-y-1"},rt={class:"flex items-center justify-between text-[10px] text-text-muted"},it={class:"font-mono"},dt={class:"h-1.5 rounded-full bg-surface-overlay overflow-hidden"},ct={class:"text-[9px] text-text-muted"},ut=D({__name:"SettingsModelsTab",setup(A){const a=X(),c=g(null),x=g(null);async function v(o){if(c.value===o){try{x.value=null,await a.deleteModel(o)}catch(l){x.value=l instanceof Error?l.message:"Delete failed"}c.value=null}else c.value=o,setTimeout(()=>{c.value===o&&(c.value=null)},3e3)}const h=g("all"),i=g(""),_=I(()=>[{key:"all",label:"All"},...F.map(o=>({key:o.key,label:o.label}))]),M=I(()=>{let o=[];for(const t of F)if(!(h.value!=="all"&&t.key!==h.value))for(const u of t.entries)o.push({...u,category:t.key});const l=i.value.toLowerCase().trim();return l&&(o=o.filter(t=>t.name.toLowerCase().includes(l)||t.description.toLowerCase().includes(l))),o}),G=g(new Map);function y(o){const l=G.value.get(o.name);return o.variants.find(t=>t.tag===l)??o.variants[0]}function f(o,l){const t=new Map(G.value);t.set(o,l),G.value=t}function r(o,l){const t=l==="latest"?o:`${o}:${l}`;return a.modelNames.some(u=>u===t||u===`${t}:latest`||u===o)}const p=g(new Map),L=g(null),B=g("");async function N(o){const l=new Map(p.value);l.set(o,{status:"Starting...",percent:0}),p.value=l,L.value=null;try{await P.pullModel(o,(u,w,j)=>{const O=new Map(p.value),J=w&&j?Math.round(w/j*100):0;O.set(o,{status:u,percent:J}),p.value=O}),await a.fetchModels();const t=new Map(p.value);t.delete(o),p.value=t}catch(t){L.value=`Failed to pull ${o}: ${t instanceof Error?t.message:"Unknown error"}`;const u=new Map(p.value);u.delete(o),p.value=u}}function H(o){const l=y(o),t=l.tag==="latest"?o.name:`${o.name}:${l.tag}`;N(t)}function R(){const o=B.value.trim();o&&(N(o),B.value="")}function U(o){return p.value.has(o)}return Q(()=>{a.models.length===0&&a.fetchModels()}),(o,l)=>(s(),n("div",he,[e("div",ye,[e("div",_e,[e("h3",ke,[l[3]||(l[3]=V(" Installed Models ",-1)),e("span",Be,"("+d(m(a).models.length)+")",1)]),e("button",{class:"rounded-lg px-3 py-1.5 text-xs text-text-secondary hover:bg-surface-overlay hover:text-text-primary transition-colors",onClick:l[0]||(l[0]=t=>m(a).fetchModels())}," Refresh ")]),x.value?(s(),n("p",we,d(x.value),1)):b("",!0),m(a).models.length===0?(s(),n("div",Ce," No models installed. Pull one from the catalog below. ")):(s(),n("div",Me,[(s(!0),n(k,null,$(m(a).models,t=>(s(),n("div",{key:t.name,class:"flex items-center gap-3 rounded-lg bg-surface px-3 py-2.5 text-xs"},[e("div",Ge,[e("div",$e,[e("span",ze,d(t.name),1),W(se,{"model-name":t.name},null,8,["model-name"])]),e("div",Se,[t.details?.family?(s(),n("span",Ae,d(t.details.family),1)):b("",!0),t.details?.parameter_size?(s(),n("span",Le,d(t.details.parameter_size),1)):b("",!0),t.details?.quantization_level?(s(),n("span",Te,d(t.details.quantization_level),1)):b("",!0)])]),e("span",Ve,d(m(te)(t.size)),1),c.value===t.name?(s(),n("button",{key:0,class:"shrink-0 rounded-lg border border-error/30 px-2.5 py-1 text-[10px] text-error hover:bg-error/10 transition-colors",onClick:u=>v(t.name)}," Confirm delete? ",8,Ie)):(s(),n("button",{key:1,class:"shrink-0 rounded p-1 text-text-muted hover:text-error transition-colors",title:"Delete model",onClick:u=>v(t.name)},[...l[4]||(l[4]=[e("svg",{class:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])],8,De))]))),128))]))]),e("div",Ue,[l[6]||(l[6]=e("h3",{class:"text-sm font-medium text-text-primary"},"Download Models",-1)),e("div",Ee,[(s(!0),n(k,null,$(_.value,t=>(s(),n("button",{key:t.key,class:q(["rounded-lg px-3 py-1.5 text-xs transition-colors",h.value===t.key?"bg-accent/10 text-accent":"bg-surface text-text-secondary hover:bg-surface-overlay hover:text-text-primary"]),onClick:u=>h.value=t.key},d(t.label),11,Pe))),128))]),C(e("input",{"onUpdate:modelValue":l[1]||(l[1]=t=>i.value=t),type:"text",placeholder:"Search models...",class:"w-full rounded-lg border border-border-default bg-surface px-3 py-2 text-sm text-text-primary placeholder-text-muted outline-none focus:border-accent"},null,512),[[S,i.value]]),L.value?(s(),n("p",qe,d(L.value),1)):b("",!0),M.value.length===0?(s(),n("div",Ne," No models match your search. ")):(s(),n("div",Re,[(s(!0),n(k,null,$(M.value,t=>(s(),n("div",{key:t.name,class:"rounded-lg border border-border-default bg-surface p-3"},[e("div",je,[e("div",Oe,[e("div",Fe,[e("span",Qe,d(t.name),1),r(t.name,y(t).tag)?(s(),n("span",We," Installed ")):b("",!0)]),e("p",He,d(t.description),1)]),e("div",Je,[t.variants.length>1?(s(),n("select",{key:0,value:y(t).tag,class:"rounded border border-border-default bg-surface px-2 py-1 text-[10px] text-text-primary outline-none focus:border-accent",onChange:u=>f(t.name,u.target.value)},[(s(!0),n(k,null,$(t.variants,u=>(s(),n("option",{key:u.tag,value:u.tag},d(u.params)+" ("+d(u.size)+") ",9,Xe))),128))],40,Ke)):(s(),n("span",Ye,d(t.variants[0].params)+" ("+d(t.variants[0].size)+") ",1)),e("button",{disabled:U(`${t.name}:${y(t).tag}`)||U(t.name),class:"rounded-lg bg-accent px-3 py-1 text-[10px] text-white hover:bg-accent-hover disabled:opacity-40 transition-colors",onClick:u=>H(t)}," Pull ",8,Ze)])]),p.value.has(`${t.name}:${y(t).tag}`)||p.value.has(t.name)?(s(),n("div",et,[e("div",tt,[e("div",{class:"h-full rounded-full bg-accent transition-all duration-300",style:E({width:`${(p.value.get(`${t.name}:${y(t).tag}`)??p.value.get(t.name))?.percent??0}%`})},null,4)]),e("p",st,d((p.value.get(`${t.name}:${y(t).tag}`)??p.value.get(t.name))?.status),1)])):b("",!0)]))),128))])),e("div",at,[l[5]||(l[5]=e("p",{class:"mb-2 text-xs text-text-muted"},"Pull any model by name",-1)),e("div",ot,[C(e("input",{"onUpdate:modelValue":l[2]||(l[2]=t=>B.value=t),type:"text",placeholder:"e.g. llama3.2:3b",class:"flex-1 rounded-lg border border-border-default bg-surface px-3 py-2 text-sm text-text-primary placeholder-text-muted outline-none focus:border-accent font-mono",onKeydown:Y(R,["enter"])},null,544),[[S,B.value]]),e("button",{disabled:!B.value.trim()||U(B.value.trim()),class:"rounded-lg bg-accent px-4 py-2 text-sm text-white hover:bg-accent-hover disabled:opacity-40 transition-colors",onClick:R}," Pull ",8,nt)]),(s(!0),n(k,null,$(p.value,([t,u])=>(s(),n(k,{key:t},[M.value.some(w=>`${w.name}:${y(w).tag}`===t||w.name===t)?b("",!0):(s(),n("div",lt,[e("div",rt,[e("span",it,d(t),1),e("span",null,d(u.percent)+"%",1)]),e("div",dt,[e("div",{class:"h-full rounded-full bg-accent transition-all duration-300",style:E({width:`${u.percent}%`})},null,4)]),e("p",ct,d(u.status),1)]))],64))),128))])])]))}}),pt={class:"space-y-6"},mt={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-4"},xt={class:"flex gap-3"},gt={class:"flex items-center gap-2 text-sm"},vt={class:"text-text-secondary"},bt={class:"text-text-primary font-medium"},ft={key:0,class:"text-xs text-error"},ht={class:"flex gap-3"},yt=["disabled"],_t={class:"border-t border-border-default pt-3"},kt={key:0,class:"mt-3 space-y-2 text-xs text-text-secondary"},Bt=D({__name:"SettingsIntegrationsTab",setup(A){const a=ae(),c=g(a.clientId),x=g(!1);function v(){a.updateClientId(c.value)}return(h,i)=>(s(),n("div",pt,[e("div",mt,[i[7]||(i[7]=e("h3",{class:"text-sm font-medium text-text-primary"},"Google Integration",-1)),i[8]||(i[8]=e("p",{class:"text-[10px] text-text-muted"},"Connect your Google account to enable Calendar and Gmail tools in the Tool Workshop.",-1)),e("div",null,[i[4]||(i[4]=e("label",{class:"block text-xs text-text-secondary mb-1"},"OAuth2 Client ID",-1)),e("div",xt,[C(e("input",{"onUpdate:modelValue":i[0]||(i[0]=_=>c.value=_),class:"flex-1 rounded-lg border border-border-default bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-accent focus:outline-none font-mono",placeholder:"123456789-abcdef.apps.googleusercontent.com"},null,512),[[S,c.value]]),e("button",{class:"rounded-lg bg-surface-overlay px-4 py-2 text-sm text-text-primary hover:bg-border-default transition-colors",onClick:v}," Save ")])]),e("div",gt,[e("span",{class:q(["inline-block h-2 w-2 rounded-full",{"bg-success":m(a).connected,"bg-error":!m(a).connected&&!m(a).isAuthenticating,"bg-warning animate-pulse":m(a).isAuthenticating}])},null,2),e("span",vt,[m(a).isAuthenticating?(s(),n(k,{key:0},[V("Authenticating...")],64)):m(a).connected?(s(),n(k,{key:1},[i[5]||(i[5]=V("Connected as ",-1)),e("span",bt,d(m(a).userEmail??"unknown"),1)],64)):(s(),n(k,{key:2},[V("Not connected")],64))])]),m(a).error?(s(),n("p",ft,d(m(a).error),1)):b("",!0),e("div",ht,[m(a).connected?b("",!0):(s(),n("button",{key:0,class:"rounded-lg bg-accent px-4 py-2 text-sm text-surface hover:bg-accent-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!m(a).clientId||m(a).isAuthenticating,onClick:i[1]||(i[1]=_=>m(a).connect())}," Connect Google Account ",8,yt)),m(a).connected?(s(),n("button",{key:1,class:"rounded-lg border border-error/30 px-4 py-2 text-sm text-error hover:bg-error/10 transition-colors",onClick:i[2]||(i[2]=_=>m(a).disconnect())}," Disconnect ")):b("",!0)]),e("div",_t,[e("button",{class:"text-xs text-accent hover:text-accent-hover transition-colors",onClick:i[3]||(i[3]=_=>x.value=!x.value)},d(x.value?"Hide":"Show")+" setup instructions ",1),x.value?(s(),n("div",kt,[...i[6]||(i[6]=[z('<p class="font-medium text-text-primary">One-time setup (5 minutes):</p><ol class="list-decimal list-inside space-y-2 ml-1"><li>Go to <a href="https://console.cloud.google.com/" target="_blank" rel="noopener" class="text-accent hover:underline">Google Cloud Console</a> and create a new project</li><li>Enable the <a href="https://console.cloud.google.com/apis/library/calendar-json.googleapis.com" target="_blank" rel="noopener" class="text-accent hover:underline">Google Calendar API</a></li><li>Enable the <a href="https://console.cloud.google.com/apis/library/gmail.googleapis.com" target="_blank" rel="noopener" class="text-accent hover:underline">Gmail API</a></li><li>Go to <a href="https://console.cloud.google.com/apis/credentials/consent" target="_blank" rel="noopener" class="text-accent hover:underline">OAuth consent screen</a>, set up as <strong>External</strong>, add your email as a <strong>test user</strong></li><li>Go to <a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener" class="text-accent hover:underline">Credentials</a>, click <strong>+ Create Credentials</strong> → <strong>OAuth 2.0 Client ID</strong></li><li>Set application type to <strong>Web application</strong></li><li>Add <strong>Authorized JavaScript origins</strong>: <code class="bg-surface rounded px-1.5 py-0.5 text-[11px] font-mono text-text-primary">http://localhost:5173</code></li><li>Add <strong>Authorized redirect URIs</strong>: <code class="bg-surface rounded px-1.5 py-0.5 text-[11px] font-mono text-text-primary">http://localhost:5173/auth/google/callback</code></li><li>Copy the <strong>Client ID</strong> and paste it above, then click Save</li><li>Click <strong>Connect Google Account</strong> above</li></ol><div class="mt-3 rounded-lg bg-surface-overlay p-3 text-[11px]"><p class="font-medium text-text-primary mb-1">Note: "App not verified" warning</p><p>Google will show a warning because your app is in testing mode. Click <strong>Advanced</strong> → <strong>Go to [your project name] (unsafe)</strong> to proceed.</p></div>',3)])])):b("",!0)])])]))}}),wt={},Ct={class:"space-y-6"};function Mt(A,a){return s(),n("div",Ct,[...a[0]||(a[0]=[z('<div class="rounded-lg border border-border-default bg-surface-raised p-5 space-y-4"><div class="flex items-center gap-3"><span class="text-2xl font-bold text-accent">xR</span><div><h3 class="text-sm font-semibold text-text-primary">LLMxRay</h3><p class="text-xs text-text-muted">Local LLM Observatory</p></div></div><div class="grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"><span class="text-text-muted">Version</span><span class="text-text-primary">1.0.0</span><span class="text-text-muted">License</span><span class="text-text-primary">Apache 2.0</span><span class="text-text-muted">Repository</span><a href="https://github.com/LogneBudo/llmxray" target="_blank" rel="noopener" class="text-accent hover:underline"> github.com/LogneBudo/llmxray </a></div></div><div class="rounded-lg border border-border-default bg-surface-raised p-5 space-y-3"><h3 class="text-sm font-medium text-text-primary">Tech Stack</h3><div class="grid grid-cols-2 gap-2 text-xs"><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">Vue 3.5</p><p class="text-[10px] text-text-muted">Composition API + TypeScript</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">Vite 7</p><p class="text-[10px] text-text-muted">Build tooling + dev server</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">Tailwind CSS 4</p><p class="text-[10px] text-text-muted">Utility-first styling</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">Pinia 3</p><p class="text-[10px] text-text-muted">State management</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">Ollama</p><p class="text-[10px] text-text-muted">Local LLM runtime</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">IndexedDB</p><p class="text-[10px] text-text-muted">Browser-native persistence</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">D3.js + Chart.js</p><p class="text-[10px] text-text-muted">Data visualization</p></div><div class="rounded-lg bg-surface p-2.5"><p class="font-medium text-text-primary">pdfjs + mammoth</p><p class="text-[10px] text-text-muted">Document parsing</p></div></div></div>',2)])])}const Gt=oe(wt,[["render",Mt]]),$t={class:"max-w-4xl space-y-6"},Dt=D({__name:"SettingsPage",setup(A){const a=Z(),c=g(a.query.tab??"general"),x=[{key:"general",label:"General"},{key:"models",label:"Models"},{key:"integrations",label:"Integrations"},{key:"about",label:"About"}];return(v,h)=>(s(),n("div",$t,[W(ee,{tabs:x,"active-tab":c.value,"onUpdate:activeTab":h[0]||(h[0]=i=>c.value=i)},null,8,["active-tab"]),c.value==="general"?(s(),T(fe,{key:0})):c.value==="models"?(s(),T(ut,{key:1})):c.value==="integrations"?(s(),T(Bt,{key:2})):c.value==="about"?(s(),T(Gt,{key:3})):b("",!0)]))}});export{Dt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as v,r as y,c as f,a as b,e as l,f as u,t as c,i as g,g as h,b as d,h as M}from"./index-BqB3FY2M.js";import{a as k}from"./agent-store-_RIMRfEn.js";const V=v("prompt",()=>{const e=y(new Map);function n(a){return e.value.get(a)??null}function t(a){return e.value.get(a)?.sections??[]}function s(a,o){e.value.set(a,o)}return{anatomyBySession:e,getAnatomy:n,getSections:t,setAnatomy:s}});function x(e){const n=Math.max(0,Math.min(1,e));if(n>=.7){const t=(n-.7)/.3;return`rgb(${Math.round(74*(1-t))}, 222, 128)`}else if(n>=.4){const t=(n-.4)/.3,s=Math.round(163+59*t);return`rgb(${Math.round(251-177*t)}, ${s}, ${Math.round(36+92*t)})`}else{const t=n/.4;return`rgb(248, ${Math.round(113*t)}, ${Math.round(113*t)})`}}function z(e,n){if(n<=0)return x(.5);const t=e/n,s=Math.max(0,Math.min(1,1-(t-.5)/2));return x(s)}const D={system:"#818cf8",user:"#a855f7",context:"#a78bfa",tools:"#fb923c",memory:"#4ade80",examples:"#fbbf24",instructions:"#f472b6",unknown:"#94a3b8"},E={start:"#4ade80",llm_call:"#a855f7",tool_call:"#fb923c",decision:"#a78bfa",output:"#4ade80",error:"#f87171"};function F(e){const n=k(),t=f(()=>n.getTokens(e.value)),s=f(()=>{const r=t.value;if(r.length===0)return{min:0,max:1,median:.5};const i=r.map(m=>m.confidence).sort((m,p)=>m-p);return{min:i[0],max:i[i.length-1],median:i[Math.floor(i.length/2)]}});function a(r){return x(r)}function o(r){return r>=.7?"high":r>=.4?"medium":"low"}return{tokens:t,confidenceRange:s,getColor:a,getConfidenceLabel:o}}const C={class:"rounded-lg border border-border-default bg-surface-raised p-4"},w={class:"text-xs font-medium text-text-muted uppercase tracking-wide"},_={class:"mt-1 flex items-baseline gap-1"},$={class:"text-2xl font-bold text-text-primary"},S={key:0,class:"text-sm text-text-secondary"},L=b({__name:"MetricCard",props:{label:{},value:{},unit:{},trend:{}},setup(e){return(n,t)=>(d(),l("div",C,[u("div",w,c(e.label),1),u("div",_,[u("span",$,c(e.value),1),e.unit?(d(),l("span",S,c(e.unit),1)):g("",!0)]),e.trend!==void 0?(d(),l("div",{key:0,class:h(["mt-1 text-xs",e.trend>=0?"text-success":"text-error"])},c(e.trend>=0?"↑":"↓")+" "+c(Math.abs(e.trend).toFixed(1))+"% ",3)):g("",!0)]))}}),T=["title"],B={key:0,class:"relative mr-1.5 flex h-2 w-2"},P=b({__name:"StatusBadge",props:{status:{},detail:{}},setup(e){const n=e,t=f(()=>["streaming","executing","running"].includes(n.status)),s=f(()=>({idle:"bg-surface-overlay text-text-muted",streaming:"bg-accent/20 text-accent",completed:"bg-success/20 text-success",error:"bg-error/20 text-error",cancelled:"bg-warning/20 text-warning",pending:"bg-surface-overlay text-text-muted",executing:"bg-accent/20 text-accent",failed:"bg-error/20 text-error",running:"bg-accent/20 text-accent",partial:"bg-warning/20 text-warning"})[n.status]??"bg-surface-overlay text-text-muted");return(a,o)=>(d(),l("span",{class:h(["relative inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",s.value]),title:e.detail},[t.value?(d(),l("span",B,[...o[0]||(o[0]=[u("span",{class:"absolute inline-flex h-full w-full rounded-full bg-current opacity-75",style:{animation:"ripple 1.5s ease-out infinite"}},null,-1),u("span",{class:"relative inline-flex h-2 w-2 rounded-full bg-current"},null,-1)])])):g("",!0),M(" "+c(e.status),1)],10,T))}});export{P as _,F as a,L as b,x as c,z as l,E as n,D as s,V as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as u}from"./format-BqVZ9rwM.js";import{a as x,e as s,f as n,t,h as v,u as i,i as m,F as b,j as k,k as f,g as h,c as d,b as l}from"./index-BqB3FY2M.js";const w={class:"space-y-1.5"},B={key:0,class:"flex items-center justify-between text-xs"},p={class:"text-text-secondary"},C={class:"text-text-muted"},S={class:"ml-1"},$={key:0,class:"flex h-full"},j=["title"],M={key:1,class:"flex items-center justify-between text-[10px] text-text-muted"},F=x({__name:"StorageGauge",props:{used:{},total:{},label:{},animating:{type:Boolean,default:!1},segments:{},compact:{type:Boolean,default:!1}},setup(e){const a=e,o=d(()=>a.total<=0?0:Math.min(Math.round(a.used/a.total*100),100)),y=d(()=>o.value>85?"bg-error":o.value>60?"bg-warning":"bg-success"),g=d(()=>!a.segments||a.total<=0?[]:a.segments.map(c=>({...c,width:Math.max(c.bytes/a.total*100,.5)})));return(c,N)=>(l(),s("div",w,[e.compact?m("",!0):(l(),s("div",B,[n("span",p,t(e.label??"Storage"),1),n("span",C,[v(t(i(u)(e.used))+" / "+t(i(u)(e.total))+" ",1),n("span",S,"("+t(o.value)+"%)",1)])])),n("div",{class:h(["h-2 rounded-full bg-surface-overlay overflow-hidden",{"animate-storage-pulse":e.animating}])},[e.segments&&e.segments.length>0?(l(),s("div",$,[(l(!0),s(b,null,k(g.value,r=>(l(),s("div",{key:r.name,class:"h-full transition-all duration-500 first:rounded-l-full last:rounded-r-full",style:f({width:`${r.width}%`,backgroundColor:r.color}),title:`${r.name}: ${i(u)(r.bytes)}`},null,12,j))),128))])):(l(),s("div",{key:1,class:h(["h-full rounded-full transition-all duration-500",y.value]),style:f({width:`${o.value}%`})},null,6))],2),e.compact?(l(),s("div",M,[n("span",null,t(e.label),1),n("span",null,t(i(u)(e.used))+" / "+t(i(u)(e.total))+" ("+t(o.value)+"%)",1)])):m("",!0)]))}});export{F as _};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BqB3FY2M.js","assets/index-C0qd34Zo.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as L,b as r,e as o,f as t,t as a,u as l,i as x,F as y,j as b,k as A,c as w,z as j,A as G,L as H,x as q,h as p,g as S,m as V,r as k,o as E,_ as M}from"./index-BqB3FY2M.js";import{u as Q}from"./metrics-store-HzdMIV8O.js";import{b as c}from"./format-BqVZ9rwM.js";import{u as J}from"./storage-store-B1XevdC4.js";import{_ as K}from"./StorageGauge.vue_vue_type_style_index_0_lang-hO4dId5t.js";async function W(){try{const m=await fetch("/__system-info");return m.ok?await m.json():null}catch{return null}}const X={class:"rounded-lg border border-border-default bg-surface p-3 space-y-2.5"},Y={class:"flex items-center justify-between"},Z={class:"flex items-center gap-2"},tt={class:"text-sm"},et={class:"text-xs font-medium text-text-primary"},st={class:"flex items-center gap-2"},at={class:"text-[10px] font-medium text-text-secondary"},rt={key:0,class:"h-1.5 rounded-full bg-surface-overlay overflow-hidden"},ot={class:"flex h-full"},lt=["title"],nt={key:1,class:"h-1.5 rounded-full bg-surface-overlay"},dt={class:"flex items-center justify-between text-[10px] text-text-muted"},it={key:2,class:"space-y-1"},ut={class:"flex-1 text-text-muted"},xt={class:"text-text-muted"},ct={class:"text-text-secondary w-14 text-right"},mt={key:3,class:"text-[10px] text-text-muted italic"},pt=L({__name:"StorageBreakdownCard",props:{database:{}},emits:["clear"],setup(m,{emit:$}){const _=m,u=$,f=["#8b5cf6","#06b6d4","#f59e0b","#10b981","#f43f5e"],D=w(()=>_.database.stores.filter(g=>g.bytes>0).map((g,v)=>({name:g.name,bytes:g.bytes,color:f[v%f.length]})));return(g,v)=>(r(),o("div",X,[t("div",Y,[t("div",Z,[t("span",tt,a(m.database.icon),1),t("span",et,a(m.database.label),1)]),t("div",st,[t("span",at,a(l(c)(m.database.totalBytes)),1),m.database.totalBytes>0?(r(),o("button",{key:0,class:"rounded px-1.5 py-0.5 text-[9px] text-text-muted hover:text-error hover:bg-error/10 transition-colors",title:"Clear all data",onClick:v[0]||(v[0]=i=>u("clear",m.database.id))}," Clear ")):x("",!0)])]),m.database.totalBytes>0?(r(),o("div",rt,[t("div",ot,[(r(!0),o(y,null,b(D.value,i=>(r(),o("div",{key:i.name,class:"h-full transition-all duration-500 first:rounded-l-full last:rounded-r-full",style:A({width:`${i.bytes/m.database.totalBytes*100}%`,backgroundColor:i.color}),title:`${i.name}: ${l(c)(i.bytes)}`},null,12,lt))),128))])])):(r(),o("div",nt)),t("div",dt,[t("span",null,a(m.database.recordCount.toLocaleString())+" records",1),t("span",null,a(m.database.type==="indexeddb"?"IndexedDB":"External"),1)]),m.database.stores.some(i=>i.count>0)?(r(),o("div",it,[(r(!0),o(y,null,b(m.database.stores.filter(i=>i.count>0),(i,n)=>(r(),o("div",{key:i.name,class:"flex items-center gap-2 text-[10px]"},[t("span",{class:"h-2 w-2 shrink-0 rounded-full",style:A({backgroundColor:f[n%f.length]})},null,4),t("span",ut,a(i.name),1),t("span",xt,a(i.count),1),t("span",ct,a(l(c)(i.bytes)),1)]))),128))])):(r(),o("p",mt,"Empty"))]))}}),yt={class:"max-w-4xl space-y-6"},ft={key:0,class:"flex flex-col items-center justify-center py-16 gap-4"},vt={key:1,class:"rounded-lg border border-border-default bg-surface-raised p-4 text-xs text-text-muted"},gt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},_t={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},bt={class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},ht={class:"text-text-primary"},wt={class:"text-text-primary"},Bt={class:"text-text-primary"},kt={class:"text-text-primary"},St={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},Mt={class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},$t={class:"text-text-primary"},Ct={class:"text-text-primary"},zt={class:"text-text-primary"},At={class:"text-text-primary"},Dt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Pt={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},Rt={class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},Tt={class:"text-text-primary"},It={class:"text-text-primary"},Vt={class:"text-text-primary"},Et={class:"text-text-primary"},Lt={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},Ot={class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},Ft={class:"text-text-primary"},Ut={class:"text-text-primary"},Nt={class:"text-text-primary"},jt={class:"h-2 rounded-full bg-surface-overlay overflow-hidden"},Gt={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},Ht={class:"text-text-muted"},qt={class:"text-text-primary"},Qt={class:"text-text-primary"},Jt={class:"text-text-primary"},Kt={key:1,class:"col-span-2 border-b border-border-default/50 my-1"},Wt={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},Xt={class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},Yt={class:"text-text-primary"},Zt={class:"text-text-primary"},te={class:"text-text-primary"},ee={class:"text-text-primary"},se={class:"h-2 rounded-full bg-surface-overlay overflow-hidden"},ae={key:0,class:"border-b border-border-default/50"},re={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-4"},oe={class:"flex items-center justify-between"},le={class:"flex items-center gap-2"},ne={key:2,class:"text-[10px] text-text-muted"},de={key:1,class:"grid grid-cols-1 md:grid-cols-2 gap-3"},ie={key:2,class:"text-[9px] text-text-muted"},ue={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},xe={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},ce={class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},me={class:"flex items-center gap-1.5"},pe={class:"text-text-primary"},ye={class:"text-text-primary"},fe={class:"text-text-primary"},ve={class:"text-text-primary"},ge={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},_e={key:0,class:"text-xs text-text-muted py-2"},be={key:1,class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},he={class:"text-text-primary font-medium"},we={class:"text-accent font-medium"},Be={class:"text-text-primary font-medium"},ke={class:"text-text-primary font-medium"},Se={key:2,class:"flex flex-wrap gap-1.5 pt-1"},Me={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},$e={key:0,class:"text-xs text-text-muted py-2"},Ce={key:1,class:"space-y-2"},ze={class:"flex gap-4 text-xs text-text-secondary"},Ae={key:0},De={class:"text-accent font-medium"},Pe={key:1},Re={class:"text-text-primary font-medium"},Te={class:"text-text-primary font-medium"},Ie={class:"flex-1 min-w-0"},Ve={class:"text-sm font-medium text-text-primary truncate"},Ee={class:"text-xs text-text-muted"},Le={class:"text-right text-xs space-y-0.5 shrink-0"},Oe={key:0},Fe={class:"ml-1.5 text-accent font-medium"},Ue={key:1},Ne={class:"ml-1.5 text-text-primary font-medium"},je={class:"ml-1.5 text-text-secondary"},Ge=["title"],He={class:"rounded-lg border border-border-default bg-surface-raised p-4 space-y-3"},qe={key:0,class:"text-xs text-text-muted py-2"},Qe={key:1,class:"overflow-x-auto"},Je={class:"w-full text-xs"},Ke={class:"py-1.5 pr-4 text-text-primary font-medium"},We={class:"py-1.5 pr-4 text-text-secondary"},Xe={class:"py-1.5 pr-4 text-text-secondary"},Ye={class:"py-1.5 pr-4 text-text-secondary"},Ze={class:"py-1.5 text-right text-text-secondary"},os=L({__name:"SystemPage",setup(m){const $=Q(),_=j(),u=J(),f=k(null);async function D(d){if(f.value===d){const e={rag:()=>M(()=>import("./vector-db-ChAzHl5A.js"),[]).then(s=>s.vectorDB.clear()),conversations:()=>M(()=>import("./index-BqB3FY2M.js").then(s=>s.aj),__vite__mapDeps([0,1])).then(s=>s.conversationDB.clear()),benchmarks:()=>M(()=>import("./benchmark-db-D8D5Wf9h.js"),[]).then(s=>s.benchmarkDB.clear()),"message-memory":()=>M(()=>import("./message-memory-db-C3Ifhs2B.js"),[]).then(s=>s.messageMemoryDB.clear()),"canvas-ai":()=>M(()=>import("./canvas-ai-db-BolM-_G7.js"),[]).then(s=>s.canvasAiDB.clear())};try{await e[d]?.(),await u.refresh()}catch(s){console.error(`Failed to clear database ${d}:`,s)}f.value=null}else f.value=d,setTimeout(()=>{f.value===d&&(f.value=null)},3e3)}const g=k(null),v=k(!1),i=k([]),n=k(null),C=k(!0),O=w(()=>_.models.reduce((d,e)=>d+e.size,0)),P=w(()=>i.value.reduce((d,e)=>d+e.size_vram,0)),R=w(()=>i.value.reduce((d,e)=>d+(e.size-e.size_vram),0)),h=w(()=>$.aggregate),F=w(()=>{if(!n.value)return"";const d=n.value.cpu.maxClockMhz;return d>=1e3?`${(d/1e3).toFixed(2)} GHz`:`${d} MHz`}),z=w(()=>{if(!n.value)return 0;const{totalBytes:d,freeBytes:e}=n.value.memory;return d>0?Math.round((d-e)/d*100):0});let T=null;async function U(){try{g.value=await E.version(),v.value=!0}catch{v.value=!1,g.value=null}try{i.value=await E.ps()}catch{i.value=[]}}async function I(){await Promise.all([U(),W().then(d=>{d&&(n.value=d)}),u.refreshIfStale(3e4)])}function N(d){const e=new Date(d).getTime()-Date.now();if(e<=0)return"expiring...";const s=Math.floor(e/6e4);return s<1?"< 1 min":s<60?`${s} min`:`${Math.floor(s/60)}h ${s%60}m`}return G(async()=>{C.value=!0,await I(),C.value=!1,_.models.length===0&&await _.fetchModels(),$.recalculateAggregate(),T=setInterval(I,5e3)}),H(()=>{T&&clearInterval(T)}),(d,e)=>(r(),o("div",yt,[t("div",{class:"flex items-center justify-between"},[e[1]||(e[1]=t("div",null,[t("h2",{class:"text-lg font-semibold text-text-primary"},"My System"),t("p",{class:"text-xs text-text-muted mt-0.5"},"Hardware, runtime, and inference overview")],-1)),t("button",{class:"rounded-lg bg-surface-overlay px-3 py-1.5 text-xs text-text-secondary hover:bg-border-default transition-colors",onClick:I}," Refresh ")]),C.value&&!n.value?(r(),o("div",ft,[...e[2]||(e[2]=[q('<svg class="h-10 w-10 animate-spin text-accent" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle class="opacity-20" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="3"></circle><path class="opacity-80" d="M12 2a10 10 0 0 1 10 10" stroke="currentColor" stroke-width="3" stroke-linecap="round"></path></svg><p class="text-sm text-text-secondary">Detecting hardware...</p><p class="text-[10px] text-text-muted">Querying CPU, memory, GPU, and storage</p>',3)])])):x("",!0),!C.value&&!n.value?(r(),o("div",vt,[...e[3]||(e[3]=[p(" Hardware detection unavailable. Please restart the dev server (",-1),t("code",{class:"text-text-secondary"},"npm run dev",-1),p(") to enable the system info plugin. ",-1)])])):x("",!0),n.value?(r(),o(y,{key:2},[t("div",gt,[t("div",_t,[e[8]||(e[8]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"🖥"),p(" Operating System ")],-1)),t("div",bt,[e[4]||(e[4]=t("span",{class:"text-text-muted"},"OS",-1)),t("span",ht,a(n.value.os.name),1),e[5]||(e[5]=t("span",{class:"text-text-muted"},"Version",-1)),t("span",wt,a(n.value.os.version),1),e[6]||(e[6]=t("span",{class:"text-text-muted"},"Build",-1)),t("span",Bt,a(n.value.os.build||"—"),1),e[7]||(e[7]=t("span",{class:"text-text-muted"},"Architecture",-1)),t("span",kt,a(n.value.os.arch),1)])]),t("div",St,[e[13]||(e[13]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"💻"),p(" Device ")],-1)),t("div",Mt,[e[10]||(e[10]=t("span",{class:"text-text-muted"},"Name",-1)),t("span",$t,a(n.value.device.name),1),e[11]||(e[11]=t("span",{class:"text-text-muted"},"Manufacturer",-1)),t("span",Ct,a(n.value.device.manufacturer||"—"),1),e[12]||(e[12]=t("span",{class:"text-text-muted"},"Model",-1)),t("span",zt,a(n.value.device.model||"—"),1),n.value.device.family?(r(),o(y,{key:0},[e[9]||(e[9]=t("span",{class:"text-text-muted"},"Family",-1)),t("span",At,a(n.value.device.family),1)],64)):x("",!0)])])]),t("div",Dt,[t("div",Pt,[e[18]||(e[18]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"⚙"),p(" Processor ")],-1)),t("div",Rt,[e[14]||(e[14]=t("span",{class:"text-text-muted"},"CPU",-1)),t("span",Tt,a(n.value.cpu.name),1),e[15]||(e[15]=t("span",{class:"text-text-muted"},"Physical Cores",-1)),t("span",It,a(n.value.cpu.cores),1),e[16]||(e[16]=t("span",{class:"text-text-muted"},"Logical Processors",-1)),t("span",Vt,a(n.value.cpu.logicalProcessors),1),e[17]||(e[17]=t("span",{class:"text-text-muted"},"Max Clock",-1)),t("span",Et,a(F.value),1)])]),t("div",Lt,[e[22]||(e[22]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"🧠"),p(" Memory ")],-1)),t("div",Ot,[e[19]||(e[19]=t("span",{class:"text-text-muted"},"Total RAM",-1)),t("span",Ft,a(l(c)(n.value.memory.totalBytes)),1),e[20]||(e[20]=t("span",{class:"text-text-muted"},"Available",-1)),t("span",Ut,a(l(c)(n.value.memory.freeBytes)),1),e[21]||(e[21]=t("span",{class:"text-text-muted"},"In Use",-1)),t("span",Nt,a(l(c)(n.value.memory.totalBytes-n.value.memory.freeBytes))+" ("+a(z.value)+"%)",1)]),t("div",jt,[t("div",{class:S(["h-full rounded-full transition-all duration-500",z.value>85?"bg-error":z.value>60?"bg-warning":"bg-success"]),style:A({width:`${z.value}%`})},null,6)])])]),t("div",Gt,[e[25]||(e[25]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"🎮"),p(" Graphics ")],-1)),(r(!0),o(y,null,b(n.value.gpu,(s,B)=>(r(),o("div",{key:B,class:"grid grid-cols-[auto_1fr] gap-y-2 gap-x-4 text-xs"},[t("span",Ht,"GPU "+a(n.value.gpu.length>1?B+1:""),1),t("span",qt,a(s.name),1),e[24]||(e[24]=t("span",{class:"text-text-muted"},"Adapter RAM",-1)),t("span",Qt,a(s.adapterRamBytes>0?l(c)(s.adapterRamBytes):"Shared / Not reported"),1),s.driverVersion?(r(),o(y,{key:0},[e[23]||(e[23]=t("span",{class:"text-text-muted"},"Driver",-1)),t("span",Jt,a(s.driverVersion),1)],64)):x("",!0),B<n.value.gpu.length-1?(r(),o("div",Kt)):x("",!0)]))),128))]),t("div",Wt,[e[30]||(e[30]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"💾"),p(" Storage ")],-1)),(r(!0),o(y,null,b(n.value.storage,(s,B)=>(r(),o("div",{key:B,class:"space-y-2"},[t("div",Xt,[e[26]||(e[26]=t("span",{class:"text-text-muted"},"Drive",-1)),t("span",Yt,a(s.drive),1),e[27]||(e[27]=t("span",{class:"text-text-muted"},"Total",-1)),t("span",Zt,a(l(c)(s.totalBytes)),1),e[28]||(e[28]=t("span",{class:"text-text-muted"},"Free",-1)),t("span",te,a(l(c)(s.freeBytes)),1),e[29]||(e[29]=t("span",{class:"text-text-muted"},"Used",-1)),t("span",ee,a(l(c)(s.totalBytes-s.freeBytes))+" ("+a(s.totalBytes>0?Math.round((s.totalBytes-s.freeBytes)/s.totalBytes*100):0)+"%) ",1)]),t("div",se,[t("div",{class:S(["h-full rounded-full transition-all duration-500",s.totalBytes>0&&(s.totalBytes-s.freeBytes)/s.totalBytes>.85?"bg-error":(s.totalBytes-s.freeBytes)/s.totalBytes>.6?"bg-warning":"bg-success"]),style:A({width:`${s.totalBytes>0?(s.totalBytes-s.freeBytes)/s.totalBytes*100:0}%`})},null,6)]),B<n.value.storage.length-1?(r(),o("div",ae)):x("",!0)]))),128))])],64)):x("",!0),t("div",re,[t("div",oe,[e[31]||(e[31]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"📀"),p(" Browser Storage ")],-1)),t("div",le,[l(u).origin?(r(),o("span",{key:0,class:S(["rounded-full px-2 py-0.5 text-[9px]",l(u).origin.persisted?"bg-success/10 text-success":"bg-warning/10 text-warning"])},a(l(u).origin.persisted?"Persistent":"Best-effort"),3)):x("",!0),l(u).loading?(r(),o("span",ne,"Scanning...")):(r(),o("button",{key:1,class:"text-[10px] text-text-muted hover:text-text-primary transition-colors",onClick:e[0]||(e[0]=s=>l(u).refresh())}," Refresh "))])]),l(u).origin?(r(),V(K,{key:0,used:l(u).origin.usage,total:l(u).origin.quota,label:"IndexedDB Quota"},null,8,["used","total"])):x("",!0),l(u).databases.length>0?(r(),o("div",de,[(r(!0),o(y,null,b(l(u).databases,s=>(r(),V(pt,{key:s.id,database:s,onClear:D},null,8,["database"]))),128))])):x("",!0),l(u).databases.length>0?(r(),o("p",ie,a(l(u).totalRecordCount.toLocaleString())+" total records across "+a(l(u).databases.length)+" databases ",1)):x("",!0)]),t("div",ue,[t("div",xe,[e[37]||(e[37]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"⚡"),p(" Ollama Runtime ")],-1)),t("div",ce,[e[32]||(e[32]=t("span",{class:"text-text-muted"},"Status",-1)),t("span",me,[t("span",{class:S(["inline-block h-2 w-2 rounded-full",v.value?"bg-success":"bg-error"])},null,2),t("span",{class:S(v.value?"text-success":"text-error")},a(v.value?"Connected":"Disconnected"),3)]),e[33]||(e[33]=t("span",{class:"text-text-muted"},"Version",-1)),t("span",pe,a(g.value??"—"),1),e[34]||(e[34]=t("span",{class:"text-text-muted"},"Installed Models",-1)),t("span",ye,a(l(_).models.length),1),e[35]||(e[35]=t("span",{class:"text-text-muted"},"Total Model Storage",-1)),t("span",fe,a(l(c)(O.value)),1),e[36]||(e[36]=t("span",{class:"text-text-muted"},"Models Loaded",-1)),t("span",ve,a(i.value.length),1)])]),t("div",ge,[e[43]||(e[43]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"📊"),p(" Inference "),t("span",{class:"text-[10px] text-text-muted font-normal"},"(this session)")],-1)),h.value.totalSessions===0?(r(),o("div",_e," No inference sessions yet. ")):(r(),o("div",be,[e[38]||(e[38]=t("span",{class:"text-text-muted"},"Sessions",-1)),t("span",he,a(h.value.totalSessions),1),e[39]||(e[39]=t("span",{class:"text-text-muted"},"Avg Speed",-1)),t("span",we,a(h.value.avgTps.toFixed(1))+" tok/s",1),e[40]||(e[40]=t("span",{class:"text-text-muted"},"Tokens Generated",-1)),t("span",Be,a(h.value.totalTokensGenerated.toLocaleString()),1),e[41]||(e[41]=t("span",{class:"text-text-muted"},"Avg TTFT",-1)),t("span",ke,a(h.value.avgTtftMs.toFixed(0))+" ms",1)])),h.value.modelsUsed.length>0?(r(),o("div",Se,[e[42]||(e[42]=t("span",{class:"text-[10px] text-text-muted mr-1"},"Models used:",-1)),(r(!0),o(y,null,b(h.value.modelsUsed,s=>(r(),o("span",{key:s,class:"rounded-full bg-surface-overlay px-2 py-0.5 text-[10px] text-text-secondary"},a(s),1))),128))])):x("",!0)])]),t("div",Me,[e[50]||(e[50]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"⚡"),p(" Active Models ")],-1)),i.value.length===0?(r(),o("div",$e," No models currently loaded in memory. Send a message to load one. ")):(r(),o("div",Ce,[t("div",ze,[P.value>0?(r(),o("span",Ae,[e[44]||(e[44]=p("VRAM: ",-1)),t("span",De,a(l(c)(P.value)),1)])):x("",!0),R.value>0?(r(),o("span",Pe,[e[45]||(e[45]=p("RAM: ",-1)),t("span",Re,a(l(c)(R.value)),1)])):x("",!0),t("span",null,[e[46]||(e[46]=p("Total: ",-1)),t("span",Te,a(l(c)(P.value+R.value)),1)])]),(r(!0),o(y,null,b(i.value,s=>(r(),o("div",{key:s.digest,class:"flex items-center gap-4 rounded-lg bg-surface px-4 py-3 border border-border-default"},[t("div",Ie,[t("p",Ve,a(s.name),1),t("p",Ee,a(s.details.parameter_size)+" · "+a(s.details.quantization_level)+" · "+a(s.details.family),1)]),t("div",Le,[s.size_vram>0?(r(),o("p",Oe,[e[47]||(e[47]=t("span",{class:"text-text-muted"},"VRAM",-1)),t("span",Fe,a(l(c)(s.size_vram)),1)])):x("",!0),s.size-s.size_vram>0?(r(),o("p",Ue,[e[48]||(e[48]=t("span",{class:"text-text-muted"},"RAM",-1)),t("span",Ne,a(l(c)(s.size-s.size_vram)),1)])):x("",!0),t("p",null,[e[49]||(e[49]=t("span",{class:"text-text-muted"},"Ctx",-1)),t("span",je,a(s.context_length.toLocaleString()),1)])]),t("div",{class:"text-xs text-text-muted shrink-0 w-16 text-right",title:s.expires_at},a(N(s.expires_at)),9,Ge)]))),128))]))]),t("div",He,[e[52]||(e[52]=t("h3",{class:"text-sm font-medium text-text-primary flex items-center gap-2"},[t("span",{class:"text-base"},"📦"),p(" Installed Models ")],-1)),l(_).models.length===0?(r(),o("div",qe," No models installed. ")):(r(),o("div",Qe,[t("table",Je,[e[51]||(e[51]=t("thead",null,[t("tr",{class:"border-b border-border-default text-text-muted"},[t("th",{class:"text-left py-1.5 pr-4 font-medium"},"Model"),t("th",{class:"text-left py-1.5 pr-4 font-medium"},"Family"),t("th",{class:"text-left py-1.5 pr-4 font-medium"},"Parameters"),t("th",{class:"text-left py-1.5 pr-4 font-medium"},"Quantization"),t("th",{class:"text-right py-1.5 font-medium"},"Size")])],-1)),t("tbody",null,[(r(!0),o(y,null,b(l(_).models,s=>(r(),o("tr",{key:s.name,class:"border-b border-border-default/50"},[t("td",Ke,a(s.name),1),t("td",We,a(s.details.family),1),t("td",Xe,a(s.details.parameter_size),1),t("td",Ye,a(s.details.quantization_level),1),t("td",Ze,a(l(c)(s.size)),1)]))),128))])])]))])]))}});export{os as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{u as p}from"./toolcall-store-BumXt8DE.js";import{u as m}from"./StatusBadge.vue_vue_type_script_setup_true_lang-f9O-U2FX.js";import{n as a,o as d}from"./index-BqB3FY2M.js";import{a as y}from"./stream-handler-29OjEvbo.js";function u(n){if(!n)return 0;const o=n.split(/\s+/).filter(Boolean).length;return Math.ceil(o*1.3)}function g(n,o){const i=b(o),t=u(o);for(const r of i)r.tokenCount=u(r.content),r.percentage=t>0?r.tokenCount/t*100:0;return{sessionId:n,rawPrompt:o,totalTokenCount:t,sections:i}}function S(n,o){const i=[];let t=0;for(const e of o){const c={system:"system",user:"user",assistant:"context",tool:"tools"},l={id:a(),type:c[e.role]??"unknown",label:`${e.role} message`,content:e.content,startOffset:t,endOffset:t+e.content.length,tokenCount:u(e.content),percentage:0};i.push(l),t+=e.content.length+1}const r=i.reduce((e,c)=>e+c.tokenCount,0);for(const e of i)e.percentage=r>0?e.tokenCount/r*100:0;const s=o.map(e=>`[${e.role}] ${e.content}`).join(`
|
|
2
|
-
|
|
3
|
-
`);return{sessionId:n,rawPrompt:s,totalTokenCount:r,sections:i,messages:o.map(e=>({role:e.role,content:e.content,tokenCount:u(e.content)}))}}function b(n){const o=[],i=[{regex:/^#{1,3}\s*system\b/im,type:"system",label:"System Instructions"},{regex:/^#{1,3}\s*(?:user|query|question)\b/im,type:"user",label:"User Query"},{regex:/^#{1,3}\s*(?:context|background)\b/im,type:"context",label:"Context"},{regex:/^#{1,3}\s*(?:tools?|functions?)\b/im,type:"tools",label:"Tool Definitions"},{regex:/^#{1,3}\s*(?:memory|history|conversation)\b/im,type:"memory",label:"Memory / History"},{regex:/^#{1,3}\s*(?:examples?|few[- ]shot)\b/im,type:"examples",label:"Examples"},{regex:/^#{1,3}\s*(?:instructions?|rules?|guidelines?)\b/im,type:"instructions",label:"Instructions"}],t=[];for(const{regex:s,type:e,label:c}of i){const l=n.match(s);l?.index!==void 0&&t.push({index:l.index,type:e,label:c})}if(t.length===0)return o.push({id:a(),type:"user",label:"Prompt",content:n,startOffset:0,endOffset:n.length,tokenCount:0,percentage:100}),o;t.sort((s,e)=>s.index-e.index);for(let s=0;s<t.length;s++){const e=t[s],c=t[s+1],l=c?c.index:n.length,f=n.slice(e.index,l).trim();o.push({id:a(),type:e.type,label:e.label,content:f,startOffset:e.index,endOffset:l,tokenCount:0,percentage:0})}const r=t[0];if(r&&r.index>0){const s=n.slice(0,r.index).trim();s&&o.unshift({id:a(),type:"unknown",label:"Preamble",content:s,startOffset:0,endOffset:r.index,tokenCount:0,percentage:0})}return o}async function O(n){const o=p(),i=m(),t=o.createSession({mode:"generate",model:n.model,prompt:n.prompt,options:n.options});o.setActiveSession(t);const r=g(t,n.prompt);i.setAnatomy(t,r);const s=new AbortController;return d.streamGenerate({model:n.model,prompt:n.prompt,system:n.system,options:n.options},s.signal).then(e=>y(t,e,s.signal)).catch(e=>{s.signal.aborted||o.setSessionError(t,e instanceof Error?e.message:"Generation failed")}),{sessionId:t,abort:()=>{s.abort(),o.cancelSession(t)}}}export{S as a,O as s};
|