hermes-web-ui 0.6.0-beta.2 → 0.6.0

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.
Files changed (36) hide show
  1. package/dist/client/assets/js/{ChannelsView-9bNGmPOL.js → ChannelsView-CvORJMzg.js} +1 -1
  2. package/dist/client/assets/js/{ChatView-CrMN1j5u.js → ChatView-DihfBNUf.js} +1 -1
  3. package/dist/client/assets/js/{FileRenameModal-C4oWOgjw.js → FileRenameModal-DN-U6DZT.js} +1 -1
  4. package/dist/client/assets/js/{FilesView-pDP8mSTZ.js → FilesView-BxW5kOlO.js} +1 -1
  5. package/dist/client/assets/js/{GroupChatView-BV3Dxn4i.js → GroupChatView-Cdyg0EOz.js} +1 -1
  6. package/dist/client/assets/js/{HistoryMessageList-CHk-rOIr.js → HistoryMessageList-S77rD1zj.js} +1 -1
  7. package/dist/client/assets/js/{HistoryView-RE-m9Yx6.js → HistoryView-DM7qDtZb.js} +1 -1
  8. package/dist/client/assets/js/{JobsView-BkXCTE4b.js → JobsView-BqylpVBm.js} +1 -1
  9. package/dist/client/assets/js/{KanbanView-Bwlm-lFI.js → KanbanView-C8uXrTRt.js} +1 -1
  10. package/dist/client/assets/js/{LoginView-Cil7q9fA.js → LoginView-ISxozFfh.js} +1 -1
  11. package/dist/client/assets/js/{LogsView-BRXZpNpB.js → LogsView-CtCOjFb5.js} +1 -1
  12. package/dist/client/assets/js/{MarkdownRenderer-BbsOzYq-.js → MarkdownRenderer-BJbqsrMI.js} +1 -1
  13. package/dist/client/assets/js/{MemoryView-BeY8xybk.js → MemoryView-Bc-a9i1U.js} +1 -1
  14. package/dist/client/assets/js/{MessageItem-DWHvbLzg.js → MessageItem-DOA2nFJg.js} +1 -1
  15. package/dist/client/assets/js/{ModelsView-C33B9WXE.js → ModelsView-CmcXLgHA.js} +1 -1
  16. package/dist/client/assets/js/{OutlinePanel-CxJshR71.js → OutlinePanel-D2LVzKPs.js} +1 -1
  17. package/dist/client/assets/js/{PerformanceView-Bcs2X6p5.js → PerformanceView-BIMfq0BU.js} +1 -1
  18. package/dist/client/assets/js/{PluginsView-ClPgLZw1.js → PluginsView-DfSS_RTl.js} +1 -1
  19. package/dist/client/assets/js/{ProfilesView-C4kzKN1z.js → ProfilesView-CVh7LT-n.js} +1 -1
  20. package/dist/client/assets/js/{SettingRow-BAmGrtcn.js → SettingRow-Dt5XWkpQ.js} +1 -1
  21. package/dist/client/assets/js/{SettingsView-BuKFsiAz.js → SettingsView-hA4C1YcG.js} +1 -1
  22. package/dist/client/assets/js/{SkillsUsageView-CRcgWp1p.js → SkillsUsageView-_ToBXkb1.js} +1 -1
  23. package/dist/client/assets/js/{SkillsView-B2j4jJMz.js → SkillsView-DMUkyn3M.js} +1 -1
  24. package/dist/client/assets/js/{TerminalView-0vvlfSha.js → TerminalView-CS_MwrJD.js} +1 -1
  25. package/dist/client/assets/js/{UsageView-3v8bYw4Z.js → UsageView-D6o-9cR-.js} +1 -1
  26. package/dist/client/assets/js/{_plugin-vue_export-helper-B8gz9Iqn.js → _plugin-vue_export-helper-CHoatqkO.js} +2 -2
  27. package/dist/client/assets/js/{index-Cuk9R8hy.js → index-DpU5R9KV.js} +1 -1
  28. package/dist/client/assets/js/{models-Of46_lGf.js → models-CDdUhb_e.js} +1 -1
  29. package/dist/client/assets/js/profiles-CyjgPK1f.js +1 -0
  30. package/dist/client/assets/js/{session-browser-prefs-IGK7Xpdn.js → session-browser-prefs-C6G-jnbR.js} +1 -1
  31. package/dist/client/assets/js/{skills-BQ2jtPxK.js → skills-vuknhTFJ.js} +1 -1
  32. package/dist/client/index.html +3 -3
  33. package/dist/server/index.js +2 -2
  34. package/dist/server/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/dist/client/assets/js/profiles-DiEn61KW.js +0 -1
@@ -1,4 +1,4 @@
1
- import{n as oe}from"./rolldown-runtime-BKwlnUi0.js";import{$ as jt,Bt as _,Ht as f,Pt as L,Q as x,W as Wt,Z as Yt,at as l,bt as ne,ct as _e,gt as Xt,ht as we,it as g,lt as qt,nt as i,rt as M,t as Gt,tt as r,vt as o,wt as Qt,y as Zt,zt as p}from"./ui-vendor-BMwF7QXa.js";import{n as es,r as ts}from"./vue-vendor-kBYBtqCg.js";import{n as ss,t as as}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{r as ns,t as is}from"./profiles-DiEn61KW.js";import{B as os,E as Te,O as ls,V as rs,_ as us,b as cs,g as ds,h as ms,k as gs,m as vs,v as hs,y as ps}from"./index-Cuk9R8hy.js";import{n as fs,t as ys}from"./clipboard-4x9B6X3a.js";import{a as ks,i as _s,n as ws,o as Ts,r as Se,t as A}from"./MarkdownRenderer-BbsOzYq-.js";import{a as Ss,i as bs,n as Cs,o as xs,r as be,s as Ms,t as Ce}from"./ttsHelpers-CEvJOgh2.js";var xe,Me,Ae,Pe,Be,Ie,$e,De,Ue,Ne,Oe,Ee,Fe,Ve,Re,Le,He,Ke,Je,ze,je,We,Ye,Xe,qe,Ge,Qe,Ze,et,tt,st,at,nt,it,ot,lt,rt,ut,ct,S,ie,dt,mt,gt,vt,H,pt,ht=oe((()=>{Wt(),es(),Gt(),gs(),fs(),ws(),us(),vs(),is(),ps(),rs(),ks(),xs(),bs(),Cs(),xe=["id"],Me={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-icon"},Ae={class:"tool-name"},Pe={key:2,class:"tool-preview"},Be={key:3,class:"tool-spinner"},Ie={key:4,class:"tool-error-badge"},$e={key:0,class:"tool-detail-section","data-copy-source":"tool-args"},De={class:"tool-detail-label"},Ue=["innerHTML"],Ne={key:1,class:"tool-detail-section","data-copy-source":"tool-result"},Oe={class:"tool-detail-label"},Ee=["innerHTML"],Fe={key:1,class:"msg-body"},Ve={key:0,class:"msg-attachments"},Re=["src","alt","onClick"],Le=["onClick","title"],He={class:"att-name"},Ke={class:"att-size"},Je={class:"thinking-label"},ze={key:0,class:"thinking-meta"},je={class:"thinking-meta"},We={key:0,class:"thinking-body"},Ye={key:0,class:"msg-attachments"},Xe=["src","alt","onClick"],qe=["onClick","title"],Ge={class:"att-name"},Qe={key:6,class:"command-result command-status"},Ze={class:"command-status-grid"},et={class:"command-status-key"},tt={class:"command-status-value"},st={key:7,class:"command-result"},at={key:8,class:"streaming-dots"},nt={class:"message-meta"},it=["title"],ot={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},lt={key:1,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},rt=["title"],ut={class:"message-time"},ct=["src"],S=1e3,ie=200,dt=6,mt=1e3,gt=50,vt=50,H="__truncated__",pt=qt({__name:"MessageItem",props:{message:{},highlight:{type:Boolean},headingIdPrefix:{}},setup(c){const n=c,{t:d}=ts(),k=Zt(),ft=r(()=>n.message.role==="system"),yt=r(()=>n.message.role==="assistant"&&n.message.systemType==="error"),le=r(()=>n.headingIdPrefix||`msg-${n.message.id}`),N=r(()=>n.message.role==="command"||n.message.systemType==="command"),kt=r(()=>n.message.role==="command"&&n.message.systemType==="error"),_t=r(()=>N.value&&n.message.commandAction==="status"),wt=r(()=>{const e=n.message.commandData||{};return[{key:"status",value:e.isWorking?"running":"idle"},{key:"source",value:e.source},{key:"profile",value:e.profile},{key:"model",value:e.model||"-"},{key:"queue",value:e.queueLength??0},{key:"run",value:e.runId||"-"}]});function Tt(e){return!e||typeof e!="object"?"":(e.type==="text"||e.type==="input_text")&&typeof e.text=="string"?e.text:""}function St(e){if(!e||typeof e!="object"||e.type!=="input_image"&&e.type!=="image_url")return null;const t=e.image_url;return typeof t=="string"?t:t&&typeof t=="object"&&typeof t.url=="string"?t.url:null}function bt(e,t){const s=e.match(/^data:image\/([^;,]+)/i),u=s?.[1]==="jpeg"?"jpg":s?.[1]||"png";return`image-${t+1}.${u}`}function Ct(e){const t=e.trim();if(!t)return null;const s=u=>{const h=JSON.parse(u);return Array.isArray(h)&&h.length>0&&"type"in h[0]?h:null};try{return s(t)}catch{if(!t.startsWith("[{'")&&!t.startsWith('[{"'))return null;try{return s(t.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/'/g,'"'))}catch{return null}}}const K=r(()=>Ct(n.message.content||"")),J=r(()=>K.value!==null),re=r(()=>J.value?K.value.map(e=>Tt(e)).filter(Boolean).join(`
1
+ import{n as oe}from"./rolldown-runtime-BKwlnUi0.js";import{$ as jt,Bt as _,Ht as f,Pt as L,Q as x,W as Wt,Z as Yt,at as l,bt as ne,ct as _e,gt as Xt,ht as we,it as g,lt as qt,nt as i,rt as M,t as Gt,tt as r,vt as o,wt as Qt,y as Zt,zt as p}from"./ui-vendor-BMwF7QXa.js";import{n as es,r as ts}from"./vue-vendor-kBYBtqCg.js";import{n as ss,t as as}from"./_plugin-vue_export-helper-CHoatqkO.js";import{r as ns,t as is}from"./profiles-CyjgPK1f.js";import{B as os,E as Te,O as ls,V as rs,_ as us,b as cs,g as ds,h as ms,k as gs,m as vs,v as hs,y as ps}from"./index-DpU5R9KV.js";import{n as fs,t as ys}from"./clipboard-4x9B6X3a.js";import{a as ks,i as _s,n as ws,o as Ts,r as Se,t as A}from"./MarkdownRenderer-BJbqsrMI.js";import{a as Ss,i as bs,n as Cs,o as xs,r as be,s as Ms,t as Ce}from"./ttsHelpers-CEvJOgh2.js";var xe,Me,Ae,Pe,Be,Ie,$e,De,Ue,Ne,Oe,Ee,Fe,Ve,Re,Le,He,Ke,Je,ze,je,We,Ye,Xe,qe,Ge,Qe,Ze,et,tt,st,at,nt,it,ot,lt,rt,ut,ct,S,ie,dt,mt,gt,vt,H,pt,ht=oe((()=>{Wt(),es(),Gt(),gs(),fs(),ws(),us(),vs(),is(),ps(),rs(),ks(),xs(),bs(),Cs(),xe=["id"],Me={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-icon"},Ae={class:"tool-name"},Pe={key:2,class:"tool-preview"},Be={key:3,class:"tool-spinner"},Ie={key:4,class:"tool-error-badge"},$e={key:0,class:"tool-detail-section","data-copy-source":"tool-args"},De={class:"tool-detail-label"},Ue=["innerHTML"],Ne={key:1,class:"tool-detail-section","data-copy-source":"tool-result"},Oe={class:"tool-detail-label"},Ee=["innerHTML"],Fe={key:1,class:"msg-body"},Ve={key:0,class:"msg-attachments"},Re=["src","alt","onClick"],Le=["onClick","title"],He={class:"att-name"},Ke={class:"att-size"},Je={class:"thinking-label"},ze={key:0,class:"thinking-meta"},je={class:"thinking-meta"},We={key:0,class:"thinking-body"},Ye={key:0,class:"msg-attachments"},Xe=["src","alt","onClick"],qe=["onClick","title"],Ge={class:"att-name"},Qe={key:6,class:"command-result command-status"},Ze={class:"command-status-grid"},et={class:"command-status-key"},tt={class:"command-status-value"},st={key:7,class:"command-result"},at={key:8,class:"streaming-dots"},nt={class:"message-meta"},it=["title"],ot={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},lt={key:1,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},rt=["title"],ut={class:"message-time"},ct=["src"],S=1e3,ie=200,dt=6,mt=1e3,gt=50,vt=50,H="__truncated__",pt=qt({__name:"MessageItem",props:{message:{},highlight:{type:Boolean},headingIdPrefix:{}},setup(c){const n=c,{t:d}=ts(),k=Zt(),ft=r(()=>n.message.role==="system"),yt=r(()=>n.message.role==="assistant"&&n.message.systemType==="error"),le=r(()=>n.headingIdPrefix||`msg-${n.message.id}`),N=r(()=>n.message.role==="command"||n.message.systemType==="command"),kt=r(()=>n.message.role==="command"&&n.message.systemType==="error"),_t=r(()=>N.value&&n.message.commandAction==="status"),wt=r(()=>{const e=n.message.commandData||{};return[{key:"status",value:e.isWorking?"running":"idle"},{key:"source",value:e.source},{key:"profile",value:e.profile},{key:"model",value:e.model||"-"},{key:"queue",value:e.queueLength??0},{key:"run",value:e.runId||"-"}]});function Tt(e){return!e||typeof e!="object"?"":(e.type==="text"||e.type==="input_text")&&typeof e.text=="string"?e.text:""}function St(e){if(!e||typeof e!="object"||e.type!=="input_image"&&e.type!=="image_url")return null;const t=e.image_url;return typeof t=="string"?t:t&&typeof t=="object"&&typeof t.url=="string"?t.url:null}function bt(e,t){const s=e.match(/^data:image\/([^;,]+)/i),u=s?.[1]==="jpeg"?"jpg":s?.[1]||"png";return`image-${t+1}.${u}`}function Ct(e){const t=e.trim();if(!t)return null;const s=u=>{const h=JSON.parse(u);return Array.isArray(h)&&h.length>0&&"type"in h[0]?h:null};try{return s(t)}catch{if(!t.startsWith("[{'")&&!t.startsWith('[{"'))return null;try{return s(t.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/'/g,'"'))}catch{return null}}}const K=r(()=>Ct(n.message.content||"")),J=r(()=>K.value!==null),re=r(()=>J.value?K.value.map(e=>Tt(e)).filter(Boolean).join(`
2
2
  `):n.message.content||""),z=r(()=>J.value?K.value.flatMap((e,t)=>{if(e.type==="image")return[{type:"image",name:String(e.name||`image-${t+1}`),path:String(e.path||"")}].filter(u=>u.path);if(e.type==="file")return[{type:"file",name:String(e.name||`file-${t+1}`),path:String(e.path||"")}].filter(u=>u.path);const s=St(e);return s?.startsWith("data:image/")?[{type:"image",name:bt(s,t),url:s}]:[]}):null);function ue(e){return e.url?e.url:e.path?ls(e.path,e.name):""}const $=L(!1),P=L(null),j=ms(),ce=ns(),xt=cs(),m=Ms(),a=Ss(),de=r(()=>j.activeSession?.profile||ce.activeProfileName||"default"),Mt=r(()=>ce.profiles.find(e=>e.name===de.value)?.avatar),W=r(()=>{if(n.message.role==="tool")return null;const e=n.message.content||"";return e.trim()?e:null});async function At(){const e=W.value;if(e){if(await ys(e)){k.success(d("chat.copiedBubble"));return}k.error(d("chat.copyFailed"))}}const w=r(()=>hs(n.message.content||"",{streaming:!!n.message.isStreaming})),me=r(()=>!!(n.message.reasoning&&n.message.reasoning.length>0)),Pt=r(()=>me.value||w.value.hasThinking),Bt=r(()=>{const e=[];return n.message.reasoning&&e.push(n.message.reasoning),e.push(...w.value.segments),w.value.pending&&e.push(w.value.pending),e.join(`
3
3
 
4
4
  `)}),It=r(()=>{let e=ds(w.value);return n.message.reasoning&&(e+=n.message.reasoning.length),e}),ge=r(()=>n.message.isStreaming?!!(w.value.pending!==null||me.value&&!n.message.content):!1),Y=L(null),O=r(()=>ge.value?!0:Y.value!==null?Y.value:!!xt.display.show_reasoning);function $t(){Y.value=!O.value}const ve=L(Date.now());let b=null;function Dt(){const e=j.getThinkingObservation(n.message.id),t=!!(n.message.isStreaming&&e?.startedAt!==void 0&&e.endedAt===void 0);t&&b===null?b=window.setInterval(()=>{ve.value=Date.now()},1e3):!t&&b!==null&&(window.clearInterval(b),b=null)}Qt(Dt),we(()=>{b!==null&&window.clearInterval(b)});const X=r(()=>{const e=j.getThinkingObservation(n.message.id);if(!e?.startedAt)return null;const t=e.startedAt,s=e?.endedAt??(n.message.isStreaming?ve.value:t);return Math.max(0,s-t)});function Ut(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const s=Math.floor(t/60),u=t%60;return u===0?`${s}m`:`${s}m ${u}s`}const Nt=r(()=>new Date(n.message.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}));function he(e){return e.startsWith("image/")}function Ot(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}function Et(e){const t=n.message.content||"";try{const h=JSON.parse(t);if(Array.isArray(h)&&h.length>0&&"type"in h[0]){const T=h.find(D=>D.type==="file"&&D.name===e);if(T&&T.path)return T.path}}catch{}const s=/\[File:\s*([^\]]+)\]\(([^)]+)\)/g;let u;for(;(u=s.exec(t))!==null;)if(u[1].trim()===e.trim())return u[2];return null}function Ft(e){const t=Et(e.name);if(t){k.info(d("download.downloading")),Te(t,e.name).catch(s=>{k.error(s.message||d("download.downloadFailed"))});return}if(e.url&&e.url.startsWith("blob:")){const s=document.createElement("a");s.href=e.url,s.download=e.name,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}function Vt(e,t){return e.length>ie?e.slice(0,ie)+`
@@ -1,4 +1,4 @@
1
- import{n as U}from"./rolldown-runtime-BKwlnUi0.js";import{A as Se,Bt as Te,C as Lo,Ct as re,F as Go,Ht as t,I as b,O as Ro,P as Yo,Pt as _,Q as de,S as K,St as Wo,Tt as s,W as G,X as Jo,_t as ce,at as g,bt as ue,ct as d,f as jo,gt as Ao,it as V,k as Ue,l as _e,lt as R,m as Qo,nt as o,p as H,rt as D,st as w,t as Q,tt as q,vt as r,y as ee,z as ve,zt as e}from"./ui-vendor-BMwF7QXa.js";import{n as Y,r as W}from"./vue-vendor-kBYBtqCg.js";import{d as E,l as pe,n as J,t as j}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{c as Zo,f as et,l as lt,p as ot,r as tt,t as at}from"./profiles-DiEn61KW.js";import{h as st,m as it}from"./index-Cuk9R8hy.js";import{n as me,t as fe}from"./clipboard-4x9B6X3a.js";import{n as he,t as ge}from"./models-Of46_lGf.js";async function nt(){return E("/api/hermes/auth/copilot/start",{method:"POST"})}async function rt(z){return E(`/api/hermes/auth/copilot/poll/${z}`)}async function Ae(){return E("/api/hermes/auth/copilot/check-token")}async function dt(){return E("/api/hermes/auth/copilot/enable",{method:"POST"})}async function ut(){return E("/api/hermes/auth/copilot/disable",{method:"POST"})}var ye=U((()=>{pe()})),Ie,Oe,Ne,Ve,ze,Be,Fe,De,qe,Ee,Xe,He,Ke,Ge,Re,Ye,We,Je,je,Qe,Ze,el,ll,ol,tl,al,sl,il,nl,rl,dl,ul,vl,cl,_l,pl,So,ml=U((()=>{G(),Q(),ge(),Zo(),it(),ye(),Y(),Ie={class:"provider-card"},Oe={class:"card-header"},Ne={class:"provider-name"},Ve={class:"provider-badges"},ze={key:0,class:"type-badge default"},Be={class:"card-body"},Fe={class:"info-row"},De={class:"info-label"},qe={class:"info-value mono"},Ee={class:"info-row"},Xe={class:"info-label"},He={class:"info-value mono"},Ke={class:"info-row models-row"},Ge={class:"info-label"},Re={class:"info-value models-count"},Ye={class:"models-list"},We=["title","onClick"],Je={class:"model-tag-name"},je={key:0,class:"model-tag-default"},Qe={key:1,class:"model-tag-id"},Ze={key:0,class:"model-tag model-tag-more"},el={class:"card-actions"},ll={class:"alias-list-hint"},ol={class:"alias-list"},tl={class:"alias-row-text"},al={class:"alias-row-name"},sl={key:0,class:"alias-row-default"},il={class:"alias-row-id"},nl={key:0,class:"model-alias-canonical"},rl={class:"model-alias-hint"},dl={class:"model-alias-actions"},ul={class:"visibility-hint"},vl={class:"visibility-count"},cl={class:"visibility-list"},_l={key:0,class:"visibility-model-id"},pl={class:"visibility-actions"},So=R({__name:"ProviderCard",props:{provider:{}},setup(z){const C=z,{t:l}=W(),k=he(),p=lt(),m=st(),a=ee(),$=Lo(),N=q(()=>!C.provider.builtin&&C.provider.provider.startsWith("custom:")),I=q(()=>C.provider.provider==="copilot"),v=q(()=>C.provider.label),O=_(!1),B=_(!1),S=_(!1),F=_(""),P=_(""),x=_(""),c=_(!1),h=_(!1),i=_([]),n=q(()=>k.allProviders.find(A=>A.provider===C.provider.provider)),L=q(()=>C.provider.available_models?.length?C.provider.available_models:n.value?.models?.length?n.value.models:C.provider.models),Z=q(()=>p.getProviderVisibility(C.provider.provider)),ie=q(()=>Z.value.mode==="include"),le=q(()=>`${C.provider.models.length}/${L.value.length}`),oe=q(()=>k.defaultProvider===C.provider.provider);function X(A){return oe.value&&k.defaultModel===A}function ne(A){return p.getModelAlias(A,C.provider.provider)}function te(A){return p.displayModelName(A,C.provider.provider)}function ae(A){F.value=C.provider.provider,P.value=A,x.value=p.getModelAlias(A,C.provider.provider),S.value=!0}async function se(){if(!(!P.value||!F.value))try{await p.setModelAlias(P.value,F.value,x.value),S.value=!1}catch(A){a.error(A.message||l("models.aliasSaveFailed"))}}async function we(){x.value="",await se()}function ke(){const A=p.getProviderVisibility(C.provider.provider);i.value=A.mode==="include"?L.value.filter(y=>A.models.includes(y)):[...L.value],c.value=!0}async function xe(){if(i.value.length===0){a.error(l("models.visibilitySelectOne"));return}h.value=!0;try{const A=i.value.filter(f=>L.value.includes(f)),y=A.length===L.value.length?"all":"include";await p.setModelVisibility(C.provider.provider,{mode:y,models:A}),await k.fetchProviders(),c.value=!1,a.success(l("models.visibilitySaved"))}catch(A){a.error(A.message||l("models.visibilitySaveFailed"))}finally{h.value=!1}}function be(){i.value=[...L.value]}function Ce(){i.value=[]}async function Me(){let A="";if(I.value)try{const y=await Ae();y.source==="env"?A=l("models.copilotDeleteHintEnv"):y.source==="gh-cli"?A=l("models.copilotDeleteHintGhCli"):y.source==="apps-json"&&(A=l("models.copilotDeleteHintAppsJson"))}catch{}$.warning({title:l("models.deleteProvider"),content:I.value&&A?`${l("models.deleteConfirm",{name:v.value})}
1
+ import{n as U}from"./rolldown-runtime-BKwlnUi0.js";import{A as Se,Bt as Te,C as Lo,Ct as re,F as Go,Ht as t,I as b,O as Ro,P as Yo,Pt as _,Q as de,S as K,St as Wo,Tt as s,W as G,X as Jo,_t as ce,at as g,bt as ue,ct as d,f as jo,gt as Ao,it as V,k as Ue,l as _e,lt as R,m as Qo,nt as o,p as H,rt as D,st as w,t as Q,tt as q,vt as r,y as ee,z as ve,zt as e}from"./ui-vendor-BMwF7QXa.js";import{n as Y,r as W}from"./vue-vendor-kBYBtqCg.js";import{d as E,l as pe,n as J,t as j}from"./_plugin-vue_export-helper-CHoatqkO.js";import{c as Zo,f as et,l as lt,p as ot,r as tt,t as at}from"./profiles-CyjgPK1f.js";import{h as st,m as it}from"./index-DpU5R9KV.js";import{n as me,t as fe}from"./clipboard-4x9B6X3a.js";import{n as he,t as ge}from"./models-CDdUhb_e.js";async function nt(){return E("/api/hermes/auth/copilot/start",{method:"POST"})}async function rt(z){return E(`/api/hermes/auth/copilot/poll/${z}`)}async function Ae(){return E("/api/hermes/auth/copilot/check-token")}async function dt(){return E("/api/hermes/auth/copilot/enable",{method:"POST"})}async function ut(){return E("/api/hermes/auth/copilot/disable",{method:"POST"})}var ye=U((()=>{pe()})),Ie,Oe,Ne,Ve,ze,Be,Fe,De,qe,Ee,Xe,He,Ke,Ge,Re,Ye,We,Je,je,Qe,Ze,el,ll,ol,tl,al,sl,il,nl,rl,dl,ul,vl,cl,_l,pl,So,ml=U((()=>{G(),Q(),ge(),Zo(),it(),ye(),Y(),Ie={class:"provider-card"},Oe={class:"card-header"},Ne={class:"provider-name"},Ve={class:"provider-badges"},ze={key:0,class:"type-badge default"},Be={class:"card-body"},Fe={class:"info-row"},De={class:"info-label"},qe={class:"info-value mono"},Ee={class:"info-row"},Xe={class:"info-label"},He={class:"info-value mono"},Ke={class:"info-row models-row"},Ge={class:"info-label"},Re={class:"info-value models-count"},Ye={class:"models-list"},We=["title","onClick"],Je={class:"model-tag-name"},je={key:0,class:"model-tag-default"},Qe={key:1,class:"model-tag-id"},Ze={key:0,class:"model-tag model-tag-more"},el={class:"card-actions"},ll={class:"alias-list-hint"},ol={class:"alias-list"},tl={class:"alias-row-text"},al={class:"alias-row-name"},sl={key:0,class:"alias-row-default"},il={class:"alias-row-id"},nl={key:0,class:"model-alias-canonical"},rl={class:"model-alias-hint"},dl={class:"model-alias-actions"},ul={class:"visibility-hint"},vl={class:"visibility-count"},cl={class:"visibility-list"},_l={key:0,class:"visibility-model-id"},pl={class:"visibility-actions"},So=R({__name:"ProviderCard",props:{provider:{}},setup(z){const C=z,{t:l}=W(),k=he(),p=lt(),m=st(),a=ee(),$=Lo(),N=q(()=>!C.provider.builtin&&C.provider.provider.startsWith("custom:")),I=q(()=>C.provider.provider==="copilot"),v=q(()=>C.provider.label),O=_(!1),B=_(!1),S=_(!1),F=_(""),P=_(""),x=_(""),c=_(!1),h=_(!1),i=_([]),n=q(()=>k.allProviders.find(A=>A.provider===C.provider.provider)),L=q(()=>C.provider.available_models?.length?C.provider.available_models:n.value?.models?.length?n.value.models:C.provider.models),Z=q(()=>p.getProviderVisibility(C.provider.provider)),ie=q(()=>Z.value.mode==="include"),le=q(()=>`${C.provider.models.length}/${L.value.length}`),oe=q(()=>k.defaultProvider===C.provider.provider);function X(A){return oe.value&&k.defaultModel===A}function ne(A){return p.getModelAlias(A,C.provider.provider)}function te(A){return p.displayModelName(A,C.provider.provider)}function ae(A){F.value=C.provider.provider,P.value=A,x.value=p.getModelAlias(A,C.provider.provider),S.value=!0}async function se(){if(!(!P.value||!F.value))try{await p.setModelAlias(P.value,F.value,x.value),S.value=!1}catch(A){a.error(A.message||l("models.aliasSaveFailed"))}}async function we(){x.value="",await se()}function ke(){const A=p.getProviderVisibility(C.provider.provider);i.value=A.mode==="include"?L.value.filter(y=>A.models.includes(y)):[...L.value],c.value=!0}async function xe(){if(i.value.length===0){a.error(l("models.visibilitySelectOne"));return}h.value=!0;try{const A=i.value.filter(f=>L.value.includes(f)),y=A.length===L.value.length?"all":"include";await p.setModelVisibility(C.provider.provider,{mode:y,models:A}),await k.fetchProviders(),c.value=!1,a.success(l("models.visibilitySaved"))}catch(A){a.error(A.message||l("models.visibilitySaveFailed"))}finally{h.value=!1}}function be(){i.value=[...L.value]}function Ce(){i.value=[]}async function Me(){let A="";if(I.value)try{const y=await Ae();y.source==="env"?A=l("models.copilotDeleteHintEnv"):y.source==="gh-cli"?A=l("models.copilotDeleteHintGhCli"):y.source==="apps-json"&&(A=l("models.copilotDeleteHintAppsJson"))}catch{}$.warning({title:l("models.deleteProvider"),content:I.value&&A?`${l("models.deleteConfirm",{name:v.value})}
2
2
 
3
3
  ${A}`:l("models.deleteConfirm",{name:v.value}),positiveText:l("common.delete"),negativeText:l("common.cancel"),onPositiveClick:async()=>{O.value=!0;try{if(I.value?(await ut(),m.clearProviderFromSessions("copilot"),await k.fetchProviders()):await k.removeProvider(C.provider.provider),!p.selectedModel&&p.modelGroups.length>0){const y=p.modelGroups.find(f=>f.models.length>0);y&&await p.switchModel(y.models[0],y.provider)}a.success(l("models.providerDeleted"))}catch(y){a.error(y.message)}finally{O.value=!1}}})}return(A,y)=>(r(),g("div",Ie,[o("div",Oe,[o("h3",Ne,t(v.value),1),o("div",Ve,[oe.value?(r(),g("span",ze,t(e(l)("models.currentDefault")),1)):V("",!0),o("span",{class:Te(["type-badge",N.value?"custom":"builtin"])},t(N.value?e(l)("models.customType"):e(l)("models.builtIn")),3)])]),o("div",Be,[o("div",Fe,[o("span",De,t(e(l)("models.provider")),1),o("code",qe,t(z.provider.provider),1)]),o("div",Ee,[o("span",Xe,t(e(l)("models.baseUrl")),1),o("code",He,t(z.provider.base_url),1)]),o("div",Ke,[o("span",Ge,t(e(l)("models.models")),1),o("span",Re,t(ie.value?le.value:z.provider.models.length)+" "+t(e(l)("models.count")),1)]),o("div",Ye,[(r(!0),g(de,null,ue(z.provider.models.slice(0,20),f=>(r(),g("button",{key:f,class:Te(["model-tag model-tag-button",{default:X(f)}]),type:"button",title:e(l)("models.aliasTitleFor",{model:f}),onClick:Pe=>ae(f)},[o("span",Je,t(te(f)),1),X(f)?(r(),g("span",je,t(e(l)("models.defaultShort")),1)):V("",!0),ne(f)?(r(),g("span",Qe,t(f),1)):V("",!0)],10,We))),128)),z.provider.models.length>20?(r(),g("span",Ze," +"+t(z.provider.models.length-20)+" "+t(e(l)("models.more")),1)):V("",!0)])]),o("div",el,[d(e(b),{size:"tiny",quaternary:"",onClick:y[0]||(y[0]=f=>B.value=!0)},{default:s(()=>[w(t(e(l)("models.aliasManage")),1)]),_:1}),d(e(b),{size:"tiny",quaternary:"",onClick:ke},{default:s(()=>[w(t(e(l)("models.manageVisibleModels")),1)]),_:1}),d(e(b),{size:"tiny",quaternary:"",type:"error",loading:O.value,onClick:Me},{default:s(()=>[w(t(e(l)("common.delete")),1)]),_:1},8,["loading"])]),d(e(K),{show:B.value,"onUpdate:show":y[1]||(y[1]=f=>B.value=f),preset:"card",title:e(l)("models.aliasManageFor",{provider:v.value}),style:{width:"min(560px, calc(100vw - 32px))"},"mask-closable":!0},{default:s(()=>[o("div",ll,t(e(l)("models.aliasHint")),1),o("div",ol,[(r(!0),g(de,null,ue(z.provider.models,f=>(r(),g("div",{key:f,class:"alias-row"},[o("div",tl,[o("span",al,t(te(f)),1),X(f)?(r(),g("span",sl,t(e(l)("models.defaultShort")),1)):V("",!0),o("code",il,t(f),1)]),d(e(b),{size:"tiny",quaternary:"",onClick:Pe=>ae(f)},{default:s(()=>[w(t(e(l)("models.aliasEdit")),1)]),_:1},8,["onClick"])]))),128))])]),_:1},8,["show","title"]),d(e(K),{show:S.value,"onUpdate:show":y[4]||(y[4]=f=>S.value=f),preset:"card",title:P.value?e(l)("models.aliasTitleFor",{model:P.value}):e(l)("models.aliasTitle"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!0},{footer:s(()=>[o("div",dl,[d(e(b),{quaternary:"",disabled:!e(p).getModelAlias(P.value,F.value),onClick:we},{default:s(()=>[w(t(e(l)("models.aliasUseOriginal")),1)]),_:1},8,["disabled"]),y[8]||(y[8]=o("div",{class:"model-alias-spacer"},null,-1)),d(e(b),{onClick:y[3]||(y[3]=f=>S.value=!1)},{default:s(()=>[w(t(e(l)("common.cancel")),1)]),_:1}),d(e(b),{type:"primary",onClick:se},{default:s(()=>[w(t(e(l)("common.save")),1)]),_:1})])]),default:s(()=>[d(e(ve),{value:x.value,"onUpdate:value":y[2]||(y[2]=f=>x.value=f),placeholder:e(l)("models.aliasPlaceholder"),clearable:"",onKeydown:Jo(se,["enter"])},null,8,["value","placeholder"]),P.value?(r(),g("div",nl,t(e(l)("models.aliasCanonical",{model:P.value})),1)):V("",!0),o("div",rl,t(e(l)("models.aliasHint")),1)]),_:1},8,["show","title"]),d(e(K),{show:c.value,"onUpdate:show":y[7]||(y[7]=f=>c.value=f),preset:"card",title:e(l)("models.manageVisibleModelsFor",{name:v.value}),style:{width:"min(560px, calc(100vw - 32px))"},"mask-closable":!h.value},{default:s(()=>[o("p",ul,t(e(l)("models.visibilityHint")),1),o("div",vl,t(i.value.length)+"/"+t(L.value.length)+" "+t(e(l)("models.count")),1),o("div",cl,[d(e(Go),{value:i.value,"onUpdate:value":y[5]||(y[5]=f=>i.value=f)},{default:s(()=>[(r(!0),g(de,null,ue(L.value,f=>(r(),D(e(Yo),{key:f,value:f,class:"visibility-model"},{default:s(()=>[o("code",null,t(te(f)),1),ne(f)?(r(),g("code",_l,t(f),1)):V("",!0)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),o("div",pl,[d(e(b),{size:"small",quaternary:"",disabled:h.value,onClick:be},{default:s(()=>[w(t(e(l)("models.showAllModels")),1)]),_:1},8,["disabled"]),d(e(b),{size:"small",quaternary:"",disabled:h.value,onClick:Ce},{default:s(()=>[w(t(e(l)("models.clearVisibleModels")),1)]),_:1},8,["disabled"]),y[9]||(y[9]=o("div",{class:"visibility-action-spacer"},null,-1)),d(e(b),{size:"small",disabled:h.value,onClick:y[6]||(y[6]=f=>c.value=!1)},{default:s(()=>[w(t(e(l)("common.cancel")),1)]),_:1},8,["disabled"]),d(e(b),{size:"small",type:"primary",loading:h.value,onClick:xe},{default:s(()=>[w(t(e(l)("common.save")),1)]),_:1},8,["loading"])])]),_:1},8,["show","title","mask-closable"])]))}})})),vt=U((()=>{})),To,ct=U((()=>{ml(),ml(),vt(),J(),To=j(So,[["__scopeId","data-v-4aed95c5"]])})),fl,hl,Uo,gl=U((()=>{G(),ct(),ge(),Y(),fl={key:0,class:"empty-state"},hl={key:1,class:"providers-grid"},Uo=R({__name:"ProvidersPanel",setup(z){const{t:C}=W(),l=he();return(k,p)=>e(l).providers.length===0?(r(),g("div",fl,[p[0]||(p[0]=o("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1",class:"empty-icon"},[o("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),o("path",{d:"M2 17l10 5 10-5"}),o("path",{d:"M2 12l10 5 10-5"})],-1)),o("p",null,t(e(C)("models.noProviders")),1)])):(r(),g("div",hl,[(r(!0),g(de,null,ue(e(l).providers,m=>(r(),D(To,{key:m.provider,provider:m},null,8,["provider"]))),128))]))}})})),_t=U((()=>{})),Io,pt=U((()=>{gl(),gl(),_t(),J(),Io=j(Uo,[["__scopeId","data-v-76eec30b"]])}));async function mt(){return E("/api/hermes/auth/codex/start",{method:"POST"})}async function ft(z){return E(`/api/hermes/auth/codex/poll/${z}`)}var ht=U((()=>{pe()})),yl,wl,kl,xl,bl,Cl,Ml,Pl,$l,Ll,Al,Oo,Sl=U((()=>{G(),Q(),Y(),ht(),me(),yl={class:"codex-login"},wl={key:0,class:"codex-login__state"},kl={key:1,class:"codex-login__state"},xl={class:"codex-login__hint"},bl={class:"codex-login__code-text"},Cl={key:2,class:"codex-login__state codex-login__state--success"},Ml={key:3,class:"codex-login__state"},Pl={class:"codex-login__error"},$l={key:4,class:"codex-login__state"},Ll={class:"codex-login__error"},Al={class:"modal-footer"},Oo=R({__name:"CodexLoginModal",emits:["close","success"],setup(z,{emit:C}){const{t:l}=W(),k=C,p=ee(),m=_(!0),a=_("idle"),$=_(""),N=_(""),I=_(""),v=_("");let O=null;async function B(){a.value="loading",v.value="";try{const i=await mt();$.value=i.user_code,N.value=i.verification_url,I.value=i.session_id,a.value="waiting",S()}catch(i){a.value="error";const n=i.message||"";try{const L=n.match(/\{[\s\S]*\}$/);L?v.value=JSON.parse(L[0]).error||n:v.value=n}catch{v.value=n}p.error(v.value)}}function S(){F(),O=setTimeout(async()=>{try{const i=await ft(I.value);i.status==="pending"?S():i.status==="approved"?(a.value="approved",p.success(l("models.codexApproved")),setTimeout(()=>{m.value=!1,setTimeout(()=>k("success"),200)},1e3)):i.status==="expired"?a.value="expired":i.status==="error"&&(a.value="error",v.value=i.error||"Unknown error")}catch{S()}},3e3)}function F(){O&&(clearTimeout(O),O=null)}function P(){F(),m.value=!1,setTimeout(()=>k("close"),200)}async function x(){await fe($.value)?p.success(l("models.codexCopyCode")):p.error(l("models.codexCopyCode")+" ✗")}function c(){window.open(N.value,"_blank")}function h(){a.value="idle",$.value="",N.value="",I.value="",v.value="",B()}return ce(()=>{F()}),B(),(i,n)=>{const L=Wo("NSpin");return r(),D(e(K),{show:m.value,"onUpdate:show":n[0]||(n[0]=Z=>m.value=Z),preset:"card",title:e(l)("models.codexLoginTitle"),style:{width:"min(440px, calc(100vw - 32px))"},"mask-closable":a.value!=="waiting",onAfterLeave:n[1]||(n[1]=Z=>k("close"))},{footer:s(()=>[o("div",Al,[d(e(b),{disabled:a.value==="waiting",onClick:P},{default:s(()=>[w(t(e(l)("common.cancel")),1)]),_:1},8,["disabled"])])]),default:s(()=>[o("div",yl,[a.value==="idle"||a.value==="loading"?(r(),g("div",wl,[d(L,{size:"small"})])):a.value==="waiting"?(r(),g("div",kl,[o("p",xl,t(e(l)("models.codexWaiting")),1),o("div",{class:"codex-login__code",onClick:x},[o("span",bl,t($.value),1),n[2]||(n[2]=o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),o("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})],-1))]),d(e(b),{type:"primary",block:"",onClick:c},{icon:s(()=>[...n[3]||(n[3]=[o("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),o("polyline",{points:"15 3 21 3 21 9"}),o("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])]),default:s(()=>[w(" "+t(e(l)("models.codexOpenLink")),1)]),_:1})])):a.value==="approved"?(r(),g("div",Cl,[n[4]||(n[4]=o("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),o("polyline",{points:"22 4 12 14.01 9 11.01"})],-1)),o("p",null,t(e(l)("models.codexApproved")),1)])):a.value==="expired"?(r(),g("div",Ml,[o("p",Pl,t(e(l)("models.codexExpired")),1),d(e(b),{size:"small",onClick:h},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):a.value==="error"?(r(),g("div",$l,[o("p",Ll,t(v.value),1),d(e(b),{size:"small",onClick:h},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):V("",!0)])]),_:1},8,["show","title","mask-closable"])}}})})),gt=U((()=>{})),No,yt=U((()=>{Sl(),Sl(),gt(),J(),No=j(Oo,[["__scopeId","data-v-b8a659c8"]])}));async function wt(){return E("/api/hermes/auth/nous/start",{method:"POST"})}async function kt(z){return E(`/api/hermes/auth/nous/poll/${z}`)}var xt=U((()=>{pe()})),Tl,Ul,Il,Ol,Nl,Vl,zl,Bl,Fl,Dl,ql,Vo,El=U((()=>{G(),Q(),Y(),xt(),me(),Tl={class:"nous-login"},Ul={key:0,class:"nous-login__state"},Il={key:1,class:"nous-login__state"},Ol={class:"nous-login__hint"},Nl={class:"nous-login__code-text"},Vl={key:2,class:"nous-login__state nous-login__state--success"},zl={key:3,class:"nous-login__state"},Bl={class:"nous-login__error"},Fl={key:4,class:"nous-login__state"},Dl={class:"nous-login__error"},ql={class:"modal-footer"},Vo=R({__name:"NousLoginModal",emits:["close","success"],setup(z,{emit:C}){const{t:l}=W(),k=C,p=ee(),m=_(!0),a=_("idle"),$=_(""),N=_(""),I=_(""),v=_("");let O=null;async function B(){a.value="loading",v.value="";try{const i=await wt();$.value=i.user_code,N.value=i.verification_url,I.value=i.session_id,a.value="waiting",S()}catch(i){a.value="error";const n=i.message||"";try{const L=n.match(/\{[\s\S]*\}$/);L?v.value=JSON.parse(L[0]).error||n:v.value=n}catch{v.value=n}p.error(v.value)}}function S(){F(),O=setTimeout(async()=>{try{const i=await kt(I.value);i.status==="pending"?S():i.status==="approved"?(a.value="approved",p.success(l("models.nousApproved")),setTimeout(()=>{m.value=!1,setTimeout(()=>k("success"),200)},1e3)):i.status==="expired"?a.value="expired":i.status==="denied"?(a.value="error",v.value=l("models.nousDenied")):i.status==="error"&&(a.value="error",v.value=i.error||"Unknown error")}catch{S()}},3e3)}function F(){O&&(clearTimeout(O),O=null)}function P(){F(),m.value=!1,setTimeout(()=>k("close"),200)}async function x(){await fe($.value)?p.success(l("models.nousCopyCode")):p.error(l("models.nousCopyCode")+" ✗")}function c(){window.open(N.value,"_blank")}function h(){a.value="idle",$.value="",N.value="",I.value="",v.value="",B()}return ce(()=>{F()}),B(),(i,n)=>(r(),D(e(K),{show:m.value,"onUpdate:show":n[0]||(n[0]=L=>m.value=L),preset:"card",title:e(l)("models.nousLoginTitle"),style:{width:"min(440px, calc(100vw - 32px))"},"mask-closable":a.value!=="waiting",onAfterLeave:n[1]||(n[1]=L=>k("close"))},{footer:s(()=>[o("div",ql,[d(e(b),{disabled:a.value==="waiting",onClick:P},{default:s(()=>[w(t(e(l)("common.cancel")),1)]),_:1},8,["disabled"])])]),default:s(()=>[o("div",Tl,[a.value==="idle"||a.value==="loading"?(r(),g("div",Ul,[d(e(_e),{size:"small"})])):a.value==="waiting"?(r(),g("div",Il,[o("p",Ol,t(e(l)("models.nousWaiting")),1),o("div",{class:"nous-login__code",onClick:x},[o("span",Nl,t($.value),1),n[2]||(n[2]=o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),o("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})],-1))]),d(e(b),{type:"primary",block:"",onClick:c},{icon:s(()=>[...n[3]||(n[3]=[o("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),o("polyline",{points:"15 3 21 3 21 9"}),o("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])]),default:s(()=>[w(" "+t(e(l)("models.nousOpenLink")),1)]),_:1})])):a.value==="approved"?(r(),g("div",Vl,[n[4]||(n[4]=o("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),o("polyline",{points:"22 4 12 14.01 9 11.01"})],-1)),o("p",null,t(e(l)("models.nousApproved")),1)])):a.value==="expired"?(r(),g("div",zl,[o("p",Bl,t(e(l)("models.nousExpired")),1),d(e(b),{size:"small",onClick:h},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):a.value==="error"?(r(),g("div",Fl,[o("p",Dl,t(v.value),1),d(e(b),{size:"small",onClick:h},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):V("",!0)])]),_:1},8,["show","title","mask-closable"]))}})})),bt=U((()=>{})),zo,Ct=U((()=>{El(),El(),bt(),J(),zo=j(Vo,[["__scopeId","data-v-13765003"]])})),Xl,Hl,Kl,Gl,Rl,Yl,Wl,Jl,jl,Ql,Zl,Bo,eo=U((()=>{G(),Q(),Y(),ye(),me(),Xl={class:"copilot-login"},Hl={key:0,class:"copilot-login__state"},Kl={key:1,class:"copilot-login__state"},Gl={class:"copilot-login__hint"},Rl={class:"copilot-login__code-text"},Yl={key:2,class:"copilot-login__state copilot-login__state--success"},Wl={key:3,class:"copilot-login__state"},Jl={class:"copilot-login__error"},jl={key:4,class:"copilot-login__state"},Ql={class:"copilot-login__error"},Zl={class:"modal-footer"},Bo=R({__name:"CopilotLoginModal",emits:["close","success"],setup(z,{emit:C}){const{t:l}=W(),k=C,p=ee(),m=_(!0),a=_("idle"),$=_(""),N=_(""),I=_(""),v=_("");let O=null;async function B(){a.value="loading",v.value="";try{const i=await nt();$.value=i.user_code,N.value=i.verification_url,I.value=i.session_id,a.value="waiting",S()}catch(i){a.value="error";const n=i?.message||"";try{const L=n.match(/\{[\s\S]*\}$/);L?v.value=JSON.parse(L[0]).error||n:v.value=n}catch{v.value=n}p.error(v.value)}}function S(){F(),O=setTimeout(async()=>{try{const i=await rt(I.value);i.status==="pending"?S():i.status==="approved"?(a.value="approved",p.success(l("models.copilotApproved")),setTimeout(()=>{m.value=!1,setTimeout(()=>k("success"),200)},1e3)):i.status==="expired"?a.value="expired":i.status==="denied"?(a.value="error",v.value=l("models.copilotDenied")):i.status==="error"&&(a.value="error",v.value=i.error||"Unknown error")}catch{S()}},3e3)}function F(){O&&(clearTimeout(O),O=null)}function P(){F(),m.value=!1,setTimeout(()=>k("close"),200)}async function x(){await fe($.value)?p.success(l("models.copilotCopyCode")):p.error(l("models.copilotCopyCode")+" ✗")}function c(){window.open(N.value,"_blank")}function h(){a.value="idle",$.value="",N.value="",I.value="",v.value="",B()}return ce(()=>{F()}),B(),(i,n)=>(r(),D(e(K),{show:m.value,"onUpdate:show":n[0]||(n[0]=L=>m.value=L),preset:"card",title:e(l)("models.copilotLoginTitle"),style:{width:"min(440px, calc(100vw - 32px))"},"mask-closable":a.value!=="waiting",onAfterLeave:n[1]||(n[1]=L=>k("close"))},{footer:s(()=>[o("div",Zl,[d(e(b),{disabled:a.value==="waiting",onClick:P},{default:s(()=>[w(t(e(l)("common.cancel")),1)]),_:1},8,["disabled"])])]),default:s(()=>[o("div",Xl,[a.value==="idle"||a.value==="loading"?(r(),g("div",Hl,[d(e(_e),{size:"small"})])):a.value==="waiting"?(r(),g("div",Kl,[o("p",Gl,t(e(l)("models.copilotWaiting")),1),o("div",{class:"copilot-login__code",onClick:x},[o("span",Rl,t($.value),1),n[2]||(n[2]=o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),o("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})],-1))]),d(e(b),{type:"primary",block:"",onClick:c},{icon:s(()=>[...n[3]||(n[3]=[o("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),o("polyline",{points:"15 3 21 3 21 9"}),o("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])]),default:s(()=>[w(" "+t(e(l)("models.copilotOpenLink")),1)]),_:1})])):a.value==="approved"?(r(),g("div",Yl,[n[4]||(n[4]=o("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),o("polyline",{points:"22 4 12 14.01 9 11.01"})],-1)),o("p",null,t(e(l)("models.copilotApproved")),1)])):a.value==="expired"?(r(),g("div",Wl,[o("p",Jl,t(e(l)("models.copilotExpired")),1),d(e(b),{size:"small",onClick:h},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):a.value==="error"?(r(),g("div",jl,[o("p",Ql,t(v.value),1),d(e(b),{size:"small",onClick:h},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):V("",!0)])]),_:1},8,["show","title","mask-closable"]))}})})),Mt=U((()=>{})),Fo,Pt=U((()=>{eo(),eo(),Mt(),J(),Fo=j(Bo,[["__scopeId","data-v-fe3fcc7e"]])}));async function $t(){return E("/api/hermes/auth/xai/start",{method:"POST"})}async function Lt(z){return E(`/api/hermes/auth/xai/poll/${z}`)}var At=U((()=>{pe()})),lo,oo,to,ao,so,io,no,ro,uo,vo,Do,co=U((()=>{G(),Q(),Y(),At(),me(),lo={class:"xai-login"},oo={key:0,class:"xai-login__state"},to={key:1,class:"xai-login__state"},ao={class:"xai-login__hint"},so={key:2,class:"xai-login__state xai-login__state--success"},io={key:3,class:"xai-login__state"},no={class:"xai-login__error"},ro={key:4,class:"xai-login__state"},uo={class:"xai-login__error"},vo={class:"modal-footer"},Do=R({__name:"XaiOAuthLoginModal",emits:["close","success"],setup(z,{emit:C}){const{t:l}=W(),k=C,p=ee(),m=_(!0),a=_("idle"),$=_(""),N=_(""),I=_("");let v=null;async function O(){a.value="loading",I.value="";try{const h=await $t();$.value=h.authorization_url,N.value=h.session_id,a.value="waiting",window.open($.value,"_blank"),B()}catch(h){a.value="error",I.value=h?.message||String(h),p.error(I.value)}}function B(){S(),v=setTimeout(async()=>{try{const h=await Lt(N.value);h.status==="pending"?B():h.status==="approved"?(a.value="approved",p.success(l("models.xaiApproved")),setTimeout(()=>{m.value=!1,setTimeout(()=>k("success"),200)},1e3)):h.status==="expired"?a.value="expired":h.status==="error"&&(a.value="error",I.value=h.error||"Unknown error")}catch{B()}},2e3)}function S(){v&&clearTimeout(v),v=null}function F(){S(),m.value=!1,setTimeout(()=>k("close"),200)}function P(){window.open($.value,"_blank")}async function x(){await fe($.value)?p.success(l("common.copied")):p.error(l("chat.copyFailed"))}function c(){a.value="idle",$.value="",N.value="",I.value="",O()}return ce(S),O(),(h,i)=>(r(),D(e(K),{show:m.value,"onUpdate:show":i[0]||(i[0]=n=>m.value=n),preset:"card",title:e(l)("models.xaiLoginTitle"),style:{width:"min(440px, calc(100vw - 32px))"},"mask-closable":a.value!=="waiting",onAfterLeave:i[1]||(i[1]=n=>k("close"))},{footer:s(()=>[o("div",vo,[d(e(b),{disabled:a.value==="waiting",onClick:F},{default:s(()=>[w(t(e(l)("common.cancel")),1)]),_:1},8,["disabled"])])]),default:s(()=>[o("div",lo,[a.value==="idle"||a.value==="loading"?(r(),g("div",oo,[d(e(_e),{size:"small"})])):a.value==="waiting"?(r(),g("div",to,[o("p",ao,t(e(l)("models.xaiWaiting")),1),d(e(b),{type:"primary",block:"",onClick:P},{default:s(()=>[w(t(e(l)("models.xaiOpenLink")),1)]),_:1}),d(e(b),{block:"",onClick:x},{default:s(()=>[w(t(e(l)("models.xaiCopyLink")),1)]),_:1})])):a.value==="approved"?(r(),g("div",so,[i[2]||(i[2]=o("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[o("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),o("polyline",{points:"22 4 12 14.01 9 11.01"})],-1)),o("p",null,t(e(l)("models.xaiApproved")),1)])):a.value==="expired"?(r(),g("div",io,[o("p",no,t(e(l)("models.xaiExpired")),1),d(e(b),{size:"small",onClick:c},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):a.value==="error"?(r(),g("div",ro,[o("p",uo,t(I.value),1),d(e(b),{size:"small",onClick:c},{default:s(()=>[w(t(e(l)("common.retry")),1)]),_:1})])):V("",!0)])]),_:1},8,["show","title","mask-closable"]))}})})),St=U((()=>{})),qo,Tt=U((()=>{co(),co(),St(),J(),qo=j(Do,[["__scopeId","data-v-73a4b1b7"]])})),_o,po,mo,fo,ho,go,yo,$e,wo,Le,ko,Eo,xo=U((()=>{G(),Q(),ge(),Y(),yt(),Ct(),Pt(),Tt(),ye(),ot(),_o={style:{display:"flex",gap:"12px"}},po={key:0,class:"fun-provider-hint"},mo=["href"],fo={style:{display:"flex",gap:"8px",width:"100%"}},ho={class:"modal-footer"},go="openai-codex",yo="nous",$e="copilot",wo="cliproxyapi",Le="xai-oauth",ko="alibaba-coding-plan",Eo=R({__name:"ProviderFormModal",emits:["close","saved"],setup(z,{emit:C}){const{t:l}=W(),k=C,p=he(),m=ee(),a=Lo(),$=_(!0),N=_(!1),I=_(!1),v=_(!1),O=_(!1),B=_(!1),S=_(!1),F=_(!1),P=_("preset"),x=_(null),c=_({name:"",base_url:"",api_key:"",model:"",context_length:null}),h=_([]),i={intl:"https://coding-intl.dashscope.aliyuncs.com/v1",cn:"https://coding.dashscope.aliyuncs.com/v1"},n=q(()=>x.value===go),L=q(()=>x.value===yo),Z=q(()=>x.value===$e),ie=q(()=>x.value===wo),le=q(()=>x.value===Le),oe=q(()=>x.value===ko),X=_("intl"),ne=q(()=>p.allProviders.map(M=>({label:M.label,value:M.provider}))),te={"fun-codex":"https://apikey.fun/register?aff=LIBAPI","fun-claude":"https://apikey.fun/register?aff=LIBAPI"},ae=q(()=>x.value&&te[x.value]||"");function se(M){const u=M.replace(/^https?:\/\//,"").replace(/\/v1\/?$/,"").split("/")[0];return u.includes("localhost")||u.includes("127.0.0.1")?l("models.local",{host:u}):u.charAt(0).toUpperCase()+u.slice(1)}re(x,M=>{if(c.value.model="",X.value="intl",M){const u=p.allProviders.find(T=>T.provider===M);u&&(c.value.name=u.label,c.value.base_url=u.base_url,h.value=u.models.map(T=>({label:T,value:T})),u.models.length>0&&(c.value.model=u.models[0])),M===$e?y():M===Le&&(S.value=!0)}}),re(X,M=>{oe.value&&(c.value.base_url=i[M])}),re(()=>c.value.base_url,M=>{P.value==="custom"&&M.trim()&&!c.value.name&&(c.value.name=se(M.trim()))}),re(P,()=>{h.value=[],c.value={name:"",base_url:"",api_key:"",model:"",context_length:null},x.value=null}),Ao(()=>{p.providers.length===0&&p.fetchProviders()});async function we(){const{base_url:M}=c.value;if(!M.trim()){m.warning(l("models.enterBaseUrl"));return}I.value=!0;try{h.value=(await et({base_url:M.trim(),api_key:c.value.api_key.trim()})).models.map(u=>({label:u,value:u})),h.value.length>0&&!c.value.model&&(c.value.model=h.value[0].value),m.success(l("models.foundModels",{count:h.value.length}))}catch(u){m.error(l("models.fetchFailed")+": "+u.message)}finally{I.value=!1}}async function ke(){if(P.value==="preset"&&!x.value){m.warning(l("models.selectProviderRequired"));return}if(n.value){v.value=!0;return}if(L.value){O.value=!0;return}if(Z.value){y();return}if(le.value){S.value=!0;return}if(!c.value.base_url.trim()){m.warning(l("models.baseUrlRequired"));return}if(!c.value.api_key.trim()&&!ie.value&&!le.value){m.warning(l("models.apiKeyRequired"));return}if(!c.value.model){m.warning(l("models.modelRequired"));return}N.value=!0;try{const M=P.value==="preset"?x.value:null,u=c.value.context_length??void 0;await p.addProvider({name:c.value.name.trim(),base_url:c.value.base_url.trim(),api_key:c.value.api_key.trim(),model:c.value.model,context_length:u,providerKey:M}),m.success(l("models.providerAdded")),k("saved")}catch(M){m.error(M.message)}finally{N.value=!1}}async function xe(){v.value=!1,m.success(l("models.providerAdded")),k("saved")}async function be(){O.value=!1,m.success(l("models.providerAdded")),k("saved")}async function Ce(){B.value=!1,m.success(l("models.providerAdded")),k("saved")}async function Me(){S.value=!1,m.success(l("models.providerAdded")),k("saved")}function A(M){return M==="env"?l("models.copilotAddSourceEnv"):M==="gh-cli"?l("models.copilotAddSourceGhCli"):M==="apps-json"?l("models.copilotAddSourceAppsJson"):""}async function y(){if(!F.value){F.value=!0;try{const M=await Ae();if(M.has_token){const u=A(M.source);a.success({title:l("models.copilotAddDetectedTitle"),content:u?`${l("models.copilotAddDetected")}
4
4
 
@@ -1,3 +1,3 @@
1
- import{n as k}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as oe,D as fe,Ht as m,P as ge,Pt as ke,Q as L,Tt as b,W as le,Z as B,_t as ye,at as c,bt as Me,ct as I,d as xe,it as g,lt as ae,mt as $e,nt as n,rt as A,st as P,t as Se,tt as M,vt as r,zt as _}from"./ui-vendor-BMwF7QXa.js";import{n as re,r as ue}from"./vue-vendor-kBYBtqCg.js";import{n as ce,t as de}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{c as we,l as Te,r as be,t as Ce}from"./profiles-DiEn61KW.js";import{B as Be,V as Pe}from"./index-Cuk9R8hy.js";function Ue(t){return t?he[t]||t:""}function me(t){if(!t)return"";const v=new Date(t),d=new Date;return v.toDateString()===d.toDateString()?v.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):v.toLocaleDateString([],{month:"short",day:"numeric"})}function We(t){return me(t*1e3)}var he,Le=k((()=>{he={telegram:"Telegram",api_server:"API Server",cli:"CLI",discord:"Discord",slack:"Slack",matrix:"Matrix",whatsapp:"WhatsApp",signal:"Signal",email:"Email",sms:"SMS",dingtalk:"DingTalk",feishu:"Feishu",wecom:"WeCom",weixin:"WeChat",bluebubbles:"iMessage",mattermost:"Mattermost",cron:"Cron"}})),D,E,N,O,V,q,z,Q,U,W,F,H,pe,G=k((()=>{le(),Se(),re(),we(),Ce(),Pe(),Le(),D=["aria-current"],E={key:0,class:"session-item-checkbox"},N={class:"session-item-content"},O={class:"session-item-title-row"},V={key:0,class:"session-item-pin","aria-hidden":"true"},q={class:"session-item-title"},z={key:0,class:"session-item-streaming",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round"},Q={class:"session-item-meta"},U=["title"],W={class:"session-item-time"},F={key:0,class:"session-item-profile"},H={class:"session-item-profile-name"},pe=ae({__name:"SessionListItem",props:{session:{},active:{type:Boolean},pinned:{type:Boolean},canDelete:{type:Boolean},streaming:{type:Boolean},selectable:{type:Boolean},selected:{type:Boolean},showProfile:{type:Boolean,default:!0}},emits:["select","contextmenu","delete","toggle-select"],setup(t,{emit:v}){const d=t,f=v,{t:x}=ue(),y=Te(),$=be(),l=M(()=>d.session.model?y.displayModelName(d.session.model,d.session.provider):""),e=M(()=>d.session.profile||"default"),s=M(()=>$.profiles.find(p=>p.name===e.value)?.avatar),a=M(()=>!!y.profileModelGroups.find(p=>p.profile===e.value)?.groups?.some(p=>p.models.length>0)),o=M(()=>y.profileModelGroups.length>0&&!a.value);let u=null;const h=ke(!1);function S(p){h.value=!1,u=setTimeout(()=>{h.value=!0;const i=p.touches[0];f("contextmenu",new MouseEvent("contextmenu",{clientX:i.clientX,clientY:i.clientY,bubbles:!0}))},500)}function w(){u&&(clearTimeout(u),u=null)}function T(){u&&(clearTimeout(u),u=null)}function ve(){if(h.value){h.value=!1;return}f("select")}return ye(()=>{u&&clearTimeout(u)}),(p,i)=>(r(),c("button",{class:oe(["session-item",{active:t.active,"batch-mode":t.selectable,"missing-models":o.value}]),"aria-current":t.active?"page":void 0,onClick:ve,onContextmenu:i[4]||(i[4]=C=>f("contextmenu",C)),onTouchstart:S,onTouchend:w,onTouchmove:T},[t.selectable?(r(),c("div",E,[I(_(ge),{checked:t.selected,onClick:i[0]||(i[0]=B(C=>f("toggle-select"),["stop"]))},null,8,["checked"])])):g("",!0),n("div",N,[n("span",O,[t.pinned?(r(),c("span",V,[...i[5]||(i[5]=[n("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[n("path",{d:"M12 17v5"}),n("path",{d:"M5 8l14 0"}),n("path",{d:"M8 3l8 0 0 5 3 5-14 0 3-5z"})],-1)])])):g("",!0),n("span",q,[t.streaming?(r(),c("svg",z,[...i[6]||(i[6]=[n("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])])):g("",!0),P(" "+m(t.session.title),1)]),o.value?(r(),A(_(fe),{key:1,trigger:"click",placement:"top"},{trigger:b(()=>[n("button",{class:"session-item-warning",type:"button",onClick:i[1]||(i[1]=B(()=>{},["stop"]))}," ! ")]),default:b(()=>[P(" "+m(_(x)("chat.profileMissingModelsTip",{profile:e.value})),1)]),_:1})):g("",!0)]),n("span",Q,[l.value?(r(),c("span",{key:0,class:"session-item-model",title:t.session.model},m(l.value),9,U)):g("",!0),n("span",W,m(_(me)(t.session.createdAt)),1)]),d.showProfile?(r(),c("span",F,[I(Be,{class:"session-item-profile-avatar",name:e.value,avatar:s.value,size:16},null,8,["name","avatar"]),n("span",H,m(e.value),1)])):g("",!0)]),t.canDelete&&!t.selectable?(r(),A(_(xe),{key:1,onPositiveClick:i[3]||(i[3]=C=>f("delete"))},{trigger:b(()=>[n("button",{class:"session-item-delete",onClick:i[2]||(i[2]=B(()=>{},["stop"]))},[...i[7]||(i[7]=[n("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),default:b(()=>[P(" "+m(_(x)("chat.deleteSession")),1)]),_:1})):g("",!0)],42,D))}})})),Ie=k((()=>{})),Ae,Fe=k((()=>{G(),G(),Ie(),ce(),Ae=de(pe,[["__scopeId","data-v-36a6e2dd"]])})),X,Y,j,R,Z,J,K,ee,te,se,ne,_e,ie=k((()=>{le(),re(),X={class:"outline-panel"},Y={class:"outline-header"},j={class:"outline-title"},R={class:"outline-content"},Z=["onClick"],J={class:"user-question"},K={class:"q-text"},ee=["onClick"],te={class:"heading-item"},se={class:"heading-text"},ne={key:1,class:"outline-empty"},_e=ae({__name:"OutlinePanel",props:{messages:{}},setup(t){const v=t,{t:d}=ue();function f(l,e){const s=[],a=l.replace(/<think>[\s\S]*?<\/think>/g,"").split(`
1
+ import{n as k}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as oe,D as fe,Ht as m,P as ge,Pt as ke,Q as L,Tt as b,W as le,Z as B,_t as ye,at as c,bt as Me,ct as I,d as xe,it as g,lt as ae,mt as $e,nt as n,rt as A,st as P,t as Se,tt as M,vt as r,zt as _}from"./ui-vendor-BMwF7QXa.js";import{n as re,r as ue}from"./vue-vendor-kBYBtqCg.js";import{n as ce,t as de}from"./_plugin-vue_export-helper-CHoatqkO.js";import{c as we,l as Te,r as be,t as Ce}from"./profiles-CyjgPK1f.js";import{B as Be,V as Pe}from"./index-DpU5R9KV.js";function Ue(t){return t?he[t]||t:""}function me(t){if(!t)return"";const v=new Date(t),d=new Date;return v.toDateString()===d.toDateString()?v.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):v.toLocaleDateString([],{month:"short",day:"numeric"})}function We(t){return me(t*1e3)}var he,Le=k((()=>{he={telegram:"Telegram",api_server:"API Server",cli:"CLI",discord:"Discord",slack:"Slack",matrix:"Matrix",whatsapp:"WhatsApp",signal:"Signal",email:"Email",sms:"SMS",dingtalk:"DingTalk",feishu:"Feishu",wecom:"WeCom",weixin:"WeChat",bluebubbles:"iMessage",mattermost:"Mattermost",cron:"Cron"}})),D,E,N,O,V,q,z,Q,U,W,F,H,pe,G=k((()=>{le(),Se(),re(),we(),Ce(),Pe(),Le(),D=["aria-current"],E={key:0,class:"session-item-checkbox"},N={class:"session-item-content"},O={class:"session-item-title-row"},V={key:0,class:"session-item-pin","aria-hidden":"true"},q={class:"session-item-title"},z={key:0,class:"session-item-streaming",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round"},Q={class:"session-item-meta"},U=["title"],W={class:"session-item-time"},F={key:0,class:"session-item-profile"},H={class:"session-item-profile-name"},pe=ae({__name:"SessionListItem",props:{session:{},active:{type:Boolean},pinned:{type:Boolean},canDelete:{type:Boolean},streaming:{type:Boolean},selectable:{type:Boolean},selected:{type:Boolean},showProfile:{type:Boolean,default:!0}},emits:["select","contextmenu","delete","toggle-select"],setup(t,{emit:v}){const d=t,f=v,{t:x}=ue(),y=Te(),$=be(),l=M(()=>d.session.model?y.displayModelName(d.session.model,d.session.provider):""),e=M(()=>d.session.profile||"default"),s=M(()=>$.profiles.find(p=>p.name===e.value)?.avatar),a=M(()=>!!y.profileModelGroups.find(p=>p.profile===e.value)?.groups?.some(p=>p.models.length>0)),o=M(()=>y.profileModelGroups.length>0&&!a.value);let u=null;const h=ke(!1);function S(p){h.value=!1,u=setTimeout(()=>{h.value=!0;const i=p.touches[0];f("contextmenu",new MouseEvent("contextmenu",{clientX:i.clientX,clientY:i.clientY,bubbles:!0}))},500)}function w(){u&&(clearTimeout(u),u=null)}function T(){u&&(clearTimeout(u),u=null)}function ve(){if(h.value){h.value=!1;return}f("select")}return ye(()=>{u&&clearTimeout(u)}),(p,i)=>(r(),c("button",{class:oe(["session-item",{active:t.active,"batch-mode":t.selectable,"missing-models":o.value}]),"aria-current":t.active?"page":void 0,onClick:ve,onContextmenu:i[4]||(i[4]=C=>f("contextmenu",C)),onTouchstart:S,onTouchend:w,onTouchmove:T},[t.selectable?(r(),c("div",E,[I(_(ge),{checked:t.selected,onClick:i[0]||(i[0]=B(C=>f("toggle-select"),["stop"]))},null,8,["checked"])])):g("",!0),n("div",N,[n("span",O,[t.pinned?(r(),c("span",V,[...i[5]||(i[5]=[n("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[n("path",{d:"M12 17v5"}),n("path",{d:"M5 8l14 0"}),n("path",{d:"M8 3l8 0 0 5 3 5-14 0 3-5z"})],-1)])])):g("",!0),n("span",q,[t.streaming?(r(),c("svg",z,[...i[6]||(i[6]=[n("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])])):g("",!0),P(" "+m(t.session.title),1)]),o.value?(r(),A(_(fe),{key:1,trigger:"click",placement:"top"},{trigger:b(()=>[n("button",{class:"session-item-warning",type:"button",onClick:i[1]||(i[1]=B(()=>{},["stop"]))}," ! ")]),default:b(()=>[P(" "+m(_(x)("chat.profileMissingModelsTip",{profile:e.value})),1)]),_:1})):g("",!0)]),n("span",Q,[l.value?(r(),c("span",{key:0,class:"session-item-model",title:t.session.model},m(l.value),9,U)):g("",!0),n("span",W,m(_(me)(t.session.createdAt)),1)]),d.showProfile?(r(),c("span",F,[I(Be,{class:"session-item-profile-avatar",name:e.value,avatar:s.value,size:16},null,8,["name","avatar"]),n("span",H,m(e.value),1)])):g("",!0)]),t.canDelete&&!t.selectable?(r(),A(_(xe),{key:1,onPositiveClick:i[3]||(i[3]=C=>f("delete"))},{trigger:b(()=>[n("button",{class:"session-item-delete",onClick:i[2]||(i[2]=B(()=>{},["stop"]))},[...i[7]||(i[7]=[n("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),default:b(()=>[P(" "+m(_(x)("chat.deleteSession")),1)]),_:1})):g("",!0)],42,D))}})})),Ie=k((()=>{})),Ae,Fe=k((()=>{G(),G(),Ie(),ce(),Ae=de(pe,[["__scopeId","data-v-36a6e2dd"]])})),X,Y,j,R,Z,J,K,ee,te,se,ne,_e,ie=k((()=>{le(),re(),X={class:"outline-panel"},Y={class:"outline-header"},j={class:"outline-title"},R={class:"outline-content"},Z=["onClick"],J={class:"user-question"},K={class:"q-text"},ee=["onClick"],te={class:"heading-item"},se={class:"heading-text"},ne={key:1,class:"outline-empty"},_e=ae({__name:"OutlinePanel",props:{messages:{}},setup(t){const v=t,{t:d}=ue();function f(l,e){const s=[],a=l.replace(/<think>[\s\S]*?<\/think>/g,"").split(`
2
2
  `);let o=0;for(const u of a){const h=u.trim(),S=h.match(/^#\s+(.+)/),w=h.match(/^##\s+(.+)/),T=h.match(/^###\s+(.+)/);S?(o++,s.push({id:`outline-${e}-h${o}`,type:"outline",content:S[1].trim(),messageId:e,level:1,anchorId:`msg-${e}-heading-${o}`})):w?(o++,s.push({id:`outline-${e}-h${o}`,type:"outline",content:w[1].trim(),messageId:e,level:2,anchorId:`msg-${e}-heading-${o}`})):T&&(o++,s.push({id:`outline-${e}-h${o}`,type:"outline",content:T[1].trim(),messageId:e,level:3,anchorId:`msg-${e}-heading-${o}`}))}return s}function x(l){const e=l.replace(/<think>[\s\S]*?<\/think>/g,"").split(`
3
3
  `)[0]||"";return e.length>50?e.slice(0,50)+"...":e||d("chat.outlineUserQuestion")}const y=M(()=>{const l=[];let e=0;const s=v.messages.filter(a=>a.role==="user"||a.role==="assistant");for(;e<s.length;){const a=s[e];if(a.role==="user"){for(l.push({id:`user-${a.id}`,type:"user",content:x(a.content||""),messageId:a.id,level:0,anchorId:`message-${a.id}`}),e++;e<s.length&&s[e].role!=="assistant";)e++;if(e<s.length){const o=s[e],u=f(o.content||"",o.id);l.push(...u)}}e++}return l});function $(l){console.log("Attempting to scroll to anchor:",l),$e(()=>{const e=document.getElementById(l);console.log("Found element:",e),e?e.scrollIntoView({behavior:"smooth",block:"start"}):(console.log("All heading elements on page:"),document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(s=>{console.log(" -",s.id,":",s.textContent?.slice(0,50))}))})}return(l,e)=>(r(),c("div",X,[n("div",Y,[n("span",j,m(_(d)("chat.outlineTitle")),1)]),n("div",R,[y.value.length>0?(r(!0),c(L,{key:0},Me(y.value,s=>(r(),c(L,{key:s.id},[s.type==="user"?(r(),c("div",{key:0,class:"outline-item user-item",onClick:a=>$(s.anchorId)},[n("div",J,[e[0]||(e[0]=n("span",{class:"q-label"},"Q:",-1)),n("span",K,m(s.content),1)])],8,Z)):(r(),c("div",{key:1,class:oe(["outline-item outline-heading-item",`level-${s.level}`]),onClick:a=>$(s.anchorId)},[n("div",te,[n("span",se,m(s.content),1)])],10,ee))],64))),128)):(r(),c("div",ne,m(_(d)("chat.outlineEmpty")),1))])]))}})})),De=k((()=>{})),Ee,He=k((()=>{ie(),ie(),De(),ce(),Ee=de(_e,[["__scopeId","data-v-f426d6f3"]])}));export{We as a,Fe as i,He as n,Ue as o,Ae as r,Le as s,Ee as t};
@@ -1 +1 @@
1
- import{n as g}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as M,Ht as s,I as C,Pt as w,Q as $,Tt as P,Vt as S,W as ge,at as u,bt as V,ct as k,gt as be,ht as we,it as h,l as Pe,lt as ke,nt as e,st as x,t as Be,tt as y,vt as m,y as Me,zt as a}from"./ui-vendor-BMwF7QXa.js";import{n as Ce,r as $e}from"./vue-vendor-kBYBtqCg.js";import{d as Se,l as Ve,n as xe,t as Re}from"./_plugin-vue_export-helper-B8gz9Iqn.js";async function Ie(){return Se("/api/hermes/performance/runtime")}var Fe=g((()=>{Ve()})),R,I,F,N,U,z,D,T,W,A,L,O,j,q,E,G,H,K,Q,J,X,Y,Z,ee,se,te,re,ne,ae,le,oe,ie,ue,ce,me=g((()=>{ge(),Be(),Ce(),Fe(),R={class:"performance-view"},I={class:"page-header"},F={class:"header-title"},N={class:"header-actions"},U={key:0,class:"performance-content"},z={class:"summary-grid"},D={class:"summary-item"},T={class:"summary-label"},W={class:"meter"},A={class:"summary-item"},L={class:"summary-label"},O={class:"meter"},j={class:"summary-item"},q={class:"summary-label"},E={class:"summary-item"},G={class:"summary-label"},H={class:"runtime-section"},K={class:"section-header"},Q={class:"process-grid"},J={class:"process-row"},X={class:"status running"},Y={class:"process-row"},Z={key:0,class:"runtime-error"},ee={class:"runtime-section"},se={class:"section-header"},te={class:"worker-table-wrap"},re={class:"worker-table"},ne={key:0},ae={colspan:"7",class:"empty-cell"},le={class:"runtime-section"},oe={class:"section-header"},ie={class:"session-list"},ue={key:0,class:"session-empty"},ce=ke({__name:"PerformanceView",setup(De){const{t:n}=$e(),de=Me(),t=w(null),p=w(!1),f=w(!0);let c;const _e=y(()=>t.value?.bridge.broker.process?.memoryRssBytes??null),pe=y(()=>t.value?.web.memory.rss??null),fe=y(()=>t.value?.bridge.workers.length??0),ve=y(()=>t.value?.bridge.workers.filter(r=>r.running).length??0);function d(r){if(r==null||!Number.isFinite(r))return"-";const o=["B","KB","MB","GB","TB"];let l=r,i=0;for(;l>=1024&&i<o.length-1;)l/=1024,i+=1;return`${l.toFixed(i===0?0:1)} ${o[i]}`}function _(r){return r==null||!Number.isFinite(r)?"-":`${r.toFixed(1)}%`}function he(r){if(r==null||!Number.isFinite(r))return"-";const o=Math.floor(r/86400),l=Math.floor(r%86400/3600),i=Math.floor(r%3600/60);return o>0?`${o}d ${l}h`:l>0?`${l}h ${i}m`:`${i}m`}function ye(r){return r?new Date(r*1e3).toLocaleString():"-"}function v(r){return n(r?"performance.running":"performance.stopped")}async function b(r=!0){p.value=!0;try{t.value=await Ie()}catch(o){r&&de.error(o?.message||n("performance.loadFailed"))}finally{p.value=!1}}function B(r){f.value=r,c&&(clearInterval(c),c=void 0),r&&(c=setInterval(()=>b(!1),5e3))}return be(()=>{b(),B(!0)}),we(()=>{c&&clearInterval(c)}),(r,o)=>(m(),u("div",R,[e("header",I,[e("h2",F,s(a(n)("performance.title")),1),e("div",N,[k(a(C),{size:"small",type:f.value?"primary":"default",secondary:"",onClick:o[0]||(o[0]=l=>B(!f.value))},{default:P(()=>[x(s(f.value?a(n)("performance.autoRefreshOn"):a(n)("performance.autoRefreshOff")),1)]),_:1},8,["type"]),k(a(C),{size:"small",loading:p.value,onClick:o[1]||(o[1]=l=>b())},{default:P(()=>[x(s(a(n)("performance.refresh")),1)]),_:1},8,["loading"])])]),k(a(Pe),{show:p.value&&!t.value,class:"performance-spin"},{default:P(()=>[t.value?(m(),u("main",U,[e("section",z,[e("div",D,[e("span",T,s(a(n)("performance.systemCpu")),1),e("strong",null,s(_(t.value.system.cpuPercent)),1),e("div",W,[e("span",{style:S({width:`${t.value.system.cpuPercent||0}%`})},null,4)])]),e("div",A,[e("span",L,s(a(n)("performance.systemMemory")),1),e("strong",null,s(_(t.value.system.memoryPercent)),1),e("small",null,s(d(t.value.system.usedMemoryBytes))+" / "+s(d(t.value.system.totalMemoryBytes)),1),e("div",O,[e("span",{style:S({width:`${t.value.system.memoryPercent||0}%`})},null,4)])]),e("div",j,[e("span",q,s(a(n)("performance.activeSessions")),1),e("strong",null,s(t.value.sessions.active),1),e("small",null,s(a(n)("performance.runningSessions",{count:t.value.sessions.running})),1)]),e("div",E,[e("span",G,s(a(n)("performance.workers")),1),e("strong",null,s(ve.value)+" / "+s(fe.value),1),e("small",null,s(a(n)("performance.totalWorkerMemory"))+" "+s(d(t.value.bridge.totalWorkerMemoryRssBytes)),1)])]),e("section",H,[e("div",K,[e("h3",null,s(a(n)("performance.processes")),1),e("span",null,s(t.value.system.platform)+" "+s(t.value.system.arch)+" · "+s(t.value.system.cpuCount)+" CPU · "+s(a(n)("performance.uptime"))+" "+s(he(t.value.system.uptimeSeconds)),1)]),e("div",Q,[e("div",J,[e("div",null,[o[2]||(o[2]=e("strong",null,"Web UI",-1)),e("span",null,"PID "+s(t.value.web.pid),1)]),e("span",null,s(_(t.value.web.cpuPercent)),1),e("span",null,s(d(pe.value)),1),e("span",X,s(v(!0)),1)]),e("div",Y,[e("div",null,[o[3]||(o[3]=e("strong",null,"Bridge Broker",-1)),e("span",null,s(t.value.bridge.endpoint),1)]),e("span",null,s(_(t.value.bridge.broker.process?.cpuPercent)),1),e("span",null,s(d(_e.value)),1),e("span",{class:M(["status",{running:t.value.bridge.reachable&&t.value.bridge.broker.running}])},s(t.value.bridge.reachable&&t.value.bridge.broker.running?v(!0):v(!1)),3)])]),t.value.bridge.error?(m(),u("div",Z,s(t.value.bridge.error),1)):h("",!0)]),e("section",ee,[e("div",se,[e("h3",null,s(a(n)("performance.workerMemory")),1),e("span",null,s(a(n)("performance.lastUpdated"))+" "+s(new Date(t.value.timestamp).toLocaleTimeString()),1)]),e("div",te,[e("table",re,[e("thead",null,[e("tr",null,[e("th",null,s(a(n)("performance.profile")),1),o[4]||(o[4]=e("th",null,"PID",-1)),o[5]||(o[5]=e("th",null,"CPU",-1)),e("th",null,s(a(n)("performance.memory")),1),e("th",null,s(a(n)("performance.runningActiveSessions")),1),e("th",null,s(a(n)("performance.lastUsed")),1),e("th",null,s(a(n)("performance.status")),1)])]),e("tbody",null,[t.value.bridge.workers.length===0?(m(),u("tr",ne,[e("td",ae,s(a(n)("performance.noWorkers")),1)])):h("",!0),(m(!0),u($,null,V(t.value.bridge.workers,l=>(m(),u("tr",{key:l.profile||l.pid},[e("td",null,s(l.profile||"-"),1),e("td",null,s(l.pid||"-"),1),e("td",null,s(_(l.cpuPercent)),1),e("td",null,s(d(l.memoryRssBytes)),1),e("td",null,s(l.runningSessionCount)+" / "+s(l.sessionCount),1),e("td",null,s(ye(l.lastUsedAt)),1),e("td",null,[e("span",{class:M(["status",{running:l.running}])},s(v(l.running)),3)])]))),128))])])])]),e("section",le,[e("div",oe,[e("h3",null,s(a(n)("performance.sessionsByProfile")),1)]),e("div",ie,[Object.keys(t.value.sessions.byProfile).length===0?(m(),u("div",ue,s(a(n)("performance.noActiveSessions")),1)):h("",!0),(m(!0),u($,null,V(t.value.sessions.byProfile,(l,i)=>(m(),u("div",{key:i,class:"session-row"},[e("span",null,s(i),1),e("strong",null,s(l),1)]))),128))])])])):h("",!0)]),_:1},8,["show"])]))}})})),Ne=g((()=>{})),Ue,ze=g((()=>{me(),me(),Ne(),xe(),Ue=Re(ce,[["__scopeId","data-v-1a62c0a5"]])}));ze();export{Ue as default};
1
+ import{n as g}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as M,Ht as s,I as C,Pt as w,Q as $,Tt as P,Vt as S,W as ge,at as u,bt as V,ct as k,gt as be,ht as we,it as h,l as Pe,lt as ke,nt as e,st as x,t as Be,tt as y,vt as m,y as Me,zt as a}from"./ui-vendor-BMwF7QXa.js";import{n as Ce,r as $e}from"./vue-vendor-kBYBtqCg.js";import{d as Se,l as Ve,n as xe,t as Re}from"./_plugin-vue_export-helper-CHoatqkO.js";async function Ie(){return Se("/api/hermes/performance/runtime")}var Fe=g((()=>{Ve()})),R,I,F,N,U,z,D,T,W,A,L,O,j,q,E,G,H,K,Q,J,X,Y,Z,ee,se,te,re,ne,ae,le,oe,ie,ue,ce,me=g((()=>{ge(),Be(),Ce(),Fe(),R={class:"performance-view"},I={class:"page-header"},F={class:"header-title"},N={class:"header-actions"},U={key:0,class:"performance-content"},z={class:"summary-grid"},D={class:"summary-item"},T={class:"summary-label"},W={class:"meter"},A={class:"summary-item"},L={class:"summary-label"},O={class:"meter"},j={class:"summary-item"},q={class:"summary-label"},E={class:"summary-item"},G={class:"summary-label"},H={class:"runtime-section"},K={class:"section-header"},Q={class:"process-grid"},J={class:"process-row"},X={class:"status running"},Y={class:"process-row"},Z={key:0,class:"runtime-error"},ee={class:"runtime-section"},se={class:"section-header"},te={class:"worker-table-wrap"},re={class:"worker-table"},ne={key:0},ae={colspan:"7",class:"empty-cell"},le={class:"runtime-section"},oe={class:"section-header"},ie={class:"session-list"},ue={key:0,class:"session-empty"},ce=ke({__name:"PerformanceView",setup(De){const{t:n}=$e(),de=Me(),t=w(null),p=w(!1),f=w(!0);let c;const _e=y(()=>t.value?.bridge.broker.process?.memoryRssBytes??null),pe=y(()=>t.value?.web.memory.rss??null),fe=y(()=>t.value?.bridge.workers.length??0),ve=y(()=>t.value?.bridge.workers.filter(r=>r.running).length??0);function d(r){if(r==null||!Number.isFinite(r))return"-";const o=["B","KB","MB","GB","TB"];let l=r,i=0;for(;l>=1024&&i<o.length-1;)l/=1024,i+=1;return`${l.toFixed(i===0?0:1)} ${o[i]}`}function _(r){return r==null||!Number.isFinite(r)?"-":`${r.toFixed(1)}%`}function he(r){if(r==null||!Number.isFinite(r))return"-";const o=Math.floor(r/86400),l=Math.floor(r%86400/3600),i=Math.floor(r%3600/60);return o>0?`${o}d ${l}h`:l>0?`${l}h ${i}m`:`${i}m`}function ye(r){return r?new Date(r*1e3).toLocaleString():"-"}function v(r){return n(r?"performance.running":"performance.stopped")}async function b(r=!0){p.value=!0;try{t.value=await Ie()}catch(o){r&&de.error(o?.message||n("performance.loadFailed"))}finally{p.value=!1}}function B(r){f.value=r,c&&(clearInterval(c),c=void 0),r&&(c=setInterval(()=>b(!1),5e3))}return be(()=>{b(),B(!0)}),we(()=>{c&&clearInterval(c)}),(r,o)=>(m(),u("div",R,[e("header",I,[e("h2",F,s(a(n)("performance.title")),1),e("div",N,[k(a(C),{size:"small",type:f.value?"primary":"default",secondary:"",onClick:o[0]||(o[0]=l=>B(!f.value))},{default:P(()=>[x(s(f.value?a(n)("performance.autoRefreshOn"):a(n)("performance.autoRefreshOff")),1)]),_:1},8,["type"]),k(a(C),{size:"small",loading:p.value,onClick:o[1]||(o[1]=l=>b())},{default:P(()=>[x(s(a(n)("performance.refresh")),1)]),_:1},8,["loading"])])]),k(a(Pe),{show:p.value&&!t.value,class:"performance-spin"},{default:P(()=>[t.value?(m(),u("main",U,[e("section",z,[e("div",D,[e("span",T,s(a(n)("performance.systemCpu")),1),e("strong",null,s(_(t.value.system.cpuPercent)),1),e("div",W,[e("span",{style:S({width:`${t.value.system.cpuPercent||0}%`})},null,4)])]),e("div",A,[e("span",L,s(a(n)("performance.systemMemory")),1),e("strong",null,s(_(t.value.system.memoryPercent)),1),e("small",null,s(d(t.value.system.usedMemoryBytes))+" / "+s(d(t.value.system.totalMemoryBytes)),1),e("div",O,[e("span",{style:S({width:`${t.value.system.memoryPercent||0}%`})},null,4)])]),e("div",j,[e("span",q,s(a(n)("performance.activeSessions")),1),e("strong",null,s(t.value.sessions.active),1),e("small",null,s(a(n)("performance.runningSessions",{count:t.value.sessions.running})),1)]),e("div",E,[e("span",G,s(a(n)("performance.workers")),1),e("strong",null,s(ve.value)+" / "+s(fe.value),1),e("small",null,s(a(n)("performance.totalWorkerMemory"))+" "+s(d(t.value.bridge.totalWorkerMemoryRssBytes)),1)])]),e("section",H,[e("div",K,[e("h3",null,s(a(n)("performance.processes")),1),e("span",null,s(t.value.system.platform)+" "+s(t.value.system.arch)+" · "+s(t.value.system.cpuCount)+" CPU · "+s(a(n)("performance.uptime"))+" "+s(he(t.value.system.uptimeSeconds)),1)]),e("div",Q,[e("div",J,[e("div",null,[o[2]||(o[2]=e("strong",null,"Web UI",-1)),e("span",null,"PID "+s(t.value.web.pid),1)]),e("span",null,s(_(t.value.web.cpuPercent)),1),e("span",null,s(d(pe.value)),1),e("span",X,s(v(!0)),1)]),e("div",Y,[e("div",null,[o[3]||(o[3]=e("strong",null,"Bridge Broker",-1)),e("span",null,s(t.value.bridge.endpoint),1)]),e("span",null,s(_(t.value.bridge.broker.process?.cpuPercent)),1),e("span",null,s(d(_e.value)),1),e("span",{class:M(["status",{running:t.value.bridge.reachable&&t.value.bridge.broker.running}])},s(t.value.bridge.reachable&&t.value.bridge.broker.running?v(!0):v(!1)),3)])]),t.value.bridge.error?(m(),u("div",Z,s(t.value.bridge.error),1)):h("",!0)]),e("section",ee,[e("div",se,[e("h3",null,s(a(n)("performance.workerMemory")),1),e("span",null,s(a(n)("performance.lastUpdated"))+" "+s(new Date(t.value.timestamp).toLocaleTimeString()),1)]),e("div",te,[e("table",re,[e("thead",null,[e("tr",null,[e("th",null,s(a(n)("performance.profile")),1),o[4]||(o[4]=e("th",null,"PID",-1)),o[5]||(o[5]=e("th",null,"CPU",-1)),e("th",null,s(a(n)("performance.memory")),1),e("th",null,s(a(n)("performance.runningActiveSessions")),1),e("th",null,s(a(n)("performance.lastUsed")),1),e("th",null,s(a(n)("performance.status")),1)])]),e("tbody",null,[t.value.bridge.workers.length===0?(m(),u("tr",ne,[e("td",ae,s(a(n)("performance.noWorkers")),1)])):h("",!0),(m(!0),u($,null,V(t.value.bridge.workers,l=>(m(),u("tr",{key:l.profile||l.pid},[e("td",null,s(l.profile||"-"),1),e("td",null,s(l.pid||"-"),1),e("td",null,s(_(l.cpuPercent)),1),e("td",null,s(d(l.memoryRssBytes)),1),e("td",null,s(l.runningSessionCount)+" / "+s(l.sessionCount),1),e("td",null,s(ye(l.lastUsedAt)),1),e("td",null,[e("span",{class:M(["status",{running:l.running}])},s(v(l.running)),3)])]))),128))])])])]),e("section",le,[e("div",oe,[e("h3",null,s(a(n)("performance.sessionsByProfile")),1)]),e("div",ie,[Object.keys(t.value.sessions.byProfile).length===0?(m(),u("div",ue,s(a(n)("performance.noActiveSessions")),1)):h("",!0),(m(!0),u($,null,V(t.value.sessions.byProfile,(l,i)=>(m(),u("div",{key:i,class:"session-row"},[e("span",null,s(i),1),e("strong",null,s(l),1)]))),128))])])])):h("",!0)]),_:1},8,["show"])]))}})})),Ne=g((()=>{})),Ue,ze=g((()=>{me(),me(),Ne(),xe(),Ue=Re(ce,[["__scopeId","data-v-1a62c0a5"]])}));ze();export{Ue as default};
@@ -1 +1 @@
1
- import{n as C}from"./rolldown-runtime-BKwlnUi0.js";import{A as T,B as z,Ct as Ce,Ht as t,I as A,Pt as v,Q as F,Tt as p,U as Ve,V as B,W as xe,at as r,bt as U,ct as c,it as _,l as Te,lt as ze,nt as e,rt as P,st as o,t as Be,tt as h,vt as i,y as Ee,z as Le,zt as a}from"./ui-vendor-BMwF7QXa.js";import{n as Me,r as Ne}from"./vue-vendor-kBYBtqCg.js";import{d as $e,l as Ae,n as Fe,t as Ue}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{r as qe,t as Ie}from"./profiles-DiEn61KW.js";async function Oe(){return $e("/api/hermes/plugins")}var je=C((()=>{Ae()})),q,I,O,j,H,Q,R,D,K,W,G,J,X,Y,Z,ee,ae,te,se,le,ne,ue,ie,re,oe,de,ce,ve,pe,fe,_e=C((()=>{xe(),Be(),Me(),je(),Ie(),q={class:"plugins-view"},I={class:"page-header"},O={class:"header-title"},j={class:"plugins-content"},H={class:"summary-grid"},Q={class:"summary-card"},R={class:"summary-label"},D={class:"summary-card success"},K={class:"summary-label"},W={class:"summary-card warning"},G={class:"summary-label"},J={class:"summary-card error"},X={class:"summary-label"},Y={class:"summary-card info"},Z={class:"summary-label"},ee={class:"filter-row"},ae={key:0,class:"plugins-table-wrap"},te={class:"plugins-table"},se={class:"plugin-name"},le={key:0},ne={key:0,class:"description"},ue={key:1,class:"meta-line"},ie={key:0},re={key:1},oe={class:"config-status"},de={class:"capability-list"},ce={class:"path-cell"},ve={key:1,class:"muted"},pe={key:1,class:"metadata-panel"},fe=ze({__name:"PluginsView",setup(De){const{t:n,te:E}=Ne(),me=Ee(),y=qe(),d=v([]),V=v([]),f=v(null),m=v(!1),b=v(""),x=v(""),k=v(null),w=v(null),S=v(null),ge=["enabled","auto-active","inactive","disabled","provider-managed"],he=h(()=>ge.map(s=>({label:n(`plugins.status.${s}`),value:s}))),ye=h(()=>M(d.value.map(s=>s.source))),be=h(()=>M(d.value.map(s=>s.kind))),g=h(()=>({total:d.value.length,active:d.value.filter(s=>s.effectiveStatus==="enabled"||s.effectiveStatus==="auto-active").length,inactive:d.value.filter(s=>s.effectiveStatus==="inactive").length,disabled:d.value.filter(s=>s.effectiveStatus==="disabled").length,providerManaged:d.value.filter(s=>s.effectiveStatus==="provider-managed").length})),L=h(()=>{const s=x.value.trim().toLowerCase();return d.value.filter(u=>k.value&&u.source!==k.value||w.value&&u.kind!==w.value||S.value&&u.effectiveStatus!==S.value?!1:s?[u.key,u.name,u.description,u.path,u.source,u.kind].some(l=>String(l||"").toLowerCase().includes(s)):!0)});function M(s){return Array.from(new Set(s.filter(Boolean))).sort((u,l)=>u.localeCompare(l)).map(u=>({label:u,value:u}))}async function N(){m.value=!0,b.value="";try{(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles();const s=await Oe();d.value=s.plugins??[],V.value=s.warnings??[],f.value=s.metadata??null}catch(s){b.value=s?.message||n("plugins.loadFailed")}finally{m.value=!1}}function ke(s){const u=`plugins.statusLabel.${s.effectiveStatus}`;return E(u)?n(u):s.effectiveStatus}function we(s){const u=`plugins.configStatuses.${s.configStatus}`;return E(u)?n(u):s.configStatus}function Se(s){switch(s.effectiveStatus){case"enabled":case"auto-active":return"success";case"disabled":return"error";case"provider-managed":return"info";default:return"warning"}}function $(s){const u=s.key.replace(/'/g,"'\\''");return s.effectiveStatus==="disabled"||s.effectiveStatus==="inactive"?`hermes plugins enable '${u}'`:s.effectiveStatus==="enabled"?`hermes plugins disable '${u}'`:""}async function Pe(s){const u=$(s);u&&(await navigator.clipboard.writeText(u),me.success(n("plugins.commandCopied")))}return Ce(()=>y.activeProfileName||"default",()=>{d.value=[],V.value=[],f.value=null,N()},{immediate:!0}),(s,u)=>(i(),r("div",q,[e("header",I,[e("h2",O,t(a(n)("plugins.title")),1),c(a(A),{size:"small",quaternary:"",loading:m.value,onClick:N},{default:p(()=>[o(t(a(n)("plugins.refresh")),1)]),_:1},8,["loading"])]),e("div",j,[c(a(z),{type:"info",bordered:!1,class:"plugins-notice"},{default:p(()=>[o(t(a(n)("plugins.notice")),1)]),_:1}),b.value?(i(),P(a(z),{key:0,type:"error",class:"plugins-notice"},{default:p(()=>[o(t(b.value),1)]),_:1})):_("",!0),(i(!0),r(F,null,U(V.value,l=>(i(),P(a(z),{key:l,type:"warning",class:"plugins-notice"},{default:p(()=>[o(t(l),1)]),_:2},1024))),128)),e("div",H,[e("div",Q,[e("span",R,t(a(n)("plugins.summary.total")),1),e("strong",null,t(g.value.total),1)]),e("div",D,[e("span",K,t(a(n)("plugins.summary.active")),1),e("strong",null,t(g.value.active),1)]),e("div",W,[e("span",G,t(a(n)("plugins.summary.inactive")),1),e("strong",null,t(g.value.inactive),1)]),e("div",J,[e("span",X,t(a(n)("plugins.summary.disabled")),1),e("strong",null,t(g.value.disabled),1)]),e("div",Y,[e("span",Z,t(a(n)("plugins.summary.providerManaged")),1),e("strong",null,t(g.value.providerManaged),1)])]),e("div",ee,[c(a(Le),{value:x.value,"onUpdate:value":u[0]||(u[0]=l=>x.value=l),placeholder:a(n)("plugins.searchPlaceholder"),clearable:""},null,8,["value","placeholder"]),c(a(T),{value:k.value,"onUpdate:value":u[1]||(u[1]=l=>k.value=l),options:ye.value,placeholder:a(n)("plugins.source"),clearable:""},null,8,["value","options","placeholder"]),c(a(T),{value:w.value,"onUpdate:value":u[2]||(u[2]=l=>w.value=l),options:be.value,placeholder:a(n)("plugins.kind"),clearable:""},null,8,["value","options","placeholder"]),c(a(T),{value:S.value,"onUpdate:value":u[3]||(u[3]=l=>S.value=l),options:he.value,placeholder:a(n)("plugins.statusTitle"),clearable:""},null,8,["value","options","placeholder"])]),c(a(Te),{show:m.value&&d.value.length===0},{default:p(()=>[L.value.length?(i(),r("div",ae,[e("table",te,[e("thead",null,[e("tr",null,[e("th",null,t(a(n)("plugins.table.plugin")),1),e("th",null,t(a(n)("plugins.table.status")),1),e("th",null,t(a(n)("plugins.table.source")),1),e("th",null,t(a(n)("plugins.table.kind")),1),e("th",null,t(a(n)("plugins.table.capabilities")),1),e("th",null,t(a(n)("plugins.table.path")),1),e("th",null,t(a(n)("plugins.table.cli")),1)])]),e("tbody",null,[(i(!0),r(F,null,U(L.value,l=>(i(),r("tr",{key:l.key},[e("td",null,[e("div",se,[e("strong",null,t(l.key),1),l.name!==l.key?(i(),r("span",le,t(l.name),1)):_("",!0)]),l.description?(i(),r("div",ne,t(l.description),1)):_("",!0),l.version||l.author?(i(),r("div",ue,[l.version?(i(),r("span",ie,"v"+t(l.version),1)):_("",!0),l.author?(i(),r("span",re,t(l.author),1)):_("",!0)])):_("",!0)]),e("td",null,[c(a(B),{size:"small",type:Se(l)},{default:p(()=>[o(t(ke(l)),1)]),_:2},1032,["type"]),e("div",oe,t(a(n)("plugins.configStatus",{status:we(l)})),1)]),e("td",null,[c(a(B),{size:"small",round:""},{default:p(()=>[o(t(l.source),1)]),_:2},1024)]),e("td",null,[c(a(B),{size:"small",round:""},{default:p(()=>[o(t(l.kind),1)]),_:2},1024)]),e("td",null,[e("div",de,[e("span",null,t(a(n)("plugins.capabilities.tools",{count:l.providesTools.length})),1),e("span",null,t(a(n)("plugins.capabilities.hooks",{count:l.providesHooks.length})),1),e("span",null,t(a(n)("plugins.capabilities.env",{count:l.requiresEnv.length})),1)])]),e("td",null,[e("code",ce,t(l.path||a(n)("plugins.notAvailable")),1)]),e("td",null,[$(l)?(i(),P(a(A),{key:0,size:"tiny",secondary:"",onClick:Ke=>Pe(l)},{default:p(()=>[o(t(a(n)("plugins.copyCommand")),1)]),_:1},8,["onClick"])):(i(),r("span",ve,t(a(n)("plugins.managedElsewhere")),1))])]))),128))])])])):m.value?_("",!0):(i(),P(a(Ve),{key:1,description:a(n)("plugins.noMatch")},null,8,["description"]))]),_:1},8,["show"]),f.value?(i(),r("div",pe,[e("span",null,[o(t(a(n)("plugins.metadata.agentRoot"))+": ",1),e("code",null,t(f.value.hermesAgentRoot),1)]),e("span",null,[o(t(a(n)("plugins.metadata.python"))+": ",1),e("code",null,t(f.value.pythonExecutable),1)]),e("span",null,[o(t(a(n)("plugins.metadata.scanCwd"))+": ",1),e("code",null,t(f.value.cwd),1)]),e("span",null,[o(t(a(n)("plugins.metadata.projectPlugins"))+": ",1),e("code",null,t(f.value.projectPluginsEnabled?a(n)("plugins.enabled"):a(n)("plugins.disabled")),1)])])):_("",!0)])]))}})})),He=C((()=>{})),Qe,Re=C((()=>{_e(),_e(),He(),Fe(),Qe=Ue(fe,[["__scopeId","data-v-4d517283"]])}));Re();export{Qe as default};
1
+ import{n as C}from"./rolldown-runtime-BKwlnUi0.js";import{A as T,B as z,Ct as Ce,Ht as t,I as A,Pt as v,Q as F,Tt as p,U as Ve,V as B,W as xe,at as r,bt as U,ct as c,it as _,l as Te,lt as ze,nt as e,rt as P,st as o,t as Be,tt as h,vt as i,y as Ee,z as Le,zt as a}from"./ui-vendor-BMwF7QXa.js";import{n as Me,r as Ne}from"./vue-vendor-kBYBtqCg.js";import{d as $e,l as Ae,n as Fe,t as Ue}from"./_plugin-vue_export-helper-CHoatqkO.js";import{r as qe,t as Ie}from"./profiles-CyjgPK1f.js";async function Oe(){return $e("/api/hermes/plugins")}var je=C((()=>{Ae()})),q,I,O,j,H,Q,R,D,K,W,G,J,X,Y,Z,ee,ae,te,se,le,ne,ue,ie,re,oe,de,ce,ve,pe,fe,_e=C((()=>{xe(),Be(),Me(),je(),Ie(),q={class:"plugins-view"},I={class:"page-header"},O={class:"header-title"},j={class:"plugins-content"},H={class:"summary-grid"},Q={class:"summary-card"},R={class:"summary-label"},D={class:"summary-card success"},K={class:"summary-label"},W={class:"summary-card warning"},G={class:"summary-label"},J={class:"summary-card error"},X={class:"summary-label"},Y={class:"summary-card info"},Z={class:"summary-label"},ee={class:"filter-row"},ae={key:0,class:"plugins-table-wrap"},te={class:"plugins-table"},se={class:"plugin-name"},le={key:0},ne={key:0,class:"description"},ue={key:1,class:"meta-line"},ie={key:0},re={key:1},oe={class:"config-status"},de={class:"capability-list"},ce={class:"path-cell"},ve={key:1,class:"muted"},pe={key:1,class:"metadata-panel"},fe=ze({__name:"PluginsView",setup(De){const{t:n,te:E}=Ne(),me=Ee(),y=qe(),d=v([]),V=v([]),f=v(null),m=v(!1),b=v(""),x=v(""),k=v(null),w=v(null),S=v(null),ge=["enabled","auto-active","inactive","disabled","provider-managed"],he=h(()=>ge.map(s=>({label:n(`plugins.status.${s}`),value:s}))),ye=h(()=>M(d.value.map(s=>s.source))),be=h(()=>M(d.value.map(s=>s.kind))),g=h(()=>({total:d.value.length,active:d.value.filter(s=>s.effectiveStatus==="enabled"||s.effectiveStatus==="auto-active").length,inactive:d.value.filter(s=>s.effectiveStatus==="inactive").length,disabled:d.value.filter(s=>s.effectiveStatus==="disabled").length,providerManaged:d.value.filter(s=>s.effectiveStatus==="provider-managed").length})),L=h(()=>{const s=x.value.trim().toLowerCase();return d.value.filter(u=>k.value&&u.source!==k.value||w.value&&u.kind!==w.value||S.value&&u.effectiveStatus!==S.value?!1:s?[u.key,u.name,u.description,u.path,u.source,u.kind].some(l=>String(l||"").toLowerCase().includes(s)):!0)});function M(s){return Array.from(new Set(s.filter(Boolean))).sort((u,l)=>u.localeCompare(l)).map(u=>({label:u,value:u}))}async function N(){m.value=!0,b.value="";try{(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles();const s=await Oe();d.value=s.plugins??[],V.value=s.warnings??[],f.value=s.metadata??null}catch(s){b.value=s?.message||n("plugins.loadFailed")}finally{m.value=!1}}function ke(s){const u=`plugins.statusLabel.${s.effectiveStatus}`;return E(u)?n(u):s.effectiveStatus}function we(s){const u=`plugins.configStatuses.${s.configStatus}`;return E(u)?n(u):s.configStatus}function Se(s){switch(s.effectiveStatus){case"enabled":case"auto-active":return"success";case"disabled":return"error";case"provider-managed":return"info";default:return"warning"}}function $(s){const u=s.key.replace(/'/g,"'\\''");return s.effectiveStatus==="disabled"||s.effectiveStatus==="inactive"?`hermes plugins enable '${u}'`:s.effectiveStatus==="enabled"?`hermes plugins disable '${u}'`:""}async function Pe(s){const u=$(s);u&&(await navigator.clipboard.writeText(u),me.success(n("plugins.commandCopied")))}return Ce(()=>y.activeProfileName||"default",()=>{d.value=[],V.value=[],f.value=null,N()},{immediate:!0}),(s,u)=>(i(),r("div",q,[e("header",I,[e("h2",O,t(a(n)("plugins.title")),1),c(a(A),{size:"small",quaternary:"",loading:m.value,onClick:N},{default:p(()=>[o(t(a(n)("plugins.refresh")),1)]),_:1},8,["loading"])]),e("div",j,[c(a(z),{type:"info",bordered:!1,class:"plugins-notice"},{default:p(()=>[o(t(a(n)("plugins.notice")),1)]),_:1}),b.value?(i(),P(a(z),{key:0,type:"error",class:"plugins-notice"},{default:p(()=>[o(t(b.value),1)]),_:1})):_("",!0),(i(!0),r(F,null,U(V.value,l=>(i(),P(a(z),{key:l,type:"warning",class:"plugins-notice"},{default:p(()=>[o(t(l),1)]),_:2},1024))),128)),e("div",H,[e("div",Q,[e("span",R,t(a(n)("plugins.summary.total")),1),e("strong",null,t(g.value.total),1)]),e("div",D,[e("span",K,t(a(n)("plugins.summary.active")),1),e("strong",null,t(g.value.active),1)]),e("div",W,[e("span",G,t(a(n)("plugins.summary.inactive")),1),e("strong",null,t(g.value.inactive),1)]),e("div",J,[e("span",X,t(a(n)("plugins.summary.disabled")),1),e("strong",null,t(g.value.disabled),1)]),e("div",Y,[e("span",Z,t(a(n)("plugins.summary.providerManaged")),1),e("strong",null,t(g.value.providerManaged),1)])]),e("div",ee,[c(a(Le),{value:x.value,"onUpdate:value":u[0]||(u[0]=l=>x.value=l),placeholder:a(n)("plugins.searchPlaceholder"),clearable:""},null,8,["value","placeholder"]),c(a(T),{value:k.value,"onUpdate:value":u[1]||(u[1]=l=>k.value=l),options:ye.value,placeholder:a(n)("plugins.source"),clearable:""},null,8,["value","options","placeholder"]),c(a(T),{value:w.value,"onUpdate:value":u[2]||(u[2]=l=>w.value=l),options:be.value,placeholder:a(n)("plugins.kind"),clearable:""},null,8,["value","options","placeholder"]),c(a(T),{value:S.value,"onUpdate:value":u[3]||(u[3]=l=>S.value=l),options:he.value,placeholder:a(n)("plugins.statusTitle"),clearable:""},null,8,["value","options","placeholder"])]),c(a(Te),{show:m.value&&d.value.length===0},{default:p(()=>[L.value.length?(i(),r("div",ae,[e("table",te,[e("thead",null,[e("tr",null,[e("th",null,t(a(n)("plugins.table.plugin")),1),e("th",null,t(a(n)("plugins.table.status")),1),e("th",null,t(a(n)("plugins.table.source")),1),e("th",null,t(a(n)("plugins.table.kind")),1),e("th",null,t(a(n)("plugins.table.capabilities")),1),e("th",null,t(a(n)("plugins.table.path")),1),e("th",null,t(a(n)("plugins.table.cli")),1)])]),e("tbody",null,[(i(!0),r(F,null,U(L.value,l=>(i(),r("tr",{key:l.key},[e("td",null,[e("div",se,[e("strong",null,t(l.key),1),l.name!==l.key?(i(),r("span",le,t(l.name),1)):_("",!0)]),l.description?(i(),r("div",ne,t(l.description),1)):_("",!0),l.version||l.author?(i(),r("div",ue,[l.version?(i(),r("span",ie,"v"+t(l.version),1)):_("",!0),l.author?(i(),r("span",re,t(l.author),1)):_("",!0)])):_("",!0)]),e("td",null,[c(a(B),{size:"small",type:Se(l)},{default:p(()=>[o(t(ke(l)),1)]),_:2},1032,["type"]),e("div",oe,t(a(n)("plugins.configStatus",{status:we(l)})),1)]),e("td",null,[c(a(B),{size:"small",round:""},{default:p(()=>[o(t(l.source),1)]),_:2},1024)]),e("td",null,[c(a(B),{size:"small",round:""},{default:p(()=>[o(t(l.kind),1)]),_:2},1024)]),e("td",null,[e("div",de,[e("span",null,t(a(n)("plugins.capabilities.tools",{count:l.providesTools.length})),1),e("span",null,t(a(n)("plugins.capabilities.hooks",{count:l.providesHooks.length})),1),e("span",null,t(a(n)("plugins.capabilities.env",{count:l.requiresEnv.length})),1)])]),e("td",null,[e("code",ce,t(l.path||a(n)("plugins.notAvailable")),1)]),e("td",null,[$(l)?(i(),P(a(A),{key:0,size:"tiny",secondary:"",onClick:Ke=>Pe(l)},{default:p(()=>[o(t(a(n)("plugins.copyCommand")),1)]),_:1},8,["onClick"])):(i(),r("span",ve,t(a(n)("plugins.managedElsewhere")),1))])]))),128))])])])):m.value?_("",!0):(i(),P(a(Ve),{key:1,description:a(n)("plugins.noMatch")},null,8,["description"]))]),_:1},8,["show"]),f.value?(i(),r("div",pe,[e("span",null,[o(t(a(n)("plugins.metadata.agentRoot"))+": ",1),e("code",null,t(f.value.hermesAgentRoot),1)]),e("span",null,[o(t(a(n)("plugins.metadata.python"))+": ",1),e("code",null,t(f.value.pythonExecutable),1)]),e("span",null,[o(t(a(n)("plugins.metadata.scanCwd"))+": ",1),e("code",null,t(f.value.cwd),1)]),e("span",null,[o(t(a(n)("plugins.metadata.projectPlugins"))+": ",1),e("code",null,t(f.value.projectPluginsEnabled?a(n)("plugins.enabled"):a(n)("plugins.disabled")),1)])])):_("",!0)])]))}})})),He=C((()=>{})),Qe,Re=C((()=>{_e(),_e(),He(),Fe(),Qe=Ue(fe,[["__scopeId","data-v-4d517283"]])}));Re();export{Qe as default};
@@ -1,3 +1,3 @@
1
- import{n as y}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as W,C as Je,Ht as i,I as k,Pt as h,Q as Fe,S as q,Tt as s,V as Ke,W as V,at as I,bt as Oe,c as Xe,ct as p,gt as Ze,i as E,it as S,l as Be,lt as T,m as Le,nt as a,p as H,r as el,rt as M,st as P,t as D,tt as ll,vt as m,y as A,z as Ue,zt as e}from"./ui-vendor-BMwF7QXa.js";import{n as N,r as F}from"./vue-vendor-kBYBtqCg.js";import{n as B,t as L}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{r as U,t as R}from"./profiles-DiEn61KW.js";import{B as al,V as tl}from"./index-Cuk9R8hy.js";var Q,G,J,K,O,X,Z,ee,le,ae,te,oe,ie,se,re,ne,ue,de,fe,pe,_e,ce,ve,me,he,Re,ge=y((()=>{V(),D(),R(),N(),tl(),Q={class:"card-header"},G={class:"profile-title"},J={class:"profile-name"},K={class:"card-body"},O={class:"info-row"},X={class:"info-label"},Z={class:"info-value mono"},ee={class:"toggle-text"},le={key:0,class:"card-detail"},ae={class:"info-row"},te={class:"info-label"},oe={class:"info-value"},ie={class:"info-row"},se={class:"info-label"},re={class:"info-value mono detail-path"},ne={class:"info-row"},ue={class:"info-label"},de={class:"info-value"},fe={class:"info-row"},pe={class:"info-label"},_e={class:"info-value"},ce={class:"info-row"},ve={class:"info-label"},me={class:"info-value"},he={class:"card-actions"},Re=T({__name:"ProfileCard",props:{profile:{}},setup(C,{emit:x}){const u=C,{t:l}=F(),r=U(),n=A(),g=Je(),_=h(!1),d=h(!1),c=h(!1),o=h(!1),v=h(null),$=ll(()=>u.profile.name==="default");async function b(){if(_.value){_.value=!1;return}_.value=!0,d.value=!0;try{v.value=await r.fetchProfileDetail(u.profile.name)}finally{d.value=!1}}async function f(){g.warning({title:l("profiles.switchTo"),content:l("profiles.switchConfirm",{name:u.profile.name}),positiveText:l("profiles.switchTo"),negativeText:l("common.cancel"),onPositiveClick:t})}async function t(){o.value=!0;try{await r.switchHermesProfile(u.profile.name)?(n.success(l("profiles.switchSuccess",{name:u.profile.name})),setTimeout(()=>window.location.reload(),500)):n.error(l("profiles.switchFailed"))}finally{o.value=!1}}function w(){g.warning({title:l("profiles.delete"),content:l("profiles.deleteConfirm",{name:u.profile.name}),positiveText:l("common.delete"),negativeText:l("common.cancel"),onPositiveClick:async()=>{await r.deleteProfile(u.profile.name)?n.success(l("profiles.deleteSuccess")):n.error(l("profiles.deleteFailed"))}})}async function z(){c.value=!0;try{await r.exportProfile(u.profile.name)?n.success(l("profiles.exportSuccess")):n.error(l("profiles.exportFailed"))}finally{c.value=!1}}return(j,Y)=>(m(),I("div",{class:W(["profile-card",{active:C.profile.active}])},[a("div",Q,[a("div",G,[p(al,{name:C.profile.name,avatar:C.profile.avatar,size:28},null,8,["name","avatar"]),a("h3",J,i(C.profile.name),1)]),C.profile.active?(m(),M(e(Ke),{key:0,size:"tiny",type:"success",bordered:!1},{default:s(()=>[P(i(e(l)("profiles.active")),1)]),_:1})):S("",!0)]),a("div",K,[a("div",O,[a("span",X,i(e(l)("profiles.model")),1),a("code",Z,i(C.profile.model),1)])]),a("div",{class:"card-detail-toggle",onClick:b},[(m(),I("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:W(["toggle-icon",{expanded:_.value}])},[...Y[0]||(Y[0]=[a("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),a("span",ee,i(_.value?e(l)("common.collapse"):e(l)("common.expand")),1)]),_.value?(m(),I("div",le,[p(e(Be),{show:d.value,size:"small"},{default:s(()=>[v.value?(m(),I(Fe,{key:0},[a("div",ae,[a("span",te,i(e(l)("profiles.provider")),1),a("span",oe,i(v.value.provider),1)]),a("div",ie,[a("span",se,i(e(l)("profiles.path")),1),a("code",re,i(v.value.path),1)]),a("div",ne,[a("span",ue,i(e(l)("profiles.skills")),1),a("span",de,i(v.value.skills),1)]),a("div",fe,[a("span",pe,i(e(l)("profiles.hasEnv")),1),a("span",_e,i(v.value.hasEnv?"Yes":"No"),1)]),a("div",ce,[a("span",ve,i(e(l)("profiles.hasSoulMd")),1),a("span",me,i(v.value.hasSoulMd?"Yes":"No"),1)])],64)):S("",!0)]),_:1},8,["show"])])):S("",!0),a("div",he,[C.profile.active?S("",!0):(m(),M(e(k),{key:0,size:"tiny",loading:o.value,quaternary:"",type:"primary",onClick:f},{default:s(()=>[P(i(e(l)("profiles.switchTo")),1)]),_:1},8,["loading"])),p(e(k),{size:"tiny",quaternary:"",type:"error",disabled:$.value||C.profile.active,onClick:w},{default:s(()=>[P(i(e(l)("common.delete")),1)]),_:1},8,["disabled"]),p(e(k),{size:"tiny",quaternary:"",loading:c.value,onClick:z},{default:s(()=>[P(i(e(l)("profiles.export")),1)]),_:1},8,["loading"])])],2))}})})),ol=y((()=>{})),je,il=y((()=>{ge(),ge(),ol(),B(),je=L(Re,[["__scopeId","data-v-6cae06e2"]])})),ye,we,De,Pe=y((()=>{V(),il(),R(),N(),ye={key:0,class:"empty-state"},we={key:1,class:"profiles-grid"},De=T({__name:"ProfilesPanel",emits:["rename"],setup(C){const{t:x}=F(),u=U();return(l,r)=>e(u).profiles.length===0?(m(),I("div",ye,[r[1]||(r[1]=a("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1",class:"empty-icon"},[a("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a("circle",{cx:"12",cy:"7",r:"4"})],-1)),a("p",null,i(e(x)("profiles.noProfiles")),1)])):(m(),I("div",we,[(m(!0),I(Fe,null,Oe(e(u).profiles,n=>(m(),M(je,{key:n.name,profile:n,onRename:r[0]||(r[0]=g=>l.$emit("rename",g))},null,8,["profile"]))),128))]))}})})),sl=y((()=>{})),Ae,rl=y((()=>{Pe(),Pe(),sl(),B(),Ae=L(De,[["__scopeId","data-v-51e73d5a"]])})),Ce,Ee,xe=y((()=>{V(),D(),R(),N(),Ce={class:"modal-footer"},Ee=T({__name:"ProfileCreateModal",emits:["close","saved"],setup(C,{emit:x}){const u=x,{t:l}=F(),r=U(),n=A(),g=h(!0),_=h(!1),d=h(""),c=h(!1),o=h("");function v(f){const t=f.toLowerCase().replace(/[^a-z0-9_-]/g,"");t!==f?o.value=l("profiles.nameValidation"):o.value="",d.value=t}async function $(){if(!d.value){n.warning(l("profiles.namePlaceholder"));return}if(!/^[a-z0-9_-]+$/.test(d.value)){n.error(l("profiles.nameValidation"));return}_.value=!0;try{const f=await r.createProfile(d.value.trim(),c.value);if(f.success){const t=f.strippedCredentials??[],w=f.disabledPlatforms??[],z=f.strippedConfigCredentials??[];if(c.value&&(t.length>0||w.length>0||z.length>0)){const j=[];t.length>0&&j.push(l("profiles.cloneStrippedCredentials",{count:t.length,list:t.join(", ")})),w.length>0&&j.push(l("profiles.cloneDisabledPlatforms",{count:w.length,list:w.join(", ")})),z.length>0&&j.push(l("profiles.cloneStrippedConfigCredentials",{count:z.length,list:z.join(", ")})),n.info(`${l("profiles.createSuccess",{name:d.value.trim()})}
1
+ import{n as y}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as W,C as Je,Ht as i,I as k,Pt as h,Q as Fe,S as q,Tt as s,V as Ke,W as V,at as I,bt as Oe,c as Xe,ct as p,gt as Ze,i as E,it as S,l as Be,lt as T,m as Le,nt as a,p as H,r as el,rt as M,st as P,t as D,tt as ll,vt as m,y as A,z as Ue,zt as e}from"./ui-vendor-BMwF7QXa.js";import{n as N,r as F}from"./vue-vendor-kBYBtqCg.js";import{n as B,t as L}from"./_plugin-vue_export-helper-CHoatqkO.js";import{r as U,t as R}from"./profiles-CyjgPK1f.js";import{B as al,V as tl}from"./index-DpU5R9KV.js";var Q,G,J,K,O,X,Z,ee,le,ae,te,oe,ie,se,re,ne,ue,de,fe,pe,_e,ce,ve,me,he,Re,ge=y((()=>{V(),D(),R(),N(),tl(),Q={class:"card-header"},G={class:"profile-title"},J={class:"profile-name"},K={class:"card-body"},O={class:"info-row"},X={class:"info-label"},Z={class:"info-value mono"},ee={class:"toggle-text"},le={key:0,class:"card-detail"},ae={class:"info-row"},te={class:"info-label"},oe={class:"info-value"},ie={class:"info-row"},se={class:"info-label"},re={class:"info-value mono detail-path"},ne={class:"info-row"},ue={class:"info-label"},de={class:"info-value"},fe={class:"info-row"},pe={class:"info-label"},_e={class:"info-value"},ce={class:"info-row"},ve={class:"info-label"},me={class:"info-value"},he={class:"card-actions"},Re=T({__name:"ProfileCard",props:{profile:{}},setup(C,{emit:x}){const u=C,{t:l}=F(),r=U(),n=A(),g=Je(),_=h(!1),d=h(!1),c=h(!1),o=h(!1),v=h(null),$=ll(()=>u.profile.name==="default");async function b(){if(_.value){_.value=!1;return}_.value=!0,d.value=!0;try{v.value=await r.fetchProfileDetail(u.profile.name)}finally{d.value=!1}}async function f(){g.warning({title:l("profiles.switchTo"),content:l("profiles.switchConfirm",{name:u.profile.name}),positiveText:l("profiles.switchTo"),negativeText:l("common.cancel"),onPositiveClick:t})}async function t(){o.value=!0;try{await r.switchHermesProfile(u.profile.name)?(n.success(l("profiles.switchSuccess",{name:u.profile.name})),setTimeout(()=>window.location.reload(),500)):n.error(l("profiles.switchFailed"))}finally{o.value=!1}}function w(){g.warning({title:l("profiles.delete"),content:l("profiles.deleteConfirm",{name:u.profile.name}),positiveText:l("common.delete"),negativeText:l("common.cancel"),onPositiveClick:async()=>{await r.deleteProfile(u.profile.name)?n.success(l("profiles.deleteSuccess")):n.error(l("profiles.deleteFailed"))}})}async function z(){c.value=!0;try{await r.exportProfile(u.profile.name)?n.success(l("profiles.exportSuccess")):n.error(l("profiles.exportFailed"))}finally{c.value=!1}}return(j,Y)=>(m(),I("div",{class:W(["profile-card",{active:C.profile.active}])},[a("div",Q,[a("div",G,[p(al,{name:C.profile.name,avatar:C.profile.avatar,size:28},null,8,["name","avatar"]),a("h3",J,i(C.profile.name),1)]),C.profile.active?(m(),M(e(Ke),{key:0,size:"tiny",type:"success",bordered:!1},{default:s(()=>[P(i(e(l)("profiles.active")),1)]),_:1})):S("",!0)]),a("div",K,[a("div",O,[a("span",X,i(e(l)("profiles.model")),1),a("code",Z,i(C.profile.model),1)])]),a("div",{class:"card-detail-toggle",onClick:b},[(m(),I("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:W(["toggle-icon",{expanded:_.value}])},[...Y[0]||(Y[0]=[a("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),a("span",ee,i(_.value?e(l)("common.collapse"):e(l)("common.expand")),1)]),_.value?(m(),I("div",le,[p(e(Be),{show:d.value,size:"small"},{default:s(()=>[v.value?(m(),I(Fe,{key:0},[a("div",ae,[a("span",te,i(e(l)("profiles.provider")),1),a("span",oe,i(v.value.provider),1)]),a("div",ie,[a("span",se,i(e(l)("profiles.path")),1),a("code",re,i(v.value.path),1)]),a("div",ne,[a("span",ue,i(e(l)("profiles.skills")),1),a("span",de,i(v.value.skills),1)]),a("div",fe,[a("span",pe,i(e(l)("profiles.hasEnv")),1),a("span",_e,i(v.value.hasEnv?"Yes":"No"),1)]),a("div",ce,[a("span",ve,i(e(l)("profiles.hasSoulMd")),1),a("span",me,i(v.value.hasSoulMd?"Yes":"No"),1)])],64)):S("",!0)]),_:1},8,["show"])])):S("",!0),a("div",he,[C.profile.active?S("",!0):(m(),M(e(k),{key:0,size:"tiny",loading:o.value,quaternary:"",type:"primary",onClick:f},{default:s(()=>[P(i(e(l)("profiles.switchTo")),1)]),_:1},8,["loading"])),p(e(k),{size:"tiny",quaternary:"",type:"error",disabled:$.value||C.profile.active,onClick:w},{default:s(()=>[P(i(e(l)("common.delete")),1)]),_:1},8,["disabled"]),p(e(k),{size:"tiny",quaternary:"",loading:c.value,onClick:z},{default:s(()=>[P(i(e(l)("profiles.export")),1)]),_:1},8,["loading"])])],2))}})})),ol=y((()=>{})),je,il=y((()=>{ge(),ge(),ol(),B(),je=L(Re,[["__scopeId","data-v-6cae06e2"]])})),ye,we,De,Pe=y((()=>{V(),il(),R(),N(),ye={key:0,class:"empty-state"},we={key:1,class:"profiles-grid"},De=T({__name:"ProfilesPanel",emits:["rename"],setup(C){const{t:x}=F(),u=U();return(l,r)=>e(u).profiles.length===0?(m(),I("div",ye,[r[1]||(r[1]=a("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1",class:"empty-icon"},[a("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a("circle",{cx:"12",cy:"7",r:"4"})],-1)),a("p",null,i(e(x)("profiles.noProfiles")),1)])):(m(),I("div",we,[(m(!0),I(Fe,null,Oe(e(u).profiles,n=>(m(),M(je,{key:n.name,profile:n,onRename:r[0]||(r[0]=g=>l.$emit("rename",g))},null,8,["profile"]))),128))]))}})})),sl=y((()=>{})),Ae,rl=y((()=>{Pe(),Pe(),sl(),B(),Ae=L(De,[["__scopeId","data-v-51e73d5a"]])})),Ce,Ee,xe=y((()=>{V(),D(),R(),N(),Ce={class:"modal-footer"},Ee=T({__name:"ProfileCreateModal",emits:["close","saved"],setup(C,{emit:x}){const u=x,{t:l}=F(),r=U(),n=A(),g=h(!0),_=h(!1),d=h(""),c=h(!1),o=h("");function v(f){const t=f.toLowerCase().replace(/[^a-z0-9_-]/g,"");t!==f?o.value=l("profiles.nameValidation"):o.value="",d.value=t}async function $(){if(!d.value){n.warning(l("profiles.namePlaceholder"));return}if(!/^[a-z0-9_-]+$/.test(d.value)){n.error(l("profiles.nameValidation"));return}_.value=!0;try{const f=await r.createProfile(d.value.trim(),c.value);if(f.success){const t=f.strippedCredentials??[],w=f.disabledPlatforms??[],z=f.strippedConfigCredentials??[];if(c.value&&(t.length>0||w.length>0||z.length>0)){const j=[];t.length>0&&j.push(l("profiles.cloneStrippedCredentials",{count:t.length,list:t.join(", ")})),w.length>0&&j.push(l("profiles.cloneDisabledPlatforms",{count:w.length,list:w.join(", ")})),z.length>0&&j.push(l("profiles.cloneStrippedConfigCredentials",{count:z.length,list:z.join(", ")})),n.info(`${l("profiles.createSuccess",{name:d.value.trim()})}
2
2
  ${j.join(`
3
3
  `)}`,{duration:6e3})}else n.success(l("profiles.createSuccess",{name:d.value.trim()}));u("saved")}else{const t=f.error||l("profiles.createFailed");n.error(t)}}finally{_.value=!1}}function b(){g.value=!1,setTimeout(()=>u("close"),200)}return(f,t)=>(m(),M(e(q),{show:g.value,"onUpdate:show":t[2]||(t[2]=w=>g.value=w),preset:"card",title:e(l)("profiles.create"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!_.value,onAfterLeave:t[3]||(t[3]=w=>u("close"))},{footer:s(()=>[a("div",Ce,[p(e(k),{onClick:b},{default:s(()=>[P(i(e(l)("common.cancel")),1)]),_:1}),p(e(k),{type:"primary",loading:_.value,onClick:$},{default:s(()=>[P(i(e(l)("common.create")),1)]),_:1},8,["loading"])])]),default:s(()=>[p(e(Le),{"label-placement":"top"},{default:s(()=>[p(e(H),{label:e(l)("profiles.name"),required:""},{default:s(()=>[p(e(Ue),{value:d.value,"onUpdate:value":t[0]||(t[0]=w=>d.value=w),placeholder:e(l)("profiles.namePlaceholder"),onInput:v},null,8,["value","placeholder"])]),_:1},8,["label"]),o.value?(m(),M(e(E),{key:0,depth:"3",type:"warning",style:{"font-size":"12px"}},{default:s(()=>[P(i(o.value),1)]),_:1})):S("",!0),p(e(H),{label:e(l)("profiles.cloneFromCurrent")},{default:s(()=>[p(e(Xe),{value:c.value,"onUpdate:value":t[1]||(t[1]=w=>c.value=w)},null,8,["value"])]),_:1},8,["label"]),c.value?(m(),M(e(E),{key:1,depth:"3",style:{"font-size":"12px"}},{default:s(()=>[P(i(e(l)("profiles.cloneCleanupNotice")),1)]),_:1})):S("",!0)]),_:1})]),_:1},8,["show","title","mask-closable"]))}})})),nl=y((()=>{})),ul=y((()=>{})),He,dl=y((()=>{xe(),xe(),nl(),ul(),B(),He=L(Ee,[["__scopeId","data-v-06cc88f3"]])})),ke,qe,Me=y((()=>{V(),D(),R(),N(),ke={class:"modal-footer"},qe=T({__name:"ProfileRenameModal",props:{profileName:{}},emits:["close","saved"],setup(C,{emit:x}){const u=C,l=x,{t:r}=F(),n=U(),g=A(),_=h(!0),d=h(!1),c=h(""),o=h("");function v(f){const t=f.toLowerCase().replace(/[^a-z0-9_-]/g,"");t!==f?o.value=r("profiles.nameValidation"):o.value="",c.value=t}async function $(){if(!c.value){g.warning(r("profiles.newNamePlaceholder"));return}if(!/^[a-z0-9_-]+$/.test(c.value)){g.error(r("profiles.nameValidation"));return}d.value=!0;try{await n.renameProfile(u.profileName,c.value.trim())?(g.success(r("profiles.renameSuccess")),l("saved")):g.error(r("profiles.renameFailed"))}finally{d.value=!1}}function b(){_.value=!1,setTimeout(()=>l("close"),200)}return(f,t)=>(m(),M(e(q),{show:_.value,"onUpdate:show":t[1]||(t[1]=w=>_.value=w),preset:"card",title:e(r)("profiles.rename"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!d.value,onAfterLeave:t[2]||(t[2]=w=>l("close"))},{footer:s(()=>[a("div",ke,[p(e(k),{onClick:b},{default:s(()=>[P(i(e(r)("common.cancel")),1)]),_:1}),p(e(k),{type:"primary",loading:d.value,onClick:$},{default:s(()=>[P(i(e(r)("common.confirm")),1)]),_:1},8,["loading"])])]),default:s(()=>[p(e(Le),{"label-placement":"top"},{default:s(()=>[p(e(H),{label:e(r)("profiles.newName"),required:""},{default:s(()=>[p(e(Ue),{value:c.value,"onUpdate:value":t[0]||(t[0]=w=>c.value=w),placeholder:e(r)("profiles.newNamePlaceholder"),onInput:v},null,8,["value","placeholder"])]),_:1},8,["label"]),o.value?(m(),M(e(E),{key:0,depth:"3",type:"warning",style:{"font-size":"12px"}},{default:s(()=>[P(i(o.value),1)]),_:1})):S("",!0)]),_:1})]),_:1},8,["show","title","mask-closable"]))}})})),fl=y((()=>{})),Ye,pl=y((()=>{Me(),Me(),fl(),B(),Ye=L(qe,[["__scopeId","data-v-740612c1"]])})),be,We,Se=y((()=>{V(),D(),R(),N(),be={class:"modal-footer"},We=T({__name:"ProfileImportModal",emits:["close","saved"],setup(C,{emit:x}){const u=x,{t:l}=F(),r=U(),n=A(),g=h(!0),_=h(!1),d=h([]),c=[".tar.gz",".tgz",".gz",".zip"];function o({file:b}){const f=b.name?.toLowerCase()||"";return c.some(t=>f.endsWith(t))?!0:(n.warning(l("profiles.importInvalidFile")),!1)}async function v(){if(!d.value.length){n.warning(l("profiles.importSelectFile"));return}_.value=!0;try{const b=d.value[0].file;if(!b){n.error(l("profiles.importFailed"));return}await r.importProfile(b)?(n.success(l("profiles.importSuccess")),u("saved")):n.error(l("profiles.importFailed"))}finally{_.value=!1}}function $(){g.value=!1,setTimeout(()=>u("close"),200)}return(b,f)=>(m(),M(e(q),{show:g.value,"onUpdate:show":f[1]||(f[1]=t=>g.value=t),preset:"card",title:e(l)("profiles.import"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!_.value,onAfterLeave:f[2]||(f[2]=t=>u("close"))},{footer:s(()=>[a("div",be,[p(e(k),{onClick:$},{default:s(()=>[P(i(e(l)("common.cancel")),1)]),_:1}),p(e(k),{type:"primary",loading:_.value,disabled:!d.value.length,onClick:v},{default:s(()=>[P(i(e(l)("common.confirm")),1)]),_:1},8,["loading","disabled"])])]),default:s(()=>[p(e(el),{"file-list":d.value,"onUpdate:fileList":f[0]||(f[0]=t=>d.value=t),max:1,accept:c.join(","),disabled:_.value,onBeforeUpload:o},{default:s(()=>[p(e(k),null,{default:s(()=>[P(i(e(l)("profiles.importSelectFile")),1)]),_:1})]),_:1},8,["file-list","accept","disabled"])]),_:1},8,["show","title","mask-closable"]))}})})),_l=y((()=>{})),Qe,cl=y((()=>{Se(),Se(),_l(),B(),Qe=L(We,[["__scopeId","data-v-accddacf"]])})),Ie,$e,ze,Ve,Te,Ge,Ne=y((()=>{V(),D(),N(),rl(),dl(),pl(),cl(),R(),Ie={class:"profiles-view"},$e={class:"page-header"},ze={class:"header-title"},Ve={class:"header-actions"},Te={class:"profiles-content"},Ge=T({__name:"ProfilesView",setup(C){const{t:x}=F(),u=U(),l=h(!1),r=h(!1),n=h(null);Ze(()=>{u.fetchHermesProfiles()});function g(){l.value=!1}function _(){n.value=null}function d(){r.value=!1}return(c,o)=>(m(),I("div",Ie,[a("header",$e,[a("h2",ze,i(e(x)("profiles.title")),1),a("div",Ve,[p(e(k),{size:"small",onClick:o[0]||(o[0]=v=>r.value=!0)},{icon:s(()=>[...o[6]||(o[6]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),a("polyline",{points:"17 8 12 3 7 8"}),a("line",{x1:"12",y1:"3",x2:"12",y2:"15"})],-1)])]),default:s(()=>[P(" "+i(e(x)("profiles.import")),1)]),_:1}),p(e(k),{type:"primary",size:"small",onClick:o[1]||(o[1]=v=>l.value=!0)},{icon:s(()=>[...o[7]||(o[7]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:s(()=>[P(" "+i(e(x)("profiles.create")),1)]),_:1})])]),a("div",Te,[p(e(Be),{show:e(u).loading&&e(u).profiles.length===0},{default:s(()=>[p(Ae,{onRename:o[2]||(o[2]=v=>n.value=v)})]),_:1},8,["show"])]),l.value?(m(),M(He,{key:0,onClose:o[3]||(o[3]=v=>l.value=!1),onSaved:g})):S("",!0),n.value?(m(),M(Ye,{key:1,"profile-name":n.value,onClose:o[4]||(o[4]=v=>n.value=null),onSaved:_},null,8,["profile-name"])):S("",!0),r.value?(m(),M(Qe,{key:2,onClose:o[5]||(o[5]=v=>r.value=!1),onSaved:d})):S("",!0)]))}})})),vl=y((()=>{})),ml,hl=y((()=>{Ne(),Ne(),vl(),B(),ml=L(Ge,[["__scopeId","data-v-e503e05e"]])}));hl();export{ml as default};
@@ -1 +1 @@
1
- import{n as _}from"./rolldown-runtime-BKwlnUi0.js";import{Ht as i,W as c,at as n,it as g,lt as m,nt as e,vt as s,xt as h}from"./ui-vendor-BMwF7QXa.js";import{n as b,t as f}from"./_plugin-vue_export-helper-B8gz9Iqn.js";var a,o,r,l,u,p,d=_((()=>{c(),a={class:"setting-row"},o={class:"setting-info"},r={class:"setting-label"},l={key:0,class:"setting-hint"},u={class:"setting-control"},p=m({__name:"SettingRow",props:{label:{},hint:{}},setup(t){return(v,y)=>(s(),n("div",a,[e("div",o,[e("label",r,i(t.label),1),t.hint?(s(),n("p",l,i(t.hint),1)):g("",!0)]),e("div",u,[h(v.$slots,"default",{},void 0,!0)])]))}})})),S=_((()=>{})),w,B=_((()=>{d(),d(),S(),b(),w=f(p,[["__scopeId","data-v-b81640b4"]])}));export{B as n,w as t};
1
+ import{n as _}from"./rolldown-runtime-BKwlnUi0.js";import{Ht as i,W as c,at as n,it as g,lt as m,nt as e,vt as s,xt as h}from"./ui-vendor-BMwF7QXa.js";import{n as b,t as f}from"./_plugin-vue_export-helper-CHoatqkO.js";var a,o,r,l,u,p,d=_((()=>{c(),a={class:"setting-row"},o={class:"setting-info"},r={class:"setting-label"},l={key:0,class:"setting-hint"},u={class:"setting-control"},p=m({__name:"SettingRow",props:{label:{},hint:{}},setup(t){return(v,y)=>(s(),n("div",a,[e("div",o,[e("label",r,i(t.label),1),t.hint?(s(),n("p",l,i(t.hint),1)):g("",!0)]),e("div",u,[h(v.$slots,"default",{},void 0,!0)])]))}})})),S=_((()=>{})),w,B=_((()=>{d(),d(),S(),b(),w=f(p,[["__scopeId","data-v-b81640b4"]])}));export{B as n,w as t};