hermium 0.1.10 → 0.2.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 (212) hide show
  1. package/README.md +56 -0
  2. package/bin/hermium.mjs +185 -164
  3. package/dist/api.mjs +3513 -0
  4. package/dist/public/assets/css/index-Dfs9RUU9.css +1 -0
  5. package/dist/public/assets/css/styles-B8p6jk5Z.css +1 -0
  6. package/dist/public/assets/js/ChatInputBlock-Bw7AL70H.js +1 -0
  7. package/dist/public/assets/js/MarkdownMessage-8d7Y6VL-.js +1 -0
  8. package/dist/public/assets/js/base-ui-BvQbAt_1.js +1 -0
  9. package/dist/public/assets/js/chat._sessionId-BG6lVraH.js +1 -0
  10. package/dist/public/assets/js/chat.index-D2zdMPTT.js +1 -0
  11. package/dist/public/assets/js/index-C0AK45FU.js +60 -0
  12. package/dist/public/assets/js/index-Cx5En4FK.js +1 -0
  13. package/dist/public/assets/js/memory-CeSRdTkW.js +3 -0
  14. package/dist/public/assets/js/router-8uDKazL-.js +1 -0
  15. package/dist/public/assets/js/settings-Bc3Y5zXO.js +1 -0
  16. package/dist/public/assets/js/skills-DZv7sA_5.js +1 -0
  17. package/dist/public/assets/js/theme-CPkdkpaj.js +1 -0
  18. package/dist/public/assets/js/usage-DXQsT9_b.js +1 -0
  19. package/dist/public/assets/woff2/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  20. package/dist/public/assets/woff2/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  21. package/dist/public/assets/woff2/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  22. package/dist/public/assets/woff2/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  23. package/dist/public/assets/woff2/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  24. package/dist/public/favicon.ico +0 -0
  25. package/dist/public/logo.png +0 -0
  26. package/package.json +1 -1
  27. package/dist/public/assets/IconAlertCircle-BW147gsG.js +0 -1
  28. package/dist/public/assets/IconAlertTriangle-DCoTLVSd.js +0 -1
  29. package/dist/public/assets/IconCheck-DAO7Fpl9.js +0 -1
  30. package/dist/public/assets/IconCode-BqfTl5wU.js +0 -1
  31. package/dist/public/assets/IconLoader2-B_pehSXN.js +0 -1
  32. package/dist/public/assets/IconRefresh-BbMGoMV8.js +0 -1
  33. package/dist/public/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  34. package/dist/public/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  35. package/dist/public/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  36. package/dist/public/assets/index-BL9a2Xg9.js +0 -1
  37. package/dist/public/assets/index-BSwXjgjr.js +0 -1
  38. package/dist/public/assets/index-BWl8tn18.js +0 -1
  39. package/dist/public/assets/index-CQh8SXb2.js +0 -94
  40. package/dist/public/assets/index-Cxd-kSUY.js +0 -1
  41. package/dist/public/assets/index-DA5SH--7.js +0 -2
  42. package/dist/public/assets/index-DCHbvtBS.js +0 -1
  43. package/dist/public/assets/index-DCYXJZEe.js +0 -1
  44. package/dist/public/assets/index-DFDfp0ca.js +0 -1
  45. package/dist/public/assets/index-GuAAqSCJ.js +0 -14
  46. package/dist/public/assets/index-WIDirTHx.js +0 -29
  47. package/dist/public/assets/index-X3XZcAzy.js +0 -1
  48. package/dist/public/assets/input-7TQEEJq6.js +0 -1
  49. package/dist/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  50. package/dist/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  51. package/dist/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  52. package/dist/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  53. package/dist/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  54. package/dist/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  55. package/dist/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  56. package/dist/public/assets/models-BlUb1eaf.js +0 -1
  57. package/dist/public/assets/styles-PHtUFHUr.css +0 -1
  58. package/dist/public/assets/switch-B_iYUUM3.js +0 -1
  59. package/dist/public/assets/syntax-highlighter-DcBYfnEK.js +0 -6
  60. package/dist/public/assets/textarea-Dm4aaRqS.js +0 -1
  61. package/dist/public/favicon.png +0 -0
  62. package/dist/public/nous-logo.png +0 -0
  63. package/dist/server/index.mjs +0 -244
  64. package/dist/web-server/__23tanstack-start-plugin-adapters-Cwee5PKy.mjs +0 -6
  65. package/dist/web-server/_chunks/ssr-renderer.mjs +0 -22
  66. package/dist/web-server/_libs/babel__runtime.mjs +0 -237
  67. package/dist/web-server/_libs/bail.mjs +0 -8
  68. package/dist/web-server/_libs/base-ui__react.mjs +0 -9554
  69. package/dist/web-server/_libs/base-ui__utils.mjs +0 -1101
  70. package/dist/web-server/_libs/ccount.mjs +0 -16
  71. package/dist/web-server/_libs/character-entities-legacy.mjs +0 -111
  72. package/dist/web-server/_libs/character-entities.mjs +0 -2130
  73. package/dist/web-server/_libs/character-reference-invalid.mjs +0 -33
  74. package/dist/web-server/_libs/class-variance-authority.mjs +0 -44
  75. package/dist/web-server/_libs/clsx.mjs +0 -16
  76. package/dist/web-server/_libs/comma-separated-tokens.mjs +0 -31
  77. package/dist/web-server/_libs/cookie-es.mjs +0 -44
  78. package/dist/web-server/_libs/croner.mjs +0 -1
  79. package/dist/web-server/_libs/crossws.mjs +0 -1
  80. package/dist/web-server/_libs/decode-named-character-reference+[...].mjs +0 -8
  81. package/dist/web-server/_libs/devlop.mjs +0 -8
  82. package/dist/web-server/_libs/escape-string-regexp.mjs +0 -9
  83. package/dist/web-server/_libs/estree-util-is-identifier-name.mjs +0 -11
  84. package/dist/web-server/_libs/extend.mjs +0 -97
  85. package/dist/web-server/_libs/fault.mjs +0 -1
  86. package/dist/web-server/_libs/floating-ui__core.mjs +0 -663
  87. package/dist/web-server/_libs/floating-ui__dom.mjs +0 -624
  88. package/dist/web-server/_libs/floating-ui__react-dom.mjs +0 -279
  89. package/dist/web-server/_libs/floating-ui__utils.mjs +0 -322
  90. package/dist/web-server/_libs/format.mjs +0 -1
  91. package/dist/web-server/_libs/h3.mjs +0 -408
  92. package/dist/web-server/_libs/hast-util-parse-selector.mjs +0 -39
  93. package/dist/web-server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
  94. package/dist/web-server/_libs/hast-util-whitespace.mjs +0 -10
  95. package/dist/web-server/_libs/hastscript.mjs +0 -200
  96. package/dist/web-server/_libs/highlight.js.mjs +0 -1
  97. package/dist/web-server/_libs/hookable.mjs +0 -1
  98. package/dist/web-server/_libs/html-url-attributes.mjs +0 -26
  99. package/dist/web-server/_libs/inline-style-parser.mjs +0 -142
  100. package/dist/web-server/_libs/is-alphabetical.mjs +0 -7
  101. package/dist/web-server/_libs/is-alphanumerical.mjs +0 -8
  102. package/dist/web-server/_libs/is-decimal.mjs +0 -7
  103. package/dist/web-server/_libs/is-hexadecimal.mjs +0 -7
  104. package/dist/web-server/_libs/is-plain-obj.mjs +0 -10
  105. package/dist/web-server/_libs/isbot.mjs +0 -21
  106. package/dist/web-server/_libs/longest-streak.mjs +0 -25
  107. package/dist/web-server/_libs/lowlight.mjs +0 -1
  108. package/dist/web-server/_libs/markdown-table.mjs +0 -142
  109. package/dist/web-server/_libs/mdast-util-find-and-replace.mjs +0 -109
  110. package/dist/web-server/_libs/mdast-util-from-markdown.mjs +0 -717
  111. package/dist/web-server/_libs/mdast-util-gfm-autolink-literal+[...].mjs +0 -156
  112. package/dist/web-server/_libs/mdast-util-gfm-footnote.mjs +0 -117
  113. package/dist/web-server/_libs/mdast-util-gfm-strikethrough.mjs +0 -54
  114. package/dist/web-server/_libs/mdast-util-gfm-table.mjs +0 -157
  115. package/dist/web-server/_libs/mdast-util-gfm-task-list-item.mjs +0 -77
  116. package/dist/web-server/_libs/mdast-util-gfm.mjs +0 -29
  117. package/dist/web-server/_libs/mdast-util-phrasing.mjs +0 -30
  118. package/dist/web-server/_libs/mdast-util-to-hast.mjs +0 -710
  119. package/dist/web-server/_libs/mdast-util-to-markdown.mjs +0 -798
  120. package/dist/web-server/_libs/mdast-util-to-string.mjs +0 -38
  121. package/dist/web-server/_libs/micromark-core-commonmark.mjs +0 -2259
  122. package/dist/web-server/_libs/micromark-extension-gfm-autolink-literal+[...].mjs +0 -344
  123. package/dist/web-server/_libs/micromark-extension-gfm-footnote+[...].mjs +0 -279
  124. package/dist/web-server/_libs/micromark-extension-gfm-strikethrough+[...].mjs +0 -98
  125. package/dist/web-server/_libs/micromark-extension-gfm-table.mjs +0 -491
  126. package/dist/web-server/_libs/micromark-extension-gfm-tagfilter+[...].mjs +0 -1
  127. package/dist/web-server/_libs/micromark-extension-gfm-task-list-item+[...].mjs +0 -77
  128. package/dist/web-server/_libs/micromark-extension-gfm.mjs +0 -18
  129. package/dist/web-server/_libs/micromark-factory-destination.mjs +0 -94
  130. package/dist/web-server/_libs/micromark-factory-label.mjs +0 -63
  131. package/dist/web-server/_libs/micromark-factory-space.mjs +0 -24
  132. package/dist/web-server/_libs/micromark-factory-title.mjs +0 -65
  133. package/dist/web-server/_libs/micromark-factory-whitespace.mjs +0 -22
  134. package/dist/web-server/_libs/micromark-util-character.mjs +0 -44
  135. package/dist/web-server/_libs/micromark-util-chunked.mjs +0 -36
  136. package/dist/web-server/_libs/micromark-util-classify-character+[...].mjs +0 -12
  137. package/dist/web-server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
  138. package/dist/web-server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
  139. package/dist/web-server/_libs/micromark-util-decode-string.mjs +0 -21
  140. package/dist/web-server/_libs/micromark-util-encode.mjs +0 -1
  141. package/dist/web-server/_libs/micromark-util-html-tag-name.mjs +0 -69
  142. package/dist/web-server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
  143. package/dist/web-server/_libs/micromark-util-resolve-all.mjs +0 -15
  144. package/dist/web-server/_libs/micromark-util-sanitize-uri.mjs +0 -41
  145. package/dist/web-server/_libs/micromark-util-subtokenize.mjs +0 -346
  146. package/dist/web-server/_libs/micromark.mjs +0 -906
  147. package/dist/web-server/_libs/ocache.mjs +0 -1
  148. package/dist/web-server/_libs/ohash.mjs +0 -1
  149. package/dist/web-server/_libs/parse-entities.mjs +0 -245
  150. package/dist/web-server/_libs/property-information.mjs +0 -1210
  151. package/dist/web-server/_libs/react-dom.mjs +0 -10779
  152. package/dist/web-server/_libs/react-markdown.mjs +0 -147
  153. package/dist/web-server/_libs/react-syntax-highlighter.mjs +0 -941
  154. package/dist/web-server/_libs/react.mjs +0 -513
  155. package/dist/web-server/_libs/refractor.mjs +0 -2425
  156. package/dist/web-server/_libs/remark-gfm.mjs +0 -20
  157. package/dist/web-server/_libs/remark-parse.mjs +0 -19
  158. package/dist/web-server/_libs/remark-rehype.mjs +0 -21
  159. package/dist/web-server/_libs/reselect.mjs +0 -1
  160. package/dist/web-server/_libs/rou3.mjs +0 -8
  161. package/dist/web-server/_libs/seroval-plugins.mjs +0 -58
  162. package/dist/web-server/_libs/seroval.mjs +0 -1775
  163. package/dist/web-server/_libs/space-separated-tokens.mjs +0 -11
  164. package/dist/web-server/_libs/srvx.mjs +0 -781
  165. package/dist/web-server/_libs/style-to-js.mjs +0 -72
  166. package/dist/web-server/_libs/style-to-object.mjs +0 -38
  167. package/dist/web-server/_libs/tabler__icons-react.mjs +0 -233
  168. package/dist/web-server/_libs/tanstack__history.mjs +0 -204
  169. package/dist/web-server/_libs/tanstack__query-core.mjs +0 -2552
  170. package/dist/web-server/_libs/tanstack__react-query.mjs +0 -190
  171. package/dist/web-server/_libs/tanstack__react-router.mjs +0 -1120
  172. package/dist/web-server/_libs/tanstack__react-store.mjs +0 -2
  173. package/dist/web-server/_libs/tanstack__router-core.mjs +0 -4288
  174. package/dist/web-server/_libs/tanstack__store.mjs +0 -1
  175. package/dist/web-server/_libs/trim-lines.mjs +0 -41
  176. package/dist/web-server/_libs/trough.mjs +0 -85
  177. package/dist/web-server/_libs/ufo.mjs +0 -54
  178. package/dist/web-server/_libs/unctx.mjs +0 -1
  179. package/dist/web-server/_libs/ungap__structured-clone.mjs +0 -224
  180. package/dist/web-server/_libs/unified.mjs +0 -661
  181. package/dist/web-server/_libs/unist-util-is.mjs +0 -100
  182. package/dist/web-server/_libs/unist-util-position.mjs +0 -27
  183. package/dist/web-server/_libs/unist-util-stringify-position.mjs +0 -27
  184. package/dist/web-server/_libs/unist-util-visit-parents.mjs +0 -83
  185. package/dist/web-server/_libs/unist-util-visit.mjs +0 -24
  186. package/dist/web-server/_libs/unstorage.mjs +0 -1
  187. package/dist/web-server/_libs/use-sync-external-store.mjs +0 -139
  188. package/dist/web-server/_libs/vfile-message.mjs +0 -138
  189. package/dist/web-server/_libs/vfile.mjs +0 -467
  190. package/dist/web-server/_libs/zod.mjs +0 -3915
  191. package/dist/web-server/_libs/zustand.mjs +0 -343
  192. package/dist/web-server/_libs/zwitch.mjs +0 -1
  193. package/dist/web-server/_ssr/index--Bo2_ipW.mjs +0 -277
  194. package/dist/web-server/_ssr/index-BEvygh5x.mjs +0 -612
  195. package/dist/web-server/_ssr/index-BFaKxYfN.mjs +0 -40
  196. package/dist/web-server/_ssr/index-BdrMzRTd.mjs +0 -513
  197. package/dist/web-server/_ssr/index-CoDfv1vI.mjs +0 -66
  198. package/dist/web-server/_ssr/index-Cwp8Gyl1.mjs +0 -1812
  199. package/dist/web-server/_ssr/index-DQsfKYjV.mjs +0 -449
  200. package/dist/web-server/_ssr/index-Dbs9k8Ea.mjs +0 -251
  201. package/dist/web-server/_ssr/index-Dk93oyZD.mjs +0 -213
  202. package/dist/web-server/_ssr/index-KNJ7huw_.mjs +0 -369
  203. package/dist/web-server/_ssr/index.mjs +0 -1558
  204. package/dist/web-server/_ssr/input-BV1DMASc.mjs +0 -20
  205. package/dist/web-server/_ssr/models-MzrvbL2i.mjs +0 -43
  206. package/dist/web-server/_ssr/router-CS6Zq3md.mjs +0 -2134
  207. package/dist/web-server/_ssr/start-HYkvq4Ni.mjs +0 -4
  208. package/dist/web-server/_ssr/switch-Bd-Sg0HG.mjs +0 -33
  209. package/dist/web-server/_ssr/syntax-highlighter-5vezNTce.mjs +0 -62
  210. package/dist/web-server/_ssr/textarea-CB4kQp9w.mjs +0 -18
  211. package/dist/web-server/_tanstack-start-manifest_v-m5lY48LR.mjs +0 -4
  212. package/dist/web-server/index.mjs +0 -611
@@ -0,0 +1 @@
1
+ import{am as e}from"./index-C0AK45FU.js";import{d as a}from"./router-8uDKazL-.js";import{C as n}from"./ChatInputBlock-Bw7AL70H.js";import"./base-ui-BvQbAt_1.js";function x(){const t=a();return e.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-2xl mx-auto",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-semibold tracking-tight text-foreground text-center",children:"What can I help you with?"}),e.jsx("div",{className:"w-full",children:e.jsx(n,{onCreateSession:s=>{t({to:"/chat/$sessionId",params:{sessionId:s}})}})})]})})}export{x as component};
@@ -0,0 +1,3 @@
1
+ import{aw as y,ar as r,aF as w,am as e,j as g,S as z,D as k,d as j,b as u,p as C,l as I,s as M,r as E}from"./index-C0AK45FU.js";import{M as A}from"./MarkdownMessage-8d7Y6VL-.js";import"./base-ui-BvQbAt_1.js";import"./router-8uDKazL-.js";async function D(){return y("/api/hermes/memory")}async function F(s,o){await y("/api/hermes/memory",{method:"POST",body:JSON.stringify({section:s,content:o})})}const L={memory:{title:"My Notes",icon:e.jsx(E,{className:"size-4"}),empty:"No notes yet. Write down things you want the AI to remember.",placeholder:"Write anything you want the AI to remember about this conversation, context, or preferences..."},user:{title:"User Profile",icon:e.jsx(M,{className:"size-4"}),empty:"No user profile. Add details about yourself.",placeholder:"Describe yourself — your role, expertise, preferences, communication style..."},soul:{title:"Soul",icon:e.jsx(j,{className:"size-4"}),empty:"No soul defined. Set the AI's personality and behavior.",placeholder:"Define the AI's personality, tone, expertise, and how it should behave..."}};function P(s){if(!s)return"";try{return new Date(s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}}function p({section:s,data:o,onSave:f}){const[l,i]=r.useState(!1),[c,m]=r.useState(""),[d,n]=r.useState(!1),a=L[s],t=o[s],x=o[`${s}_mtime`],N=!t.trim(),v=()=>{m(t),i(!0)},b=()=>{i(!1),m("")},S=async()=>{n(!0);try{await f(s,c),i(!1)}catch(h){console.error("Failed to save memory:",h)}finally{n(!1)}};return e.jsxs("div",{className:"flex flex-col border rounded-lg overflow-hidden h-full min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 bg-muted/50 border-b shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:a.icon}),e.jsx("span",{className:"text-sm font-medium",children:a.title}),x?e.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-1",children:P(x)}):null]}),l?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(u,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:b,disabled:d,children:"Cancel"}),e.jsx(u,{size:"sm",className:"h-7 px-3 text-xs",onClick:S,disabled:d,children:d?e.jsx(g,{className:"size-3 animate-spin"}):"Save"})]}):e.jsxs(u,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:v,children:[e.jsx(I,{className:"size-3 mr-1"}),"Edit"]})]}),l?e.jsx("textarea",{value:c,onChange:h=>m(h.target.value),placeholder:a.placeholder,spellCheck:!1,className:"flex-1 min-h-0 w-full resize-none border-0 bg-transparent px-3 py-3 text-sm leading-relaxed outline-none focus-visible:ring-0 font-mono"}):e.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:N?e.jsx("p",{className:"text-sm text-muted-foreground italic",children:a.empty}):e.jsx(A,{content:t.replace(/§/g,`
2
+
3
+ `)})})]})}function U(){const[s,o]=r.useState(null),[f,l]=r.useState(!0),[i,c]=r.useState(!1),{state:m}=w(),d=m==="collapsed",n=r.useCallback(async()=>{try{const t=await D();o(t)}catch(t){console.error("Failed to load memory:",t)}},[]);r.useEffect(()=>{l(!0),n().finally(()=>l(!1))},[n]);const a=async(t,x)=>{await F(t,x),await n()};return f?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(g,{className:"size-4 animate-spin"}),"Loading memory…"]})}):s?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d&&e.jsx(z,{className:k("mr-1 -ml-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0")}),e.jsx(j,{className:"size-5 text-muted-foreground"}),e.jsx("h2",{className:"text-sm font-medium",children:"Memory"})]}),e.jsxs(u,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{c(!0),n().finally(()=>c(!1))},disabled:i,children:[i?e.jsx(g,{className:"size-3 animate-spin"}):e.jsx(C,{className:"size-3"}),"Refresh"]})]}),e.jsx("div",{className:"flex-1 min-h-0 p-4 overflow-hidden",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 h-full min-h-0",children:[e.jsx(p,{section:"memory",data:s,onSave:a}),e.jsx(p,{section:"user",data:s,onSave:a}),e.jsx(p,{section:"soul",data:s,onSave:a})]})})]}):e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load memory."})})}export{U as component};
@@ -0,0 +1 @@
1
+ import{ar as c,am as i,J as ze,T as q,R as O,aG as g,a8 as k,av as we,a9 as xe,N as Je,au as Re,H as b,Q as Ce,ap as $e,aq as Ge,B as Ve,a as Qe,ae as Ye,ag as J,a1 as Ze,ay as ie,aj as Xe,F as et,ai as tt,Z as z,aC as Ie,A as Le,a5 as rt,E as Pe,y as nt,a6 as ot,K as st,ac as at,W as be,ax as it}from"./index-C0AK45FU.js";var $=c.use,H=typeof window<"u"?c.useLayoutEffect:c.useEffect;function se(e){const t=c.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function ct(e,t,r={},n={}){c.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([o])=>{t(o)},r);return a.observe(e.current),()=>{a.disconnect()}},[t,r,n.disabled,e])}function ut(e){const t=c.useRef(null);return c.useImperativeHandle(e,()=>t.current,[]),t}function lt({promise:e}){if($)return $(e);const t=ze(e);if(t[q].status==="pending")throw t;if(t[q].status==="error")throw t[q].error;return t[q].data}function rr(e){const t=i.jsx(dt,{...e});return e.fallback?i.jsx(c.Suspense,{fallback:e.fallback,children:t}):t}function dt(e){const t=lt(e);return e.children(t)}function ce(e){const t=e.errorComponent??ue;return i.jsx(ft,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:n})=>r?c.createElement(t,{error:r,reset:n}):e.children})}var ft=class extends c.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const r=e.getResetKey();return t.error&&t.resetKey!==r?{resetKey:r,error:null}:{resetKey:r}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ue({error:e}){const[t,r]=c.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function ht({children:e,fallback:t=null}){return le()?i.jsx(O.Fragment,{children:e}):i.jsx(O.Fragment,{children:t})}function le(){return O.useSyncExternalStore(pt,()=>!0,()=>!1)}function pt(){return()=>{}}var _e=c.createContext(null);function S(e){return c.useContext(_e)}var G=c.createContext(void 0),mt=c.createContext(void 0),gt={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function _(e){const t=S(),r=c.useContext(e.from?mt:G),n=e.from??r,a=n?e.from?t.stores.getRouteMatchStore(n):t.stores.matchStores.get(n):void 0,o=c.useRef(void 0);return g(a??gt,s=>{if((e.shouldThrow??!0)&&!s&&k(),s===void 0)return;const u=e.select?e.select(s):s;if(e.structuralSharing??t.options.defaultStructuralSharing){const h=we(o.current,u);return o.current=h,h}return u})}function Te(e){return _({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Me(e){const{select:t,...r}=e;return _({...r,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function Ee(e){return _({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function ke(e){return _({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ae(e){const t=S();return c.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}function Be(e){return _({...e,select:t=>e.select?e.select(t.context):t.context})}function yt(e,t){const r=S(),n=ut(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:u,preload:h,preloadDelay:l,preloadIntentProximity:d,hashScrollIntoView:f,replace:y,startTransition:p,resetScroll:v,viewTransition:I,children:P,target:A,disabled:C,style:W,className:V,onClick:Q,onBlur:Y,onFocus:Z,onMouseEnter:X,onMouseLeave:ee,onTouchStart:te,ignoreBlocker:Oe,params:Jt,search:$t,hash:Gt,state:Vt,mask:Qt,reloadDocument:Yt,unsafeRelative:Zt,from:Xt,_fromLocation:er,...de}=e,re=le(),B=c.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),j=g(r.stores.location,m=>m,(m,R)=>m.href===R.href),x=c.useMemo(()=>{const m={_fromLocation:j,...B};return r.buildLocation(m)},[r,j,B]),fe=x.maskedLocation?x.maskedLocation.publicHref:x.publicHref,he=x.maskedLocation?x.maskedLocation.external:x.external,F=c.useMemo(()=>It(fe,he,r.history,C),[C,he,fe,r.history]),D=c.useMemo(()=>{if(F?.external)return xe(F.href,r.protocolAllowlist)?void 0:F.href;if(!Pt(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),xe(u,r.protocolAllowlist)?void 0:u}catch{}},[u,F,r.protocolAllowlist]),ne=c.useMemo(()=>{if(D)return!1;if(s?.exact){if(!Je(j.pathname,x.pathname,r.basepath))return!1}else{const m=Re(j.pathname,r.basepath),R=Re(x.pathname,r.basepath);if(!(m.startsWith(R)&&(m.length===R.length||m[R.length]==="/")))return!1}return(s?.includeSearch??!0)&&!b(j.search,x.search,{partial:!s?.exact,ignoreUndefined:!s?.explicitUndefined})?!1:s?.includeHash?re&&j.hash===x.hash:!0},[s?.exact,s?.explicitUndefined,s?.includeHash,s?.includeSearch,j,D,re,x.hash,x.pathname,x.search,r.basepath]),K=ne?Ce(a,{})??vt:ae,U=ne?ae:Ce(o,{})??ae,pe=[V,K.className,U.className].filter(Boolean).join(" "),me=(W||K.style||U.style)&&{...W,...K.style,...U.style},[We,ge]=c.useState(!1),ye=c.useRef(!1),T=e.reloadDocument||D?!1:h??r.options.defaultPreload,oe=l??r.options.defaultPreloadDelay??0,w=c.useCallback(()=>{r.preloadRoute({...B,_builtLocation:x}).catch(m=>{console.warn(m),console.warn($e)})},[r,B,x]);ct(n,c.useCallback(m=>{m?.isIntersecting&&w()},[w]),Ct,{disabled:!!C||T!=="viewport"}),c.useEffect(()=>{ye.current||!C&&T==="render"&&(w(),ye.current=!0)},[C,w,T]);const Ke=m=>{const R=m.currentTarget.getAttribute("target"),L=A!==void 0?A:R;if(!C&&!bt(m)&&!m.defaultPrevented&&(!L||L==="_self")&&m.button===0){m.preventDefault(),Ge.flushSync(()=>{ge(!0)});const qe=r.subscribe("onResolved",()=>{qe(),ge(!1)});r.navigate({...B,replace:y,resetScroll:v,hashScrollIntoView:f,startTransition:p,viewTransition:I,ignoreBlocker:Oe})}};if(D)return{...de,ref:n,href:D,...P&&{children:P},...A&&{target:A},...C&&{disabled:C},...W&&{style:W},...V&&{className:V},...Q&&{onClick:Q},...Y&&{onBlur:Y},...Z&&{onFocus:Z},...X&&{onMouseEnter:X},...ee&&{onMouseLeave:ee},...te&&{onTouchStart:te}};const ve=m=>{if(C||T!=="intent")return;if(!oe){w();return}const R=m.currentTarget;if(N.has(R))return;const L=setTimeout(()=>{N.delete(R),w()},oe);N.set(R,L)},Ue=m=>{C||T!=="intent"||w()},Se=m=>{if(C||!T||!oe)return;const R=m.currentTarget,L=N.get(R);L&&(clearTimeout(L),N.delete(R))};return{...de,...K,...U,href:F?.href,ref:n,onClick:M([Q,Ke]),onBlur:M([Y,Se]),onFocus:M([Z,ve]),onMouseEnter:M([X,ve]),onMouseLeave:M([ee,Se]),onTouchStart:M([te,Ue]),disabled:!!C,target:A,...me&&{style:me},...pe&&{className:pe},...C&&St,...ne&&xt,...re&&We&&Rt}}var ae={},vt={className:"active"},St={role:"link","aria-disabled":!0},xt={"data-status":"active","aria-current":"page"},Rt={"data-transitioning":"transitioning"},N=new WeakMap,Ct={rootMargin:"100px"},M=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function It(e,t,r,n){if(!n)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Pt(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Fe=c.forwardRef((e,t)=>{const{_asChild:r,...n}=e,{type:a,...o}=yt(n,t),s=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;if(!r){const{disabled:u,...h}=o;return c.createElement("a",h,s)}return c.createElement(r,o,s)});function bt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var jt=class extends Qe{constructor(e){super(e),this.useMatch=t=>_({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Be({...t,from:this.id}),this.useSearch=t=>ke({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ee({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Me({...t,from:this.id}),this.useLoaderData=t=>Te({...t,from:this.id}),this.useNavigate=()=>Ae({from:this.fullPath}),this.Link=O.forwardRef((t,r)=>i.jsx(Fe,{ref:r,from:this.fullPath,...t}))}};function wt(e){return new jt(e)}var Lt=class extends Ve{constructor(e){super(e),this.useMatch=t=>_({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Be({...t,from:this.id}),this.useSearch=t=>ke({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ee({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Me({...t,from:this.id}),this.useLoaderData=t=>Te({...t,from:this.id}),this.useNavigate=()=>Ae({from:this.fullPath}),this.Link=O.forwardRef((t,r)=>i.jsx(Fe,{ref:r,from:this.fullPath,...t}))}};function nr(e){return new Lt(e)}function or(e){return new _t(e,{silent:!0}).createRoute}var _t=class{constructor(e,t){this.path=e,this.createRoute=r=>{const n=wt(r);return n.isRoot=!1,n},this.silent=t?.silent}};function sr(e,t){let r,n,a,o;const s=()=>(r||(r=e().then(h=>{r=void 0,n=h[t]}).catch(h=>{if(a=h,Ye(a)&&a instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const l=`tanstack_router_reload:${a.message}`;sessionStorage.getItem(l)||(sessionStorage.setItem(l,"1"),o=!0)}})),r),u=function(l){if(o)throw window.location.reload(),new Promise(()=>{});if(a)throw a;if(!n)if($)$(s());else throw s();return c.createElement(n,l)};return u.preload=s,u}function Tt(e){const t=S(),r=`not-found-${g(t.stores.location,n=>n.pathname)}-${g(t.stores.status,n=>n)}`;return i.jsx(ce,{getResetKey:()=>r,onCatch:(n,a)=>{if(J(n))e.onCatch?.(n,a);else throw n},errorComponent:({error:n})=>{if(J(n))return e.fallback?.(n);throw n},children:e.children})}function Mt(){return i.jsx("p",{children:"Not Found"})}function E(e){return i.jsx(i.Fragment,{children:e.children})}function De(e,t,r){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{...r}):i.jsx(Mt,{})}function Et(){return Ze(S()),null}var Ne=c.memo(function({matchId:t}){const r=S(),n=r.stores.matchStores.get(t);n||k();const a=g(r.stores.loadedAt,s=>s),o=g(n,s=>s);return i.jsx(kt,{router:r,matchId:t,resetKey:a,matchState:c.useMemo(()=>{const s=o.routeId,u=r.routesById[s].parentRoute?.id;return{routeId:s,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:u}},[o._displayPending,o.routeId,o.ssr,r.routesById])})});function kt({router:e,matchId:t,resetKey:r,matchState:n}){const a=e.routesById[n.routeId],o=a.options.pendingComponent??e.options.defaultPendingComponent,s=o?i.jsx(o,{}):null,u=a.options.errorComponent??e.options.defaultErrorComponent,h=a.options.onCatch??e.options.defaultOnCatch,l=a.isRoot?a.options.notFoundComponent??e.options.notFoundRoute?.options.component:a.options.notFoundComponent,d=n.ssr===!1||n.ssr==="data-only",f=(!a.isRoot||a.options.wrapInSuspense||d)&&(a.options.wrapInSuspense??o??(a.options.errorComponent?.preload||d))?c.Suspense:E,y=u?ce:E,p=l?Tt:E;return i.jsxs(a.isRoot?a.options.shellComponent??E:E,{children:[i.jsx(G.Provider,{value:t,children:i.jsx(f,{fallback:s,children:i.jsx(y,{getResetKey:()=>r,errorComponent:u||ue,onCatch:(v,I)=>{if(J(v))throw v.routeId??=n.routeId,v;h?.(v,I)},children:i.jsx(p,{fallback:v=>{if(v.routeId??=n.routeId,!l||v.routeId&&v.routeId!==n.routeId||!v.routeId&&!a.isRoot)throw v;return c.createElement(l,v)},children:d||n._displayPending?i.jsx(ht,{fallback:s,children:i.jsx(je,{matchId:t})}):i.jsx(je,{matchId:t})})})})}),n.parentRouteId===ie?i.jsxs(i.Fragment,{children:[i.jsx(At,{resetKey:r}),e.options.scrollRestoration&&Xe?i.jsx(Et,{}):null]}):null]})}function At({resetKey:e}){const t=S(),r=c.useRef(void 0);return H(()=>{const n=t.latestLocation.href;(r.current===void 0||r.current!==n)&&(t.emit({type:"onRendered",...z(t.stores.location.get(),t.stores.resolvedLocation.get())}),r.current=n)},[t.latestLocation.state.__TSR_key,e,t]),null}var je=c.memo(function({matchId:t}){const r=S(),n=(d,f)=>r.getMatch(d.id)?._nonReactive[f]??d._nonReactive[f],a=r.stores.matchStores.get(t);a||k();const o=g(a,d=>d),s=o.routeId,u=r.routesById[s],h=c.useMemo(()=>{const d=(r.routesById[s].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:s,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return d?JSON.stringify(d):void 0},[s,o.loaderDeps,o._strictParams,o._strictSearch,r.options.defaultRemountDeps,r.routesById]),l=c.useMemo(()=>{const d=u.options.component??r.options.defaultComponent;return d?i.jsx(d,{},h):i.jsx(Bt,{})},[h,u.options.component,r.options.defaultComponent]);if(o._displayPending)throw n(o,"displayPendingPromise");if(o._forcePending)throw n(o,"minPendingPromise");if(o.status==="pending"){const d=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(d){const f=r.getMatch(o.id);if(f&&!f._nonReactive.minPendingPromise){const y=et();f._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n(o,"loadPromise")}if(o.status==="notFound")return J(o.error)||k(),De(r,u,o.error);if(o.status==="redirected")throw tt(o.error)||k(),n(o,"loadPromise");if(o.status==="error")throw o.error;return l}),Bt=c.memo(function(){const t=S(),r=c.useContext(G);let n,a=!1,o;{const l=r?t.stores.matchStores.get(r):void 0;[n,a]=g(l,d=>[d?.routeId,d?.globalNotFound??!1]),o=g(t.stores.matchesId,d=>d[d.findIndex(f=>f===r)+1])}const s=n?t.routesById[n]:void 0,u=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(a)return s||k(),De(t,s,void 0);if(!o)return null;const h=i.jsx(Ne,{matchId:o});return n===ie?i.jsx(c.Suspense,{fallback:u,children:h}):h});function Ft(){const e=S(),t=c.useRef({router:e,mounted:!1}),[r,n]=c.useState(!1),a=g(e.stores.isLoading,f=>f),o=g(e.stores.hasPending,f=>f),s=se(a),u=a||r||o,h=se(u),l=a||o,d=se(l);return e.startTransition=f=>{n(!0),c.startTransition(()=>{f(),n(!1)})},c.useEffect(()=>{const f=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ie(e.latestLocation.publicHref)!==Ie(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{f()}},[e,e.history]),H(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),H(()=>{s&&!a&&e.emit({type:"onLoad",...z(e.stores.location.get(),e.stores.resolvedLocation.get())})},[s,e,a]),H(()=>{d&&!l&&e.emit({type:"onBeforeRouteMount",...z(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,d,e]),H(()=>{if(h&&!u){const f=z(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),Le(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&rt(e)}},[u,h,e]),null}function Dt(){const e=S(),t=e.routesById[ie].options.pendingComponent??e.options.defaultPendingComponent,r=t?i.jsx(t,{}):null,n=i.jsxs(typeof document<"u"&&e.ssr?E:c.Suspense,{fallback:r,children:[i.jsx(Ft,{}),i.jsx(Nt,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:n}):n}function Nt(){const e=S(),t=g(e.stores.firstId,a=>a),r=g(e.stores.loadedAt,a=>a),n=t?i.jsx(Ne,{matchId:t}):null;return i.jsx(G.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:i.jsx(ce,{getResetKey:()=>r,errorComponent:ue,onCatch:void 0,children:n})})}var Ht=e=>({createMutableStore:Pe,createReadonlyStore:Pe,batch:Le}),ar=e=>new Ot(e),Ot=class extends nt{constructor(e){super(e,Ht)}};function Wt({router:e,children:t,...r}){ot(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const n=i.jsx(_e.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:n}):n}function ir({router:e,...t}){return i.jsx(Wt,{router:e,...t,children:i.jsx(Dt,{})})}function cr(e){const t=S(),r=c.useRef(void 0);return g(t.stores.location,n=>{const a=n;if(t.options.defaultStructuralSharing){const o=we(r.current,a);return r.current=o,o}return a})}function He(e){const{attrs:t,children:r,nonce:n}=e;switch(e.tag){case"title":return i.jsx("title",{...t,suppressHydrationWarning:!0,children:r});case"meta":return i.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return i.jsx("link",{...t,precedence:t?.precedence??(t?.rel==="stylesheet"?"default":void 0),nonce:n,suppressHydrationWarning:!0});case"style":return e.inlineCss,i.jsx("style",{...t,dangerouslySetInnerHTML:{__html:r},nonce:n});case"script":return i.jsx(Kt,{attrs:t,children:r});default:return null}}function Kt({attrs:e,children:t}){S();const r=le(),n=typeof e?.type=="string"&&e.type!==""&&e.type!=="text/javascript"&&e.type!=="module";if(c.useEffect(()=>{if(!n){if(e?.src){const a=(()=>{try{const s=document.baseURI||window.location.href;return new URL(e.src,s).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(s=>s.src===a))return;const o=document.createElement("script");for(const[s,u]of Object.entries(e))s!=="suppressHydrationWarning"&&u!==void 0&&u!==!1&&o.setAttribute(s,typeof u=="boolean"?"":String(u));return document.head.appendChild(o),()=>{o.parentNode&&o.parentNode.removeChild(o)}}if(typeof t=="string"){const a=typeof e?.type=="string"?e.type:"text/javascript",o=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(u=>{if(!(u instanceof HTMLScriptElement))return!1;const h=u.getAttribute("type")??"text/javascript",l=u.getAttribute("nonce")??void 0;return u.textContent===t&&h===a&&l===o}))return;const s=document.createElement("script");if(s.textContent=t,e)for(const[u,h]of Object.entries(e))u!=="suppressHydrationWarning"&&h!==void 0&&h!==!1&&s.setAttribute(u,typeof h=="boolean"?"":String(h));return document.head.appendChild(s),()=>{s.parentNode&&s.parentNode.removeChild(s)}}}},[e,t,n]),n&&typeof t=="string")return i.jsx("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return i.jsx("script",{...e,suppressHydrationWarning:!0});if(typeof t=="string")return i.jsx("script",{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var Ut=e=>{const t=S(),r=t.options.ssr?.nonce,n=g(t.stores.matches,l=>l.map(d=>d.meta).filter(Boolean),b),a=c.useMemo(()=>{const l=[],d={};let f;for(let y=n.length-1;y>=0;y--){const p=n[y];for(let v=p.length-1;v>=0;v--){const I=p[v];if(I)if(I.title)f||(f={tag:"title",children:I.title});else if("script:ld+json"in I)try{const P=JSON.stringify(I["script:ld+json"]);l.push({tag:"script",attrs:{type:"application/ld+json"},children:st(P)})}catch{}else{const P=I.name??I.property;if(P){if(d[P])continue;d[P]=!0}l.push({tag:"meta",attrs:{...I,nonce:r}})}}}return f&&l.push(f),r&&l.push({tag:"meta",attrs:{property:"csp-nonce",content:r}}),l.reverse(),l},[n,r]),o=g(t.stores.matches,l=>{const d=l.map(p=>p.links).filter(Boolean).flat(1).map(p=>({tag:"link",attrs:{...p,nonce:r}})),f=t.ssr?.manifest,y=l.map(p=>f?.routes[p.routeId]?.assets??[]).filter(Boolean).flat(1).flatMap(p=>p.tag==="link"?at(f,p)?[]:[{tag:"link",attrs:{...p.attrs,crossOrigin:be(e,"stylesheet")??p.attrs?.crossOrigin,suppressHydrationWarning:!0,nonce:r}}]:p.tag==="style"?[{tag:"style",attrs:{...p.attrs,nonce:r},children:p.children,...p.inlineCss?{inlineCss:!0}:{}}]:[]);return[...d,...y]},b),s=g(t.stores.matches,l=>{const d=[];return l.map(f=>t.looseRoutesById[f.routeId]).forEach(f=>t.ssr?.manifest?.routes[f.id]?.preloads?.filter(Boolean).forEach(y=>{const p=it(y);d.push({tag:"link",attrs:{rel:"modulepreload",href:p.href,crossOrigin:be(e,"modulepreload")??p.crossOrigin,nonce:r}})})),d},b),u=g(t.stores.matches,l=>l.map(d=>d.styles).flat(1).filter(Boolean).map(({children:d,...f})=>({tag:"style",attrs:{...f,nonce:r},children:d})),b),h=g(t.stores.matches,l=>l.map(d=>d.headScripts).flat(1).filter(Boolean).map(({children:d,...f})=>({tag:"script",attrs:{...f,nonce:r},children:d})),b);return qt([...a,...s,...o,...u,...h],l=>JSON.stringify(l))};function qt(e,t){const r=new Set;return e.filter(n=>{const a=t(n);return r.has(a)?!1:(r.add(a),!0)})}function ur(e){const t=Ut(e.assetCrossOrigin),r=S().options.ssr?.nonce;return i.jsx(i.Fragment,{children:t.map(n=>c.createElement(He,{...n,key:`tsr-meta-${JSON.stringify(n)}`,nonce:r}))})}var lr=()=>{const e=S(),t=e.options.ssr?.nonce,r=o=>{const s=[],u=e.ssr?.manifest;return u?(o.map(h=>e.looseRoutesById[h.routeId]).forEach(h=>u.routes[h.id]?.assets?.filter(l=>l.tag==="script").forEach(l=>{s.push({tag:"script",attrs:{...l.attrs,nonce:t},children:l.children})})),s):[]},n=o=>o.map(s=>s.scripts).flat(1).filter(Boolean).map(({children:s,...u})=>({tag:"script",attrs:{...u,suppressHydrationWarning:!0,nonce:t},children:s})),a=g(e.stores.matches,r,b);return zt(e,g(e.stores.matches,n,b),a)};function zt(e,t,r){let n;e.serverSsr&&(n=e.serverSsr.takeBufferedScripts());const a=[...t,...r];return n&&a.unshift(n),i.jsx(i.Fragment,{children:a.map((o,s)=>c.createElement(He,{...o,key:`tsr-scripts-${o.tag}-${s}`}))})}export{rr as A,ur as H,Fe as L,ir as R,lr as S,nr as a,ar as b,or as c,Ae as d,sr as l,cr as u};
@@ -0,0 +1 @@
1
+ import{am as e}from"./index-C0AK45FU.js";import"./base-ui-BvQbAt_1.js";import"./router-8uDKazL-.js";function n(){return e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Settings"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure profiles, models, and preferences."})]})}export{n as component};
@@ -0,0 +1 @@
1
+ import{aw as j,am as e,D as m,aF as ae,ar as l,S as R,b as z,I as q,j as C,p as B,i as le,t as E,q as re,v as ie,g as K,f as O,n as ne}from"./index-C0AK45FU.js";import{S as oe,n as ce}from"./base-ui-BvQbAt_1.js";import{M as H}from"./MarkdownMessage-8d7Y6VL-.js";import"./router-8uDKazL-.js";async function de(){return j("/api/hermes/skills")}async function F(n){return(await j(`/api/hermes/skills/${n}`)).content}async function J(n,c){return(await j(`/api/hermes/skills/${n}/${c}/files`)).files}async function ue(n,c){await j("/api/hermes/skills/toggle",{method:"PUT",body:JSON.stringify({name:n,enabled:c})})}function me({className:n,size:c="default",...o}){return e.jsx(oe,{"data-slot":"switch","data-size":c,className:m("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",n),...o,children:e.jsx(ce,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function U({source:n}){const c=n==="builtin"?"bg-muted-foreground":n==="hub"?"bg-blue-400":"bg-emerald-400";return e.jsx("span",{className:m("size-2 rounded-full shrink-0",c)})}function ge(){const{state:n}=ae(),c=n==="collapsed",[o,L]=l.useState(null),[v,x]=l.useState(!0),[d,V]=l.useState(""),[u,W]=l.useState("all"),[I,G]=l.useState(new Set),[k,Q]=l.useState(!0),[r,b]=l.useState(null),[X,h]=l.useState(""),[$,N]=l.useState([]),[P,f]=l.useState(!1),[A,y]=l.useState(null),[Y,p]=l.useState(""),[,D]=l.useState(!1),w=l.useCallback(async()=>{try{const s=await de();L(s)}catch(s){console.error("Failed to load skills:",s)}},[]);l.useEffect(()=>{x(!0),w().finally(()=>x(!1))},[w]),l.useEffect(()=>{if(!r){h(""),N([]),y(null),p("");return}f(!0);const s=`${r.category}/${r.skill}/SKILL.md`;Promise.all([F(s),J(r.category,r.skill)]).then(([t,a])=>{h(t),N(a.filter(i=>!i.isDir))}).catch(t=>{h(`Failed to load skill: ${t.message}`)}).finally(()=>f(!1))},[r]);const M=l.useMemo(()=>{if(!o)return[];let s=o.categories;if(u!=="all"&&(s=s.map(t=>({...t,skills:t.skills.filter(a=>(a.source||"local")===u)})).filter(t=>t.skills.length>0)),d.trim()){const t=d.toLowerCase();s=s.map(a=>({...a,skills:a.skills.filter(i=>i.name.toLowerCase().includes(t)||i.description.toLowerCase().includes(t))})).filter(a=>a.skills.length>0||a.name.toLowerCase().includes(t))}return s},[o,u,d]),T=l.useMemo(()=>{if(!o)return[];let s=o.archived;if(u!=="all"&&(s=s.filter(t=>(t.source||"local")===u)),d.trim()){const t=d.toLowerCase();s=s.filter(a=>a.name.toLowerCase().includes(t)||a.description.toLowerCase().includes(t))}return s},[o,u,d]),Z=s=>{G(t=>{const a=new Set(t);return a.has(s)?a.delete(s):a.add(s),a})},_=async(s,t,a)=>{try{await ue(t,a),L(i=>i&&{...i,categories:i.categories.map(g=>g.name===s?{...g,skills:g.skills.map(S=>S.name===t?{...S,enabled:a}:S)}:g)})}catch(i){console.error("Toggle failed:",i)}},ee=async s=>{if(r){D(!0),y(s);try{const t=`${r.category}/${r.skill}/`,a=await F(`${t}${s}`);p(a)}catch(t){p(`Failed to load file: ${t.message}`)}finally{D(!1)}}},se=()=>{y(null),p("")},te=[{label:"All",value:"all"},{label:"Builtin",value:"builtin"},{label:"Hub",value:"hub"},{label:"Local",value:"local"}];return r?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-3 shrink-0 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 z-10",children:[c&&e.jsx(R,{className:m("mr-1 -ml-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0")}),e.jsxs(z,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>b(null),children:[e.jsx(q,{className:"size-3.5 mr-1"}),"Back"]})]}),e.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 flex items-center gap-2 max-w-[50%]",children:[e.jsx("span",{className:"text-muted-foreground text-sm truncate",children:r.category}),e.jsx("span",{className:"text-muted-foreground shrink-0",children:"/"}),e.jsx("span",{className:"text-sm font-medium truncate",children:r.skill})]}),e.jsx("div",{className:"z-10",children:e.jsxs(z,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{f(!0);const s=`${r.category}/${r.skill}/SKILL.md`;Promise.all([F(s),J(r.category,r.skill)]).then(([t,a])=>{h(t),N(a.filter(i=>!i.isDir))}).finally(()=>f(!1))},disabled:P,children:[P?e.jsx(C,{className:"size-3 animate-spin"}):e.jsx(B,{className:"size-3"}),"Refresh"]})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:e.jsx("div",{className:"max-w-3xl mx-auto flex flex-col gap-4",children:A?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:se,className:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline w-fit",children:[e.jsx(q,{className:"size-3"}),"Back to ",r.skill]}),e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:A}),e.jsx(H,{content:Y})]}):e.jsxs(e.Fragment,{children:[e.jsx(H,{content:X}),$.length>0&&e.jsxs("div",{className:"border-t pt-4 mt-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Attached Files"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:$.map(s=>e.jsxs("button",{onClick:()=>ee(s.path),className:"inline-flex items-center gap-1.5 rounded-md border bg-muted/50 px-2.5 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[e.jsx(le,{className:"size-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate max-w-[180px]",children:s.path})]},s.path))})]})]})})})]}):e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col h-full shrink-0",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-3 shrink-0",children:[c&&e.jsx(R,{className:m("mr-1 -ml-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0")}),e.jsx(E,{className:"size-5 text-muted-foreground"}),e.jsx("h2",{className:"text-sm font-medium",children:"Skills"}),e.jsx(z,{variant:"ghost",size:"sm",className:"ml-auto h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{x(!0),w().finally(()=>x(!1))},disabled:v,children:v?e.jsx(C,{className:"size-3 animate-spin"}):e.jsx(B,{className:"size-3"})})]}),e.jsxs("div",{className:"px-3 py-2 border-b flex flex-col gap-2 shrink-0",children:[e.jsxs("div",{className:"relative",children:[e.jsx(re,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),e.jsx(ie,{value:d,onChange:s=>V(s.target.value),placeholder:"Search skills...",className:"h-8 pl-7 text-xs"})]}),e.jsx("div",{className:"flex items-center gap-1",children:te.map(s=>e.jsx("button",{onClick:()=>W(s.value),className:m("px-2 py-0.5 text-[11px] rounded-sm transition-colors",u===s.value?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:s.label},s.value))})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:v?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(C,{className:"size-4 animate-spin text-muted-foreground"})}):!o||M.length===0?e.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:d?"No skills match your search.":"No skills found."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[M.map(s=>e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{onClick:()=>Z(s.name),className:"flex items-center gap-1.5 px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider rounded-md hover:bg-muted/50 transition-colors",children:[I.has(s.name)?e.jsx(K,{className:"size-3 shrink-0"}):e.jsx(O,{className:"size-3 shrink-0"}),e.jsx("span",{className:"truncate",children:s.name}),e.jsx("span",{className:"ml-auto text-[10px] bg-muted px-1.5 py-0.5 rounded-full",children:s.skills.length})]}),!I.has(s.name)&&e.jsx("div",{className:"flex flex-col",children:s.skills.map(t=>e.jsxs("div",{className:"group flex items-center gap-2 px-2 py-1.5 pl-7 rounded-md hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>b({category:s.name,skill:t.name}),children:[e.jsx(U,{source:t.source}),e.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium truncate",children:t.name}),t.modified&&e.jsx("span",{className:"text-[10px] text-amber-500",title:"Modified",children:"✎"}),t.pinned&&e.jsx(ne,{className:"size-3 text-amber-500 shrink-0"})]}),t.description&&e.jsx("span",{className:"text-[10px] text-muted-foreground truncate",children:t.description})]}),e.jsx(me,{checked:t.enabled!==!1,onCheckedChange:a=>_(s.name,t.name,a),className:"scale-75 shrink-0",onClick:a=>a.stopPropagation()})]},t.name))})]},s.name)),(T.length>0||(o?.archived.length??0)>0)&&e.jsxs("div",{className:"flex flex-col mt-2 pt-2 border-t",children:[e.jsxs("button",{onClick:()=>Q(!k),className:"flex items-center gap-1.5 px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider rounded-md hover:bg-muted/50 transition-colors",children:[k?e.jsx(K,{className:"size-3 shrink-0"}):e.jsx(O,{className:"size-3 shrink-0"}),e.jsx("span",{children:"Archived"}),e.jsx("span",{className:"ml-auto text-[10px] bg-muted px-1.5 py-0.5 rounded-full",children:o?.archived.length??0})]}),!k&&T.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 pl-7 rounded-md hover:bg-muted/50 cursor-pointer transition-colors opacity-60",onClick:()=>b({category:".archive",skill:s.name}),children:[e.jsx(U,{source:s.source}),e.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs font-medium truncate",children:s.name}),s.description&&e.jsx("span",{className:"text-[10px] text-muted-foreground truncate",children:s.description})]})]},s.name))]})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(E,{className:"size-12 opacity-20"}),e.jsx("p",{className:"text-sm",children:"Select a skill to view its details"})]})})]})}export{ge as component};
@@ -0,0 +1 @@
1
+ const o="hermium-theme";function n(){try{const e=localStorage.getItem(o);if(e==="dark"||e==="light"||e==="system")return e}catch{}return"system"}function c(e){localStorage.setItem(o,e)}function s(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function a(e){const r=s(e),t=document.documentElement;r==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function m(){const e=n(),t=s(e)==="dark"?"light":"dark";return c(t),a(t),t}export{a as applyTheme,n as getStoredTheme,s as resolveTheme,c as storeTheme,m as toggleTheme};
@@ -0,0 +1 @@
1
+ import{aw as f,am as e,ar as o}from"./index-C0AK45FU.js";import"./base-ui-BvQbAt_1.js";import"./router-8uDKazL-.js";async function g(t=30){const a=new URLSearchParams({days:String(t)});return f(`/api/hermes/usage/stats?${a}`)}const x=["#4fd1c5","#63b3ed","#f6ad55","#b794f4","#68d391","#fc8181","#f687b3","#90cdf4","#fbd38d","#9ae6b4"];function m(t){return(t||"").trim()||"unknown"}function j(t){const a=m(t);let n=0;for(let s=0;s<a.length;s++)n=(n<<5)-n+a.charCodeAt(s),n|=0;return x[Math.abs(n)%x.length]}function l(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t)}function u(t){return t===0?"$0.00":t<.01?"<$0.01":"$"+t.toFixed(2)}function c(t,a){return a<=0?0:t/a*100}function h(t,a){const n=t+a;return n===0?"--":(a/n*100).toFixed(1)+"%"}function b(t=30){const[a,n]=o.useState(null),[s,r]=o.useState(!1);return o.useEffect(()=>{r(!0),g(t).then(n).catch(console.error).finally(()=>r(!1))},[t]),{stats:a,loading:s}}function d({label:t,value:a,sub:n}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t}),e.jsx("div",{className:"text-xl font-semibold",children:a}),n&&e.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:n})]})}function N({stats:t}){const a=t.total_input_tokens+t.total_output_tokens,n=t.total_cache_read_tokens,s=a+n>0?(n/(t.total_input_tokens+n)*100).toFixed(1)+"%":"--",r=t.daily_usage.filter(p=>p.sessions>0).length,i=r>0?(t.total_sessions/r).toFixed(1):"0.0";return e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-5",children:[e.jsx(d,{label:"Total Tokens",value:l(a),sub:`${l(t.total_input_tokens)} input / ${l(t.total_output_tokens)} output`}),e.jsx(d,{label:"Total Sessions",value:String(t.total_sessions),sub:`${i} avg/day`}),e.jsx(d,{label:"Estimated Cost",value:u(t.total_cost??0)}),e.jsx(d,{label:"Cache Hit Rate",value:s,sub:n>0?`${l(n)} tokens`:void 0})]})}function k({stats:t}){const a=o.useMemo(()=>(t.daily_usage??[]).map(s=>{const r=s.input_tokens+s.output_tokens+s.cache_read_tokens;return{...s,visualTokens:r,inputPercent:c(s.input_tokens,r),outputPercent:c(s.output_tokens,r),cachePercent:c(s.cache_read_tokens,r)}}),[t]),n=o.useMemo(()=>Math.max(...a.map(s=>s.visualTokens),1),[a]);return a.length===0?null:e.jsxs("div",{className:"rounded-lg border bg-card p-4 mb-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-secondary-foreground mb-3",children:"Daily Trend"}),e.jsx("div",{className:"flex gap-0.5 mb-2",children:a.map(s=>e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col items-center relative group",children:[e.jsx("div",{className:"w-full h-36 bg-muted/40 rounded-t-sm flex items-end overflow-hidden",children:e.jsxs("div",{className:"w-full flex flex-col-reverse justify-start transition-all",style:{height:`${s.visualTokens/n*100}%`},children:[s.output_tokens>0&&e.jsx("div",{className:"w-full bg-emerald-500/80",style:{height:`${s.outputPercent}%`}}),s.input_tokens>0&&e.jsx("div",{className:"w-full bg-indigo-500/80",style:{height:`${s.inputPercent}%`}}),s.cache_read_tokens>0&&e.jsx("div",{className:"w-full bg-amber-400/80",style:{height:`${s.cachePercent}%`}})]})}),e.jsxs("div",{className:"hidden group-hover:block absolute bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 bg-popover text-popover-foreground text-[11px] whitespace-nowrap z-10 rounded-md border px-2 py-1.5 shadow-md",children:[e.jsx("div",{className:"font-semibold mb-0.5",children:s.date}),e.jsxs("div",{children:["Input: ",l(s.input_tokens)]}),e.jsxs("div",{children:["Output: ",l(s.output_tokens)]}),e.jsxs("div",{children:["Cache read: ",l(s.cache_read_tokens)]}),e.jsxs("div",{children:["Cache write: ",l(s.cache_write_tokens)]}),e.jsxs("div",{children:["Hit rate: ",h(s.input_tokens,s.cache_read_tokens)]}),e.jsxs("div",{children:["Sessions: ",s.sessions]}),e.jsxs("div",{children:["Cost: ",u(s.cost??0)]})]})]},s.date))}),e.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground mb-3",children:[e.jsx("span",{children:a[0]?.date.slice(5)}),e.jsx("span",{children:a[a.length-1]?.date.slice(5)})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground mb-4",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm bg-indigo-500/80"})," Input"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm bg-emerald-500/80"})," Output"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm bg-amber-400/80"})," Cache read"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-[11px] border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted-foreground text-left",children:[e.jsx("th",{className:"pb-1.5 pr-2 font-medium",children:"Date"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Input"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Output"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Cache read"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Cache write"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Hit rate"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Sessions"}),e.jsx("th",{className:"pb-1.5 pr-2 font-medium text-right",children:"Cost"})]})}),e.jsx("tbody",{children:[...a].reverse().map(s=>e.jsxs("tr",{className:"border-t",children:[e.jsx("td",{className:"py-1.5 pr-2",children:s.date}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:l(s.input_tokens)}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:l(s.output_tokens)}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:l(s.cache_read_tokens)}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:l(s.cache_write_tokens)}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:h(s.input_tokens,s.cache_read_tokens)}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:s.sessions}),e.jsx("td",{className:"py-1.5 pr-2 text-right",children:u(s.cost??0)})]},s.date))})]})})]})}function v({stats:t}){const a=o.useMemo(()=>(t.model_usage??[]).map(s=>{const r=s.input_tokens+s.output_tokens,i=r+s.cache_read_tokens;return{model:m(s.model),inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheTokens:s.cache_read_tokens,cacheWriteTokens:s.cache_write_tokens,totalTokens:r,visualTokens:i,sessions:s.sessions,color:j(s.model),inputPercent:c(s.input_tokens,i),outputPercent:c(s.output_tokens,i),cachePercent:c(s.cache_read_tokens,i)}}).sort((s,r)=>r.visualTokens-s.visualTokens),[t]),n=o.useMemo(()=>Math.max(...a.map(s=>s.visualTokens),1),[a]);return a.length===0?null:e.jsxs("div",{className:"rounded-lg border bg-card p-4 mb-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-secondary-foreground mb-3",children:"Model Breakdown"}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground mb-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm bg-indigo-500/80"})," Input"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm bg-emerald-500/80"})," Output"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm bg-amber-400/80"})," Cache read"]})]}),e.jsx("div",{className:"flex flex-col gap-2",children:a.map(s=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{background:s.color}}),e.jsx("span",{className:"text-xs font-mono text-secondary-foreground w-32 shrink-0 truncate",title:s.model,children:s.model}),e.jsx("div",{className:"flex-1 h-4 bg-muted/40 rounded-sm overflow-hidden",children:e.jsxs("div",{className:"h-full flex min-w-[2px] transition-all",style:{width:`${s.visualTokens/n*100}%`},children:[s.inputTokens>0&&e.jsx("div",{className:"h-full bg-indigo-500/80",style:{width:`${s.inputPercent}%`}}),s.outputTokens>0&&e.jsx("div",{className:"h-full bg-emerald-500/80",style:{width:`${s.outputPercent}%`}}),s.cacheTokens>0&&e.jsx("div",{className:"h-full bg-amber-400/80",style:{width:`${s.cachePercent}%`}})]})}),e.jsxs("span",{className:"text-xs text-muted-foreground w-20 text-right shrink-0",children:[l(s.totalTokens),s.cacheTokens>0&&e.jsxs("span",{className:"text-[10px] text-amber-500 ml-1",children:["+",l(s.cacheTokens)]})]})]},s.model))})]})}function T(){const{stats:t,loading:a}=b(30);return e.jsx("div",{className:"flex-1 overflow-y-auto p-4 md:p-6",children:e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsxs("header",{className:"mb-5",children:[e.jsx("h1",{className:"text-lg font-semibold",children:"Usage"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token consumption and cost estimates over the last 30 days."})]}),a&&e.jsx("div",{className:"text-sm text-muted-foreground py-8",children:"Loading usage stats…"}),!a&&!t&&e.jsx("div",{className:"text-sm text-muted-foreground py-8",children:"Failed to load usage data."}),!a&&t&&t.total_sessions===0&&e.jsx("div",{className:"text-sm text-muted-foreground py-8",children:"No usage data yet."}),!a&&t&&t.total_sessions>0&&e.jsxs(e.Fragment,{children:[e.jsx(N,{stats:t}),e.jsx(v,{stats:t}),e.jsx(k,{stats:t})]})]})})}export{T as component};
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermium",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "description": "Hermium CLI — self-hosted AI chat dashboard for Hermes Agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- import{c as e}from"./index-CQh8SXb2.js";const t=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],o=e("outline","alert-circle","AlertCircle",t);export{o as I};
@@ -1 +0,0 @@
1
- import{c as e}from"./index-CQh8SXb2.js";const t=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],o=e("outline","alert-triangle","AlertTriangle",t);export{o as I};
@@ -1 +0,0 @@
1
- import{c}from"./index-CQh8SXb2.js";const e=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],t=c("outline","check","Check",e);export{t as I};
@@ -1 +0,0 @@
1
- import{c as o}from"./index-CQh8SXb2.js";const e=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],s=o("outline","arrow-up","ArrowUp",e);const t=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]],c=o("outline","code","Code",t);export{c as I,s as a};
@@ -1 +0,0 @@
1
- import{c as o}from"./index-CQh8SXb2.js";const e=[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]],t=o("outline","loader-2","Loader2",e);export{t as I};
@@ -1 +0,0 @@
1
- import{c as e}from"./index-CQh8SXb2.js";const o=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],s=e("outline","refresh","Refresh",o);export{s as I};
@@ -1 +0,0 @@
1
- import{c as i,o as j,L as N,j as e,M as b,k as y,O as k,P as w,r as m,Q as M,S}from"./index-CQh8SXb2.js";const _=[["path",{d:"M17 7l-10 10",key:"svg-0"}],["path",{d:"M8 7l9 0l0 9",key:"svg-1"}]],u=i("outline","arrow-up-right","ArrowUpRight",_);const C=[["path",{d:"M15 10l-4 4l6 6l4 -16l-18 7l4 2l2 6l3 -4",key:"svg-0"}]],z=i("outline","brand-telegram","BrandTelegram",C);const A=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]],I=i("outline","package","Package",A);const T=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M3.6 9h16.8",key:"svg-1"}],["path",{d:"M3.6 15h16.8",key:"svg-2"}],["path",{d:"M11.5 3a17 17 0 0 0 0 18",key:"svg-3"}],["path",{d:"M12.5 3a17 17 0 0 1 0 18",key:"svg-4"}]],L=i("outline","world","World",T);function P(){return j({queryKey:["models"],queryFn:N,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1})}const p={appearance:{icon:k,title:"Appearance",description:"Choose your preferred theme",get content(){return e.jsx(W,{})}},model:{icon:y,title:"Model",description:"Choose your default AI model",get content(){return e.jsx(H,{})}},about:{icon:b,title:"About",description:"Links and community",get content(){return e.jsx(B,{})}}};function B(){const{data:s}=w();return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3.5 rounded-xl border border-border bg-background px-4 py-3 shadow-sm",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-violet-50 dark:bg-violet-950/40",children:e.jsx(I,{className:"size-5 text-violet-600 dark:text-violet-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:"Hermium"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[s?.current?`Version ${s.current}`:"Loading version...",s?.outdated&&s.latest&&e.jsxs("span",{className:"ml-1.5 text-amber-600 dark:text-amber-400",children:["(v",s.latest," available)"]})]})]})]}),e.jsxs("a",{href:"https://github.com/abboskhonov/hermium",target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-3.5 rounded-xl border border-border bg-background px-4 py-3 text-sm text-foreground shadow-sm hover:border-foreground/20 hover:shadow-md transition-all",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-neutral-100 dark:bg-neutral-800",children:e.jsx(b,{className:"size-5 text-neutral-700 dark:text-neutral-300"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:"GitHub"}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:"abboskhonov/hermium"})]}),e.jsx(u,{className:"size-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]}),e.jsxs("a",{href:"https://hermium.vercel.app",target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-3.5 rounded-xl border border-border bg-background px-4 py-3 text-sm text-foreground shadow-sm hover:border-foreground/20 hover:shadow-md transition-all",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-emerald-50 dark:bg-emerald-950/40",children:e.jsx(L,{className:"size-5 text-emerald-600 dark:text-emerald-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:"Website"}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:"hermium.vercel.app"})]}),e.jsx(u,{className:"size-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]}),e.jsxs("a",{href:"https://t.me/hermium_chat",target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-3.5 rounded-xl border border-border bg-background px-4 py-3 text-sm text-foreground shadow-sm hover:border-foreground/20 hover:shadow-md transition-all",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-sky-50 dark:bg-sky-950/40",children:e.jsx(z,{className:"size-5 text-sky-500 dark:text-sky-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:"Telegram"}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:"@hermium_chat"})]}),e.jsx(u,{className:"size-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]})]})}function H(){const{data:s,isLoading:a}=P(),[r,n]=m.useState(""),[c,h]=m.useState(!1),f=s?.models??[],l=s?.default_model,o=r||l||"",v=m.useCallback(async()=>{if(o){h(!0);try{await M({model:o})}catch{}finally{h(!1)}}},[o]);return e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Active Model"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Pick the model your Hermes agent currently uses."}),a?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading…"}):f.length===0?e.jsxs("div",{className:"text-sm text-muted-foreground",children:["No models found. Check your ",e.jsx("code",{children:"~/.hermes/config.yaml"}),"."]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{value:o,onChange:d=>n(d.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring min-w-[240px]",children:f.map(d=>e.jsx("option",{value:d.id,children:d.name},d.id))}),e.jsx("button",{onClick:v,disabled:c||!o||o===l,className:t("rounded-lg px-4 py-2 text-sm font-medium transition-colors",c||!o||o===l?"bg-muted text-muted-foreground cursor-not-allowed":"bg-primary text-primary-foreground hover:bg-primary/90"),children:c?"Saving…":"Save"})]}),l&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current: ",e.jsx("span",{className:"font-medium text-foreground",children:l})]})]})}function R({variant:s}){const a=s==="light";return e.jsx("div",{className:"relative w-full aspect-[16/10] overflow-hidden rounded-lg",children:s==="system"?e.jsxs("div",{className:"flex h-full w-full",children:[e.jsxs("div",{className:"flex h-full w-1/2 bg-neutral-100",children:[e.jsx(x,{light:!0}),e.jsx(g,{light:!0})]}),e.jsxs("div",{className:"flex h-full w-1/2 bg-neutral-900",children:[e.jsx(x,{light:!1}),e.jsx(g,{light:!1})]})]}):e.jsxs("div",{className:t("flex h-full w-full",a?"bg-neutral-100":"bg-neutral-900"),children:[e.jsx(x,{light:a}),e.jsx(g,{light:a})]})})}function x({light:s}){const a=s?"bg-white":"bg-neutral-800",r=s?"bg-neutral-200":"bg-neutral-700",n=s?"bg-neutral-300":"bg-neutral-600";return e.jsxs("div",{className:t("flex w-[28%] flex-col gap-1.5 p-1.5",a),children:[e.jsx("div",{className:t("h-1.5 w-4 rounded-sm",n)}),e.jsx("div",{className:t("mt-1 h-0.5 w-full rounded-sm",r)}),e.jsx("div",{className:t("h-0.5 w-3/4 rounded-sm",r)}),e.jsx("div",{className:t("h-0.5 w-5/6 rounded-sm",r)}),e.jsx("div",{className:t("mt-auto h-0.5 w-2/3 rounded-sm",r)})]})}function g({light:s}){const a=s?"bg-neutral-50":"bg-neutral-950",r=s?"bg-neutral-200":"bg-neutral-700",n=s?"bg-neutral-100":"bg-neutral-800";return e.jsxs("div",{className:t("flex flex-1 flex-col gap-1.5 p-1.5",a),children:[e.jsx("div",{className:t("h-2 w-full rounded-sm",n)}),e.jsx("div",{className:t("ml-auto h-2 w-2/3 rounded-sm",r)}),e.jsx("div",{className:t("h-2 w-5/6 rounded-sm",n)}),e.jsx("div",{className:t("ml-auto h-2 w-1/2 rounded-sm",r)}),e.jsx("div",{className:t("mt-auto h-1.5 w-full rounded-sm",s?"bg-white":"bg-neutral-800")})]})}function W(){const{theme:s,setTheme:a}=S();return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose how Hermium looks for you."}),e.jsx("div",{className:"grid grid-cols-3 gap-3 pt-1",children:[{id:"light",label:"Light"},{id:"dark",label:"Dark"},{id:"system",label:"System"}].map(r=>{const n=r.id===s;return e.jsxs("button",{onClick:()=>a(r.id),className:t("flex flex-col items-center gap-2 rounded-xl border p-2 text-xs font-medium transition-all",n?"border-[#2563eb] bg-primary/5 text-foreground ring-1 ring-[#2563eb]":"border-border text-muted-foreground hover:border-foreground/20 hover:text-foreground"),children:[e.jsx(R,{variant:r.id}),r.label]},r.id)})})]})}function t(...s){return s.filter(Boolean).join(" ")}function U({section:s}){const a=s&&s in p?s:"appearance",r=p[a];return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:r.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:r.description})]}),e.jsx("div",{className:"rounded-xl border border-border bg-card p-6",children:r.content})]})})}export{H as M,U as S};
@@ -1 +0,0 @@
1
- import{R as o,j as e}from"./index-CQh8SXb2.js";import{S as s}from"./index-BL9a2Xg9.js";function i(){const{section:t}=o.useSearch();return e.jsx(s,{section:t})}export{i as component};
@@ -1 +0,0 @@
1
- import{u as c,l as r,r as o,a as u,j as i}from"./index-CQh8SXb2.js";function f(){const s=c(),a=r(e=>e.sessionsLoaded),t=r(e=>e.sessions),n=o.useRef(!1);return o.useEffect(()=>{if(a)if(t.length>0)s({to:"/chat/$sessionId",params:{sessionId:t[0].id},replace:!0});else{if(n.current)return;n.current=!0,u().then(e=>{s({to:"/chat/$sessionId",params:{sessionId:e.id},replace:!0})}).catch(()=>{n.current=!1})}},[a,t,s]),i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading conversations…"})})}export{f as component};