hermes-web-ui 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/hermes-web-ui.mjs +76 -9
- package/dist/client/assets/Add-DiTv65Se.js +1 -0
- package/dist/client/assets/{Button-pgPN7RfC.js → Button-vKfgky-Y.js} +3 -3
- package/dist/client/assets/{ChannelsView-qFMvJ9rS.js → ChannelsView-CHWtzAkF.js} +1 -1
- package/dist/client/assets/ChatView--lvFbW3I.js +127 -0
- package/dist/client/assets/ChatView-b0_L3ucp.css +1 -0
- package/dist/client/assets/{Close-CXC76d7R.js → Close-Brba3ay5.js} +2 -2
- package/dist/client/assets/{FormItem-DIcSMjKz.js → FormItem-kXuCeSKq.js} +3 -3
- package/dist/client/assets/GatewaysView-DUPP1UyD.js +1 -0
- package/dist/client/assets/Input-BS71ZaoJ.js +234 -0
- package/dist/client/assets/{InputNumber-Btyn8bQo.js → InputNumber-BXy4reTI.js} +2 -2
- package/dist/client/assets/JobsView-CXa1h0NF.js +2 -0
- package/dist/client/assets/LoginView-Cpod3SAL.js +1 -0
- package/dist/client/assets/LoginView-DfWYTzX1.css +1 -0
- package/dist/client/assets/LogsView-CgxeVMn-.js +1 -0
- package/dist/client/assets/{MarkdownRenderer-G4nly1xR.js → MarkdownRenderer-B7t0ZEw0.js} +9 -9
- package/dist/client/assets/MemoryView-BQjYVDJc.js +7 -0
- package/dist/client/assets/{Modal-rKb1tfQv.js → Modal-6Bv1v4kO.js} +4 -4
- package/dist/client/assets/ModelsView-CVghPzgk.js +1 -0
- package/dist/client/assets/Popconfirm-Bpz_dC1j.js +16 -0
- package/dist/client/assets/Popover-CXrjClQw.js +117 -0
- package/dist/client/assets/ProfilesView-Brpyzl-Q.js +440 -0
- package/dist/client/assets/{Select-CpNY3UGb.js → Select-Z20Mp4nQ.js} +5 -5
- package/dist/client/assets/SettingRow-Cz749k-e.js +1 -0
- package/dist/client/assets/SettingsView-C3HbKb4w.js +352 -0
- package/dist/client/assets/{SettingsView-CX312EGG.css → SettingsView-Cw4iOwXj.css} +1 -1
- package/dist/client/assets/SkillsView-qVZkbI37.js +1 -0
- package/dist/client/assets/Spin-DKwUVt1F.js +43 -0
- package/dist/client/assets/Suffix-C1Mw6UwH.js +90 -0
- package/dist/client/assets/{Switch-haCJAcVn.js → Switch-DG-3EwdR.js} +2 -2
- package/dist/client/assets/{Tag-CKzgX6hi.js → Tag-BWD1u63m.js} +2 -2
- package/dist/client/assets/{TerminalView-CmSON012.js → TerminalView-DTR8bNOy.js} +6 -6
- package/dist/client/assets/Tooltip-Dka1-DNs.js +1 -0
- package/dist/client/assets/UsageView-elTUQCED.js +1 -0
- package/dist/client/assets/{Warning-B2AD2ulw.js → Warning-CCZES7el.js} +1 -1
- package/dist/client/assets/{_plugin-vue_export-helper-DXZ6IauR.js → _plugin-vue_export-helper-Bl_Pm_OI.js} +2 -2
- package/dist/client/assets/app-BMD_VOYs.js +1 -0
- package/dist/client/assets/{app-Du5RZCLa.js → app-y8cD3FPg.js} +1 -1
- package/dist/client/assets/auth-BPBv1nNQ.js +1 -0
- package/dist/client/assets/browser-DlPqZ-4M.js +47 -0
- package/dist/client/assets/chat-3-o9JAHE.js +6 -0
- package/dist/client/assets/composables-CoSqDggz.js +1 -0
- package/dist/client/assets/{fade-in.cssr-CkQxIGt5.js → fade-in.cssr-D0suZaLL.js} +2 -2
- package/dist/client/assets/index-BRXOdlZt.css +1 -0
- package/dist/client/assets/index-CeFFa_Wg.js +284 -0
- package/dist/client/assets/{jobs-BnXwbdOs.js → jobs-DMiCP2Li.js} +1 -1
- package/dist/client/assets/light-BNuYwJcs.js +1 -0
- package/dist/client/assets/{light-BZfVIZ0W.js → light-DLz3o2il.js} +1 -1
- package/dist/client/assets/{light-Bdfae2y3.js → light-DbUQYfY2.js} +1 -1
- package/dist/client/assets/{light-Jn66LOmu.js → light-DcGe0-g1.js} +1 -1
- package/dist/client/assets/{light-Dgzhn0jz.js → light-cIgLWDVk.js} +1 -1
- package/dist/client/assets/{models-mCQyOPuV.js → models-EKNn3-zC.js} +1 -1
- package/dist/client/assets/{pinia-Jb4QOAzE.js → pinia-C8BDM-Fc.js} +1 -1
- package/dist/client/assets/profiles-1vZTTlBc.js +1 -0
- package/dist/client/assets/{router-qWVkGgap.js → router-kR4kqS2l.js} +2 -2
- package/dist/client/assets/{session-browser-prefs-Bh1and1f.js → session-browser-prefs-BI-rZu2N.js} +1 -1
- package/dist/client/assets/sessions-CJI89wYu.js +1 -0
- package/dist/client/assets/{skills-BIFy9nXD.js → skills-DjdZmDZP.js} +1 -1
- package/dist/client/assets/{use-message-Do_vF1fs.js → use-message-sSsrvqld.js} +1 -1
- package/dist/client/assets/{useTheme-BFm8wMmc.js → useTheme-DgQIobZP.js} +1 -1
- package/dist/client/index.html +29 -30
- package/dist/server/index.js +1067 -329
- package/dist/server/index.js.map +4 -4
- package/package.json +2 -2
- package/dist/client/assets/Add-COjp_zn3.js +0 -1
- package/dist/client/assets/ChatView-DVQv3z6i.js +0 -127
- package/dist/client/assets/ChatView-w9DKSiie.css +0 -1
- package/dist/client/assets/GatewaysView-BeaZvbdd.js +0 -1
- package/dist/client/assets/Input-CxMM68Q2.js +0 -234
- package/dist/client/assets/JobsView-DhosFF52.js +0 -2
- package/dist/client/assets/LoginView-DHPxG3eC.css +0 -1
- package/dist/client/assets/LoginView-DrjDX7xD.js +0 -1
- package/dist/client/assets/LogsView-BpW_vgEs.js +0 -1
- package/dist/client/assets/MemoryView-CP3K8mDG.js +0 -7
- package/dist/client/assets/ModelsView-DdQUiiu6.js +0 -1
- package/dist/client/assets/Popconfirm-DnYCLqNF.js +0 -16
- package/dist/client/assets/Popover-DAXLiB78.js +0 -117
- package/dist/client/assets/ProfilesView-Bkhqt3QB.js +0 -440
- package/dist/client/assets/SettingRow-B4_BuJSm.js +0 -1
- package/dist/client/assets/SettingsView-ZwzxJZVc.js +0 -352
- package/dist/client/assets/SkillsView-B3X9y2kZ.js +0 -1
- package/dist/client/assets/Spin-CAOjab_F.js +0 -43
- package/dist/client/assets/Suffix-DQWmhzzW.js +0 -90
- package/dist/client/assets/Tooltip-U6DmMv6W.js +0 -1
- package/dist/client/assets/UsageView-rmIKdR1u.js +0 -1
- package/dist/client/assets/app-lD2ZIoa4.js +0 -1
- package/dist/client/assets/browser-DcLLT85r.js +0 -47
- package/dist/client/assets/chat-DJP53-h1.js +0 -6
- package/dist/client/assets/composables-CjmuafMO.js +0 -1
- package/dist/client/assets/index-BfU2Be-n.css +0 -1
- package/dist/client/assets/index-BqaBjme9.js +0 -284
- package/dist/client/assets/light-ZuZhSzix.js +0 -1
- package/dist/client/assets/light-ba4gwt1q.js +0 -1
- package/dist/client/assets/omit-1BRB6K75.js +0 -1
- package/dist/client/assets/profiles-PisKQKsd.js +0 -1
- package/dist/client/assets/sessions-smjenK_5.js +0 -1
- /package/dist/client/assets/{_common-Yp55QE79.js → _common-D_mHAddk.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as e,yt as t}from"./router-kR4kqS2l.js";var n=t({createJob:()=>o,deleteJob:()=>c,getJob:()=>a,listJobs:()=>i,pauseJob:()=>l,resumeJob:()=>u,runJob:()=>d,updateJob:()=>s});function r(e){return e.job}async function i(){return(await e(`/api/hermes/jobs?include_disabled=true`)).jobs}async function a(t){return r(await e(`/api/hermes/jobs/${t}`))}async function o(t){return r(await e(`/api/hermes/jobs`,{method:`POST`,body:JSON.stringify(t)}))}async function s(t,n){return r(await e(`/api/hermes/jobs/${t}`,{method:`PATCH`,body:JSON.stringify(n)}))}async function c(t){return e(`/api/hermes/jobs/${t}`,{method:`DELETE`})}async function l(t){return r(await e(`/api/hermes/jobs/${t}/pause`,{method:`POST`}))}async function u(t){return r(await e(`/api/hermes/jobs/${t}/resume`,{method:`POST`}))}async function d(t){return r(await e(`/api/hermes/jobs/${t}/run`,{method:`POST`}))}export{l as a,s as c,i,c as n,u as o,n as r,d as s,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,s as t}from"./browser-DlPqZ-4M.js";import{i as n}from"./Popover-CXrjClQw.js";import{r}from"./Button-vKfgky-Y.js";function i(e,t=[],n){let r={};return Object.getOwnPropertyNames(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),Object.assign(r,n)}var a={iconSize:`22px`};function o(e){let{fontSize:t,warningColor:n}=e;return Object.assign(Object.assign({},a),{fontSize:t,iconColor:n})}var s=t({name:`Popconfirm`,common:e,peers:{Button:r,Popover:n},self:o});export{o as n,i as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./browser-
|
|
1
|
+
import{n as e}from"./browser-DlPqZ-4M.js";var t={tabFontSizeSmall:`14px`,tabFontSizeMedium:`14px`,tabFontSizeLarge:`16px`,tabGapSmallLine:`36px`,tabGapMediumLine:`36px`,tabGapLargeLine:`36px`,tabGapSmallLineVertical:`8px`,tabGapMediumLineVertical:`8px`,tabGapLargeLineVertical:`8px`,tabPaddingSmallLine:`6px 0`,tabPaddingMediumLine:`10px 0`,tabPaddingLargeLine:`14px 0`,tabPaddingVerticalSmallLine:`6px 12px`,tabPaddingVerticalMediumLine:`8px 16px`,tabPaddingVerticalLargeLine:`10px 20px`,tabGapSmallBar:`36px`,tabGapMediumBar:`36px`,tabGapLargeBar:`36px`,tabGapSmallBarVertical:`8px`,tabGapMediumBarVertical:`8px`,tabGapLargeBarVertical:`8px`,tabPaddingSmallBar:`4px 0`,tabPaddingMediumBar:`6px 0`,tabPaddingLargeBar:`10px 0`,tabPaddingVerticalSmallBar:`6px 12px`,tabPaddingVerticalMediumBar:`8px 16px`,tabPaddingVerticalLargeBar:`10px 20px`,tabGapSmallCard:`4px`,tabGapMediumCard:`4px`,tabGapLargeCard:`4px`,tabGapSmallCardVertical:`4px`,tabGapMediumCardVertical:`4px`,tabGapLargeCardVertical:`4px`,tabPaddingSmallCard:`8px 16px`,tabPaddingMediumCard:`10px 20px`,tabPaddingLargeCard:`12px 24px`,tabPaddingSmallSegment:`4px 0`,tabPaddingMediumSegment:`6px 0`,tabPaddingLargeSegment:`8px 0`,tabPaddingVerticalLargeSegment:`0 8px`,tabPaddingVerticalSmallCard:`8px 12px`,tabPaddingVerticalMediumCard:`10px 16px`,tabPaddingVerticalLargeCard:`12px 20px`,tabPaddingVerticalSmallSegment:`0 4px`,tabPaddingVerticalMediumSegment:`0 6px`,tabGapSmallSegment:`0`,tabGapMediumSegment:`0`,tabGapLargeSegment:`0`,tabGapSmallSegmentVertical:`0`,tabGapMediumSegmentVertical:`0`,tabGapLargeSegmentVertical:`0`,panePaddingSmall:`8px 0 0 0`,panePaddingMedium:`12px 0 0 0`,panePaddingLarge:`16px 0 0 0`,closeSize:`18px`,closeIconSize:`14px`};function n(e){let{textColor2:n,primaryColor:r,textColorDisabled:i,closeIconColor:a,closeIconColorHover:o,closeIconColorPressed:s,closeColorHover:c,closeColorPressed:l,tabColor:u,baseColor:d,dividerColor:f,fontWeight:p,textColor1:m,borderRadius:h,fontSize:g,fontWeightStrong:_}=e;return Object.assign(Object.assign({},t),{colorSegment:u,tabFontSizeCard:g,tabTextColorLine:m,tabTextColorActiveLine:r,tabTextColorHoverLine:r,tabTextColorDisabledLine:i,tabTextColorSegment:m,tabTextColorActiveSegment:n,tabTextColorHoverSegment:n,tabTextColorDisabledSegment:i,tabTextColorBar:m,tabTextColorActiveBar:r,tabTextColorHoverBar:r,tabTextColorDisabledBar:i,tabTextColorCard:m,tabTextColorHoverCard:m,tabTextColorActiveCard:r,tabTextColorDisabledCard:i,barColor:r,closeIconColor:a,closeIconColorHover:o,closeIconColorPressed:s,closeColorHover:c,closeColorPressed:l,closeBorderRadius:h,tabColor:u,tabColorSegment:d,tabBorderColor:f,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:h,paneTextColor:n,fontWeightStrong:_})}var r={name:`Tabs`,common:e,self:n};export{r as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./browser-
|
|
1
|
+
import{n as e}from"./browser-DlPqZ-4M.js";var t={feedbackPadding:`4px 0 0 2px`,feedbackHeightSmall:`24px`,feedbackHeightMedium:`24px`,feedbackHeightLarge:`26px`,feedbackFontSizeSmall:`13px`,feedbackFontSizeMedium:`14px`,feedbackFontSizeLarge:`14px`,labelFontSizeLeftSmall:`14px`,labelFontSizeLeftMedium:`14px`,labelFontSizeLeftLarge:`15px`,labelFontSizeTopSmall:`13px`,labelFontSizeTopMedium:`14px`,labelFontSizeTopLarge:`14px`,labelHeightSmall:`24px`,labelHeightMedium:`26px`,labelHeightLarge:`28px`,labelPaddingVertical:`0 0 6px 2px`,labelPaddingHorizontal:`0 12px 0 0`,labelTextAlignVertical:`left`,labelTextAlignHorizontal:`right`,labelFontWeight:`400`};function n(e){let{heightSmall:n,heightMedium:r,heightLarge:i,textColor1:a,errorColor:o,warningColor:s,lineHeight:c,textColor3:l}=e;return Object.assign(Object.assign({},t),{blankHeightSmall:n,blankHeightMedium:r,blankHeightLarge:i,lineHeight:c,labelTextColor:a,asteriskColor:o,feedbackTextColorError:o,feedbackTextColorWarning:s,feedbackTextColor:l})}var r={name:`Form`,common:e,self:n};export{n,r as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,nt as t,s as n,st as r,u as i}from"./browser-
|
|
1
|
+
import{n as e,nt as t,s as n,st as r,u as i}from"./browser-DlPqZ-4M.js";import{r as a}from"./Button-vKfgky-Y.js";var{cubicBezierEaseInOut:o,cubicBezierEaseOut:s,cubicBezierEaseIn:c}=i;function l({overflow:e=`hidden`,duration:t=`.3s`,originalTransition:n=``,leavingDelay:i=`0s`,foldPadding:a=!1,enterToProps:l=void 0,leaveToProps:u=void 0,reverse:d=!1}={}){let f=d?`leave`:`enter`,p=d?`enter`:`leave`;return[r(`&.fade-in-height-expand-transition-${p}-from,
|
|
2
2
|
&.fade-in-height-expand-transition-${f}-to`,Object.assign(Object.assign({},l),{opacity:1})),r(`&.fade-in-height-expand-transition-${p}-to,
|
|
3
3
|
&.fade-in-height-expand-transition-${f}-from`,Object.assign(Object.assign({},u),{opacity:0,marginTop:`0 !important`,marginBottom:`0 !important`,paddingTop:a?`0 !important`:void 0,paddingBottom:a?`0 !important`:void 0})),r(`&.fade-in-height-expand-transition-${p}-active`,`
|
|
4
4
|
overflow: ${e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,rt as t,s as n}from"./browser-
|
|
1
|
+
import{n as e,rt as t,s as n}from"./browser-DlPqZ-4M.js";import{i as r}from"./Popover-CXrjClQw.js";var i={padding:`8px 14px`};function a(e){let{borderRadius:n,boxShadow2:r,baseColor:a}=e;return Object.assign(Object.assign({},i),{borderRadius:n,boxShadow:r,color:t(a,`rgba(0, 0, 0, .85)`),textColor:a})}var o=n({name:`Tooltip`,common:e,peers:{Popover:r},self:a});export{i as n,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{lt as e,w as t}from"./router-kR4kqS2l.js";import{n}from"./pinia-C8BDM-Fc.js";import{a as r,i,n as a,r as o,t as s}from"./app-y8cD3FPg.js";var c=n(`models`,()=>{let n=e([]),c=e([]),l=e(``),u=e(!1),d=t(()=>n.value.filter(e=>e.provider.startsWith(`custom:`))),f=t(()=>n.value.filter(e=>!e.provider.startsWith(`custom:`))),p=t(()=>n.value.flatMap(e=>e.models.map(t=>({id:t,provider:e.provider,label:e.label,base_url:e.base_url,isDefault:t===l.value}))));async function m(){u.value=!0;try{let e=await o();n.value=e.groups,c.value=e.allProviders,l.value=e.default}catch(e){console.error(`Failed to fetch providers:`,e)}finally{u.value=!1}}async function h(e,t){await r({default:e,provider:t}),l.value=e,s().loadModels()}async function g(e){await a(e),await m(),s().loadModels()}async function _(e){await i(e),await m(),s().loadModels()}return{providers:n,allProviders:c,defaultModel:l,loading:u,customProviders:d,builtinProviders:f,allModels:p,fetchProviders:m,setDefaultModel:h,addProvider:g,removeProvider:_}});export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as e,I as t,Z as n,at as r,dt as i,it as a,lt as o,nt as s,ot as c,pt as l,rt as u,st as d,tt as f,w as p,z as m}from"./router-kR4kqS2l.js";var h=typeof window<`u`,g,_=e=>g=e,v=Symbol();function y(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var b;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(b||={});var x=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function S(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function C(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){O(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function w(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function T(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var E=typeof navigator==`object`?navigator:{userAgent:``},D=/Macintosh/.test(E.userAgent)&&/AppleWebKit/.test(E.userAgent)&&!/Safari/.test(E.userAgent),O=h?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!D?k:`msSaveOrOpenBlob`in E?A:j:()=>{};function k(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?T(r):w(r.href)?C(e,t,n):(r.target=`_blank`,T(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){T(r)},0))}function A(e,t=`download`,n){if(typeof e==`string`)if(w(e))C(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){T(t)})}else navigator.msSaveOrOpenBlob(S(e,n),t)}function j(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return C(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(x.HTMLElement))||`safari`in x,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||D)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:M}=Object;function N(){let e=f(!0),t=e.run(()=>o({})),n=[],i=[],a=r({install(e){_(a),a._a=e,e.provide(v,a),e.config.globalProperties.$pinia=a,i.forEach(e=>n.push(e)),i=[]},use(e){return this._a?n.push(e):i.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return a}var P=()=>{};function F(e,t,n,r=P){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&s()&&c(i),i}function I(e,...t){e.forEach(e=>{e(...t)})}var L=e=>e(),R=Symbol(),z=Symbol();function B(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];y(i)&&y(r)&&e.hasOwnProperty(n)&&!a(r)&&!u(r)?e[n]=B(i,r):e[n]=r}return e}var V=Symbol();function H(e){return!y(e)||!Object.prototype.hasOwnProperty.call(e,V)}var{assign:U}=Object;function W(e){return!!(a(e)&&e.effect)}function G(e,t,n,i){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],u;function d(){return c||(n.state.value[e]=a?a():{}),U(l(n.state.value[e]),o,Object.keys(s||{}).reduce((t,i)=>(t[i]=r(p(()=>{_(n);let t=n._s.get(e);return s[i].call(t,t)})),t),{}))}return u=K(e,d,t,n,i,!0),u}function K(e,t,r={},s,c,l){let p,h=U({actions:{}},r),g={deep:!0},v,y,x=new Set,S=new Set,C=s.state.value[e];!l&&!C&&(s.state.value[e]={}),o({});let w;function T(t){let n;v=y=!1,typeof t==`function`?(t(s.state.value[e]),n={type:b.patchFunction,storeId:e,events:void 0}):(B(s.state.value[e],t),n={type:b.patchObject,payload:t,storeId:e,events:void 0});let r=w=Symbol();m().then(()=>{w===r&&(v=!0)}),y=!0,I(x,n,s.state.value[e])}let E=l?function(){let{state:e}=r,t=e?e():{};this.$patch(e=>{U(e,t)})}:P;function D(){p.stop(),x.clear(),S.clear(),s._s.delete(e)}let O=(t,n=``)=>{if(R in t)return t[z]=n,t;let r=function(){_(s);let n=Array.from(arguments),i=new Set,a=new Set;function o(e){i.add(e)}function c(e){a.add(e)}I(S,{args:n,name:r[z],store:k,after:o,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:k,n)}catch(e){throw I(a,e),e}return l instanceof Promise?l.then(e=>(I(i,e),e)).catch(e=>(I(a,e),Promise.reject(e))):(I(i,l),l)};return r[R]=!0,r[z]=n,r},k=d({_p:s,$id:e,$onAction:F.bind(null,S),$patch:T,$reset:E,$subscribe(t,r={}){let i=F(x,t,r.detached,()=>a()),a=p.run(()=>n(()=>s.state.value[e],n=>{(r.flush===`sync`?y:v)&&t({storeId:e,type:b.direct,events:void 0},n)},U({},g,r)));return i},$dispose:D});s._s.set(e,k);let A=(s._a&&s._a.runWithContext||L)(()=>s._e.run(()=>(p=f()).run(()=>t({action:O}))));for(let t in A){let n=A[t];a(n)&&!W(n)||u(n)?l||(C&&H(n)&&(a(n)?n.value=C[t]:B(n,C[t])),s.state.value[e][t]=n):typeof n==`function`&&(A[t]=O(n,t),h.actions[t]=n)}return U(k,A),U(i(k),A),Object.defineProperty(k,`$state`,{get:()=>s.state.value[e],set:e=>{T(t=>{U(t,e)})}}),s._p.forEach(e=>{U(k,p.run(()=>e({store:k,app:s._a,pinia:s,options:h})))}),C&&l&&r.hydrate&&r.hydrate(k.$state,C),v=!0,y=!0,k}function q(n,r,i){let a,o=typeof r==`function`;a=o?i:r;function s(i,s){let c=e();return i||=c?t(v,null):null,i&&_(i),i=g,i._s.has(n)||(o?K(n,r,a,i):G(n,a,i)),i._s.get(n)}return s.$id=n,s}export{q as n,N as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,lt as n,s as r}from"./router-kR4kqS2l.js";import{n as i}from"./pinia-C8BDM-Fc.js";async function a(){return(await r(`/api/hermes/profiles`)).profiles}async function o(e){return(await r(`/api/hermes/profiles/${encodeURIComponent(e)}`)).profile}async function s(e,t){try{return await r(`/api/hermes/profiles`,{method:`POST`,body:JSON.stringify({name:e,clone:t})}),!0}catch{return!1}}async function c(e){try{return await r(`/api/hermes/profiles/${encodeURIComponent(e)}`,{method:`DELETE`}),!0}catch{return!1}}async function l(e,t){try{return await r(`/api/hermes/profiles/${encodeURIComponent(e)}/rename`,{method:`POST`,body:JSON.stringify({new_name:t})}),!0}catch{return!1}}async function u(e){try{return await r(`/api/hermes/profiles/active`,{method:`PUT`,body:JSON.stringify({name:e})}),!0}catch{return!1}}async function d(n){try{let r=e(),i=t(),a={};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${r}/api/hermes/profiles/${encodeURIComponent(n)}/export`,{method:`POST`,headers:a});if(!o.ok)throw Error();let s=await o.blob(),c=URL.createObjectURL(s),l=document.createElement(`a`);return l.href=c,l.download=`hermes-profile-${n}.tar.gz`,l.click(),URL.revokeObjectURL(c),!0}catch{return!1}}async function f(n){try{let r=e(),i=t(),a={};i&&(a.Authorization=`Bearer ${i}`);let o=new FormData;return o.append(`file`,n),(await fetch(`${r}/api/hermes/profiles/import`,{method:`POST`,headers:a,body:o})).ok}catch{return!1}}var p=`hermes_active_profile_name`,m=i(`profiles`,()=>{let e=n([]),t=n(localStorage.getItem(p)),r=n(null),i=n({}),m=n(!1),h=n(!1);async function g(){m.value=!0;try{e.value=await a(),r.value=e.value.find(e=>e.active)??null,r.value&&(t.value=r.value.name,localStorage.setItem(p,r.value.name))}catch(e){console.error(`Failed to fetch profiles:`,e)}finally{m.value=!1}}async function _(e){if(i.value[e])return i.value[e];try{let t=await o(e);return i.value[e]=t,t}catch{return null}}async function v(e,t){let n=await s(e,t);return n&&await g(),n}async function y(e){let t=await c(e);return t&&(delete i.value[e],b(e),await g()),t}function b(e){let t=[`hermes_sessions_cache_v1_${e}`,`hermes_session_msgs_v1_${e}_`,`hermes_in_flight_v1_${e}_`,`hermes_active_session_${e}`,`hermes_session_pins_v1_${e}`,`hermes_human_only_v1_${e}`],n=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r&&t.some(e=>r.startsWith(e))&&n.push(r)}n.forEach(e=>localStorage.removeItem(e))}async function x(e,t){let n=await l(e,t);return n&&(delete i.value[e],await g()),n}async function S(e){h.value=!0;try{let t=await u(e);return t&&await g(),t}finally{h.value=!1}}async function C(e){return d(e)}async function w(e){let t=await f(e);return t&&await g(),t}return{profiles:e,activeProfile:r,activeProfileName:t,detailMap:i,loading:m,switching:h,fetchProfiles:g,fetchProfileDetail:_,createProfile:v,deleteProfile:y,renameProfile:x,switchProfile:S,exportProfile:C,importProfile:w}});export{m as t};
|