hermium 0.1.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.
- package/bin/hermium.mjs +290 -0
- package/dist/server/index.mjs +239 -0
- package/dist/web/assets/IconAlertCircle-B7TgWpbP.js +1 -0
- package/dist/web/assets/IconAlertTriangle-B7IYa46Q.js +1 -0
- package/dist/web/assets/IconCheck-B-_pWgtP.js +1 -0
- package/dist/web/assets/IconCode-AzDguzgN.js +1 -0
- package/dist/web/assets/IconLoader2-ClSf33Yd.js +1 -0
- package/dist/web/assets/IconPlus-BcEAWT5L.js +1 -0
- package/dist/web/assets/IconRefresh-D4MZeezY.js +1 -0
- package/dist/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/web/assets/index-B-EALIKE.js +1 -0
- package/dist/web/assets/index-BP5217kc.js +1 -0
- package/dist/web/assets/index-BiFHsDt6.js +1 -0
- package/dist/web/assets/index-BuznEPrX.js +1 -0
- package/dist/web/assets/index-CsJLc3b2.js +2 -0
- package/dist/web/assets/index-D04H-m2p.js +29 -0
- package/dist/web/assets/index-DEVyhUPW.js +14 -0
- package/dist/web/assets/index-DKYPj90W.js +90 -0
- package/dist/web/assets/index-D_8SzN4W.js +1 -0
- package/dist/web/assets/index-DmUrSr_K.js +1 -0
- package/dist/web/assets/index-xH6PhxmS.js +1 -0
- package/dist/web/assets/input-of658hyw.js +1 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/styles-C9Ypt703.css +1 -0
- package/dist/web/assets/switch-CgWk9YD3.js +1 -0
- package/dist/web/assets/syntax-highlighter-CR5pD3DZ.js +6 -0
- package/dist/web/assets/textarea-xdRt6_lX.js +1 -0
- package/dist/web/assets/useQuery-BtGwEPDz.js +1 -0
- package/dist/web/favicon.ico +0 -0
- package/dist/web/favicon.png +0 -0
- package/dist/web/manifest.json +25 -0
- package/dist/web/nous-logo.png +0 -0
- package/dist/web/robots.txt +3 -0
- package/package.json +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-DKYPj90W.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-DKYPj90W.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./index-DKYPj90W.js";const e=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],t=c("outline","check","Check",e);export{t as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./index-DKYPj90W.js";const c=[["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",c);const e=[["path",{d:"M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878",key:"svg-0"}]],d=o("outline","cloud","Cloud",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"}]],a=o("outline","code","Code",t);export{a as I,d as a,s as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./index-DKYPj90W.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./index-DKYPj90W.js";const t=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],s=o("outline","chevron-right","ChevronRight",t);const c=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],a=o("outline","clock","Clock",c);const n=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],l=o("outline","plus","Plus",n);export{l as I,a,s as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-DKYPj90W.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};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as c,x as r,r as o,a as u,j as i}from"./index-DKYPj90W.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I,r as l,j as e,b as u,z as q,p as F,A as J,C as L,B as y,I as A,D as K,g as D}from"./index-DKYPj90W.js";import{u as P}from"./useQuery-BtGwEPDz.js";import{u as C,I as _}from"./input-of658hyw.js";import{T as Q}from"./textarea-xdRt6_lX.js";import{I as B,a as E,b as W}from"./IconPlus-BcEAWT5L.js";import{I as H}from"./IconRefresh-D4MZeezY.js";import{I as U}from"./IconLoader2-ClSf33Yd.js";const O=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],G=I("outline","calendar","Calendar",O);const V=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],X=I("outline","player-play","PlayerPlay",V);const Y=[["path",{d:"M7 6a7.75 7.75 0 1 0 10 0",key:"svg-0"}],["path",{d:"M12 4l0 8",key:"svg-1"}]],Z=I("outline","power","Power",Y),T=l.createContext(null);function ee(){const t=l.useContext(T);if(!t)throw new Error("Dialog components must be used within <Dialog>");return t}function te({open:t,onOpenChange:s,children:o}){const a=l.useCallback(r=>s(r),[s]);return l.useEffect(()=>{if(!t)return;const r=d=>{d.key==="Escape"&&a(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,a]),t?e.jsxs(T.Provider,{value:{open:t,setOpen:a},children:[e.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm",onClick:()=>a(!1)}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsx("div",{className:"relative w-full max-w-lg rounded-xl border border-border bg-card shadow-xl",onClick:r=>r.stopPropagation(),children:o})})]}):null}function se({children:t,className:s}){return ee(),e.jsx("div",{className:u("p-5",s),children:t})}function re({children:t,className:s}){return e.jsx("div",{className:u("mb-4",s),children:t})}function ne({children:t,className:s}){return e.jsx("h2",{className:u("text-base font-semibold",s),children:t})}function oe({children:t,className:s}){return e.jsx("div",{className:u("flex items-center justify-end gap-2 mt-4",s),children:t})}function v(t){return t.job_id||t.id||""}function ae(t){return t.name||v(t)||"Untitled"}function R(t){const s=t.trim().split(/\s+/);if(s.length<2)return t;const o=parseInt(s[0],10),a=parseInt(s[1],10);if(isNaN(o)||isNaN(a))return t;if(s[1]==="*")return`At minute ${o} past every hour`;const r=new Date(0,0,0,a,o).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});if(s.length>=5){const d=s.slice(2,5).join(" ");if(d==="* * 1-5")return`${r} weekdays`;if(d==="* * 0,6")return`${r} weekends`}return`${r} daily`}function z(t){if(!t)return"—";if(typeof t=="string")return R(t);const s=t.display||t.expr||JSON.stringify(t);return R(s)}function ie(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/1024/1024).toFixed(1)}MB`}function le(t){const s=new Date(t),o=Date.now()-s.getTime(),a=Math.floor(o/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const r=Math.floor(a/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function de(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ce(){return P({queryKey:["cron","jobs"],queryFn:()=>D("/api/cron-history/jobs"),refetchInterval:3e4})}function ue(t){return P({queryKey:["cron","runs",t],queryFn:()=>D("/api/cron-history"),refetchInterval:15e3})}function me(t,s,o){if(o==="hourly")return`${s} * * * *`;const a=`${s} ${t}`;return o==="weekdays"?`${a} * * 1-5`:o==="weekends"?`${a} * * 0,6`:`${a} * * *`}function xe(t,s,o){return o==="hourly"?`At minute ${s} past every hour`:`Runs ${new Date(0,0,0,t,s).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})} ${o==="weekdays"?"on weekdays":o==="weekends"?"on weekends":"daily"}`}const he=[{label:"Every hour",dayMode:"hourly",hour:0,minute:0},{label:"Daily 9AM",dayMode:"daily",hour:9,minute:0},{label:"Daily noon",dayMode:"daily",hour:12,minute:0},{label:"Daily 6PM",dayMode:"daily",hour:18,minute:0},{label:"Weekdays 9AM",dayMode:"weekdays",hour:9,minute:0},{label:"Weekdays noon",dayMode:"weekdays",hour:12,minute:0}];function fe({value:t,onChange:s}){const[o,a]=l.useState("daily"),[r,d]=l.useState(9),[c,h]=l.useState(0),[f,p]=l.useState(!1),[g,b]=l.useState(t||""),x=l.useMemo(()=>{if(!t)return null;const i=t.trim().split(/\s+/);if(i.length<2)return null;const m=parseInt(i[0],10),j=parseInt(i[1],10);return isNaN(m)||isNaN(j)?null:{hour:j,minute:m}},[]),w=l.useRef(!1);l.useEffect(()=>{if(w.current||!x)return;w.current=!0,d(x.hour),h(x.minute);const i=t.trim().split(/\s+/);if(i.length>=5){const m=i.slice(2,5).join(" ");m==="* * 1-5"?a("weekdays"):m==="* * 0,6"?a("weekends"):(m==="* * *"||i[2]==="*")&&a("daily"),i[1]==="*"&&a("hourly")}b(t)},[x,t]);const N=l.useMemo(()=>me(r,c,o),[r,c,o]),S=l.useMemo(()=>xe(r,c,o),[r,c,o]),M=i=>{const[m,j]=i.target.value.split(":").map(Number);isNaN(m)||d(m),isNaN(j)||h(j),o==="hourly"&&a("daily")},$=i=>{d(i.hour),h(i.minute),a(i.dayMode)},n=i=>{b(i.target.value)},k=f?g:N;return l.useEffect(()=>{s(k)},[k]),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Schedule"}),f?e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{value:g,onChange:n,placeholder:"0 9 * * *",className:"h-9 text-sm font-mono"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground flex items-center gap-1.5",children:["minute hour day month weekday",e.jsx("button",{type:"button",onClick:()=>p(!1),className:"underline underline-offset-2 hover:text-foreground ml-auto transition-colors",children:"Use time picker"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"time",value:`${String(r).padStart(2,"0")}:${String(c).padStart(2,"0")}`,onChange:M,className:"flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm shadow-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"}),e.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden text-xs font-medium",children:[{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekends",label:"Weekends"}].map((i,m)=>e.jsx("button",{type:"button",onClick:()=>a(i.value),className:u("flex-1 px-3 py-1.5 transition-colors text-center",m>0&&"border-l border-border",o===i.value?"bg-primary text-primary-foreground font-semibold":"bg-background text-muted-foreground hover:bg-muted"),children:i.label},i.value))}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.map(i=>e.jsx("button",{type:"button",onClick:()=>$(i),className:u("px-2.5 py-1 rounded-md text-[11px] font-medium transition-colors",r===i.hour&&c===i.minute&&o===i.dayMode?"bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 shadow-xs":"bg-muted/50 text-muted-foreground border border-border/50 hover:bg-muted hover:text-foreground"),children:i.label},i.label))}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx(E,{className:"h-3.5 w-3.5"}),S]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("code",{className:"text-[11px] text-muted-foreground/60 font-mono",children:N}),e.jsx("button",{type:"button",onClick:()=>{b(N),p(!0)},className:"text-[10px] text-muted-foreground/40 hover:text-muted-foreground underline underline-offset-2 transition-colors",children:"Raw cron"})]})]})]})}function pe({status:t}){if(!t)return e.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground/30"});const s=t==="ok"||t==="success"||t==="completed";return e.jsx("div",{className:u("h-2 w-2 rounded-full",s?"bg-emerald-500":"bg-red-500")})}function ge({job:t,onEdit:s,onDelete:o,onToggle:a}){return e.jsxs("div",{className:u("rounded-xl border bg-card p-5 transition-colors group relative",t.enabled!==!1?"border-border hover:border-emerald-500/30":"border-border opacity-60"),children:[e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(y,{variant:"ghost",size:"icon-sm",className:"h-7 w-7",onClick:r=>{r.stopPropagation(),a()},title:t.enabled!==!1?"Disable":"Enable",children:e.jsx(Z,{className:u("h-3.5 w-3.5",t.enabled!==!1?"text-emerald-500":"text-muted-foreground")})}),e.jsx(y,{variant:"ghost",size:"icon-sm",className:"h-7 w-7",onClick:r=>{r.stopPropagation(),s()},title:"Edit",children:e.jsx(A,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.jsx(y,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 hover:text-red-500",onClick:r=>{r.stopPropagation(),o()},title:"Delete",children:e.jsx(K,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:u("h-8 w-8 rounded-lg flex items-center justify-center shrink-0",t.enabled!==!1?"bg-emerald-500/10 text-emerald-600":"bg-muted text-muted-foreground"),children:e.jsx(E,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold truncate pr-20",children:ae(t)}),e.jsx("p",{className:"text-[11px] text-muted-foreground font-mono",children:z(t.schedule)})]})]}),e.jsx(pe,{status:t.last_status})]}),t.prompt&&e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed line-clamp-2 mb-3",children:t.prompt}),e.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-muted-foreground",children:[t.run_count!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{className:"h-3 w-3"}),t.run_count," runs"]}),t.next_run_at&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(G,{className:"h-3 w-3"}),"Next: ",de(t.next_run_at)]}),t.last_run_at&&e.jsx("span",{children:le(t.last_run_at)})]})]})}function be({run:t}){const[s,o]=l.useState(!1),a=P({queryKey:["cron","run",t.jobId,t.fileName],queryFn:()=>D(`/api/cron-history/${encodeURIComponent(t.jobId)}/${encodeURIComponent(t.fileName)}`),enabled:s});return e.jsxs("div",{className:"border-b border-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>o(!s),className:"flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/30 transition-colors group",children:[e.jsx(W,{className:u("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",s&&"rotate-90")}),e.jsx("span",{className:"text-xs font-medium text-foreground/80 min-w-[80px]",children:t.jobId}),e.jsx("span",{className:"text-xs text-muted-foreground flex-1",children:t.runTime}),e.jsx("span",{className:"text-[10px] text-muted-foreground/60 font-mono shrink-0",children:ie(t.size)})]}),s&&e.jsx("div",{className:"px-4 pb-4 pl-10",children:a.isLoading?e.jsxs("div",{className:"flex items-center gap-2 py-3 text-muted-foreground text-xs",children:[e.jsx(U,{className:"h-3.5 w-3.5 animate-spin"}),"Loading..."]}):e.jsx("pre",{className:"text-[12px] font-mono leading-relaxed whitespace-pre-wrap text-foreground/80 bg-muted/30 rounded-lg p-3 border border-border/50 max-h-[400px] overflow-auto",children:a.data?.content||"No output"})})]})}function ye(){const t=q(),s=ce(),o=ue(null),[a,r]=l.useState(!1),[d,c]=l.useState(null),[h,f]=l.useState(""),[p,g]=l.useState(""),[b,x]=l.useState(""),w=l.useCallback(()=>{s.refetch(),o.refetch()},[s,o]),N=C({mutationFn:n=>F("/api/cron-history/jobs",n),onSuccess:()=>{t.invalidateQueries({queryKey:["cron","jobs"]}),r(!1)}}),S=C({mutationFn:({id:n,data:k})=>J(`/api/cron-history/jobs/${n}`,k),onSuccess:()=>{t.invalidateQueries({queryKey:["cron","jobs"]}),c(null),r(!1)}}),M=C({mutationFn:n=>L(`/api/cron-history/jobs/${n}`),onSuccess:()=>t.invalidateQueries({queryKey:["cron","jobs"]})}),$=C({mutationFn:n=>F(`/api/cron-history/jobs/${n}/toggle`,{}),onSuccess:()=>t.invalidateQueries({queryKey:["cron","jobs"]})});return e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"shrink-0 border-b px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",children:"Automations"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Scheduled cron jobs managed by the Hermes agent"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(y,{size:"sm",variant:"outline",className:"gap-1.5",onClick:()=>{c(null),f(""),g(""),x(""),r(!0)},children:[e.jsx(B,{className:"h-4 w-4"}),"New Job"]}),e.jsx("button",{onClick:w,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(H,{className:u("h-4 w-4",(s.isFetching||o.isFetching)&&"animate-spin")})})]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx(te,{open:a,onOpenChange:n=>{n||(r(!1),c(null))},children:e.jsxs(se,{children:[e.jsx(re,{children:e.jsx(ne,{children:d?"Edit Cron Job":"New Cron Job"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Name"}),e.jsx(_,{value:h,onChange:n=>f(n.target.value),placeholder:"e.g. Daily weather report",className:"h-9 text-sm"})]}),e.jsx(fe,{value:p,onChange:g}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Prompt"}),e.jsx(Q,{value:b,onChange:n=>x(n.target.value),placeholder:"What should the agent do when this job runs?",className:"min-h-[80px] text-sm",rows:4})]})]}),e.jsxs(oe,{children:[e.jsx(y,{size:"sm",variant:"ghost",onClick:()=>{r(!1),c(null)},children:"Cancel"}),e.jsx(y,{size:"sm",disabled:!h.trim()||!p.trim(),onClick:()=>{const n={name:h.trim(),schedule:p.trim(),prompt:b.trim()};d?S.mutate({id:v(d),data:n}):N.mutate(n)},children:d?"Save Changes":"Create Job"})]})]})}),e.jsxs("div",{className:"px-6 pt-5 pb-2",children:[e.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Jobs"}),s.isLoading?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(n=>e.jsx("div",{className:"rounded-xl border border-border bg-card h-36 animate-pulse",children:e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/2"}),e.jsx("div",{className:"h-3 bg-muted rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-muted rounded w-full"})]})},n))}):s.data?.jobs?.length?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:s.data.jobs.map(n=>e.jsx(ge,{job:n,onEdit:()=>{c(n),f(n.name||""),g(z(n.schedule)),x(n.prompt||""),r(!0)},onDelete:()=>M.mutate(v(n)),onToggle:()=>$.mutate(v(n))},v(n)))}):e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-muted/20 py-12 text-center",children:[e.jsx(E,{className:"h-8 w-8 text-muted-foreground/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"No cron jobs yet"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Click ",e.jsx("span",{className:"font-medium",children:"New Job"})," to create one"]})]})]}),e.jsxs("div",{className:"px-6 pb-6",children:[e.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3 mt-6",children:"Run History"}),o.isLoading?e.jsx("div",{className:"space-y-1",children:[1,2,3,4,5].map(n=>e.jsx("div",{className:"h-10 bg-muted/30 rounded animate-pulse"},n))}):o.data?.runs?.length?e.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:o.data.runs.slice(0,50).map(n=>e.jsx(be,{run:n},`${n.jobId}/${n.fileName}`))}):e.jsx("div",{className:"rounded-xl border border-dashed border-border bg-muted/20 py-10 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No runs yet"})})]})]})]})}const Me=ye;export{Me as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as F,p as D,r as o,w as z,o as R,j as e,b as i,h as U,I as k}from"./index-DKYPj90W.js";import{I as w}from"./IconLoader2-ClSf33Yd.js";import{I as S}from"./IconAlertCircle-B7TgWpbP.js";import{I as Y}from"./IconRefresh-D4MZeezY.js";import{I as B}from"./IconCheck-B-_pWgtP.js";import{M as G,r as O}from"./index-D04H-m2p.js";async function C(){return F("/api/hermes/memory")}async function T(r,s){return D("/api/hermes/memory/write",{section:r,content:s})}const E=[{key:"memory",label:"My Notes",icon:z,desc:"Personal notes & knowledge",emptyLabel:"No notes yet — click Edit to start writing."},{key:"user",label:"User Profile",icon:R,desc:"About you & your context",emptyLabel:"No profile yet — click Edit to add details about yourself."}],W={a({href:r,children:s}){return e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 underline underline-offset-2 decoration-blue-400/30 hover:decoration-blue-600/60 transition-colors",children:s})},img({src:r,alt:s}){return e.jsx("img",{src:r,alt:s,className:"rounded-xl max-w-full my-4",loading:"lazy"})}};function X(){const[r,s]=o.useState(null),[I,f]=o.useState(!0),[p,h]=o.useState(null),[n,M]=o.useState("memory"),[c,m]=o.useState(!1),[g,b]=o.useState(""),[a,_]=o.useState(!1),[y,l]=o.useState(null),x=o.useCallback(async()=>{f(!0),h(null);try{const t=await C();s(t)}catch(t){h(t instanceof Error?t.message:"Failed to load memory")}finally{f(!1)}},[]);o.useEffect(()=>{x()},[x]);const u=r?n==="memory"?r.memory:r.user:"",j=r?n==="memory"?r.memory_mtime:r.user_mtime:null,d=E.find(t=>t.key===n),N=()=>{b(u),l(null),m(!0)},L=()=>{m(!1),l(null)},q=async()=>{_(!0),l(null);try{await T(n,g);const t=await C();s(t),m(!1)}catch(t){l(t instanceof Error?t.message:"Failed to save")}finally{_(!1)}},P=t=>{if(c){if(!confirm("You have unsaved changes. Discard them?"))return;m(!1)}M(t),l(null)};return I?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(w,{className:"size-6 animate-spin"}),e.jsx("span",{className:"text-sm",children:"Loading memory..."})]})}):p?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(S,{className:"size-8 text-red-500"}),e.jsx("span",{className:"text-sm",children:p}),e.jsxs("button",{onClick:x,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium bg-muted hover:bg-muted/80 transition-colors",children:[e.jsx(Y,{className:"size-3.5"}),"Retry"]})]})}):e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-3.5",children:[e.jsx(z,{className:"size-5 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Memory"})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto space-y-1 px-2 py-1",children:E.map(t=>{const A=t.icon,v=n===t.key;return e.jsxs("button",{onClick:()=>P(t.key),className:i("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2.5 text-left transition-colors",v?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[e.jsx(A,{className:i("size-4 shrink-0",v?"text-foreground":"text-muted-foreground/60")}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:t.label}),e.jsx("div",{className:"truncate text-[10px] text-muted-foreground/70",children:t.desc})]})]},t.key)})})]}),e.jsx("div",{className:"flex flex-1 flex-col min-w-0 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 py-8",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:d.label}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:d.desc}),j&&!c&&e.jsxs("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Last modified ",new Date(j*1e3).toLocaleString()]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:c?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:L,disabled:a,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[e.jsx(U,{className:"size-4"}),"Cancel"]}),e.jsxs("button",{onClick:q,disabled:a,className:i("inline-flex items-center gap-1.5 rounded-lg px-4 py-1.5 text-sm font-medium transition-colors","bg-primary text-primary-foreground hover:bg-primary/90",a&&"opacity-60 cursor-not-allowed"),children:[a?e.jsx(w,{className:"size-4 animate-spin"}):e.jsx(B,{className:"size-4"}),a?"Saving...":"Save"]})]}):e.jsxs("button",{onClick:N,className:"inline-flex items-center gap-1.5 rounded-lg px-4 py-1.5 text-sm font-medium bg-muted text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",children:[e.jsx(k,{className:"size-4"}),"Edit"]})})]})}),y&&e.jsx("div",{className:"mb-6 rounded-lg border border-red-200 dark:border-red-800/40 bg-red-50 dark:bg-red-950/20 px-4 py-2.5",children:e.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 flex items-center gap-1.5",children:[e.jsx(S,{className:"size-3.5 shrink-0"}),y]})}),e.jsx("div",{className:"rounded-xl border border-border bg-card p-8",children:c?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("textarea",{value:g,onChange:t=>b(t.target.value),className:i("w-full min-h-[420px] rounded-lg border border-border bg-background p-4 font-mono text-sm leading-relaxed","focus:outline-none focus:ring-2 focus:ring-primary/15 focus:border-primary/40","resize-y placeholder:text-muted-foreground/30"),placeholder:`Write your ${d.label.toLowerCase()} using Markdown...`,spellCheck:!1,autoFocus:!0}),e.jsx("p",{className:"text-[11px] text-muted-foreground/50",children:"Markdown formatting is supported — headers, lists, code blocks, links, and more."})]}):u?e.jsx("div",{className:i("max-w-none","[&_h1]:mt-8 [&_h1]:mb-4 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:tracking-tight [&_h1]:text-foreground","[&_h2]:mt-7 [&_h2]:mb-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:tracking-tight [&_h2]:text-foreground","[&_h3]:mt-6 [&_h3]:mb-2.5 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:text-foreground","[&_h4]:mt-5 [&_h4]:mb-2 [&_h4]:text-base [&_h4]:font-medium [&_h4]:text-foreground","[&_h5]:mt-4 [&_h5]:mb-1.5 [&_h5]:text-sm [&_h5]:font-medium [&_h5]:text-foreground/90","[&_h6]:mt-4 [&_h6]:mb-1.5 [&_h6]:text-sm [&_h6]:font-medium [&_h6]:text-muted-foreground","[&_p]:my-4 [&_p]:leading-[1.75] [&_p]:text-foreground/85","[&_ul]:my-4 [&_ul]:pl-6 [&_ul]:list-disc [&_ul]:space-y-1.5 [&_ul]:marker:text-muted-foreground/40","[&_ol]:my-4 [&_ol]:pl-6 [&_ol]:list-decimal [&_ol]:space-y-1.5 [&_ol]:marker:text-muted-foreground/40","[&_li]:leading-relaxed [&_li]:text-foreground/85","[&_:not(pre)>code]:rounded-md [&_:not(pre)>code]:bg-muted/70 [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:text-[13px] [&_:not(pre)>code]:font-mono [&_:not(pre)>code]:text-foreground/90 [&_:not(pre)>code]:border [&_:not(pre)>code]:border-border/50","[&_pre]:my-5 [&_pre]:rounded-xl [&_pre]:bg-muted/50 [&_pre]:border [&_pre]:border-border/60 [&_pre]:px-5 [&_pre]:py-4 [&_pre]:text-[13px] [&_pre]:leading-relaxed [&_pre]:overflow-x-auto [&_pre]:font-mono [&_pre]:whitespace-pre-wrap","[&_blockquote]:my-5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-amber-400 dark:[&_blockquote]:border-amber-500 [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground [&_blockquote]:italic [&_blockquote]:leading-relaxed","[&_hr]:my-8 [&_hr]:border-border/40","[&_table]:w-full [&_table]:my-4 [&_table]:text-sm","[&_th]:border [&_th]:border-border [&_th]:bg-muted/60 [&_th]:px-4 [&_th]:py-2.5 [&_th]:text-left [&_th]:font-medium [&_th]:text-foreground/80 [&_th]:text-xs [&_th]:uppercase [&_th]:tracking-wider","[&_td]:border [&_td]:border-border [&_td]:px-4 [&_td]:py-2.5 [&_td]:text-foreground/80","[&_img]:rounded-xl [&_img]:my-5 [&_img]:max-w-full","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"),children:e.jsx(G,{remarkPlugins:[O],components:W,children:u})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[e.jsx("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-muted/50 border border-border/50",children:e.jsx(d.icon,{className:"size-6 text-muted-foreground/30"})}),e.jsxs("div",{className:"text-center max-w-xs",children:[e.jsx("p",{className:"text-sm font-medium text-foreground/70",children:d.emptyLabel}),e.jsx("p",{className:"text-xs text-muted-foreground/50 mt-1.5",children:"You can format your content with Markdown — headers, lists, code blocks, and more."})]}),e.jsxs("button",{onClick:N,className:"inline-flex items-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium bg-muted hover:bg-muted/80 text-foreground/80 transition-colors",children:[e.jsx(k,{className:"size-3.5"}),"Start Editing"]})]})})]})})]})}const Z=X;export{Z as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i,j as e,k as d,l as c,m as l,n as m,o as x,q as u,s as p,t as g,v as h,R as f}from"./index-DKYPj90W.js";const b=[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]],j=i("outline","device-desktop","DeviceDesktop",b),n={profile:{icon:x,title:"Profile",description:"Your name, email, and avatar",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Display Name"}),e.jsx("input",{type:"text",defaultValue:"User",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none focus:border-primary/50 transition-colors"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx("input",{type:"email",defaultValue:"user@hermium.dev",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none focus:border-primary/50 transition-colors"})]})]})},appearance:{icon:m,title:"Appearance",description:"Theme, font size, and density",get content(){return e.jsx(y,{})}},notifications:{icon:l,title:"Notifications",description:"Push and in-app notifications",content:e.jsx("div",{className:"space-y-3",children:["Desktop notifications","Sound on new message","Show preview in notification"].map(s=>e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",defaultChecked:!0,className:"rounded border-border accent-primary"}),e.jsx("span",{className:"text-sm text-foreground",children:s})]},s))})},"api-keys":{icon:c,title:"API Keys",description:"Manage providers and keys",content:e.jsxs("div",{className:"space-y-3",children:[[{provider:"OpenAI",key:"sk-••••••••••••••••",status:"active"},{provider:"Anthropic",key:"sk-ant-•••••••••••",status:"active"},{provider:"Groq",key:"gsk-••••••••••••••••",status:"active"}].map(s=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(u,{className:"size-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.provider}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:s.key})]})]}),e.jsx("span",{className:"text-[10px] font-medium text-green-600 dark:text-green-400 uppercase tracking-wider",children:s.status})]},s.provider)),e.jsx("button",{className:"w-full rounded-lg border border-dashed border-border px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors",children:"+ Add API Key"})]})},language:{icon:d,title:"Language & Region",description:"Language, timezone, and format preferences",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Language"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary/50 transition-colors",children:[e.jsx("option",{children:"English"}),e.jsx("option",{children:"Spanish"}),e.jsx("option",{children:"French"}),e.jsx("option",{children:"German"}),e.jsx("option",{children:"Japanese"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Timezone"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary/50 transition-colors",children:[e.jsx("option",{children:"UTC (Coordinated Universal Time)"}),e.jsx("option",{children:"America/New_York"}),e.jsx("option",{children:"America/Los_Angeles"}),e.jsx("option",{children:"Europe/London"}),e.jsx("option",{children:"Asia/Tokyo"})]})]})]})}};function y(){const{resolvedTheme:s,setTheme:t}=p();return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{id:"light",icon:g,label:"Light"},{id:"dark",icon:h,label:"Dark"},{id:"system",icon:j,label:"System"}].map(r=>{const o=r.id===(s==="dark"?"dark":r.id==="system"?"system":"light"),a=r.icon;return e.jsxs("button",{onClick:()=>t(r.id),className:v("flex flex-col items-center gap-1.5 rounded-lg border px-3 py-2.5 text-xs transition-colors",o?"border-primary/50 bg-primary/5 text-foreground":"border-border text-muted-foreground hover:border-foreground/20 hover:text-foreground"),children:[e.jsx(a,{className:"size-5"}),r.label]},r.id)})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"A"}),e.jsx("input",{type:"range",min:"12",max:"20",defaultValue:"14",className:"flex-1 accent-primary"}),e.jsx("span",{className:"text-lg text-muted-foreground",children:"A"})]})]})]})}function v(...s){return s.filter(Boolean).join(" ")}function N({section:s}){const t=s&&s in n?s:"profile",r=n[t];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})]})})}function A(){const{section:s}=f.useSearch();return e.jsx(N,{section:s})}export{A as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as j,g as z,p as Q,r as o,j as e,e as b,f as V,h as B,i as D,b as x}from"./index-DKYPj90W.js";import{S as G}from"./switch-CgWk9YD3.js";import{I as C}from"./IconLoader2-ClSf33Yd.js";import{I as H}from"./IconAlertCircle-B7TgWpbP.js";import{I as K}from"./IconRefresh-D4MZeezY.js";import{M as O,r as W}from"./index-D04H-m2p.js";const X=[["path",{d:"M9 15l6 -6",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-2"}]],J=j("outline","link","Link",X);const U=[["path",{d:"M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3",key:"svg-1"}]],Y=j("outline","tag","Tag",U);const Z=[["path",{d:"M10 7a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2l0 -10",key:"svg-0"}],["path",{d:"M7 7l0 10",key:"svg-1"}],["path",{d:"M4 8l0 8",key:"svg-2"}]],ee=j("outline","versions","Versions",Z);async function te(){return z("/api/hermes/skills")}async function se(l,a){return z(`/api/hermes/skills/${l}/${a}/SKILL.md`)}async function re(l,a){return Q(`/api/hermes/skills/${l}/${a}/toggle`)}const le={a({href:l,children:a}){return e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 underline underline-offset-2 decoration-blue-400/30 hover:decoration-blue-600/60 transition-colors",children:a})},img({src:l,alt:a}){return e.jsx("img",{src:l,alt:a,className:"rounded-xl max-w-full my-4",loading:"lazy"})},pre({children:l}){return e.jsx("pre",{className:"my-5 rounded-xl bg-muted/50 border border-border/60 px-5 py-4 text-[13px] leading-relaxed overflow-x-auto font-mono whitespace-pre-wrap",children:l})},code({children:l,className:a}){return a?e.jsx("code",{className:a,children:l}):e.jsx("code",{className:"rounded-md bg-muted/70 px-1.5 py-0.5 text-[13px] font-mono text-foreground/90 border border-border/50",children:l})}};function ne(){const[l,a]=o.useState([]),[p,I]=o.useState(0),[L,k]=o.useState(!0),[N,_]=o.useState(null),[u,y]=o.useState(""),[d,M]=o.useState(null),[i,q]=o.useState(null),[v,E]=o.useState(null),[$,c]=o.useState(""),[R,g]=o.useState(!1),[w,P]=o.useState(new Set),f=o.useCallback(async()=>{k(!0),_(null);try{const t=await te();a(t.categories),I(t.total)}catch(t){_(t instanceof Error?t.message:"Failed to load skills")}finally{k(!1)}},[]);o.useEffect(()=>{f()},[f]),o.useEffect(()=>{if(!d||!i){c("");return}let t=!1;return g(!0),se(d,i).then(s=>{if(!t){const r=s.content;if(r.startsWith("---")){const n=r.indexOf(`
|
|
2
|
+
---`,3);c(n!==-1?r.slice(n+4).trim():r)}else c(r);g(!1)}}).catch(s=>{t||(c(s instanceof Error?s.message:"Failed to load skill"),g(!1))}),()=>{t=!0}},[d,i]);const m=u.toLowerCase().trim(),S=m?l.map(t=>({...t,skills:(t.skills??[]).filter(s=>s.name.toLowerCase().includes(m)||s.description.toLowerCase().includes(m)||(s.tags??[]).some(r=>r.toLowerCase().includes(m)))})).filter(t=>t.skills.length>0||t.name.toLowerCase().includes(m)):l,T=t=>{P(s=>{const r=new Set(s);return r.has(t)?r.delete(t):r.add(t),r})},F=(t,s,r)=>{M(t),q(s),E(r)},A=async(t,s)=>{a(r=>r.map(n=>n.name===t?{...n,skills:n.skills.map(h=>h.name===s?{...h,disabled:!h.disabled}:h)}:n));try{await re(t,s)}catch{f()}};return L?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(C,{className:"size-6 animate-spin"}),e.jsx("span",{className:"text-sm",children:"Loading skills..."})]})}):N?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(H,{className:"size-8 text-red-500"}),e.jsx("span",{className:"text-sm",children:N}),e.jsxs("button",{onClick:f,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium bg-muted hover:bg-muted/80 transition-colors",children:[e.jsx(K,{className:"size-3.5"}),"Retry"]})]})}):e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-3.5 shrink-0",children:[e.jsx(b,{className:"size-5 text-muted-foreground"}),e.jsxs("span",{className:"text-sm font-semibold text-foreground",children:["Skills",p>0&&e.jsxs("span",{className:"ml-1.5 text-[11px] font-normal text-muted-foreground",children:["(",p,")"]})]})]}),e.jsx("div",{className:"px-3 pb-2 shrink-0",children:e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground/50"}),e.jsx("input",{value:u,onChange:t=>y(t.target.value),placeholder:"Search skills...",className:"w-full rounded-md border border-border/60 bg-muted/30 pl-8 pr-8 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/40 outline-none focus:ring-1 focus:ring-primary/20 focus:border-primary/30"}),u&&e.jsx("button",{onClick:()=>y(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground/40 hover:text-muted-foreground",children:e.jsx(B,{className:"size-3"})})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:S.length===0?e.jsx("div",{className:"px-4 py-8 text-center",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:u?"No skills match your search":"No skills found"})}):S.map(t=>e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>T(t.name),className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left hover:bg-muted/40 transition-colors",children:[e.jsx(D,{className:x("size-3 shrink-0 text-muted-foreground/50 transition-transform",w.has(t.name)&&"-rotate-90")}),e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground truncate",children:t.name.replace(/-/g," ")}),e.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-auto shrink-0",children:t.skills.length})]}),!w.has(t.name)&&e.jsx("div",{className:"pb-1",children:(t.skills??[]).map(s=>{const r=d===t.name&&i===s.name;return e.jsxs("button",{onClick:()=>F(t.name,s.name,s.name),className:x("flex w-full items-start gap-2 px-3 py-1.5 pl-8 text-left transition-colors",r?"bg-muted text-foreground":s.disabled?"text-muted-foreground/40 hover:bg-muted/20":"text-muted-foreground hover:bg-muted/30 hover:text-foreground"),children:[e.jsxs("div",{className:x("min-w-0 flex-1",s.disabled&&"opacity-50"),children:[e.jsx("div",{className:x("truncate text-xs font-medium",s.disabled&&"line-through"),children:s.name}),s.description&&e.jsx("div",{className:"truncate text-[10px] text-muted-foreground/60 mt-0.5",children:s.description})]}),e.jsx("div",{className:"shrink-0",onClick:n=>n.stopPropagation(),children:e.jsx(G,{checked:!s.disabled,onCheckedChange:()=>A(t.name,s.name)})})]},s.name)})})]},t.name))})]}),e.jsx("div",{className:"flex flex-1 flex-col min-w-0 overflow-y-auto",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shrink-0 border-b border-border px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-muted/50 border border-border/50",children:e.jsx(b,{className:"size-4 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-base font-semibold text-foreground truncate",children:v}),e.jsxs("p",{className:"text-xs text-muted-foreground/60 mt-0.5 flex items-center gap-1",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/40",children:d?.replace(/-/g," ")}),e.jsx("span",{className:"text-muted-foreground/30",children:"/"}),e.jsx("span",{children:v})]})]})]}),(()=>{const s=l.find(r=>r.name===d)?.skills.find(r=>r.name===i);return s?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-3",children:[s.version&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground/60 bg-muted/40 rounded-full px-2 py-0.5",children:[e.jsx(ee,{className:"size-3"}),"v",s.version]}),(s.tags??[]).map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground/60 bg-muted/40 rounded-full px-2 py-0.5",children:[e.jsx(Y,{className:"size-3"}),r]},r))]}):null})()]}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 py-6",children:R?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(C,{className:"size-5 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsx("div",{className:x("prose-sm max-w-none","[&_h1]:mt-8 [&_h1]:mb-4 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:tracking-tight [&_h1]:text-foreground","[&_h2]:mt-7 [&_h2]:mb-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:tracking-tight [&_h2]:text-foreground","[&_h3]:mt-6 [&_h3]:mb-2.5 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:text-foreground","[&_h4]:mt-5 [&_h4]:mb-2 [&_h4]:text-base [&_h4]:font-medium [&_h4]:text-foreground","[&_p]:my-4 [&_p]:leading-[1.75] [&_p]:text-foreground/85","[&_ul]:my-4 [&_ul]:pl-6 [&_ul]:list-disc [&_ul]:space-y-1.5 [&_ul]:marker:text-muted-foreground/40","[&_ol]:my-4 [&_ol]:pl-6 [&_ol]:list-decimal [&_ol]:space-y-1.5 [&_ol]:marker:text-muted-foreground/40","[&_li]:leading-relaxed [&_li]:text-foreground/85","[&_blockquote]:my-5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-amber-400 dark:[&_blockquote]:border-amber-500 [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground [&_blockquote]:italic [&_blockquote]:leading-relaxed","[&_hr]:my-8 [&_hr]:border-border/40","[&_table]:w-full [&_table]:my-4 [&_table]:text-sm","[&_th]:border [&_th]:border-border [&_th]:bg-muted/60 [&_th]:px-4 [&_th]:py-2.5 [&_th]:text-left [&_th]:font-medium [&_th]:text-foreground/80 [&_th]:text-xs [&_th]:uppercase [&_th]:tracking-wider","[&_td]:border [&_td]:border-border [&_td]:px-4 [&_td]:py-2.5 [&_td]:text-foreground/80","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"),children:e.jsx(O,{remarkPlugins:[W],components:le,children:$})}),(()=>{const r=l.find(n=>n.name===d)?.skills.find(n=>n.name===i)?.related_skills??[];return r.length?e.jsxs("div",{className:"mt-8 pt-6 border-t border-border",children:[e.jsxs("h4",{className:"flex items-center gap-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:[e.jsx(J,{className:"size-3"}),"Related Skills"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(n=>e.jsx("span",{className:"rounded-md bg-muted/40 px-2.5 py-1 text-xs text-muted-foreground border border-border/40",children:n},n))})]}):null})()]})})]}):e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-muted-foreground max-w-sm text-center",children:[e.jsx("div",{className:"flex size-16 items-center justify-center rounded-2xl bg-muted/50 border border-border/50",children:e.jsx(b,{className:"size-7 text-muted-foreground/25"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground/60",children:"Select a skill to view details"}),e.jsx("p",{className:"text-xs text-muted-foreground/50 mt-1",children:"Browse skills from your Hermes agent library. Each skill provides instructions and context for specific tasks."})]})]})})})]})}const xe=ne;export{xe as component};
|