@cosmicstack/mercury-agent 1.1.13 → 1.2.2
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/README.md +9 -6
- package/dist/index.js +27909 -22358
- package/dist/index.js.map +1 -1
- package/dist/web/ui/assets/Chat-CajL8sV3.js +27 -0
- package/dist/web/ui/assets/{Dashboard-1rlAqQ-Y.js → Dashboard-ClnaDoDG.js} +1 -2
- package/dist/web/ui/assets/{Goals-CgSUAXLH.js → Goals-Rm3s3OGd.js} +1 -2
- package/dist/web/ui/assets/{Graph-DnlOWkay.js → Graph-hYGmN5vp.js} +1 -2
- package/dist/web/ui/assets/{Kanban-DRlNiNRF.js → Kanban-BK_Oi6am.js} +1 -2
- package/dist/web/ui/assets/{Login-BP5524pC.js → Login-Bl8tq7KA.js} +1 -2
- package/dist/web/ui/assets/MarkdownRenderer-DKGKZih7.js +21 -0
- package/dist/web/ui/assets/{Memory-BOQEY0H8.js → Memory-kKRHTUyC.js} +1 -2
- package/dist/web/ui/assets/{Permissions-jbFH-toa.js → Permissions-CDRBOdMO.js} +1 -2
- package/dist/web/ui/assets/{PersonDetail-Ca8B9io8.js → PersonDetail-DLbZBUS0.js} +1 -2
- package/dist/web/ui/assets/{Persons-epdmUeBM.js → Persons-C-GjzdmT.js} +1 -2
- package/dist/web/ui/assets/{Providers-Bm8sZNZo.js → Providers-L32issLd.js} +1 -2
- package/dist/web/ui/assets/{Schedules-BZKhm9R7.js → Schedules-BvGLrPPD.js} +1 -2
- package/dist/web/ui/assets/{Settings-Hii-5oku.js → Settings-BP9_1JW3.js} +1 -2
- package/dist/web/ui/assets/{Skills-BHJp2CgD.js → Skills-CvXlgjZK.js} +1 -2
- package/dist/web/ui/assets/{Tasks-D36pqkro.js → Tasks-XcAVd2Ff.js} +1 -2
- package/dist/web/ui/assets/{Usage-CmjaYrsT.js → Usage--2hxK31f.js} +1 -2
- package/dist/web/ui/assets/{Workspace-BYLf-wTJ.js → Workspace-BPChIyBc.js} +11 -12
- package/dist/web/ui/assets/{activity-MOTqH8zM.js → activity-CDTOZzUZ.js} +1 -2
- package/dist/web/ui/assets/{alert-dialog-MbYSbZx5.js → alert-dialog-B3JUwsIN.js} +1 -2
- package/dist/web/ui/assets/{arrow-left-CtqQsBC6.js → arrow-left-CkDXNwR2.js} +1 -2
- package/dist/web/ui/assets/{avatar-BIYaY7pR.js → avatar-NU204zr9.js} +1 -2
- package/dist/web/ui/assets/{badge-CUJiWF1y.js → badge-DpVeNL8j.js} +1 -2
- package/dist/web/ui/assets/{button-CNasMlFE.js → button-V3Fu7_kO.js} +1 -2
- package/dist/web/ui/assets/{card-BdsEOP7t.js → card-CjAvp22k.js} +1 -2
- package/dist/web/ui/assets/{chevron-down-CB9J_vvZ.js → chevron-down-C66c9kfo.js} +1 -2
- package/dist/web/ui/assets/{circle-check-DvGSe1uZ.js → circle-check-Cch4Kwja.js} +1 -2
- package/dist/web/ui/assets/{circle-x-CyaGJ_BM.js → circle-x-DK0DQPGB.js} +1 -2
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js +0 -1
- package/dist/web/ui/assets/{dialog-Bd1rELXb.js → dialog-FHqlAspv.js} +1 -2
- package/dist/web/ui/assets/{download-C8RvlFqO.js → download-D73EX-Ki.js} +1 -2
- package/dist/web/ui/assets/{eye-BJ0NucMz.js → eye-CxEb5_L8.js} +1 -2
- package/dist/web/ui/assets/{file-text-BWWBuD_N.js → file-text-CDTjVG9h.js} +1 -2
- package/dist/web/ui/assets/{folder-open-BwjemFy7.js → folder-open-CF5wm-xS.js} +1 -2
- package/dist/web/ui/assets/{git-branch-D9JVASpC.js → git-branch-CYWJZoQx.js} +1 -2
- package/dist/web/ui/assets/{index-C3YiF4qv.js → index-B1xAjISP.js} +4 -5
- package/dist/web/ui/assets/{index-CaqLZNof.js → index-CufYpqmV.js} +1 -2
- package/dist/web/ui/assets/{input-CH3dmo9r.js → input-CF6e2HL4.js} +1 -2
- package/dist/web/ui/assets/{loader-circle-DbYKk0_Q.js → loader-circle-CJko6bz6.js} +1 -2
- package/dist/web/ui/assets/{pencil-gNDEMhav.js → pencil-DGvW-dl_.js} +1 -2
- package/dist/web/ui/assets/{plus-7rbHkByr.js → plus-DhHrgqcD.js} +1 -2
- package/dist/web/ui/assets/{power-BS7gCDWs.js → power-BFKfrVvI.js} +1 -2
- package/dist/web/ui/assets/{progress-ZzhsBV2v.js → progress-CsRtYJ3t.js} +1 -2
- package/dist/web/ui/assets/{search-BZsbhO0B.js → search-BwE8vRR_.js} +1 -2
- package/dist/web/ui/assets/{select-vRSgBrHz.js → select-Xy3UJnp-.js} +1 -2
- package/dist/web/ui/assets/{send-BkyTIUtJ.js → send-DHy23R-c.js} +1 -2
- package/dist/web/ui/assets/{sparkles-DcP24GEL.js → sparkles-wNQvP7So.js} +1 -2
- package/dist/web/ui/assets/{switch-LRN9wWy2.js → switch-CGgMESDf.js} +1 -2
- package/dist/web/ui/assets/{terminal-CWG62zdD.js → terminal-BvZc6N0C.js} +1 -2
- package/dist/web/ui/assets/{textarea-CXh3tmJ1.js → textarea-BTxEQ_C2.js} +1 -2
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js +0 -1
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js +0 -1
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js +0 -1
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js +0 -1
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js +0 -1
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js +0 -1
- package/dist/web/ui/assets/{zap-BEfqVtvZ.js → zap-CK8xUBKc.js} +1 -2
- package/dist/web/ui/index.html +1 -1
- package/dist/web/ui/workbox-0bb07689.js +1 -0
- package/package.json +3 -1
- package/dist/web/ui/assets/Chat-DXSn2dY8.js +0 -28
- package/dist/web/ui/assets/Chat-DXSn2dY8.js.map +0 -1
- package/dist/web/ui/assets/Dashboard-1rlAqQ-Y.js.map +0 -1
- package/dist/web/ui/assets/Goals-CgSUAXLH.js.map +0 -1
- package/dist/web/ui/assets/Graph-DnlOWkay.js.map +0 -1
- package/dist/web/ui/assets/Kanban-DRlNiNRF.js.map +0 -1
- package/dist/web/ui/assets/Login-BP5524pC.js.map +0 -1
- package/dist/web/ui/assets/MarkdownRenderer-B9KGVD0X.js +0 -22
- package/dist/web/ui/assets/MarkdownRenderer-B9KGVD0X.js.map +0 -1
- package/dist/web/ui/assets/Memory-BOQEY0H8.js.map +0 -1
- package/dist/web/ui/assets/Permissions-jbFH-toa.js.map +0 -1
- package/dist/web/ui/assets/PersonDetail-Ca8B9io8.js.map +0 -1
- package/dist/web/ui/assets/Persons-epdmUeBM.js.map +0 -1
- package/dist/web/ui/assets/Providers-Bm8sZNZo.js.map +0 -1
- package/dist/web/ui/assets/Schedules-BZKhm9R7.js.map +0 -1
- package/dist/web/ui/assets/Settings-Hii-5oku.js.map +0 -1
- package/dist/web/ui/assets/Skills-BHJp2CgD.js.map +0 -1
- package/dist/web/ui/assets/Tasks-D36pqkro.js.map +0 -1
- package/dist/web/ui/assets/Usage-CmjaYrsT.js.map +0 -1
- package/dist/web/ui/assets/Workspace-BYLf-wTJ.js.map +0 -1
- package/dist/web/ui/assets/activity-MOTqH8zM.js.map +0 -1
- package/dist/web/ui/assets/alert-dialog-MbYSbZx5.js.map +0 -1
- package/dist/web/ui/assets/arrow-left-CtqQsBC6.js.map +0 -1
- package/dist/web/ui/assets/avatar-BIYaY7pR.js.map +0 -1
- package/dist/web/ui/assets/badge-CUJiWF1y.js.map +0 -1
- package/dist/web/ui/assets/button-CNasMlFE.js.map +0 -1
- package/dist/web/ui/assets/card-BdsEOP7t.js.map +0 -1
- package/dist/web/ui/assets/chevron-down-CB9J_vvZ.js.map +0 -1
- package/dist/web/ui/assets/circle-check-DvGSe1uZ.js.map +0 -1
- package/dist/web/ui/assets/circle-x-CyaGJ_BM.js.map +0 -1
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js.map +0 -1
- package/dist/web/ui/assets/dialog-Bd1rELXb.js.map +0 -1
- package/dist/web/ui/assets/download-C8RvlFqO.js.map +0 -1
- package/dist/web/ui/assets/eye-BJ0NucMz.js.map +0 -1
- package/dist/web/ui/assets/file-text-BWWBuD_N.js.map +0 -1
- package/dist/web/ui/assets/folder-open-BwjemFy7.js.map +0 -1
- package/dist/web/ui/assets/git-branch-D9JVASpC.js.map +0 -1
- package/dist/web/ui/assets/index-C3YiF4qv.js.map +0 -1
- package/dist/web/ui/assets/index-CaqLZNof.js.map +0 -1
- package/dist/web/ui/assets/input-CH3dmo9r.js.map +0 -1
- package/dist/web/ui/assets/loader-circle-DbYKk0_Q.js.map +0 -1
- package/dist/web/ui/assets/pencil-gNDEMhav.js.map +0 -1
- package/dist/web/ui/assets/plus-7rbHkByr.js.map +0 -1
- package/dist/web/ui/assets/power-BS7gCDWs.js.map +0 -1
- package/dist/web/ui/assets/progress-ZzhsBV2v.js.map +0 -1
- package/dist/web/ui/assets/search-BZsbhO0B.js.map +0 -1
- package/dist/web/ui/assets/select-vRSgBrHz.js.map +0 -1
- package/dist/web/ui/assets/send-BkyTIUtJ.js.map +0 -1
- package/dist/web/ui/assets/sparkles-DcP24GEL.js.map +0 -1
- package/dist/web/ui/assets/switch-LRN9wWy2.js.map +0 -1
- package/dist/web/ui/assets/terminal-CWG62zdD.js.map +0 -1
- package/dist/web/ui/assets/textarea-CXh3tmJ1.js.map +0 -1
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js.map +0 -1
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js.map +0 -1
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js.map +0 -1
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js.map +0 -1
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js.map +0 -1
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js.map +0 -1
- package/dist/web/ui/assets/zap-BEfqVtvZ.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,m as g,A as L}from"./vendor-motion-Dwx3-JO5.js";import{r}from"./vendor-react-C7pctHW3.js";import{C as $,c as O,a as H,b as U}from"./card-
|
|
1
|
+
import{j as e,m as g,A as L}from"./vendor-motion-Dwx3-JO5.js";import{r}from"./vendor-react-C7pctHW3.js";import{C as $,c as O,a as H,b as U}from"./card-CjAvp22k.js";import{B as b}from"./badge-DpVeNL8j.js";import{B as y}from"./button-V3Fu7_kO.js";import{I as u}from"./input-CF6e2HL4.js";import{D as q,a as W,b as G,c as J,d as K,e as Q}from"./dialog-FHqlAspv.js";import{T as V,A as X,a as Y,b as Z,c as ee,d as se,e as te,f as ae,g as ie}from"./alert-dialog-B3JUwsIN.js";import{e as w,a as C,c as _,C as re,t as le,h as P}from"./index-B1xAjISP.js";import{S as ne}from"./sparkles-wNQvP7So.js";import{P as ce}from"./pencil-DGvW-dl_.js";import"./index-CufYpqmV.js";import"./vendor-radix-3UdfCgs_.js";import"./vendor-syntax-xZUI6Op9.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -14,4 +14,3 @@ import{j as e,m as g,A as L}from"./vendor-motion-Dwx3-JO5.js";import{r}from"./ve
|
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/const ue=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],xe=w("triangle-alert",ue),he={hidden:{opacity:0,y:12},visible:a=>({opacity:1,y:0,transition:{delay:a*.07,duration:.35,ease:"easeOut"}})};function D({className:a}){return e.jsx("div",{className:_("animate-pulse rounded-lg bg-muted",a)})}function fe(a){const c=a.trim().split(/\s+/);if(c.length<5)return a;const[n,l,x,,d]=c;return a==="* * * * *"?"Every minute":n==="0"&&l==="*"?"Every hour":n==="*/5"&&l==="*"?"Every 5 minutes":n==="*/10"&&l==="*"?"Every 10 minutes":n==="*/15"&&l==="*"?"Every 15 minutes":n==="*/30"&&l==="*"?"Every 30 minutes":x==="*"&&d==="*"&&l!=="*"&&n!=="*"?`Daily at ${l.padStart(2,"0")}:${n.padStart(2,"0")}`:d==="1-5"&&l!=="*"?`Weekdays at ${l.padStart(2,"0")}:${n.padStart(2,"0")}`:a}function ge(a){return a<60?`${a}s delay`:a<3600?`${Math.round(a/60)}m delay`:`${(a/3600).toFixed(1)}h delay`}function $e(){const[a,c]=r.useState([]),[n,l]=r.useState(!0),[x,d]=r.useState(""),[m,p]=r.useState(null),[F,h]=r.useState(!1),[j,M]=r.useState(null),[i,o]=r.useState({description:"",cron:"",delaySeconds:"",prompt:"",skillName:""}),[E,A]=r.useState(!1),[f,v]=r.useState(null),[N,T]=r.useState(!1),I=r.useCallback(()=>{l(!0),C.schedules.list().then(s=>{c(s.schedules),d("")}).catch(s=>d(s.message)).finally(()=>l(!1))},[]);r.useEffect(()=>{I()},[I]),r.useEffect(()=>{if(!m)return;const s=setTimeout(()=>p(null),3e3);return()=>clearTimeout(s)},[m]);function z(s){var t;M(s.id),o({description:s.description,cron:s.cron??"",delaySeconds:((t=s.delaySeconds)==null?void 0:t.toString())??"",prompt:s.prompt??"",skillName:s.skillName??""}),h(!0)}async function R(){if(j){A(!0);try{const s={description:i.description};i.cron.trim()&&(s.cron=i.cron.trim()),i.delaySeconds.trim()&&(s.delaySeconds=Number(i.delaySeconds)),i.prompt.trim()&&(s.prompt=i.prompt.trim()),i.skillName.trim()&&(s.skillName=i.skillName.trim());const t=await C.schedules.update(j,s);t.success&&(c(S=>S.map(k=>k.id===j?{...k,...t.schedule}:k)),p({type:"success",message:"Schedule updated"}),h(!1))}catch(s){p({type:"error",message:s instanceof Error?s.message:"Update failed"})}finally{A(!1)}}}async function B(){if(f){T(!0);try{(await C.schedules.delete(f)).success&&(c(t=>t.filter(S=>S.id!==f)),p({type:"success",message:"Schedule deleted"}))}catch(s){p({type:"error",message:s instanceof Error?s.message:"Delete failed"})}finally{T(!1),v(null)}}}return x&&!a.length?e.jsx("div",{className:"flex h-full items-center justify-center p-8",children:e.jsx("p",{className:"text-sm text-destructive",children:x})}):n?e.jsxs("div",{className:"space-y-6 p-6 lg:p-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(D,{className:"h-8 w-40"}),e.jsx(D,{className:"h-4 w-56"})]}),e.jsx("div",{className:"flex flex-col gap-4",children:Array.from({length:3}).map((s,t)=>e.jsx(D,{className:"h-[140px]"},t))})]}):e.jsxs("div",{className:"space-y-6 p-6 lg:p-8",children:[e.jsxs(g.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.3},children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Schedules"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automated recurring tasks"})]}),e.jsx(L,{children:m&&e.jsx(g.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:_("rounded-lg border px-4 py-2.5 text-sm font-medium",m.type==="success"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-500":"border-destructive/30 bg-destructive/10 text-destructive"),children:m.message})}),a.length===0?e.jsx(g.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},transition:{duration:.3},children:e.jsx($,{children:e.jsxs(O,{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(re,{className:"mb-4 h-10 w-10 text-muted-foreground/50"}),e.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"No scheduled tasks"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70",children:"Schedules will appear here once configured via the API or CLI."})]})})}):e.jsx("div",{className:"flex flex-col gap-4",children:a.map((s,t)=>e.jsx(g.div,{custom:t,variants:he,initial:"hidden",animate:"visible",children:e.jsxs($,{children:[e.jsxs(H,{className:"flex flex-row items-start justify-between gap-4 pb-3",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx(U,{className:"text-base",children:s.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.cron&&e.jsxs(b,{variant:"secondary",className:"gap-1",children:[e.jsx(de,{className:"h-3 w-3"}),fe(s.cron)]}),s.delaySeconds!=null&&e.jsxs(b,{variant:"secondary",className:"gap-1",children:[e.jsx(pe,{className:"h-3 w-3"}),ge(s.delaySeconds)]}),s.skillName&&e.jsxs(b,{variant:"default",className:"gap-1",children:[e.jsx(ne,{className:"h-3 w-3"}),s.skillName]})]})]}),e.jsxs("div",{className:"flex shrink-0 gap-1",children:[e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>z(s),children:e.jsx(ce,{className:"h-4 w-4"})}),e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>v(s.id),children:e.jsx(V,{className:"h-4 w-4 text-destructive"})})]})]}),e.jsx(O,{children:e.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[s.prompt&&e.jsxs("p",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:"Prompt: "}),le(s.prompt,100)]}),e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted-foreground",children:[s.lastRun&&e.jsxs("span",{children:["Last run:"," ",e.jsx("span",{className:"font-medium tabular-nums text-foreground",children:P(s.lastRun)})]}),s.nextRun&&e.jsxs("span",{children:["Next run:"," ",e.jsx("span",{className:"font-medium tabular-nums text-foreground",children:P(s.nextRun)})]})]})]})})]})},s.id))}),e.jsx(q,{open:F,onOpenChange:h,children:e.jsxs(W,{children:[e.jsxs(G,{children:[e.jsx(J,{children:"Edit Schedule"}),e.jsx(K,{children:"Update the schedule configuration."})]}),e.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Description"}),e.jsx(u,{value:i.description,onChange:s=>o(t=>({...t,description:s.target.value})),placeholder:"Schedule description"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Cron Expression"}),e.jsx(u,{value:i.cron,onChange:s=>o(t=>({...t,cron:s.target.value})),placeholder:"*/30 * * * *"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Delay (seconds)"}),e.jsx(u,{type:"number",value:i.delaySeconds,onChange:s=>o(t=>({...t,delaySeconds:s.target.value})),placeholder:"3600"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Prompt"}),e.jsx(u,{value:i.prompt,onChange:s=>o(t=>({...t,prompt:s.target.value})),placeholder:"Optional prompt text"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Skill Name"}),e.jsx(u,{value:i.skillName,onChange:s=>o(t=>({...t,skillName:s.target.value})),placeholder:"Optional skill name"})]})]}),e.jsxs(Q,{children:[e.jsx(y,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e.jsx(y,{onClick:R,disabled:E||!i.description.trim(),children:E?"Saving...":"Save"})]})]})}),e.jsx(X,{open:!!f,onOpenChange:s=>!s&&v(null),children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsxs(ee,{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-5 w-5 text-destructive"}),"Delete Schedule"]}),e.jsx(se,{children:"This action cannot be undone. The scheduled task will be permanently removed."})]}),e.jsxs(te,{children:[e.jsx(ae,{disabled:N,children:"Cancel"}),e.jsx(ie,{onClick:B,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:N?"Deleting...":"Delete"})]})]})})]})}export{$e as SchedulesPage};
|
|
17
|
-
//# sourceMappingURL=Schedules-BZKhm9R7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,m as g,A as ie}from"./vendor-motion-Dwx3-JO5.js";import{r as a}from"./vendor-react-C7pctHW3.js";import{e as $,u as le,a as x,i as oe,n as y,o as V,j as me,p as ue,c as G}from"./index-
|
|
1
|
+
import{j as e,m as g,A as ie}from"./vendor-motion-Dwx3-JO5.js";import{r as a}from"./vendor-react-C7pctHW3.js";import{e as $,u as le,a as x,i as oe,n as y,o as V,j as me,p as ue,c as G}from"./index-B1xAjISP.js";import{C as d,c,a as p}from"./card-CjAvp22k.js";import{I as r}from"./input-CF6e2HL4.js";import{B as h}from"./button-V3Fu7_kO.js";import{C as J}from"./circle-x-DK0DQPGB.js";import{S as xe}from"./sparkles-wNQvP7So.js";import{L as w}from"./loader-circle-CJko6bz6.js";import{C as he}from"./circle-check-Cch4Kwja.js";import"./vendor-syntax-xZUI6Op9.js";import"./vendor-radix-3UdfCgs_.js";import"./index-CufYpqmV.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -9,4 +9,3 @@ import{j as e,m as g,A as ie}from"./vendor-motion-Dwx3-JO5.js";import{r as a}fro
|
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/const fe=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],X=$("user",fe);function k({feedback:t}){return e.jsx(ie,{children:t&&e.jsx(g.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:G("flex items-center gap-2 rounded-md px-3 py-2 text-sm",t.type==="success"?"bg-emerald-500/10 text-emerald-400":"bg-destructive/10 text-destructive"),children:[t.type==="success"?e.jsx(he,{className:"h-4 w-4 shrink-0"}):e.jsx(J,{className:"h-4 w-4 shrink-0"}),t.message]})})})}function C(){return e.jsxs(d,{className:"border-border/50 bg-card/60 backdrop-blur",children:[e.jsxs(p,{children:[e.jsx("div",{className:"h-5 w-32 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-3.5 w-56 animate-pulse rounded bg-muted mt-1"})]}),e.jsx(c,{className:"space-y-4",children:[1,2,3].map(t=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-3.5 w-20 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-9 w-full animate-pulse rounded-md bg-muted"})]},t))})]})}function S(){const[t,i]=a.useState(null),l=a.useCallback(o=>{i(o),setTimeout(()=>i(null),4e3)},[]);return[t,l]}const n={initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.35}};function Be(){const[t,i]=a.useState(!0),[l,o]=a.useState(null),[K,Q]=a.useState(""),[P,U]=a.useState(""),[E,F]=a.useState(0),[B,I]=a.useState(!1),[W,D]=S(),[f,L]=a.useState(""),[j,z]=a.useState(""),[A,M]=a.useState(!1),[Y,b]=S(),[N,T]=a.useState(""),[m,_]=a.useState(""),[q,H]=a.useState(""),[R,O]=a.useState(!1),[Z,u]=S(),{theme:ee,setTheme:se}=le(),v=a.useCallback(async()=>{try{const s=await x.config.get();Q(s.identity),U(s.defaultProvider),F(s.tokenBudget),o(null)}catch(s){o(s instanceof Error?s.message:"Failed to load settings")}finally{i(!1)}},[]);a.useEffect(()=>{v()},[v]);const ae=async()=>{I(!0);try{await x.config.update({identity:K,defaultProvider:P,tokenBudget:E}),D({type:"success",message:"Settings saved"})}catch(s){D({type:"error",message:s instanceof Error?s.message:"Save failed"})}finally{I(!1)}},te=async()=>{if(!f||!j){b({type:"error",message:"Both fields are required"});return}M(!0);try{await x.auth.changeUsername(f,j),b({type:"success",message:"Username updated"}),L(""),z("")}catch(s){b({type:"error",message:s instanceof Error?s.message:"Update failed"})}finally{M(!1)}},re=async()=>{if(!N||!m){u({type:"error",message:"All fields are required"});return}if(m!==q){u({type:"error",message:"Passwords do not match"});return}O(!0);try{await x.auth.changePassword(N,m),u({type:"success",message:"Password updated"}),T(""),_(""),H("")}catch(s){u({type:"error",message:s instanceof Error?s.message:"Update failed"})}finally{O(!1)}},ne=[{value:"light",label:"Light",icon:V},{value:"dark",label:"Dark",icon:me},{value:"system",label:"System",icon:ue}];return t?e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 animate-pulse rounded-xl bg-muted"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-6 w-24 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-4 w-48 animate-pulse rounded bg-muted mt-1"})]})]}),e.jsx(C,{}),e.jsx(C,{}),e.jsx(C,{})]}):e.jsxs("div",{className:"space-y-6 p-6 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-[#00d4ff]/20 to-[#a78bfa]/20 ring-1 ring-[#00d4ff]/30",children:e.jsx(oe,{className:"h-5 w-5 text-[#00d4ff]"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage agent identity, credentials, and preferences"})]})]}),l&&e.jsx(d,{className:"border-destructive/50 bg-destructive/5",children:e.jsxs(c,{className:"flex items-center gap-3 py-4",children:[e.jsx(J,{className:"h-5 w-5 text-destructive"}),e.jsx("p",{className:"text-sm text-destructive",children:l}),e.jsx(h,{variant:"outline",size:"sm",className:"ml-auto",onClick:v,children:"Retry"})]})}),e.jsx(g.div,{...n,transition:{...n.transition,delay:0},children:e.jsxs(d,{className:"border-border/50 bg-card/60 backdrop-blur",children:[e.jsxs(p,{className:"pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-4 w-4 text-[#a78bfa]"}),e.jsx("h2",{className:"text-lg font-medium text-foreground",children:"Defaults"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Default provider and daily token budget"})]}),e.jsxs(c,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Default Provider"}),e.jsx(r,{placeholder:"openai",value:P,onChange:s=>U(s.target.value),className:"bg-background/50"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Daily Token Budget"}),e.jsx(r,{type:"number",min:0,placeholder:"100000",value:E||"",onChange:s=>F(Number(s.target.value)),className:"bg-background/50"})]})]}),e.jsx(k,{feedback:W}),e.jsx("div",{className:"pt-1",children:e.jsxs(h,{size:"sm",onClick:ae,disabled:B,className:"bg-gradient-to-r from-[#00d4ff] to-[#a78bfa] text-white hover:opacity-90 transition-opacity",children:[B&&e.jsx(w,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Save"]})})]})]})}),e.jsx(y,{className:"bg-border/40"}),e.jsx(g.div,{...n,transition:{...n.transition,delay:.1},children:e.jsxs(d,{className:"border-border/50 bg-card/60 backdrop-blur",children:[e.jsxs(p,{className:"pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-4 w-4 text-[#00d4ff]"}),e.jsx("h2",{className:"text-lg font-medium text-foreground",children:"Account"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Update your login credentials"})]}),e.jsxs(c,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"Change Username"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Current Password"}),e.jsx(r,{type:"password",placeholder:"Enter current password",value:f,onChange:s=>L(s.target.value),className:"bg-background/50"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"New Username"}),e.jsx(r,{placeholder:"Enter new username",value:j,onChange:s=>z(s.target.value),className:"bg-background/50"})]})]}),e.jsx(k,{feedback:Y}),e.jsxs(h,{size:"sm",variant:"outline",onClick:te,disabled:A,children:[A&&e.jsx(w,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Update Username"]})]}),e.jsx(y,{className:"bg-border/30"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"Change Password"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Current Password"}),e.jsx(r,{type:"password",placeholder:"Current",value:N,onChange:s=>T(s.target.value),className:"bg-background/50"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"New Password"}),e.jsx(r,{type:"password",placeholder:"New",value:m,onChange:s=>_(s.target.value),className:"bg-background/50"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Confirm Password"}),e.jsx(r,{type:"password",placeholder:"Confirm",value:q,onChange:s=>H(s.target.value),className:"bg-background/50"})]})]}),e.jsx(k,{feedback:Z}),e.jsxs(h,{size:"sm",variant:"outline",onClick:re,disabled:R,children:[R&&e.jsx(w,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Update Password"]})]})]})]})}),e.jsx(y,{className:"bg-border/40"}),e.jsx(g.div,{...n,transition:{...n.transition,delay:.2},children:e.jsxs(d,{className:"border-border/50 bg-card/60 backdrop-blur",children:[e.jsxs(p,{className:"pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-[#00d4ff]"}),e.jsx("h2",{className:"text-lg font-medium text-foreground",children:"Appearance"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred theme"})]}),e.jsx(c,{children:e.jsx("div",{className:"flex gap-2",children:ne.map(({value:s,label:de,icon:ce})=>e.jsxs("button",{onClick:()=>se(s),className:G("flex items-center gap-2 rounded-lg border px-4 py-2.5 text-sm font-medium transition-all",ee===s?"border-[#00d4ff]/50 bg-[#00d4ff]/10 text-[#00d4ff] ring-1 ring-[#00d4ff]/20":"border-border/50 bg-background/50 text-muted-foreground hover:text-foreground hover:border-border"),children:[e.jsx(ce,{className:"h-4 w-4"}),de]},s))})})]})})]})}export{Be as SettingsPage};
|
|
12
|
-
//# sourceMappingURL=Settings-Hii-5oku.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,m as d,A as L}from"./vendor-motion-Dwx3-JO5.js";import{r as i}from"./vendor-react-C7pctHW3.js";import{C as f,c as g}from"./card-
|
|
1
|
+
import{j as e,m as d,A as L}from"./vendor-motion-Dwx3-JO5.js";import{r as i}from"./vendor-react-C7pctHW3.js";import{C as f,c as g}from"./card-CjAvp22k.js";import{B as u}from"./button-V3Fu7_kO.js";import{I as S}from"./input-CF6e2HL4.js";import{B as U}from"./badge-DpVeNL8j.js";import{A as z,h as q,T as V,a as O,b as H,c as X,d as G,e as J,f as K,g as Q}from"./alert-dialog-B3JUwsIN.js";import{e as w,a as c,c as M}from"./index-B1xAjISP.js";import{S as W}from"./sparkles-wNQvP7So.js";import{L as b}from"./loader-circle-CJko6bz6.js";import{D as Y}from"./download-D73EX-Ki.js";import{F as Z}from"./folder-open-CF5wm-xS.js";import{a as ee,P as se}from"./power-BFKfrVvI.js";import{C as te}from"./circle-check-Cch4Kwja.js";import{C as ae}from"./circle-x-DK0DQPGB.js";import"./vendor-radix-3UdfCgs_.js";import"./index-CufYpqmV.js";import"./vendor-syntax-xZUI6Op9.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -14,4 +14,3 @@ import{j as e,m as d,A as L}from"./vendor-motion-Dwx3-JO5.js";import{r as i}from
|
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/const ce=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],oe=w("store",ce),de={hidden:{opacity:0,y:12},visible:r=>({opacity:1,y:0,transition:{delay:r*.06,duration:.35,ease:"easeOut"}}),exit:{opacity:0,y:-8,transition:{duration:.2}}},me={visible:{transition:{staggerChildren:.06}}};function xe({toasts:r}){return e.jsx("div",{className:"fixed bottom-6 right-6 z-50 flex flex-col gap-2",children:e.jsx(L,{children:r.map(l=>e.jsxs(d.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:40},className:M("flex items-center gap-2 rounded-lg border px-4 py-3 text-sm shadow-lg backdrop-blur-sm",l.type==="success"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-destructive/30 bg-destructive/10 text-destructive"),children:[l.type==="success"?e.jsx(te,{className:"h-4 w-4"}):e.jsx(ae,{className:"h-4 w-4"}),l.message]},l.id))})})}function o({className:r}){return e.jsx("div",{className:M("animate-pulse rounded-lg bg-muted",r)})}function he(){return e.jsx(f,{children:e.jsxs(g,{className:"p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(o,{className:"h-5 w-32"}),e.jsx(o,{className:"h-5 w-16 rounded-md"})]}),e.jsx(o,{className:"h-4 w-full"}),e.jsx(o,{className:"h-3 w-48"}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx(o,{className:"h-8 w-24"}),e.jsx(o,{className:"h-8 w-20"})]})]})})}function Re(){const[r,l]=i.useState([]),[R,E]=i.useState(!0),[m,k]=i.useState(""),[p,A]=i.useState(!1),[j,C]=i.useState(""),[y,D]=i.useState(!1),[v,x]=i.useState({}),[T,I]=i.useState([]),a=i.useCallback((s,t)=>{const h=Date.now();I(N=>[...N,{id:h,type:s,message:t}]),setTimeout(()=>{I(N=>N.filter(P=>P.id!==h))},3500)},[]),n=i.useCallback(async()=>{try{const s=await c.skills.list();l(s.skills)}catch(s){a("error",s instanceof Error?s.message:"Failed to load skills")}finally{E(!1)}},[a]);i.useEffect(()=>{n()},[n]);const F=async()=>{if(m.trim()){A(!0);try{const s=await c.skills.install(m.trim());a("success",`Installed "${s.name}" successfully`),k(""),await n()}catch(s){a("error",s instanceof Error?s.message:"Installation failed")}finally{A(!1)}}},$=async()=>{const s=j.trim();if(s){D(!0);try{const t=await c.skills.installFromRegistry(s),h=t.status==="already-installed"?"Already installed":t.status==="updated"?"Updated":t.status==="reinstalled"?"Reinstalled":"Installed";a("success",`${h} "${t.id}" (v${t.version})`),C(""),await n()}catch(t){a("error",t instanceof Error?t.message:"Registry install failed")}finally{D(!1)}}},_=async s=>{x(t=>({...t,[s.name]:!0}));try{s.active?(await c.skills.deactivate(s.name),a("success",`Deactivated "${s.name}"`)):(await c.skills.activate(s.name),a("success",`Activated "${s.name}"`)),await n()}catch(t){a("error",t instanceof Error?t.message:"Toggle failed")}finally{x(t=>({...t,[s.name]:!1}))}},B=async s=>{x(t=>({...t,[s]:!0}));try{await c.skills.delete(s),a("success",`Deleted "${s}"`),await n()}catch(t){a("error",t instanceof Error?t.message:"Delete failed")}finally{x(t=>({...t,[s]:!1}))}};return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(d.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.3},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-[#00d4ff]/10",children:e.jsx(W,{className:"h-5 w-5 text-[#00d4ff]"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Skills"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Extend Mercury with installable capabilities"})]})]})}),e.jsx(d.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.1,duration:.3},children:e.jsx(f,{children:e.jsxs(g,{className:"p-5 space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oe,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"Install from registry"})]}),e.jsxs("a",{href:"https://skills.mercuryagent.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-[#00d4ff] transition-colors",children:["Browse skills.mercuryagent.sh",e.jsx(re,{className:"h-3 w-3"})]})]}),e.jsxs("form",{onSubmit:s=>{s.preventDefault(),$()},className:"flex gap-3",children:[e.jsx(S,{placeholder:"category/skill-slug e.g. finance-legal/contract-review",value:j,onChange:s=>C(s.target.value),disabled:y,className:"flex-1 font-mono text-sm"}),e.jsx(u,{type:"submit",disabled:y||!j.trim(),children:y?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin"}),"Installing"]}):"Install"})]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Review any skill on the registry before installing — they execute with your agent's privileges."})]}),e.jsx("div",{className:"h-px bg-border"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Y,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"Install from URL"})]}),e.jsxs("form",{onSubmit:s=>{s.preventDefault(),F()},className:"flex gap-3",children:[e.jsx(S,{placeholder:"https://github.com/user/skill-package",value:m,onChange:s=>k(s.target.value),disabled:p,className:"flex-1"}),e.jsx(u,{type:"submit",variant:"outline",disabled:p||!m.trim(),children:p?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin"}),"Installing"]}):"Install"})]})]})]})})}),R?e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((s,t)=>e.jsx(he,{},t))}):r.length===0?e.jsx(d.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:e.jsx(f,{children:e.jsxs(g,{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-muted mb-4",children:e.jsx(ne,{className:"h-7 w-7 text-muted-foreground"})}),e.jsx("h3",{className:"text-base font-medium text-foreground mb-1",children:"No skills installed"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Install skills from a URL above to extend Mercury's capabilities with new tools, workflows, and integrations."})]})})}):e.jsx(d.div,{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",variants:me,initial:"hidden",animate:"visible",children:e.jsx(L,{mode:"popLayout",children:r.map((s,t)=>e.jsx(d.div,{custom:t,variants:de,initial:"hidden",animate:"visible",exit:"exit",layout:!0,children:e.jsx(f,{className:"h-full",children:e.jsxs(g,{className:"p-5 flex flex-col gap-3 h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground leading-tight",children:s.name}),e.jsx(U,{variant:s.active?"success":"secondary",children:s.active?"Active":"Inactive"})]}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.description}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-auto",children:[e.jsx(Z,{className:"h-3 w-3 text-muted-foreground/60 shrink-0"}),e.jsx("span",{className:"text-xs text-muted-foreground/60 truncate font-mono",children:s.path})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-border",children:[e.jsx(u,{size:"sm",variant:s.active?"outline":"default",disabled:!!v[s.name],onClick:()=>_(s),className:"flex-1",children:v[s.name]?e.jsx(b,{className:"h-3.5 w-3.5 animate-spin"}):s.active?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),"Deactivate"]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-3.5 w-3.5"}),"Activate"]})}),e.jsxs(z,{children:[e.jsx(q,{asChild:!0,children:e.jsx(u,{size:"sm",variant:"ghost",disabled:!!v[s.name],className:"text-muted-foreground hover:text-destructive",children:e.jsx(V,{className:"h-3.5 w-3.5"})})}),e.jsxs(O,{children:[e.jsxs(H,{children:[e.jsx(X,{children:"Delete Skill"}),e.jsxs(G,{children:["Are you sure you want to delete “",s.name,"”? This will remove the skill and all its data permanently."]})]}),e.jsxs(J,{children:[e.jsx(K,{children:"Cancel"}),e.jsx(Q,{onClick:()=>B(s.name),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]})})},s.name))})}),e.jsx(xe,{toasts:T})]})}export{Re as SkillsPage};
|
|
17
|
-
//# sourceMappingURL=Skills-BHJp2CgD.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{j as e}from"./vendor-motion-Dwx3-JO5.js";import{C as s,c as t}from"./card-
|
|
1
|
+
import{j as e}from"./vendor-motion-Dwx3-JO5.js";import{C as s,c as t}from"./card-CjAvp22k.js";import{e as a}from"./index-B1xAjISP.js";import"./vendor-react-C7pctHW3.js";import"./vendor-syntax-xZUI6Op9.js";import"./vendor-radix-3UdfCgs_.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const r=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],o=a("square-check-big",r);function l(){return e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{className:"h-6 w-6 text-muted-foreground"}),e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Tasks"})]}),e.jsx(s,{children:e.jsx(t,{className:"py-8 text-center text-muted-foreground",children:"Task management coming soon."})})]})}export{l as TasksPage};
|
|
7
|
-
//# sourceMappingURL=Tasks-D36pqkro.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,m as r}from"./vendor-motion-Dwx3-JO5.js";import{r as f}from"./vendor-react-C7pctHW3.js";import{C as i,a as l,b as n,c as d}from"./card-
|
|
1
|
+
import{j as e,m as r}from"./vendor-motion-Dwx3-JO5.js";import{r as f}from"./vendor-react-C7pctHW3.js";import{C as i,a as l,b as n,c as d}from"./card-CjAvp22k.js";import{P as O}from"./progress-CsRtYJ3t.js";import{B as p}from"./badge-DpVeNL8j.js";import{e as y,a as P,b as c,m as E,h as U,c as R,M as S}from"./index-B1xAjISP.js";import{Z as _}from"./zap-CK8xUBKc.js";import{A as g}from"./activity-CDTOZzUZ.js";import{T as B}from"./terminal-BvZc6N0C.js";import"./vendor-radix-3UdfCgs_.js";import"./index-CufYpqmV.js";import"./vendor-syntax-xZUI6Op9.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -9,4 +9,3 @@ import{j as e,m as r}from"./vendor-motion-Dwx3-JO5.js";import{r as f}from"./vend
|
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/const I=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],$=y("trending-down",I),o={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.07,duration:.35,ease:"easeOut"}})};function m({className:t}){return e.jsx("div",{className:R("animate-pulse rounded-lg bg-muted",t)})}const z={openai:"#10b981",anthropic:"#f59e0b",google:"#3b82f6",groq:"#ef4444",ollama:"#8b5cf6",openrouter:"#ec4899"},A={web:w,telegram:S,cli:B};function H(t){return z[t.toLowerCase()]??"#6b7280"}function Z(t){return A[t.toLowerCase()]??g}function ae(){const[t,C]=f.useState(null),[N,k]=f.useState("");if(f.useEffect(()=>{P.usage.get().then(C).catch(s=>k(s.message))},[]),N)return e.jsx("div",{className:"flex h-full items-center justify-center p-8",children:e.jsx("p",{className:"text-sm text-destructive",children:N})});if(!t)return e.jsxs("div",{className:"space-y-6 p-6 lg:p-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(m,{className:"h-8 w-32"}),e.jsx(m,{className:"h-4 w-64"})]}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((s,a)=>e.jsx(m,{className:"h-[130px]"},a))}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(m,{className:"h-[240px]"}),e.jsx(m,{className:"h-[240px]"})]}),e.jsx(m,{className:"h-[320px]"})]});const b=t.dailyBudget?Math.min(Math.round(t.dailyUsed/t.dailyBudget*100),100):0,h=Object.entries(t.byProvider),T=h.reduce((s,[,a])=>s+a,0)||1,j=Object.entries(t.byChannel),L=j.reduce((s,[,a])=>s+a,0)||1;return e.jsxs("div",{className:"space-y-6 p-6 lg:p-8",children:[e.jsxs(r.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.3},children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Usage"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token consumption and budget tracking"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(r.div,{custom:0,variants:o,initial:"hidden",animate:"visible",children:e.jsxs(i,{className:"mercury-glow-sm",children:[e.jsxs(l,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium text-muted-foreground",children:"Daily Used / Budget"}),e.jsx(_,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(d,{children:[e.jsxs("p",{className:"text-2xl font-bold tabular-nums",children:[c(t.dailyUsed),e.jsxs("span",{className:"ml-1 text-sm font-normal text-muted-foreground",children:["/ ",c(t.dailyBudget)]})]}),e.jsx(O,{value:b,className:"mt-3"}),e.jsxs("p",{className:"mt-1.5 text-xs text-muted-foreground tabular-nums",children:[b,"% consumed"]})]})]})}),e.jsx(r.div,{custom:1,variants:o,initial:"hidden",animate:"visible",children:e.jsxs(i,{children:[e.jsxs(l,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium text-muted-foreground",children:"Remaining"}),e.jsx($,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(d,{children:[e.jsx("p",{className:"text-2xl font-bold tabular-nums",children:c(t.remaining)}),e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"tokens left today"})]})]})}),e.jsx(r.div,{custom:2,variants:o,initial:"hidden",animate:"visible",children:e.jsxs(i,{children:[e.jsxs(l,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium text-muted-foreground",children:"Total Requests"}),e.jsx(g,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(d,{children:[e.jsx("p",{className:"text-2xl font-bold tabular-nums",children:t.requestLog.length.toLocaleString()}),e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"requests today"})]})]})})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(r.div,{custom:3,variants:o,initial:"hidden",animate:"visible",children:e.jsxs(i,{children:[e.jsx(l,{children:e.jsxs(n,{className:"flex items-center gap-2 text-base",children:[e.jsx(E,{className:"h-4 w-4"}),"Usage by Provider"]})}),e.jsx(d,{children:h.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No provider usage recorded yet."}):e.jsx("div",{className:"flex flex-col gap-4",children:h.sort(([,s],[,a])=>a-s).map(([s,a])=>{const x=Math.round(a/T*100),u=H(s);return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(p,{variant:"secondary",className:"capitalize",children:s}),e.jsxs("span",{className:"text-sm font-medium tabular-nums text-muted-foreground",children:[c(a)," ",e.jsxs("span",{className:"text-xs",children:["(",x,"%)"]})]})]}),e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:e.jsx(r.div,{className:"h-full rounded-full",style:{backgroundColor:u},initial:{width:0},animate:{width:`${x}%`},transition:{duration:.6,ease:"easeOut",delay:.3}})})]},s)})})})]})}),e.jsx(r.div,{custom:4,variants:o,initial:"hidden",animate:"visible",children:e.jsxs(i,{children:[e.jsx(l,{children:e.jsxs(n,{className:"flex items-center gap-2 text-base",children:[e.jsx(w,{className:"h-4 w-4"}),"Usage by Channel"]})}),e.jsx(d,{children:j.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No channel usage recorded yet."}):e.jsx("div",{className:"flex flex-col gap-4",children:j.sort(([,s],[,a])=>a-s).map(([s,a],x)=>{const u=Math.round(a/L*100),q=Z(s),v=["#00d4ff","#8b5cf6","#f59e0b","#10b981"],M=v[x%v.length];return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(q,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx(p,{variant:"secondary",className:"capitalize",children:s})]}),e.jsxs("span",{className:"text-sm font-medium tabular-nums text-muted-foreground",children:[c(a)," ",e.jsxs("span",{className:"text-xs",children:["(",u,"%)"]})]})]}),e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:e.jsx(r.div,{className:"h-full rounded-full",style:{backgroundColor:M},initial:{width:0},animate:{width:`${u}%`},transition:{duration:.6,ease:"easeOut",delay:.35}})})]},s)})})})]})})]}),e.jsx(r.div,{custom:5,variants:o,initial:"hidden",animate:"visible",children:e.jsxs(i,{children:[e.jsx(l,{children:e.jsxs(n,{className:"flex items-center gap-2 text-base",children:[e.jsx(g,{className:"h-4 w-4"}),"Request Log"]})}),e.jsx(d,{children:t.requestLog.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No requests recorded yet."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left",children:[e.jsx("th",{className:"pb-3 pr-4 font-medium text-muted-foreground",children:"Time"}),e.jsx("th",{className:"pb-3 pr-4 font-medium text-muted-foreground",children:"Provider"}),e.jsx("th",{className:"pb-3 text-right font-medium text-muted-foreground",children:"Tokens"})]})}),e.jsx("tbody",{children:t.requestLog.slice().reverse().slice(0,50).map((s,a)=>e.jsxs(r.tr,{className:"border-b border-border/50 last:border-0",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4+a*.02,duration:.2},children:[e.jsx("td",{className:"py-2.5 pr-4 tabular-nums text-muted-foreground",children:U(s.timestamp)}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx(p,{variant:"outline",className:"capitalize",children:s.provider})}),e.jsx("td",{className:"py-2.5 text-right font-medium tabular-nums",children:c(s.totalTokens)})]},`${s.timestamp}-${a}`))})]})})})]})})]})}export{ae as UsagePage};
|
|
12
|
-
//# sourceMappingURL=Usage-CmjaYrsT.js.map
|
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import{j as e,A as te,m as se}from"./vendor-motion-Dwx3-JO5.js";import{r as a}from"./vendor-react-C7pctHW3.js";import{e as
|
|
1
|
+
import{j as e,A as te,m as se}from"./vendor-motion-Dwx3-JO5.js";import{r as a}from"./vendor-react-C7pctHW3.js";import{e as A,a as f,c as N,S as le,X as Ne,g as re,M as ve}from"./index-B1xAjISP.js";import{B as T}from"./button-V3Fu7_kO.js";import{B as Q}from"./badge-DpVeNL8j.js";import{o as we,A as ke,b as Ce,a as Se,u as $,M as ue,F as Me}from"./MarkdownRenderer-DKGKZih7.js";import{L as K}from"./loader-circle-CJko6bz6.js";import{a as ne,C as ze}from"./chevron-down-C66c9kfo.js";import{h as De}from"./vendor-syntax-xZUI6Op9.js";import{G as oe}from"./git-branch-CYWJZoQx.js";import{D as Te}from"./download-D73EX-Ki.js";import{S as Ee}from"./sparkles-wNQvP7So.js";import{P as pe}from"./plus-DhHrgqcD.js";import{Z as Fe}from"./zap-CK8xUBKc.js";import{T as Re}from"./terminal-BvZc6N0C.js";import{S as Le}from"./send-DHy23R-c.js";import{F as He}from"./folder-open-CF5wm-xS.js";import{F as _e}from"./file-text-CDTjVG9h.js";import"./vendor-radix-3UdfCgs_.js";import"./index-CufYpqmV.js";import"./vendor-markdown-DwTbvico.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const Pe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$e=A("circle",Pe);/**
|
|
7
7
|
* @license lucide-react v0.511.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ae=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],ye=
|
|
11
|
+
*/const Ae=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],ye=A("file-code",Ae);/**
|
|
12
12
|
* @license lucide-react v0.511.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Be=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],We=
|
|
16
|
+
*/const Be=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],We=A("folder-input",Be);/**
|
|
17
17
|
* @license lucide-react v0.511.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Ge=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Ie=
|
|
21
|
+
*/const Ge=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Ie=A("folder-tree",Ge);/**
|
|
22
22
|
* @license lucide-react v0.511.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const qe=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Ke=
|
|
26
|
+
*/const qe=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Ke=A("git-commit-horizontal",qe);/**
|
|
27
27
|
* @license lucide-react v0.511.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const Ue=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Oe=
|
|
31
|
+
*/const Ue=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Oe=A("maximize-2",Ue);/**
|
|
32
32
|
* @license lucide-react v0.511.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const Ve=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Xe=
|
|
36
|
+
*/const Ve=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Xe=A("minimize-2",Ve);/**
|
|
37
37
|
* @license lucide-react v0.511.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const Ze=[["path",{d:"M5 12h14",key:"1ays0h"}]],fe=
|
|
41
|
+
*/const Ze=[["path",{d:"M5 12h14",key:"1ays0h"}]],fe=A("minus",Ze);/**
|
|
42
42
|
* @license lucide-react v0.511.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Ye=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],je=
|
|
46
|
+
*/const Ye=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],je=A("refresh-cw",Ye);/**
|
|
47
47
|
* @license lucide-react v0.511.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const Je=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Qe=P("upload",Je);function et(r){return{".ts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"jsx",".py":"python",".rs":"rust",".go":"go",".java":"java",".json":"json",".yaml":"yaml",".yml":"yaml",".toml":"toml",".md":"markdown",".txt":"text",".css":"css",".html":"html",".sh":"bash",".bash":"bash",".zsh":"bash",".sql":"sql",".xml":"xml",".svg":"xml",".dockerfile":"docker",".env":"text",".gitignore":"text",".c":"c",".cpp":"cpp",".h":"c",".hpp":"cpp",".rb":"ruby",".php":"php",".swift":"swift",".kt":"kotlin",".scala":"scala",".lua":"lua",".r":"r",".dart":"dart",".graphql":"graphql",".scss":"scss",".less":"less",".vue":"markup",".prisma":"text",".proto":"protobuf"}[r.toLowerCase()]||"text"}function ie(r,c,C){if(c)return C?e.jsx(He,{className:"h-4 w-4 text-mercury-400"}):e.jsx(Me,{className:"h-4 w-4 text-mercury-400/70"});const S=r.includes(".")?"."+r.split(".").pop():"";return[".ts",".tsx",".js",".jsx",".py",".rs",".go",".java",".sh"].includes(S)?e.jsx(ye,{className:"h-4 w-4 text-blue-400"}):e.jsx(_e,{className:"h-4 w-4 text-muted-foreground"})}function ge(r){switch(r){case"modified":return e.jsx("span",{className:"text-amber-400 text-xs font-bold",children:"M"});case"added":return e.jsx("span",{className:"text-emerald-400 text-xs font-bold",children:"A"});case"deleted":return e.jsx("span",{className:"text-red-400 text-xs font-bold",children:"D"});case"untracked":return e.jsx("span",{className:"text-gray-400 text-xs font-bold",children:"U"});case"renamed":return e.jsx("span",{className:"text-purple-400 text-xs font-bold",children:"R"});default:return e.jsx("span",{className:"text-muted-foreground text-xs",children:"?"})}}function tt({onOpenFile:r,openFiles:c}){const[C,S]=a.useState(null),[i,R]=a.useState(new Set(["."])),[y,M]=a.useState(new Map),[g,o]=a.useState(!0);a.useEffect(()=>{j()},[]);async function j(v){try{const d=await f.workspace.tree(v);!v||v==="."?(S(d),o(!1)):M(b=>new Map(b).set(v,d))}catch{o(!1)}}function W(v){const d=new Set(i);d.has(v)?d.delete(v):(d.add(v),y.has(v)||j(v)),R(d)}function F(v,d){return v.map(b=>{const l=d==="."?b.name:`${d}/${b.name}`,m=i.has(l),z=c.includes(l);if(b.isDirectory){const E=y.get(l);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>W(l),className:N("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-[13px] transition-colors","hover:bg-muted/60"),children:[m?e.jsx(ze,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):e.jsx(re,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),ie(b.name,!0,m),e.jsx("span",{className:"truncate",children:b.name})]}),m&&E&&e.jsx("div",{className:"ml-3 border-l border-border/30 pl-1",children:F(E.items,l)})]},l)}return e.jsxs("button",{onClick:()=>r(l),className:N("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-[13px] transition-colors",z?"bg-primary/10 text-primary":"hover:bg-muted/60 text-foreground/80"),children:[e.jsx("span",{className:"w-3"}),ie(b.name,!1),e.jsx("span",{className:"truncate",children:b.name})]},l)})}return g?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(K,{className:"h-5 w-5 animate-spin text-primary"})}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ie,{className:"h-4 w-4 text-mercury-400"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Explorer"})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>j(),children:e.jsx(je,{className:"h-3 w-3"})})]}),e.jsx(le,{className:"flex-1 px-1 py-1",children:C&&F(C.items,".")})]})}function st({tabs:r,activeTab:c,onSelectTab:C,onCloseTab:S,onSave:i,onContentChange:R}){const y=a.useRef(null),M=a.useRef(null),g=r.find(o=>o.path===c);return a.useEffect(()=>{function o(j){(j.metaKey||j.ctrlKey)&&j.key==="s"&&(j.preventDefault(),c&&i(c))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[c,i]),r.length===0?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 text-center",children:[e.jsx("div",{className:"rounded-2xl bg-primary/10 p-6",children:e.jsx(ye,{className:"h-12 w-12 text-primary/60"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:"No files open"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Select a file from the explorer to start editing"})]})]}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex items-center gap-0 overflow-x-auto border-b border-border bg-muted/20",children:r.map(o=>e.jsxs("button",{onClick:()=>C(o.path),className:N("group flex items-center gap-2 border-r border-border/30 px-3 py-1.5 text-[13px] transition-colors",o.path===c?"bg-background text-foreground border-b-2 border-b-primary":"text-muted-foreground hover:bg-muted/40 hover:text-foreground"),children:[ie(o.name,!1),e.jsx("span",{className:"max-w-[120px] truncate",children:o.name}),o.dirty&&e.jsx(Pe,{className:"h-2 w-2 fill-primary text-primary"}),e.jsx("button",{onClick:j=>{j.stopPropagation(),S(o.path)},className:"ml-1 rounded p-0.5 opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted",children:e.jsx(Ne,{className:"h-3 w-3"})})]},o.path))}),g&&e.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/30 bg-muted/10 px-3 py-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:g.path}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:g.language}),g.dirty&&e.jsxs(T,{size:"sm",variant:"ghost",className:"h-5 gap-1 px-2 text-[10px]",onClick:()=>i(g.path),children:[e.jsx("span",{className:"text-primary",children:"Save"}),e.jsx("span",{className:"text-muted-foreground",children:"Cmd+S"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto bg-[#282c34]",ref:M,onClick:()=>{var o;return(o=y.current)==null?void 0:o.focus()},children:e.jsxs("div",{className:"relative",style:{minWidth:"fit-content"},children:[e.jsx(De,{language:g.language,style:we,showLineNumbers:!0,lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:"rgba(255,255,255,0.25)",fontSize:"13px",lineHeight:"20px",userSelect:"none"},customStyle:{margin:0,padding:"0.5rem 0",background:"transparent",fontSize:"13px",lineHeight:"20px",fontFamily:"var(--font-mono, 'Geist Mono', ui-monospace, monospace)"},codeTagProps:{style:{fontSize:"13px",lineHeight:"20px",fontFamily:"var(--font-mono, 'Geist Mono', ui-monospace, monospace)"}},wrapLongLines:!1,children:g.content||" "}),e.jsx("textarea",{ref:y,value:g.content,onChange:o=>R(g.path,o.target.value),spellCheck:!1,className:N("absolute top-0 left-0 w-full h-full resize-none bg-transparent text-transparent caret-white","font-mono text-[13px] leading-[20px]","focus:outline-none","whitespace-pre","pointer-events-none focus:pointer-events-auto"),style:{tabSize:2,padding:"0.5rem 0 0.5rem 4.5em",fontFamily:"var(--font-mono, 'Geist Mono', ui-monospace, monospace)",overflow:"hidden"},onFocus:()=>{y.current&&(y.current.style.pointerEvents="auto")},onBlur:()=>{y.current&&(y.current.style.pointerEvents="none")},onWheel:o=>{M.current&&(M.current.scrollTop+=o.deltaY,M.current.scrollLeft+=o.deltaX)}})]})})]})]})}function at(){const[r,c]=a.useState(null),[C,S]=a.useState([]),[i,R]=a.useState([]),[y,M]=a.useState(""),[g,o]=a.useState(!1),[j,W]=a.useState(!1),[F,v]=a.useState(!0),[d,b]=a.useState(!1),[l,m]=a.useState(null),[z,E]=a.useState(null),k=a.useCallback(async(t=!1)=>{b(!0);try{const[h,I,q]=await Promise.all([f.git.status(),f.git.branches(),f.git.log(15)]);c(h),S(I.branches),R(q.commits),t&&(E({type:"success",msg:"Refreshed"}),setTimeout(()=>E(null),1500))}catch(h){E({type:"error",msg:h.message})}finally{v(!1),b(!1)}},[]);a.useEffect(()=>{k()},[k]);function x(t,h){E({type:t,msg:h}),setTimeout(()=>E(null),3e3)}async function H(t){m("stage");try{await f.git.stage(t),await k()}catch(h){x("error",h.message)}finally{m(null)}}async function A(t){m("unstage");try{await f.git.unstage(t),await k()}catch(h){x("error",h.message)}finally{m(null)}}async function O(){if(y.trim()){m("commit");try{const t=await f.git.commit(y.trim());M(""),x("success","Committed successfully"),await k()}catch(t){x("error",t.message)}finally{m(null)}}}async function G(){m("push");try{const t=await f.git.push();x("success",t.message||"Pushed"),await k()}catch(t){x("error",t.message)}finally{m(null)}}async function U(){m("pull");try{const t=await f.git.pull();x("success",t.message||"Pulled"),await k()}catch(t){x("error",t.message)}finally{m(null)}}async function V(t){m("checkout");try{await f.git.checkout(t),x("success",`Switched to ${t}`),o(!1),await k()}catch(h){x("error",h.message)}finally{m(null)}}async function X(){m("generate");try{((r==null?void 0:r.files.filter(q=>!q.staged))||[]).length>0&&(await f.git.stage(["."]),await k());const h=await f.git.generateCommitMessage(),I=typeof h=="string"?h:(h==null?void 0:h.message)||"";I?(M(I),x("success","Message generated")):x("error","No message returned")}catch(t){x("error",t.message)}finally{m(null)}}if(F)return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(K,{className:"h-5 w-5 animate-spin text-primary"})});const L=(r==null?void 0:r.files.filter(t=>t.staged))||[],_=(r==null?void 0:r.files.filter(t=>!t.staged))||[];return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(oe,{className:"h-4 w-4 text-mercury-400"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Source Control"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:U,disabled:!!l,children:e.jsx(Te,{className:"h-3 w-3"})}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:G,disabled:!!l,children:e.jsx(Qe,{className:"h-3 w-3"})}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>k(!0),disabled:!!l||d,title:"Refresh","aria-label":"Refresh",children:e.jsx(je,{className:N("h-3 w-3",d&&"animate-spin")})})]})]}),e.jsx(le,{className:"flex-1",children:e.jsxs("div",{className:"p-2 space-y-3",children:[e.jsx(te,{children:z&&e.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:N("rounded-md px-3 py-1.5 text-xs",z.type==="success"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"),children:z.msg})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("button",{onClick:()=>o(!g),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-muted/60",children:[e.jsx(oe,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"font-medium",children:(r==null?void 0:r.branch)||"—"}),r&&r.ahead>0&&e.jsxs(Q,{variant:"outline",className:"text-[10px] px-1 py-0",children:[e.jsx(ke,{className:"h-2.5 w-2.5 mr-0.5"}),r.ahead]}),r&&r.behind>0&&e.jsxs(Q,{variant:"outline",className:"text-[10px] px-1 py-0",children:[e.jsx(Ce,{className:"h-2.5 w-2.5 mr-0.5"}),r.behind]}),e.jsx(re,{className:N("ml-auto h-3 w-3 transition-transform",g&&"rotate-90")})]}),e.jsx(te,{children:g&&e.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsx("div",{className:"ml-2 space-y-0.5 border-l border-border/30 pl-2 py-1",children:C.filter(t=>!t.name.startsWith("remotes/")).map(t=>e.jsxs("button",{onClick:()=>!t.isCurrent&&V(t.name),className:N("flex w-full items-center gap-2 rounded-md px-2 py-1 text-xs transition-colors",t.isCurrent?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),disabled:t.isCurrent||!!l,children:[t.isCurrent&&e.jsx(ne,{className:"h-3 w-3"}),e.jsx("span",{className:"truncate",children:t.name})]},t.name))})})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"relative",children:[e.jsx("textarea",{value:y,onChange:t=>M(t.target.value),placeholder:"Commit message...",rows:2,className:N("w-full resize-none rounded-lg border border-border bg-muted/30 px-3 py-2 pr-9 text-sm text-foreground","placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-primary/40")}),e.jsx("button",{onClick:X,disabled:!!l,title:"AI generate commit message",className:N("absolute right-2 top-2 rounded-md p-1.5 transition-colors border border-border/50","text-primary/70 hover:text-primary hover:bg-primary/10 bg-background/80",l==="generate"&&"animate-pulse"),children:l==="generate"?e.jsx(K,{className:"h-4 w-4 animate-spin text-primary"}):e.jsx(Ee,{className:"h-4 w-4"})})]}),e.jsxs(T,{size:"sm",className:"w-full h-7 gap-1.5 text-xs",disabled:!y.trim()||L.length===0||!!l,onClick:O,children:[l==="commit"?e.jsx(K,{className:"h-3 w-3 animate-spin"}):e.jsx(ne,{className:"h-3 w-3"}),"Commit (",L.length," staged)"]})]}),L.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-1 mb-1",children:[e.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:["Staged (",L.length,")"]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>A(L.map(t=>t.path)),children:e.jsx(fe,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"space-y-0.5",children:L.map(t=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs hover:bg-muted/40 group",children:[ge(t.status),e.jsx("span",{className:"flex-1 truncate font-mono",children:t.path}),e.jsx("button",{onClick:()=>A([t.path]),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(fe,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},`staged-${t.path}`))})]}),_.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-1 mb-1",children:[e.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:["Changes (",_.length,")"]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>H(_.map(t=>t.path)),children:e.jsx(pe,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"space-y-0.5",children:_.map(t=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs hover:bg-muted/40 group",children:[ge(t.status),e.jsx("span",{className:"flex-1 truncate font-mono",children:t.path}),e.jsx("button",{onClick:()=>H([t.path]),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(pe,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},`unstaged-${t.path}`))})]}),L.length===0&&_.length===0&&e.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No changes detected"}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>W(!j),className:"flex w-full items-center gap-1.5 px-1 mb-1",children:[e.jsx(re,{className:N("h-3 w-3 text-muted-foreground transition-transform",j&&"rotate-90")}),e.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Recent Commits"})]}),e.jsx(te,{children:j&&e.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsx("div",{className:"space-y-0.5",children:i.map(t=>e.jsx("div",{className:"rounded-md px-2 py-1.5 hover:bg-muted/40 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ke,{className:"h-3 w-3 mt-0.5 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs text-foreground line-clamp-2 leading-snug",children:t.message}),e.jsxs("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:t.short}),e.jsx("span",{className:"mx-1",children:"·"}),t.date]})]})]})},t.hash))})})})]})]})})]})}function rt({projectInfo:r,codeMode:c,isMaximized:C,onToggleMaximize:S}){const[i,R]=a.useState("terminal"),[y,M]=a.useState([]),[g,o]=a.useState(""),[j,W]=a.useState(!1),[F,v]=a.useState([]),[d,b]=a.useState(-1),l=a.useRef(null),m=a.useRef(null),[z,E]=a.useState(""),{connected:k}=Se(),x=$(s=>s.streamingText),H=$(s=>s.isStreaming),A=$(s=>s.waiting),O=$(s=>s.messages),G=$(s=>s.addMessage),U=$(s=>s.setWaiting),V=$(s=>s.clearStreaming),X=$(s=>s.activeThreadId),L=$(s=>s.setActiveThread),_=$(s=>s.bumpThreadVersion),t=H||A;a.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[y]);async function h(){var w;const s=g.trim();if(!(!s||j)){o(""),v(B=>[...B,s]),b(-1),W(!0);try{const B=await f.terminal.exec(s);M(n=>[...n,{id:`${Date.now()}`,command:s,output:B.output||B.error||"",exitCode:B.exitCode,timestamp:Date.now()}])}catch(B){M(n=>[...n,{id:`${Date.now()}`,command:s,output:B.message,exitCode:1,timestamp:Date.now()}])}finally{W(!1),(w=m.current)==null||w.focus()}}}function I(s){if(s.key==="Enter")s.preventDefault(),h();else if(s.key==="ArrowUp"){if(s.preventDefault(),F.length>0){const w=d<0?F.length-1:Math.max(0,d-1);b(w),o(F[w])}}else if(s.key==="ArrowDown"&&(s.preventDefault(),d>=0)){const w=d+1;w>=F.length?(b(-1),o("")):(b(w),o(F[w]))}}async function q(){const s=z.trim();if(!s||t)return;E("");let w=X;w||(w=`web:${Date.now()}_${Math.random().toString(36).slice(2,8)}`,L(w)),G({id:crypto.randomUUID(),role:"user",content:s,timestamp:new Date().toISOString()}),U(!0),f.chat.threads.addMessage(w,"user",s).then(()=>_()).catch(()=>{});try{await f.chat.send(s,w)}catch{U(!1),V()}}const Z=O.slice(-6);return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-muted/20 px-3 py-1 text-[11px]",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:c!=null&&c.active?e.jsxs(Q,{variant:"outline",className:N("text-[10px] px-1.5 py-0 gap-1",c.state==="execute"?"border-emerald-500/40 text-emerald-400":"border-amber-500/40 text-amber-400"),children:[e.jsx(Fe,{className:"h-2.5 w-2.5"}),c.state==="execute"?"Execute":"Plan"]}):e.jsx(Q,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-muted-foreground",children:"Chat"})}),e.jsx("span",{className:"h-3 w-px bg-border"}),r&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground font-mono truncate max-w-[200px]",children:r.projectName}),e.jsx("span",{className:"h-3 w-px bg-border"}),e.jsx("span",{className:"text-muted-foreground font-mono truncate max-w-[300px]",title:r.cwd,children:r.cwd}),r.isGit&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-3 w-px bg-border"}),e.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(oe,{className:"h-3 w-3"}),e.jsx("span",{className:"font-mono",children:r.branch})]})]})]}),e.jsx("span",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx("div",{className:N("h-1.5 w-1.5 rounded-full",k?"bg-emerald-500":"bg-red-500")}),e.jsx("span",{children:k?"Connected":"Disconnected"})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-muted/10",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{onClick:()=>R("terminal"),className:N("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium transition-colors border-b-2",i==="terminal"?"border-b-primary text-foreground":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[e.jsx(Re,{className:"h-3.5 w-3.5"}),"Terminal"]}),e.jsxs("button",{onClick:()=>R("chat"),className:N("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium transition-colors border-b-2",i==="chat"?"border-b-primary text-foreground":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),"Chat",t&&e.jsx(K,{className:"h-3 w-3 animate-spin text-primary"})]})]}),e.jsx("button",{onClick:S,className:"mr-2 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",title:C?"Restore panel":"Maximize panel","aria-label":C?"Restore panel":"Maximize panel",children:C?e.jsx(Xe,{className:"h-3.5 w-3.5"}):e.jsx(Oe,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:i==="terminal"?e.jsxs("div",{className:"flex h-full flex-col bg-[#0d1117]",children:[e.jsxs("div",{ref:l,className:"flex-1 overflow-auto p-2 font-mono text-[13px]",children:[y.map(s=>e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-emerald-400",children:"$"}),e.jsx("span",{className:"text-gray-200",children:s.command})]}),s.output&&e.jsx("pre",{className:N("whitespace-pre-wrap text-[12px] leading-relaxed mt-0.5 pl-4",s.exitCode===0?"text-gray-400":"text-red-400"),children:s.output})]},s.id)),j&&e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[e.jsx(K,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{className:"text-xs",children:"Running..."})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-gray-800 bg-[#0d1117] px-3 py-2",children:[e.jsx("span",{className:"text-emerald-400 font-mono text-sm",children:"$"}),e.jsx("input",{ref:m,value:g,onChange:s=>o(s.target.value),onKeyDown:I,placeholder:"Type a command...",className:"flex-1 bg-transparent font-mono text-[13px] text-gray-200 placeholder:text-gray-600 focus:outline-none",autoFocus:!0})]})]}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(le,{className:"flex-1 px-3 py-2",children:e.jsxs("div",{className:"space-y-2",children:[Z.map(s=>e.jsx("div",{className:N("rounded-lg px-3 py-2 text-sm",s.role==="user"?"bg-primary/10 text-foreground ml-8":s.role==="system"?"bg-red-500/10 text-red-400":"bg-muted text-foreground mr-8"),children:s.role==="assistant"?e.jsx(ue,{content:s.content}):e.jsx("p",{className:"whitespace-pre-wrap text-[13px]",children:s.content})},s.id)),H&&x&&e.jsxs("div",{className:"rounded-lg bg-muted px-3 py-2 mr-8",children:[e.jsx(ue,{content:x}),e.jsx("span",{className:"inline-block h-3.5 w-[2px] animate-pulse bg-primary ml-0.5"})]}),A&&!H&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-muted px-3 py-2 text-sm text-muted-foreground mr-8",children:[e.jsx(K,{className:"h-3.5 w-3.5 animate-spin text-primary"}),"Thinking..."]})]})}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-3 py-2",children:[e.jsx("input",{value:z,onChange:s=>E(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),q())},placeholder:"Ask Mercury...",disabled:t,className:N("flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/60 focus:outline-none",t&&"opacity-50")}),e.jsx(T,{size:"icon",className:"h-7 w-7 shrink-0",disabled:t||!z.trim(),onClick:q,children:e.jsx(Le,{className:"h-3.5 w-3.5"})})]})]})})]})}function Mt(){const[r,c]=a.useState([]),[C,S]=a.useState(null),[i,R]=a.useState(null),[y,M]=a.useState(null),[g,o]=a.useState(240),[j,W]=a.useState(280),[F,v]=a.useState(260),[d,b]=a.useState(!1),[l,m]=a.useState(!0),[z,E]=a.useState(!0),[k,x]=a.useState(!1),[H,A]=a.useState(""),[O,G]=a.useState(""),[U,V]=a.useState(!1),[X,L]=a.useState(0);a.useEffect(()=>{f.workspace.info().then(R).catch(()=>{}),f.code.status().then(n=>M({state:n.state,active:n.active})).catch(()=>{})},[]);async function _(){const n=H.trim();if(n){V(!0),G("");try{await f.workspace.setRoot(n);const u=await f.workspace.info();R(u),x(!1),A(""),c([]),S(null),L(p=>p+1)}catch(u){G(u.message||"Invalid path")}finally{V(!1)}}}async function t(n){if(r.find(p=>p.path===n)){S(n);return}try{const p=await f.workspace.file(n),D=p.ext||(n.includes(".")?"."+n.split(".").pop():""),ee={path:n,name:p.name,content:p.content,language:et(D),dirty:!1,originalContent:p.content};c(Y=>[...Y,ee]),S(n)}catch{}}function h(n){if(c(u=>u.filter(p=>p.path!==n)),C===n){const u=r.filter(p=>p.path!==n);S(u.length>0?u[u.length-1].path:null)}}async function I(n){const u=r.find(p=>p.path===n);if(!(!u||!u.dirty))try{await f.workspace.saveFile(n,u.content),c(p=>p.map(D=>D.path===n?{...D,dirty:!1,originalContent:D.content}:D))}catch{}}function q(n,u){c(p=>p.map(D=>D.path===n?{...D,content:u,dirty:u!==D.originalContent}:D))}function Z(n,u,p,D,ee=!1){const Y=a.useRef(!1);return{onMouseDown:a.useCallback(ae=>{ae.preventDefault(),Y.current=!0;const ce=n==="horizontal"?ae.clientX:ae.clientY;let de;u(J=>(de=J,J));function me(J){if(!Y.current)return;const he=n==="horizontal"?J.clientX-ce:ce-J.clientY,be=ee?-he:he;u(Math.min(D,Math.max(p,de+be)))}function xe(){Y.current=!1,document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",xe)}document.addEventListener("mousemove",me),document.addEventListener("mouseup",xe)},[n,u,p,D,ee])}}const s=Z("horizontal",o,160,400),w=Z("horizontal",W,200,450,!0),B=Z("vertical",v,120,500);return e.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-border bg-muted/20 px-4 py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(We,{className:"h-4 w-4 text-mercury-400"}),e.jsx("span",{className:"font-medium text-foreground",children:(i==null?void 0:i.projectName)||"Workspace"}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate max-w-[300px]",title:i==null?void 0:i.cwd,children:(i==null?void 0:i.cwd)||"—"})]}),e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{x(!k),A((i==null?void 0:i.cwd)||""),G("")},children:"Change Folder"}),e.jsx("span",{className:"flex-1"}),e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>m(!l),children:l?"Hide Explorer":"Show Explorer"}),e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>E(!z),children:z?"Hide Git":"Show Git"})]}),e.jsx(te,{children:k&&e.jsxs(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-muted/10 px-4 py-2",children:[e.jsx("input",{value:H,onChange:n=>{A(n.target.value),G("")},onKeyDown:n=>{n.key==="Enter"&&_(),n.key==="Escape"&&x(!1)},placeholder:"/path/to/project",className:"flex-1 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-mono text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/40",autoFocus:!0}),e.jsxs(T,{size:"sm",className:"h-7 gap-1 text-xs",onClick:_,disabled:U||!H.trim(),children:[U?e.jsx(K,{className:"h-3 w-3 animate-spin"}):e.jsx(ne,{className:"h-3 w-3"}),"Open"]}),e.jsx(T,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>x(!1),children:"Cancel"})]}),O&&e.jsx("p",{className:"px-4 pb-2 text-xs text-red-400",children:O})]})}),!d&&e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{width:g},className:"shrink-0 overflow-hidden border-r border-border",children:e.jsx(tt,{onOpenFile:t,openFiles:r.map(n=>n.path)},X)}),e.jsx("div",{...s,className:"w-1 shrink-0 cursor-col-resize hover:bg-primary/30 active:bg-primary/50 transition-colors"})]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsx(st,{tabs:r,activeTab:C,onSelectTab:S,onCloseTab:h,onSave:I,onContentChange:q})}),z&&e.jsx("div",{...w,className:"w-1 shrink-0 cursor-col-resize hover:bg-primary/30 active:bg-primary/50 transition-colors"}),z&&e.jsx("div",{style:{width:j},className:"shrink-0 overflow-hidden border-l border-border",children:e.jsx(at,{},X)})]}),!d&&e.jsx("div",{...B,className:"h-1 shrink-0 cursor-row-resize hover:bg-primary/30 active:bg-primary/50 transition-colors border-t border-border"}),e.jsx("div",{style:d?void 0:{height:F},className:N("overflow-hidden",d?"flex-1 min-h-0":"shrink-0"),children:e.jsx(rt,{projectInfo:i,codeMode:y,isMaximized:d,onToggleMaximize:()=>b(n=>!n)})})]})}export{Mt as WorkspacePage};
|
|
52
|
-
//# sourceMappingURL=Workspace-BYLf-wTJ.js.map
|
|
51
|
+
*/const Je=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Qe=A("upload",Je);function et(r){return{".ts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"jsx",".py":"python",".rs":"rust",".go":"go",".java":"java",".json":"json",".yaml":"yaml",".yml":"yaml",".toml":"toml",".md":"markdown",".txt":"text",".css":"css",".html":"html",".sh":"bash",".bash":"bash",".zsh":"bash",".sql":"sql",".xml":"xml",".svg":"xml",".dockerfile":"docker",".env":"text",".gitignore":"text",".c":"c",".cpp":"cpp",".h":"c",".hpp":"cpp",".rb":"ruby",".php":"php",".swift":"swift",".kt":"kotlin",".scala":"scala",".lua":"lua",".r":"r",".dart":"dart",".graphql":"graphql",".scss":"scss",".less":"less",".vue":"markup",".prisma":"text",".proto":"protobuf"}[r.toLowerCase()]||"text"}function ie(r,c,C){if(c)return C?e.jsx(He,{className:"h-4 w-4 text-mercury-400"}):e.jsx(Me,{className:"h-4 w-4 text-mercury-400/70"});const S=r.includes(".")?"."+r.split(".").pop():"";return[".ts",".tsx",".js",".jsx",".py",".rs",".go",".java",".sh"].includes(S)?e.jsx(ye,{className:"h-4 w-4 text-blue-400"}):e.jsx(_e,{className:"h-4 w-4 text-muted-foreground"})}function ge(r){switch(r){case"modified":return e.jsx("span",{className:"text-amber-400 text-xs font-bold",children:"M"});case"added":return e.jsx("span",{className:"text-emerald-400 text-xs font-bold",children:"A"});case"deleted":return e.jsx("span",{className:"text-red-400 text-xs font-bold",children:"D"});case"untracked":return e.jsx("span",{className:"text-gray-400 text-xs font-bold",children:"U"});case"renamed":return e.jsx("span",{className:"text-purple-400 text-xs font-bold",children:"R"});default:return e.jsx("span",{className:"text-muted-foreground text-xs",children:"?"})}}function tt({onOpenFile:r,openFiles:c}){const[C,S]=a.useState(null),[i,R]=a.useState(new Set(["."])),[y,M]=a.useState(new Map),[g,o]=a.useState(!0);a.useEffect(()=>{j()},[]);async function j(v){try{const d=await f.workspace.tree(v);!v||v==="."?(S(d),o(!1)):M(b=>new Map(b).set(v,d))}catch{o(!1)}}function W(v){const d=new Set(i);d.has(v)?d.delete(v):(d.add(v),y.has(v)||j(v)),R(d)}function F(v,d){return v.map(b=>{const l=d==="."?b.name:`${d}/${b.name}`,m=i.has(l),z=c.includes(l);if(b.isDirectory){const E=y.get(l);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>W(l),className:N("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-[13px] transition-colors","hover:bg-muted/60"),children:[m?e.jsx(ze,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):e.jsx(re,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),ie(b.name,!0,m),e.jsx("span",{className:"truncate",children:b.name})]}),m&&E&&e.jsx("div",{className:"ml-3 border-l border-border/30 pl-1",children:F(E.items,l)})]},l)}return e.jsxs("button",{onClick:()=>r(l),className:N("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-[13px] transition-colors",z?"bg-primary/10 text-primary":"hover:bg-muted/60 text-foreground/80"),children:[e.jsx("span",{className:"w-3"}),ie(b.name,!1),e.jsx("span",{className:"truncate",children:b.name})]},l)})}return g?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(K,{className:"h-5 w-5 animate-spin text-primary"})}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ie,{className:"h-4 w-4 text-mercury-400"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Explorer"})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>j(),children:e.jsx(je,{className:"h-3 w-3"})})]}),e.jsx(le,{className:"flex-1 px-1 py-1",children:C&&F(C.items,".")})]})}function st({tabs:r,activeTab:c,onSelectTab:C,onCloseTab:S,onSave:i,onContentChange:R}){const y=a.useRef(null),M=a.useRef(null),g=r.find(o=>o.path===c);return a.useEffect(()=>{function o(j){(j.metaKey||j.ctrlKey)&&j.key==="s"&&(j.preventDefault(),c&&i(c))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[c,i]),r.length===0?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 text-center",children:[e.jsx("div",{className:"rounded-2xl bg-primary/10 p-6",children:e.jsx(ye,{className:"h-12 w-12 text-primary/60"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:"No files open"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Select a file from the explorer to start editing"})]})]}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex items-center gap-0 overflow-x-auto border-b border-border bg-muted/20",children:r.map(o=>e.jsxs("button",{onClick:()=>C(o.path),className:N("group flex items-center gap-2 border-r border-border/30 px-3 py-1.5 text-[13px] transition-colors",o.path===c?"bg-background text-foreground border-b-2 border-b-primary":"text-muted-foreground hover:bg-muted/40 hover:text-foreground"),children:[ie(o.name,!1),e.jsx("span",{className:"max-w-[120px] truncate",children:o.name}),o.dirty&&e.jsx($e,{className:"h-2 w-2 fill-primary text-primary"}),e.jsx("button",{onClick:j=>{j.stopPropagation(),S(o.path)},className:"ml-1 rounded p-0.5 opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted",children:e.jsx(Ne,{className:"h-3 w-3"})})]},o.path))}),g&&e.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/30 bg-muted/10 px-3 py-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:g.path}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:g.language}),g.dirty&&e.jsxs(T,{size:"sm",variant:"ghost",className:"h-5 gap-1 px-2 text-[10px]",onClick:()=>i(g.path),children:[e.jsx("span",{className:"text-primary",children:"Save"}),e.jsx("span",{className:"text-muted-foreground",children:"Cmd+S"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto bg-[#282c34]",ref:M,onClick:()=>{var o;return(o=y.current)==null?void 0:o.focus()},children:e.jsxs("div",{className:"relative",style:{minWidth:"fit-content"},children:[e.jsx(De,{language:g.language,style:we,showLineNumbers:!0,lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:"rgba(255,255,255,0.25)",fontSize:"13px",lineHeight:"20px",userSelect:"none"},customStyle:{margin:0,padding:"0.5rem 0",background:"transparent",fontSize:"13px",lineHeight:"20px",fontFamily:"var(--font-mono, 'Geist Mono', ui-monospace, monospace)"},codeTagProps:{style:{fontSize:"13px",lineHeight:"20px",fontFamily:"var(--font-mono, 'Geist Mono', ui-monospace, monospace)"}},wrapLongLines:!1,children:g.content||" "}),e.jsx("textarea",{ref:y,value:g.content,onChange:o=>R(g.path,o.target.value),spellCheck:!1,className:N("absolute top-0 left-0 w-full h-full resize-none bg-transparent text-transparent caret-white","font-mono text-[13px] leading-[20px]","focus:outline-none","whitespace-pre","pointer-events-none focus:pointer-events-auto"),style:{tabSize:2,padding:"0.5rem 0 0.5rem 4.5em",fontFamily:"var(--font-mono, 'Geist Mono', ui-monospace, monospace)",overflow:"hidden"},onFocus:()=>{y.current&&(y.current.style.pointerEvents="auto")},onBlur:()=>{y.current&&(y.current.style.pointerEvents="none")},onWheel:o=>{M.current&&(M.current.scrollTop+=o.deltaY,M.current.scrollLeft+=o.deltaX)}})]})})]})]})}function at(){const[r,c]=a.useState(null),[C,S]=a.useState([]),[i,R]=a.useState([]),[y,M]=a.useState(""),[g,o]=a.useState(!1),[j,W]=a.useState(!1),[F,v]=a.useState(!0),[d,b]=a.useState(!1),[l,m]=a.useState(null),[z,E]=a.useState(null),w=a.useCallback(async(t=!1)=>{b(!0);try{const[h,I,q]=await Promise.all([f.git.status(),f.git.branches(),f.git.log(15)]);c(h),S(I.branches),R(q.commits),t&&(E({type:"success",msg:"Refreshed"}),setTimeout(()=>E(null),1500))}catch(h){E({type:"error",msg:h.message})}finally{v(!1),b(!1)}},[]);a.useEffect(()=>{w()},[w]);function x(t,h){E({type:t,msg:h}),setTimeout(()=>E(null),3e3)}async function H(t){m("stage");try{await f.git.stage(t),await w()}catch(h){x("error",h.message)}finally{m(null)}}async function B(t){m("unstage");try{await f.git.unstage(t),await w()}catch(h){x("error",h.message)}finally{m(null)}}async function O(){if(y.trim()){m("commit");try{const t=await f.git.commit(y.trim());M(""),x("success","Committed successfully"),await w()}catch(t){x("error",t.message)}finally{m(null)}}}async function G(){m("push");try{const t=await f.git.push();x("success",t.message||"Pushed"),await w()}catch(t){x("error",t.message)}finally{m(null)}}async function U(){m("pull");try{const t=await f.git.pull();x("success",t.message||"Pulled"),await w()}catch(t){x("error",t.message)}finally{m(null)}}async function V(t){m("checkout");try{await f.git.checkout(t),x("success",`Switched to ${t}`),o(!1),await w()}catch(h){x("error",h.message)}finally{m(null)}}async function X(){m("generate");try{((r==null?void 0:r.files.filter(q=>!q.staged))||[]).length>0&&(await f.git.stage(["."]),await w());const h=await f.git.generateCommitMessage(),I=typeof h=="string"?h:(h==null?void 0:h.message)||"";I?(M(I),x("success","Message generated")):x("error","No message returned")}catch(t){x("error",t.message)}finally{m(null)}}if(F)return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(K,{className:"h-5 w-5 animate-spin text-primary"})});const L=(r==null?void 0:r.files.filter(t=>t.staged))||[],_=(r==null?void 0:r.files.filter(t=>!t.staged))||[];return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(oe,{className:"h-4 w-4 text-mercury-400"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Source Control"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:U,disabled:!!l,children:e.jsx(Te,{className:"h-3 w-3"})}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:G,disabled:!!l,children:e.jsx(Qe,{className:"h-3 w-3"})}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>w(!0),disabled:!!l||d,title:"Refresh","aria-label":"Refresh",children:e.jsx(je,{className:N("h-3 w-3",d&&"animate-spin")})})]})]}),e.jsx(le,{className:"flex-1",children:e.jsxs("div",{className:"p-2 space-y-3",children:[e.jsx(te,{children:z&&e.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:N("rounded-md px-3 py-1.5 text-xs",z.type==="success"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"),children:z.msg})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("button",{onClick:()=>o(!g),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-muted/60",children:[e.jsx(oe,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"font-medium",children:(r==null?void 0:r.branch)||"—"}),r&&r.ahead>0&&e.jsxs(Q,{variant:"outline",className:"text-[10px] px-1 py-0",children:[e.jsx(ke,{className:"h-2.5 w-2.5 mr-0.5"}),r.ahead]}),r&&r.behind>0&&e.jsxs(Q,{variant:"outline",className:"text-[10px] px-1 py-0",children:[e.jsx(Ce,{className:"h-2.5 w-2.5 mr-0.5"}),r.behind]}),e.jsx(re,{className:N("ml-auto h-3 w-3 transition-transform",g&&"rotate-90")})]}),e.jsx(te,{children:g&&e.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsx("div",{className:"ml-2 space-y-0.5 border-l border-border/30 pl-2 py-1",children:C.filter(t=>!t.name.startsWith("remotes/")).map(t=>e.jsxs("button",{onClick:()=>!t.isCurrent&&V(t.name),className:N("flex w-full items-center gap-2 rounded-md px-2 py-1 text-xs transition-colors",t.isCurrent?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),disabled:t.isCurrent||!!l,children:[t.isCurrent&&e.jsx(ne,{className:"h-3 w-3"}),e.jsx("span",{className:"truncate",children:t.name})]},t.name))})})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"relative",children:[e.jsx("textarea",{value:y,onChange:t=>M(t.target.value),placeholder:"Commit message...",rows:2,className:N("w-full resize-none rounded-lg border border-border bg-muted/30 px-3 py-2 pr-9 text-sm text-foreground","placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-primary/40")}),e.jsx("button",{onClick:X,disabled:!!l,title:"AI generate commit message",className:N("absolute right-2 top-2 rounded-md p-1.5 transition-colors border border-border/50","text-primary/70 hover:text-primary hover:bg-primary/10 bg-background/80",l==="generate"&&"animate-pulse"),children:l==="generate"?e.jsx(K,{className:"h-4 w-4 animate-spin text-primary"}):e.jsx(Ee,{className:"h-4 w-4"})})]}),e.jsxs(T,{size:"sm",className:"w-full h-7 gap-1.5 text-xs",disabled:!y.trim()||L.length===0||!!l,onClick:O,children:[l==="commit"?e.jsx(K,{className:"h-3 w-3 animate-spin"}):e.jsx(ne,{className:"h-3 w-3"}),"Commit (",L.length," staged)"]})]}),L.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-1 mb-1",children:[e.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:["Staged (",L.length,")"]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>B(L.map(t=>t.path)),children:e.jsx(fe,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"space-y-0.5",children:L.map(t=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs hover:bg-muted/40 group",children:[ge(t.status),e.jsx("span",{className:"flex-1 truncate font-mono",children:t.path}),e.jsx("button",{onClick:()=>B([t.path]),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(fe,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},`staged-${t.path}`))})]}),_.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-1 mb-1",children:[e.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:["Changes (",_.length,")"]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>H(_.map(t=>t.path)),children:e.jsx(pe,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"space-y-0.5",children:_.map(t=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs hover:bg-muted/40 group",children:[ge(t.status),e.jsx("span",{className:"flex-1 truncate font-mono",children:t.path}),e.jsx("button",{onClick:()=>H([t.path]),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(pe,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},`unstaged-${t.path}`))})]}),L.length===0&&_.length===0&&e.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No changes detected"}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>W(!j),className:"flex w-full items-center gap-1.5 px-1 mb-1",children:[e.jsx(re,{className:N("h-3 w-3 text-muted-foreground transition-transform",j&&"rotate-90")}),e.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Recent Commits"})]}),e.jsx(te,{children:j&&e.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsx("div",{className:"space-y-0.5",children:i.map(t=>e.jsx("div",{className:"rounded-md px-2 py-1.5 hover:bg-muted/40 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ke,{className:"h-3 w-3 mt-0.5 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs text-foreground line-clamp-2 leading-snug",children:t.message}),e.jsxs("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:t.short}),e.jsx("span",{className:"mx-1",children:"·"}),t.date]})]})]})},t.hash))})})})]})]})})]})}function rt({projectInfo:r,codeMode:c,isMaximized:C,onToggleMaximize:S}){const[i,R]=a.useState("terminal"),[y,M]=a.useState([]),[g,o]=a.useState(""),[j,W]=a.useState(!1),[F,v]=a.useState([]),[d,b]=a.useState(-1),l=a.useRef(null),m=a.useRef(null),[z,E]=a.useState(""),{connected:w}=Se(),x=$(s=>s.streamingText),H=$(s=>s.isStreaming),B=$(s=>s.waiting),O=$(s=>s.messages),G=$(s=>s.addMessage),U=$(s=>s.setWaiting),V=$(s=>s.clearStreaming),X=$(s=>s.activeThreadId),L=$(s=>s.setActiveThread),_=$(s=>s.bumpThreadVersion),t=H||B;a.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[y]);async function h(){var k;const s=g.trim();if(!(!s||j)){o(""),v(P=>[...P,s]),b(-1),W(!0);try{const P=await f.terminal.exec(s);M(n=>[...n,{id:`${Date.now()}`,command:s,output:P.output||P.error||"",exitCode:P.exitCode,timestamp:Date.now()}])}catch(P){M(n=>[...n,{id:`${Date.now()}`,command:s,output:P.message,exitCode:1,timestamp:Date.now()}])}finally{W(!1),(k=m.current)==null||k.focus()}}}function I(s){if(s.key==="Enter")s.preventDefault(),h();else if(s.key==="ArrowUp"){if(s.preventDefault(),F.length>0){const k=d<0?F.length-1:Math.max(0,d-1);b(k),o(F[k])}}else if(s.key==="ArrowDown"&&(s.preventDefault(),d>=0)){const k=d+1;k>=F.length?(b(-1),o("")):(b(k),o(F[k]))}}async function q(){const s=z.trim();if(!s||t)return;E("");let k=X;k||(k=(await f.chat.threads.create()).id,L(k)),G({id:crypto.randomUUID(),role:"user",content:s,timestamp:new Date().toISOString()}),U(!0);try{await f.chat.send(s,k),_()}catch{U(!1),V()}}const Z=O.slice(-6);return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-muted/20 px-3 py-1 text-[11px]",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:c!=null&&c.active?e.jsxs(Q,{variant:"outline",className:N("text-[10px] px-1.5 py-0 gap-1",c.state==="execute"?"border-emerald-500/40 text-emerald-400":"border-amber-500/40 text-amber-400"),children:[e.jsx(Fe,{className:"h-2.5 w-2.5"}),c.state==="execute"?"Execute":"Plan"]}):e.jsx(Q,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-muted-foreground",children:"Chat"})}),e.jsx("span",{className:"h-3 w-px bg-border"}),r&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground font-mono truncate max-w-[200px]",children:r.projectName}),e.jsx("span",{className:"h-3 w-px bg-border"}),e.jsx("span",{className:"text-muted-foreground font-mono truncate max-w-[300px]",title:r.cwd,children:r.cwd}),r.isGit&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-3 w-px bg-border"}),e.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(oe,{className:"h-3 w-3"}),e.jsx("span",{className:"font-mono",children:r.branch})]})]})]}),e.jsx("span",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx("div",{className:N("h-1.5 w-1.5 rounded-full",w?"bg-emerald-500":"bg-red-500")}),e.jsx("span",{children:w?"Connected":"Disconnected"})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-muted/10",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{onClick:()=>R("terminal"),className:N("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium transition-colors border-b-2",i==="terminal"?"border-b-primary text-foreground":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[e.jsx(Re,{className:"h-3.5 w-3.5"}),"Terminal"]}),e.jsxs("button",{onClick:()=>R("chat"),className:N("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium transition-colors border-b-2",i==="chat"?"border-b-primary text-foreground":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),"Chat",t&&e.jsx(K,{className:"h-3 w-3 animate-spin text-primary"})]})]}),e.jsx("button",{onClick:S,className:"mr-2 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",title:C?"Restore panel":"Maximize panel","aria-label":C?"Restore panel":"Maximize panel",children:C?e.jsx(Xe,{className:"h-3.5 w-3.5"}):e.jsx(Oe,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:i==="terminal"?e.jsxs("div",{className:"flex h-full flex-col bg-[#0d1117]",children:[e.jsxs("div",{ref:l,className:"flex-1 overflow-auto p-2 font-mono text-[13px]",children:[y.map(s=>e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-emerald-400",children:"$"}),e.jsx("span",{className:"text-gray-200",children:s.command})]}),s.output&&e.jsx("pre",{className:N("whitespace-pre-wrap text-[12px] leading-relaxed mt-0.5 pl-4",s.exitCode===0?"text-gray-400":"text-red-400"),children:s.output})]},s.id)),j&&e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[e.jsx(K,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{className:"text-xs",children:"Running..."})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-gray-800 bg-[#0d1117] px-3 py-2",children:[e.jsx("span",{className:"text-emerald-400 font-mono text-sm",children:"$"}),e.jsx("input",{ref:m,value:g,onChange:s=>o(s.target.value),onKeyDown:I,placeholder:"Type a command...",className:"flex-1 bg-transparent font-mono text-[13px] text-gray-200 placeholder:text-gray-600 focus:outline-none",autoFocus:!0})]})]}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(le,{className:"flex-1 px-3 py-2",children:e.jsxs("div",{className:"space-y-2",children:[Z.map(s=>e.jsx("div",{className:N("rounded-lg px-3 py-2 text-sm",s.role==="user"?"bg-primary/10 text-foreground ml-8":s.role==="system"?"bg-red-500/10 text-red-400":"bg-muted text-foreground mr-8"),children:s.role==="assistant"?e.jsx(ue,{content:s.content}):e.jsx("p",{className:"whitespace-pre-wrap text-[13px]",children:s.content})},s.id)),H&&x&&e.jsxs("div",{className:"rounded-lg bg-muted px-3 py-2 mr-8",children:[e.jsx(ue,{content:x}),e.jsx("span",{className:"inline-block h-3.5 w-[2px] animate-pulse bg-primary ml-0.5"})]}),B&&!H&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-muted px-3 py-2 text-sm text-muted-foreground mr-8",children:[e.jsx(K,{className:"h-3.5 w-3.5 animate-spin text-primary"}),"Thinking..."]})]})}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-3 py-2",children:[e.jsx("input",{value:z,onChange:s=>E(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),q())},placeholder:"Ask Mercury...",disabled:t,className:N("flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/60 focus:outline-none",t&&"opacity-50")}),e.jsx(T,{size:"icon",className:"h-7 w-7 shrink-0",disabled:t||!z.trim(),onClick:q,children:e.jsx(Le,{className:"h-3.5 w-3.5"})})]})]})})]})}function Mt(){const[r,c]=a.useState([]),[C,S]=a.useState(null),[i,R]=a.useState(null),[y,M]=a.useState(null),[g,o]=a.useState(240),[j,W]=a.useState(280),[F,v]=a.useState(260),[d,b]=a.useState(!1),[l,m]=a.useState(!0),[z,E]=a.useState(!0),[w,x]=a.useState(!1),[H,B]=a.useState(""),[O,G]=a.useState(""),[U,V]=a.useState(!1),[X,L]=a.useState(0);a.useEffect(()=>{f.workspace.info().then(R).catch(()=>{}),f.code.status().then(n=>M({state:n.state,active:n.active})).catch(()=>{})},[]);async function _(){const n=H.trim();if(n){V(!0),G("");try{await f.workspace.setRoot(n);const u=await f.workspace.info();R(u),x(!1),B(""),c([]),S(null),L(p=>p+1)}catch(u){G(u.message||"Invalid path")}finally{V(!1)}}}async function t(n){if(r.find(p=>p.path===n)){S(n);return}try{const p=await f.workspace.file(n),D=p.ext||(n.includes(".")?"."+n.split(".").pop():""),ee={path:n,name:p.name,content:p.content,language:et(D),dirty:!1,originalContent:p.content};c(Y=>[...Y,ee]),S(n)}catch{}}function h(n){if(c(u=>u.filter(p=>p.path!==n)),C===n){const u=r.filter(p=>p.path!==n);S(u.length>0?u[u.length-1].path:null)}}async function I(n){const u=r.find(p=>p.path===n);if(!(!u||!u.dirty))try{await f.workspace.saveFile(n,u.content),c(p=>p.map(D=>D.path===n?{...D,dirty:!1,originalContent:D.content}:D))}catch{}}function q(n,u){c(p=>p.map(D=>D.path===n?{...D,content:u,dirty:u!==D.originalContent}:D))}function Z(n,u,p,D,ee=!1){const Y=a.useRef(!1);return{onMouseDown:a.useCallback(ae=>{ae.preventDefault(),Y.current=!0;const ce=n==="horizontal"?ae.clientX:ae.clientY;let de;u(J=>(de=J,J));function me(J){if(!Y.current)return;const he=n==="horizontal"?J.clientX-ce:ce-J.clientY,be=ee?-he:he;u(Math.min(D,Math.max(p,de+be)))}function xe(){Y.current=!1,document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",xe)}document.addEventListener("mousemove",me),document.addEventListener("mouseup",xe)},[n,u,p,D,ee])}}const s=Z("horizontal",o,160,400),k=Z("horizontal",W,200,450,!0),P=Z("vertical",v,120,500);return e.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-border bg-muted/20 px-4 py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(We,{className:"h-4 w-4 text-mercury-400"}),e.jsx("span",{className:"font-medium text-foreground",children:(i==null?void 0:i.projectName)||"Workspace"}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate max-w-[300px]",title:i==null?void 0:i.cwd,children:(i==null?void 0:i.cwd)||"—"})]}),e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{x(!w),B((i==null?void 0:i.cwd)||""),G("")},children:"Change Folder"}),e.jsx("span",{className:"flex-1"}),e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>m(!l),children:l?"Hide Explorer":"Show Explorer"}),e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>E(!z),children:z?"Hide Git":"Show Git"})]}),e.jsx(te,{children:w&&e.jsxs(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-muted/10 px-4 py-2",children:[e.jsx("input",{value:H,onChange:n=>{B(n.target.value),G("")},onKeyDown:n=>{n.key==="Enter"&&_(),n.key==="Escape"&&x(!1)},placeholder:"/path/to/project",className:"flex-1 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-mono text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/40",autoFocus:!0}),e.jsxs(T,{size:"sm",className:"h-7 gap-1 text-xs",onClick:_,disabled:U||!H.trim(),children:[U?e.jsx(K,{className:"h-3 w-3 animate-spin"}):e.jsx(ne,{className:"h-3 w-3"}),"Open"]}),e.jsx(T,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>x(!1),children:"Cancel"})]}),O&&e.jsx("p",{className:"px-4 pb-2 text-xs text-red-400",children:O})]})}),!d&&e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{width:g},className:"shrink-0 overflow-hidden border-r border-border",children:e.jsx(tt,{onOpenFile:t,openFiles:r.map(n=>n.path)},X)}),e.jsx("div",{...s,className:"w-1 shrink-0 cursor-col-resize hover:bg-primary/30 active:bg-primary/50 transition-colors"})]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsx(st,{tabs:r,activeTab:C,onSelectTab:S,onCloseTab:h,onSave:I,onContentChange:q})}),z&&e.jsx("div",{...k,className:"w-1 shrink-0 cursor-col-resize hover:bg-primary/30 active:bg-primary/50 transition-colors"}),z&&e.jsx("div",{style:{width:j},className:"shrink-0 overflow-hidden border-l border-border",children:e.jsx(at,{},X)})]}),!d&&e.jsx("div",{...P,className:"h-1 shrink-0 cursor-row-resize hover:bg-primary/30 active:bg-primary/50 transition-colors border-t border-border"}),e.jsx("div",{style:d?void 0:{height:F},className:N("overflow-hidden",d?"flex-1 min-h-0":"shrink-0"),children:e.jsx(rt,{projectInfo:i,codeMode:y,isMaximized:d,onToggleMaximize:()=>b(n=>!n)})})]})}export{Mt as WorkspacePage};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as t}from"./index-
|
|
1
|
+
import{e as t}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const a=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],e=t("activity",a);export{e as A};
|
|
7
|
-
//# sourceMappingURL=activity-MOTqH8zM.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as x,c as o}from"./index-
|
|
1
|
+
import{e as x,c as o}from"./index-B1xAjISP.js";import{j as s}from"./vendor-motion-Dwx3-JO5.js";import{r as l}from"./vendor-react-C7pctHW3.js";import{W as g,X as y,Y as N,Z as r,_ as d,$ as i,a0 as n,a1 as c,a2 as m}from"./vendor-radix-3UdfCgs_.js";import{b as p}from"./button-V3Fu7_kO.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const u=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],M=x("trash-2",u),V=g,_=y,A=N,f=l.forwardRef(({className:a,...e},t)=>s.jsx(m,{className:o("fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e,ref:t}));f.displayName=m.displayName;const D=l.forwardRef(({className:a,...e},t)=>s.jsxs(A,{children:[s.jsx(f,{}),s.jsx(r,{ref:t,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...e})]}));D.displayName=r.displayName;const j=({className:a,...e})=>s.jsx("div",{className:o("flex flex-col space-y-2 text-center sm:text-left",a),...e});j.displayName="AlertDialogHeader";const b=({className:a,...e})=>s.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});b.displayName="AlertDialogFooter";const w=l.forwardRef(({className:a,...e},t)=>s.jsx(d,{ref:t,className:o("text-lg font-semibold",a),...e}));w.displayName=d.displayName;const h=l.forwardRef(({className:a,...e},t)=>s.jsx(i,{ref:t,className:o("text-sm text-muted-foreground",a),...e}));h.displayName=i.displayName;const k=l.forwardRef(({className:a,...e},t)=>s.jsx(c,{ref:t,className:o(p(),a),...e}));k.displayName=c.displayName;const v=l.forwardRef(({className:a,...e},t)=>s.jsx(n,{ref:t,className:o(p({variant:"outline"}),"mt-2 sm:mt-0",a),...e}));v.displayName=n.displayName;export{V as A,M as T,D as a,j as b,w as c,h as d,b as e,v as f,k as g,_ as h};
|
|
7
|
-
//# sourceMappingURL=alert-dialog-MbYSbZx5.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e}from"./index-
|
|
1
|
+
import{e}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const o=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],r=e("arrow-left",o);export{r as A};
|
|
7
|
-
//# sourceMappingURL=arrow-left-CtqQsBC6.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as m,c as s}from"./index-
|
|
1
|
+
import{e as m,c as s}from"./index-B1xAjISP.js";import{j as l}from"./vendor-motion-Dwx3-JO5.js";import{r as c}from"./vendor-react-C7pctHW3.js";import{F as o,G as t,H as i}from"./vendor-radix-3UdfCgs_.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const f=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],h=m("circle-user",f),d=c.forwardRef(({className:a,...e},r)=>l.jsx(o,{ref:r,className:s("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",a),...e}));d.displayName=o.displayName;const n=c.forwardRef(({className:a,...e},r)=>l.jsx(i,{ref:r,className:s("aspect-square h-full w-full",a),...e}));n.displayName=i.displayName;const p=c.forwardRef(({className:a,...e},r)=>l.jsx(t,{ref:r,className:s("flex h-full w-full items-center justify-center rounded-full bg-muted",a),...e}));p.displayName=t.displayName;export{d as A,h as C,p as a};
|
|
7
|
-
//# sourceMappingURL=avatar-BIYaY7pR.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{j as o}from"./vendor-motion-Dwx3-JO5.js";import{r as n}from"./vendor-react-C7pctHW3.js";import{c as s}from"./index-
|
|
2
|
-
//# sourceMappingURL=badge-CUJiWF1y.js.map
|
|
1
|
+
import{j as o}from"./vendor-motion-Dwx3-JO5.js";import{r as n}from"./vendor-react-C7pctHW3.js";import{c as s}from"./index-CufYpqmV.js";import{c as d}from"./index-B1xAjISP.js";const i=s("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"text-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",success:"border-transparent bg-emerald-500/15 text-emerald-500 dark:bg-emerald-500/20 dark:text-emerald-400",warning:"border-transparent bg-amber-500/15 text-amber-600 dark:bg-amber-500/20 dark:text-amber-400"}},defaultVariants:{variant:"default"}}),m=n.forwardRef(({className:r,variant:e,...t},a)=>o.jsx("div",{ref:a,className:d(i({variant:e}),r),...t}));m.displayName="Badge";export{m as B};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{j as i}from"./vendor-motion-Dwx3-JO5.js";import{r as d}from"./vendor-react-C7pctHW3.js";import{a5 as c}from"./vendor-radix-3UdfCgs_.js";import{c as u}from"./index-
|
|
2
|
-
//# sourceMappingURL=button-CNasMlFE.js.map
|
|
1
|
+
import{j as i}from"./vendor-motion-Dwx3-JO5.js";import{r as d}from"./vendor-react-C7pctHW3.js";import{a5 as c}from"./vendor-radix-3UdfCgs_.js";import{c as u}from"./index-CufYpqmV.js";import{c as m}from"./index-B1xAjISP.js";const f=u("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),p=d.forwardRef(({className:e,variant:r,size:t,asChild:o=!1,...n},s)=>{const a=o?c:"button";return i.jsx(a,{className:m(f({variant:r,size:t,className:e})),ref:s,...n})});p.displayName="Button";export{p as B,f as b};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-motion-Dwx3-JO5.js";import{r as d}from"./vendor-react-C7pctHW3.js";import{c as o}from"./index-
|
|
2
|
-
//# sourceMappingURL=card-BdsEOP7t.js.map
|
|
1
|
+
import{j as s}from"./vendor-motion-Dwx3-JO5.js";import{r as d}from"./vendor-react-C7pctHW3.js";import{c as o}from"./index-B1xAjISP.js";const t=d.forwardRef(({className:a,...r},e)=>s.jsx("div",{ref:e,className:o("rounded-xl border border-border bg-card text-card-foreground shadow-sm transition-shadow hover:shadow-md",a),...r}));t.displayName="Card";const i=d.forwardRef(({className:a,...r},e)=>s.jsx("div",{ref:e,className:o("flex flex-col space-y-1.5 p-6",a),...r}));i.displayName="CardHeader";const m=d.forwardRef(({className:a,...r},e)=>s.jsx("div",{ref:e,className:o("font-semibold leading-none tracking-tight",a),...r}));m.displayName="CardTitle";const n=d.forwardRef(({className:a,...r},e)=>s.jsx("div",{ref:e,className:o("text-sm text-muted-foreground",a),...r}));n.displayName="CardDescription";const c=d.forwardRef(({className:a,...r},e)=>s.jsx("div",{ref:e,className:o("p-6 pt-0",a),...r}));c.displayName="CardContent";const f=d.forwardRef(({className:a,...r},e)=>s.jsx("div",{ref:e,className:o("flex items-center p-6 pt-0",a),...r}));f.displayName="CardFooter";export{t as C,i as a,m as b,c,n as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as o}from"./index-
|
|
1
|
+
import{e as o}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -9,4 +9,3 @@ import{e as o}from"./index-C3YiF4qv.js";/**
|
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/const e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],s=o("chevron-down",e);export{s as C,t as a};
|
|
12
|
-
//# sourceMappingURL=chevron-down-CB9J_vvZ.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as c}from"./index-
|
|
1
|
+
import{e as c}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],r=c("circle-check",e);export{r as C};
|
|
7
|
-
//# sourceMappingURL=circle-check-DvGSe1uZ.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as c}from"./index-
|
|
1
|
+
import{e as c}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],o=c("circle-x",e);export{o as C};
|
|
7
|
-
//# sourceMappingURL=circle-x-CyaGJ_BM.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{j as t}from"./vendor-motion-Dwx3-JO5.js";import{r as l}from"./vendor-react-C7pctHW3.js";import{j as p,m as d,k as g,l as i,n,D as r,O as c}from"./vendor-radix-3UdfCgs_.js";import{X as x,c as o}from"./index-
|
|
2
|
-
//# sourceMappingURL=dialog-Bd1rELXb.js.map
|
|
1
|
+
import{j as t}from"./vendor-motion-Dwx3-JO5.js";import{r as l}from"./vendor-react-C7pctHW3.js";import{j as p,m as d,k as g,l as i,n,D as r,O as c}from"./vendor-radix-3UdfCgs_.js";import{X as x,c as o}from"./index-B1xAjISP.js";const R=p,C=d,u=g,m=l.forwardRef(({className:a,...e},s)=>t.jsx(c,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));m.displayName=c.displayName;const y=l.forwardRef(({className:a,children:e,...s},f)=>t.jsxs(u,{children:[t.jsx(m,{}),t.jsxs(i,{ref:f,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(d,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=i.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const b=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});b.displayName="DialogFooter";const j=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));j.displayName=n.displayName;const D=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));D.displayName=r.displayName;export{R as D,y as a,N as b,j as c,D as d,b as e,C as f};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as o}from"./index-
|
|
1
|
+
import{e as o}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],d=o("download",a);export{d as D};
|
|
7
|
-
//# sourceMappingURL=download-C8RvlFqO.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e as c}from"./index-
|
|
1
|
+
import{e as c}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const e=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=c("eye",e);export{r as E};
|
|
7
|
-
//# sourceMappingURL=eye-BJ0NucMz.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{e}from"./index-
|
|
1
|
+
import{e}from"./index-B1xAjISP.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/const t=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],h=e("file-text",t);export{h as F};
|
|
7
|
-
//# sourceMappingURL=file-text-BWWBuD_N.js.map
|