@lovelybunch/api 1.0.76 → 1.0.77-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/terminal/terminal-manager.js +2 -1
- package/dist/routes/api/v1/events/status/route.d.ts +1 -1
- package/dist/routes/api/v1/jobs/[id]/route.d.ts +16 -16
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/route.d.ts +16 -16
- package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
- package/dist/routes/api/v1/mail/route.d.ts +3 -3
- package/dist/routes/api/v1/slack/route.d.ts +6 -6
- package/dist/routes/api/v1/tasks/[id]/route.d.ts +4 -4
- package/dist/routes/api/v1/tasks/[id]/steps/[stepId]/route.d.ts +2 -2
- package/dist/routes/api/v1/tasks/route.d.ts +1 -1
- package/dist/server-with-static.js +23 -17
- package/dist/server.js +1 -0
- package/package.json +24 -23
- package/static/assets/{ActivityPage-sJEQn6DK.js → ActivityPage-rASRHKYj.js} +1 -1
- package/static/assets/{AgentsContextEditPage-DU3qIXk9.js → AgentsContextEditPage-CMWD-7mS.js} +1 -1
- package/static/assets/{AgentsContextPage-tJ-LhFYb.js → AgentsContextPage-VfMmxxr6.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-Bg84BQHV.js → ApiKeysSettingsPage-DxtuyXwn.js} +1 -1
- package/static/assets/{AuthSettingsPage-Bwr7uP3z.js → AuthSettingsPage-CWTpS6BA.js} +2 -2
- package/static/assets/{CallbackPage-BFn0Np2S.js → CallbackPage-CjlTVuif.js} +1 -1
- package/static/assets/{CodePage-kp4s3wCJ.js → CodePage-DwjtGxQi.js} +1 -1
- package/static/assets/{CollapsibleSection-CNs1mvsZ.js → CollapsibleSection-LrQJlSxD.js} +1 -1
- package/static/assets/{DashboardPage-DMJSzzgD.js → DashboardPage-DnyFyDO0.js} +2 -2
- package/static/assets/{GitPage-uqene8zj.js → GitPage-o37iQMYQ.js} +1 -1
- package/static/assets/{GitSettingsPage-CLswbZsT.js → GitSettingsPage-O0fe5kxm.js} +1 -1
- package/static/assets/{IdentityPage-BDTPXEo7.js → IdentityPage-KWjruliO.js} +1 -1
- package/static/assets/{ImplementationStepsEditor-D4cvhPhz.js → ImplementationStepsEditor-h_Mxu1tF.js} +1 -1
- package/static/assets/{IntegrationsSettingsPage-o7NXZGt9.js → IntegrationsSettingsPage-DeFQd6af.js} +1 -1
- package/static/assets/{JobDetailPage-DuEiPz6X.js → JobDetailPage-HOLpF7Sx.js} +1 -1
- package/static/assets/{KnowledgeDetailPage-DFVud_VC.js → KnowledgeDetailPage-C5egPQ54.js} +1 -1
- package/static/assets/KnowledgeEditPage-DrdvEGuR.js +1 -0
- package/static/assets/{KnowledgePage-B2zI3xwW.js → KnowledgePage-CK5rtZcv.js} +1 -1
- package/static/assets/{LoginPage-CUJRxwXy.js → LoginPage-DajEouCN.js} +1 -1
- package/static/assets/MailInboxPage-CewILL7o.js +1 -0
- package/static/assets/{MailProcessingModal-BJIdHOqK.js → MailProcessingModal-B1ZLXyYl.js} +1 -1
- package/static/assets/MailReadPage--LnQ743i.js +1 -0
- package/static/assets/MailSentPage-BqO4iBq6.js +1 -0
- package/static/assets/{McpSettingsPage-BZcCGkGM.js → McpSettingsPage-BZ6GJOtk.js} +1 -1
- package/static/assets/{MemoryEditPage-DXSQoCT4.js → MemoryEditPage-BLfdKEDu.js} +1 -1
- package/static/assets/{MemoryPage-oBnyuvSf.js → MemoryPage-BV0RlvUS.js} +1 -1
- package/static/assets/{NewKnowledgePage-deMsezK8.js → NewKnowledgePage-SrBhXpH6.js} +1 -1
- package/static/assets/{NewSkillPage-DRYWdrlV.js → NewSkillPage-vt-0rIkv.js} +1 -1
- package/static/assets/{NewTaskPage-B6xdic5_.js → NewTaskPage-CBUpwIFP.js} +1 -1
- package/static/assets/{NotFoundPage-Bxu9uKFO.js → NotFoundPage-CWF5qOC0.js} +1 -1
- package/static/assets/{NotificationsSettingsPage-CLgtsCVM.js → NotificationsSettingsPage-3ZvMrqiq.js} +1 -1
- package/static/assets/{PromptsSettingsPage-BWaELCjG.js → PromptsSettingsPage-pHKoiUPI.js} +1 -1
- package/static/assets/{ResourceDetailPage-CMPDRdVM.js → ResourceDetailPage-CE4iDbv7.js} +1 -1
- package/static/assets/{ResourcesPage-DspYILfG.js → ResourcesPage-4_5NA4RF.js} +1 -1
- package/static/assets/{RoleEditPage-DXtzicVZ.js → RoleEditPage-4sSELIRX.js} +1 -1
- package/static/assets/{RolePage-DafGURGp.js → RolePage-Ds17xn4X.js} +1 -1
- package/static/assets/{RulesSettingsPage-E8V9cexV.js → RulesSettingsPage-DnyGaden.js} +1 -1
- package/static/assets/{RunDetailPage-DsxkqFst.js → RunDetailPage-D2ajvKfh.js} +1 -1
- package/static/assets/SchedulePage-oEGct1B1.js +4 -0
- package/static/assets/{SkillDetailPage-CWkqSfuT.js → SkillDetailPage-mSypV_JK.js} +1 -1
- package/static/assets/{SkillEditPage-DwyebzFV.js → SkillEditPage-DeI8uu3S.js} +1 -1
- package/static/assets/{SkillsPage-CauK65X_.js → SkillsPage-Bb_dEdun.js} +1 -1
- package/static/assets/{SkillsSettingsPage-DXMRv3jR.js → SkillsSettingsPage-CMWf2O9y.js} +1 -1
- package/static/assets/SourceInput-CtyUOXOG.js +1 -0
- package/static/assets/{TagInput-Ct-WRvTs.js → TagInput-C0NyMxlY.js} +1 -1
- package/static/assets/{TaskDetailPage-CApk2iBh.js → TaskDetailPage-6DDI0juh.js} +1 -1
- package/static/assets/{TaskEditPage-NgOVShfK.js → TaskEditPage-Btc1NXtR.js} +1 -1
- package/static/assets/{TasksPage-BoPrP_Rl.js → TasksPage-C9TYvqRz.js} +1 -1
- package/static/assets/{TeamEditPage-ChY6mYm8.js → TeamEditPage-CLvNy6Ss.js} +1 -1
- package/static/assets/{TeamPage-DH-dJhFG.js → TeamPage-DSWax4fa.js} +1 -1
- package/static/assets/{TerminalPage-CRhcscF2.js → TerminalPage-DNDHEYJZ.js} +1 -1
- package/static/assets/{TerminalSessionPage-CSCQg2sn.js → TerminalSessionPage-nNCw_oDE.js} +1 -1
- package/static/assets/{UserPreferencesPage-DxCSWJnS.js → UserPreferencesPage-jc1SA79x.js} +1 -1
- package/static/assets/{UserSettingsPage-DKkOLNPV.js → UserSettingsPage-pr6n15Pz.js} +1 -1
- package/static/assets/{UtilitiesPage-CBNSvixW.js → UtilitiesPage-CjLb989o.js} +1 -1
- package/static/assets/{alert-Dw_RSroN.js → alert-BtkLXQ3p.js} +1 -1
- package/static/assets/{arrow-down-UClxXzT-.js → arrow-down-DnNLmXEs.js} +1 -1
- package/static/assets/{arrow-left-DWmf9YJp.js → arrow-left-B9NBHEkS.js} +1 -1
- package/static/assets/{arrow-up-down-Btc3okb3.js → arrow-up-down-DIuMvAne.js} +1 -1
- package/static/assets/{arrow-up-fLCh7Hvh.js → arrow-up-eMUJY7J9.js} +1 -1
- package/static/assets/{badge-vIqE5SOP.js → badge-BbfU_aPt.js} +1 -1
- package/static/assets/{browser-modal-DgMJTsMd.js → browser-modal-J9l3o5os.js} +1 -1
- package/static/assets/{card-DPLdBoa5.js → card-CL5bB4cs.js} +1 -1
- package/static/assets/{chevron-left-CiNaLX-v.js → chevron-left-B-7K6MNx.js} +1 -1
- package/static/assets/{chevron-up-DFd-7wxW.js → chevron-up-BwTmMEW2.js} +1 -1
- package/static/assets/{chevrons-up-BfU70OcQ.js → chevrons-up-jI6nxhrz.js} +1 -1
- package/static/assets/{circle-alert-Mv00T-P2.js → circle-alert-vJFSz39V.js} +1 -1
- package/static/assets/{circle-check-xMiP6SLO.js → circle-check-D2LVHMl-.js} +1 -1
- package/static/assets/{circle-check-big-BEY1IoIP.js → circle-check-big-BwQ_q1N7.js} +1 -1
- package/static/assets/{circle-play-iZZwaGbV.js → circle-play-CLKDBkrK.js} +1 -1
- package/static/assets/{circle-x-z3iynaE7.js → circle-x-CuUVLiI-.js} +1 -1
- package/static/assets/{clipboard-C8wZRPDH.js → clipboard-BHOFelnW.js} +1 -1
- package/static/assets/{clock-C_9shc08.js → clock-D-X3KCw6.js} +1 -1
- package/static/assets/{code-DH-sRhus.js → code-DqYaanki.js} +1 -1
- package/static/assets/{download-CE8b59ER.js → download-DeEju9jg.js} +1 -1
- package/static/assets/{external-link-DPyKt8NE.js → external-link-CrRz0sU-.js} +1 -1
- package/static/assets/{eye-BpGD-yoS.js → eye-Cx9ZGkg5.js} +1 -1
- package/static/assets/{folder-git-2-BIw4zbmy.js → folder-git-2-Cizv1NA6.js} +1 -1
- package/static/assets/{globe-CUo7eHKN.js → globe-lpD9Jv31.js} +1 -1
- package/static/assets/{index-jaRIZ6SY.js → index-BCYTbJRb.js} +1 -1
- package/static/assets/{index-CTouvf2d.js → index-BL-5Bhtg.js} +1 -1
- package/static/assets/{index-BaR4iUzg.js → index-BPdWQ0rI.js} +1 -1
- package/static/assets/{index-B07hel4U.js → index-BVrOTqTm.js} +1 -1
- package/static/assets/{index-iB8oed57.js → index-BknCCMZK.js} +1 -1
- package/static/assets/{index-CpJ0uBf3.js → index-BvZJRqTz.js} +1 -1
- package/static/assets/{index-UXL5-kaP.js → index-ByTA2ZiD.js} +6 -6
- package/static/assets/{index-ClO9-JVh.js → index-CMaK0hpv.js} +1 -1
- package/static/assets/{index-Bkt1rQVV.js → index-CkT4WgqR.js} +1 -1
- package/static/assets/{index-DnZKG-_7.js → index-CuLP7P_G.js} +1 -1
- package/static/assets/{index-CsBxEWw5.js → index-D12O6wM3.js} +1 -1
- package/static/assets/{index-DZAYfTI2.js → index-DIt703WU.js} +1 -1
- package/static/assets/{index-CGbmjmEy.js → index-DK1gGyTZ.js} +1 -1
- package/static/assets/index-DVMcu9sQ.css +1 -0
- package/static/assets/{index-Bfb3OTwj.js → index-Dc9Njo8L.js} +1 -1
- package/static/assets/{index-BCwmQxLC.js → index-DgAcL75U.js} +1 -1
- package/static/assets/{index-C65b3D5_.js → index-Djzp98Vj.js} +1 -1
- package/static/assets/{index-BOKaM9K-.js → index-Dnj5cWsp.js} +1 -1
- package/static/assets/{index-Dkr9CBL7.js → index-Hy3cH93B.js} +1 -1
- package/static/assets/{index-Cdwx6Zps.js → index-ihWq-CVE.js} +1 -1
- package/static/assets/{info-D-UNBNx2.js → info-DxhTCbw1.js} +1 -1
- package/static/assets/{label-8VKluf9w.js → label-Dp0-28_O.js} +1 -1
- package/static/assets/{markdown-editor-DBdRsbP2.js → markdown-editor-DUmrf1eN.js} +3 -3
- package/static/assets/{message-square-CO8kDUed.js → message-square-BPOApeM3.js} +1 -1
- package/static/assets/{paperclip-DlLXZbru.js → paperclip-Bfjc1WLZ.js} +1 -1
- package/static/assets/{pause-zSiaxJBu.js → pause-Bfz-QQZp.js} +1 -1
- package/static/assets/{pipeline-builders-Bkf0wt_O.js → pipeline-builders-DrEjlsbH.js} +1 -1
- package/static/assets/{play-DVBhRokt.js → play-fOwEoIcu.js} +1 -1
- package/static/assets/{radio-group-CThYUcA4.js → radio-group-B8RB7N01.js} +1 -1
- package/static/assets/{refresh-cw-tXYl1ePu.js → refresh-cw-Cj_5MZiJ.js} +1 -1
- package/static/assets/{search-BxF7Wwex.js → search-BgbqRUnf.js} +1 -1
- package/static/assets/{select-CyHFRA1Y.js → select-CfwLZl55.js} +1 -1
- package/static/assets/{server-lRxThHjr.js → server-u9FLHclt.js} +1 -1
- package/static/assets/{switch-BUpDbrux.js → switch-CX_Inx_p.js} +1 -1
- package/static/assets/{tabs-DkvCmQEX.js → tabs-Bj0YyeRI.js} +1 -1
- package/static/assets/{tag-CkcZNLnh.js → tag-rYG4CdRx.js} +1 -1
- package/static/assets/terminal-preview-BNm5-Umi.js +1 -0
- package/static/assets/{triangle-alert-CmjG_mbF.js → triangle-alert-C0ovMJwZ.js} +1 -1
- package/static/assets/{use-terminal-D3iV7-iC.js → use-terminal-D1UnvAVs.js} +1 -1
- package/static/assets/{video-CY_dOujm.js → video-CuyRES-H.js} +1 -1
- package/static/index.html +2 -2
- package/static/assets/KnowledgeEditPage-XG6HKK7E.js +0 -1
- package/static/assets/MailInboxPage-BlCG-tba.js +0 -1
- package/static/assets/MailReadPage-MoNo_gmW.js +0 -1
- package/static/assets/MailSentPage-QzpuIJmT.js +0 -1
- package/static/assets/SchedulePage-B2YvNDHr.js +0 -4
- package/static/assets/SourceInput-C0iKqbQ1.js +0 -1
- package/static/assets/index-BcCuKdbf.css +0 -1
- package/static/assets/terminal-preview-CLWDhoOZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,be as E,al as K,af as T,j as a,ag as N,bg as U,aj as x,ak as C,bf as V,ai as g,b4 as z,ao as H,an as $,e as I,bC as W}from"./index-
|
|
1
|
+
import{r as n,be as E,al as K,af as T,j as a,ag as N,bg as U,aj as x,ak as C,bf as V,ai as g,b4 as z,ao as H,an as $,e as I,bC as W}from"./index-ByTA2ZiD.js";var w="Radio",[X,j]=N(w),[Y,J]=X(w),k=n.forwardRef((r,t)=>{const{__scopeRadio:e,name:d,checked:o=!1,required:s,disabled:i,value:p="on",onCheck:f,form:R,...v}=r,[l,m]=n.useState(null),c=C(t,y=>m(y)),u=n.useRef(!1),b=l?R||!!l.closest("form"):!0;return a.jsxs(Y,{scope:e,checked:o,disabled:i,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":S(o),"data-disabled":i?"":void 0,disabled:i,value:p,...v,ref:c,onClick:g(r.onClick,y=>{o||f?.(),b&&(u.current=y.isPropagationStopped(),u.current||y.stopPropagation())})}),b&&a.jsx(P,{control:l,bubbles:!u.current,name:d,value:p,checked:o,required:s,disabled:i,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=w;var _="RadioIndicator",G=n.forwardRef((r,t)=>{const{__scopeRadio:e,forceMount:d,...o}=r,s=J(_,e);return a.jsx(z,{present:d||s.checked,children:a.jsx(x.span,{"data-state":S(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});G.displayName=_;var Q="RadioBubbleInput",P=n.forwardRef(({__scopeRadio:r,control:t,checked:e,bubbles:d=!0,...o},s)=>{const i=n.useRef(null),p=C(i,s),f=H(e),R=$(t);return n.useEffect(()=>{const v=i.current;if(!v)return;const l=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(l,"checked").set;if(f!==e&&c){const u=new Event("click",{bubbles:d});c.call(v,e),v.dispatchEvent(u)}},[f,e,d]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:e,...o,tabIndex:-1,ref:p,style:{...o.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});P.displayName=Q;function S(r){return r?"checked":"unchecked"}var Z=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h="RadioGroup",[ee,de]=N(h,[E,j]),A=E(),D=j(),[oe,re]=ee(h),M=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,name:d,defaultValue:o,value:s,required:i=!1,disabled:p=!1,orientation:f,dir:R,loop:v=!0,onValueChange:l,...m}=r,c=A(e),u=K(R),[b,y]=T({prop:s,defaultProp:o??null,onChange:l,caller:h});return a.jsx(oe,{scope:e,name:d,required:i,disabled:p,value:b,onValueChange:y,children:a.jsx(U,{asChild:!0,...c,orientation:f,dir:u,loop:v,children:a.jsx(x.div,{role:"radiogroup","aria-required":i,"aria-orientation":f,"data-disabled":p?"":void 0,dir:u,...m,ref:t})})})});M.displayName=h;var O="RadioGroupItem",F=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,disabled:d,...o}=r,s=re(O,e),i=s.disabled||d,p=A(e),f=D(e),R=n.useRef(null),v=C(t,R),l=s.value===o.value,m=n.useRef(!1);return n.useEffect(()=>{const c=b=>{Z.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",c),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",c),document.removeEventListener("keyup",u)}},[]),a.jsx(V,{asChild:!0,...p,focusable:!i,active:l,children:a.jsx(k,{disabled:i,required:s.required,checked:l,...f,...o,name:s.name,ref:v,onCheck:()=>s.onValueChange(o.value),onKeyDown:g(c=>{c.key==="Enter"&&c.preventDefault()}),onFocus:g(o.onFocus,()=>{m.current&&R.current?.click()})})})});F.displayName=O;var ae="RadioGroupIndicator",L=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,...d}=r,o=D(e);return a.jsx(G,{...o,...d,ref:t})});L.displayName=ae;var q=M,B=F,te=L;const se=n.forwardRef(({className:r,...t},e)=>a.jsx(q,{className:I("grid gap-2",r),...t,ref:e}));se.displayName=q.displayName;const ne=n.forwardRef(({className:r,...t},e)=>a.jsx(B,{ref:e,className:I("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),...t,children:a.jsx(te,{className:"flex items-center justify-center",children:a.jsx(W,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ne.displayName=B.displayName;export{se as R,ne as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e,e as r,n as d,ad as y}from"./index-
|
|
1
|
+
import{r as o,j as e,e as r,n as d,ad as y}from"./index-ByTA2ZiD.js";import{R as N,V as g,T as n,I as j,P as b,C as i,a as S,b as c,d as v,c as R,e as m,f as p,L as f,S as x}from"./index-CuLP7P_G.js";import{C}from"./chevron-up-BwTmMEW2.js";const k=N,E=g,I=o.forwardRef(({className:t,children:s,...a},l)=>e.jsxs(n,{ref:l,className:r("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[s,e.jsx(j,{asChild:!0,children:e.jsx(d,{className:"h-4 w-4 opacity-50"})})]}));I.displayName=n.displayName;const u=o.forwardRef(({className:t,...s},a)=>e.jsx(m,{ref:a,className:r("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(C,{className:"h-4 w-4"})}));u.displayName=m.displayName;const h=o.forwardRef(({className:t,...s},a)=>e.jsx(p,{ref:a,className:r("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(d,{className:"h-4 w-4"})}));h.displayName=p.displayName;const B=o.forwardRef(({className:t,children:s,position:a="popper",...l},w)=>e.jsx(b,{children:e.jsxs(i,{ref:w,className:r("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...l,children:[e.jsx(u,{}),e.jsx(S,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(h,{})]})}));B.displayName=i.displayName;const T=o.forwardRef(({className:t,...s},a)=>e.jsx(f,{ref:a,className:r("px-2 py-1.5 text-sm font-semibold",t),...s}));T.displayName=f.displayName;const V=o.forwardRef(({className:t,children:s,...a},l)=>e.jsxs(c,{ref:l,className:r("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(v,{children:e.jsx(y,{className:"h-4 w-4"})})}),e.jsx(R,{children:s})]}));V.displayName=c.displayName;const z=o.forwardRef(({className:t,...s},a)=>e.jsx(x,{ref:a,className:r("-mx-1 my-1 h-px bg-muted",t),...s}));z.displayName=x.displayName;export{k as S,I as a,E as b,B as c,V as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e,e as i}from"./index-
|
|
1
|
+
import{r as c,j as e,e as i}from"./index-ByTA2ZiD.js";const d=c.forwardRef(({className:s,onCheckedChange:r,onChange:t,...o},n)=>{const l=a=>{t?.(a),r?.(a.target.checked)};return e.jsxs("label",{className:i("relative inline-flex cursor-pointer",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",onChange:l,ref:n,...o}),e.jsx("div",{className:"block bg-gray-300 w-9 h-5 rounded-full transition-colors duration-200 ease-in-out peer-checked:bg-blue-600"}),e.jsx("div",{className:"absolute left-0 top-0 bg-white w-4 h-4 rounded-full mt-0.5 ml-0.5 transition-transform duration-200 ease-in-out transform peer-checked:translate-x-4 shadow"})]})});d.displayName="Switch";export{d as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,al as F,af as $,j as c,ag as D,b2 as V,aj as g,be as y,bg as k,bf as G,ai as m,b4 as L,e as T}from"./index-
|
|
1
|
+
import{r as l,al as F,af as $,j as c,ag as D,b2 as V,aj as g,be as y,bg as k,bf as G,ai as m,b4 as L,e as T}from"./index-ByTA2ZiD.js";var p="Tabs",[K,Q]=D(p,[y]),h=y(),[B,x]=K(p),N=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,onValueChange:i,defaultValue:d,orientation:n="horizontal",dir:u,activationMode:b="automatic",...v}=e,r=F(u),[s,f]=$({prop:o,onChange:i,defaultProp:d??"",caller:p});return c.jsx(B,{scope:t,baseId:V(),value:s,onValueChange:f,orientation:n,dir:r,activationMode:b,children:c.jsx(g.div,{dir:r,"data-orientation":n,...v,ref:a})})});N.displayName=p;var C="TabsList",j=l.forwardRef((e,a)=>{const{__scopeTabs:t,loop:o=!0,...i}=e,d=x(C,t),n=h(t);return c.jsx(k,{asChild:!0,...n,orientation:d.orientation,dir:d.dir,loop:o,children:c.jsx(g.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:a})})});j.displayName=C;var I="TabsTrigger",R=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,disabled:i=!1,...d}=e,n=x(I,t),u=h(t),b=A(n.baseId,o),v=E(n.baseId,o),r=o===n.value;return c.jsx(G,{asChild:!0,...u,focusable:!i,active:r,children:c.jsx(g.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":v,"data-state":r?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:b,...d,ref:a,onMouseDown:m(e.onMouseDown,s=>{!i&&s.button===0&&s.ctrlKey===!1?n.onValueChange(o):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&n.onValueChange(o)}),onFocus:m(e.onFocus,()=>{const s=n.activationMode!=="manual";!r&&!i&&s&&n.onValueChange(o)})})})});R.displayName=I;var w="TabsContent",_=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,forceMount:i,children:d,...n}=e,u=x(w,t),b=A(u.baseId,o),v=E(u.baseId,o),r=o===u.value,s=l.useRef(r);return l.useEffect(()=>{const f=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(f)},[]),c.jsx(L,{present:i||r,children:({present:f})=>c.jsx(g.div,{"data-state":r?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":b,hidden:!f,id:v,tabIndex:0,...n,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:f&&d})})});_.displayName=w;function A(e,a){return`${e}-trigger-${a}`}function E(e,a){return`${e}-content-${a}`}var q=N,S=j,M=R,P=_;const U=q,z=l.forwardRef(({className:e,...a},t)=>c.jsx(S,{ref:t,className:T("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...a}));z.displayName=S.displayName;const H=l.forwardRef(({className:e,...a},t)=>c.jsx(M,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...a}));H.displayName=M.displayName;const O=l.forwardRef(({className:e,...a},t)=>c.jsx(P,{ref:t,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...a}));O.displayName=P.displayName;export{U as T,z as a,H as b,O as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,a3 as M,j as m}from"./index-ByTA2ZiD.js";import{x as T,a as k}from"./xterm-DTxiCjtJ.js";function B(n){if(!n||typeof n!="object")return!1;const i=n,u=i.type==="snapshot"||i.type==="data",l=i.data===void 0||typeof i.data=="string";return u&&l}function N({sessionId:n,className:i,heightPx:u=160,maxScrollback:l=200}){const b=t.useRef(null),v=t.useRef(null),w=t.useRef(null),x=t.useRef(null),[R,S]=t.useState(!0),c=t.useRef([]),a=t.useRef(null);return t.useEffect(()=>{const o=b.current;if(!o||!n)return;const e=new T.Terminal({disableStdin:!0,cursorBlink:!1,convertEol:!0,scrollback:Math.max(50,Math.min(l,1e3)),fontSize:12,fontFamily:"'IBM Plex Mono', 'Source Code Pro', 'Fira Code', ui-monospace, Menlo, Monaco, monospace",lineHeight:1.25,letterSpacing:.3,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}}),h=new k.FitAddon;e.loadAddon(h),e.open(o),o.style.height=`${u}px`,v.current=e,w.current=h;const f=()=>{try{const r=o.getBoundingClientRect();r.width>8&&r.height>8&&e.element&&h.fit()}catch{}},j=setTimeout(()=>f(),100),p=new ResizeObserver(()=>f());p.observe(o);const y=()=>{document.visibilityState==="visible"&&setTimeout(f,50)};document.addEventListener("visibilitychange",y);const d=new WebSocket(`${M}/ws/terminal-preview/${n}`);x.current=d,d.onopen=()=>S(!1);const E=()=>{a.current=null;const r=c.current;if(r.length){c.current=[];try{e.write(r.join(""))}catch{}}},F=()=>{a.current===null&&(a.current=requestAnimationFrame(E))};return d.onmessage=r=>{let g;try{g=JSON.parse(r.data)}catch{return}if(!B(g))return;const s=g;if(s?.type==="snapshot"){if(e.reset(),c.current=[],s.data)try{e.write(s.data)}catch{}f()}else s?.type==="data"&&s.data&&(c.current.push(String(s.data)),F())},()=>{clearTimeout(j),p.disconnect(),document.removeEventListener("visibilitychange",y);try{d.close()}catch{}a.current!==null&&cancelAnimationFrame(a.current),a.current=null,c.current=[],e.dispose()}},[n,u,l]),m.jsxs("div",{className:`relative w-full ${i||""}`.trim(),children:[R&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/60 z-10",children:m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading preview…"})}),m.jsx("div",{ref:b,className:"border border-muted rounded overflow-hidden"})]})}export{N as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,ac as v,A as f}from"./index-
|
|
1
|
+
import{r as i,ac as v,A as f}from"./index-ByTA2ZiD.js";function j(){const[y,p]=i.useState([]),[m,c]=i.useState(!1),[d,o]=i.useState(null),{refresh:w}=v(),S=i.useCallback(async(s,n)=>{try{c(!0),o(null);const e=await fetch(`${f}/api/v1/terminal/${s}/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({startupCommand:n})});if(!e.ok){const t=await e.json();throw new Error(t.error||"Failed to create terminal session")}const r=await e.json();return await w(),r.sessionId}catch(e){const r=e instanceof Error?e.message:"Unknown error";return o(r),null}finally{c(!1)}},[w]),g=i.useCallback(async s=>{try{c(!0),o(null);let n;if(s.startsWith("session-")){const r=s.split("-");n=`${r[0]}-${r[1]}`}else{const r=s.split("-");n=`${r[0]}-${r[1]}`}const e=await fetch(`${f}/api/v1/terminal/${n}/destroy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})});if(!e.ok){const r=await e.json();throw new Error(r.error||"Failed to destroy terminal session")}return p(r=>r.filter(t=>t.id!==s)),await w(),!0}catch(n){const e=n instanceof Error?n.message:"Unknown error";return o(e),!1}finally{c(!1)}},[w]),$=i.useCallback(async(s,n,e)=>{try{o(null);let r;if(s.startsWith("session-")){const a=s.split("-");r=`${a[0]}-${a[1]}`}else{const a=s.split("-");r=`${a[0]}-${a[1]}`}const t=await fetch(`${f}/api/v1/terminal/${r}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s,cols:n,rows:e})});if(!t.ok){const a=await t.json();throw new Error(a.error||"Failed to resize terminal session")}return!0}catch(r){const t=r instanceof Error?r.message:"Unknown error";return o(t),!1}},[]),k=i.useCallback(async(s,n,e)=>{try{c(!0),o(null);const r=new URLSearchParams;s&&r.set("taskId",s),n&&(r.set("withPreview","true"),e&&Number.isFinite(e)&&r.set("lines",String(e)));const t=`${f}/api/v1/terminal/sessions${r.toString()?`?${r.toString()}`:""}`,a=await fetch(t);if(!a.ok){const l=await a.json();throw new Error(l.error||"Failed to fetch terminal sessions")}const u=await a.json();p(u.sessions)}catch(r){const t=r instanceof Error?r.message:"Unknown error";o(t)}finally{c(!1)}},[]),E=i.useCallback(async(s,n=8)=>{try{o(null);const e=new URLSearchParams;e.set("sessionId",s),e.set("withPreview","true"),e.set("lines",String(n)),e.set("colorize","true");const r=`${f}/api/v1/terminal/sessions?${e.toString()}`,t=await fetch(r);if(!t.ok){const l=await t.json().catch(()=>({}));throw new Error(l.error||"Failed to fetch preview")}const a=await t.json(),u=Array.isArray(a?.sessions)&&a.sessions[0]?.preview?a.sessions[0].preview:[];return p(l=>l.map(h=>h.id===s?{...h,preview:u}:h)),u}catch(e){const r=e instanceof Error?e.message:"Unknown error";return o(r),[]}},[]);return{sessions:y,loading:m,error:d,createSession:S,destroySession:g,resizeSession:$,refreshSessions:k,fetchPreview:E}}export{j as u};
|
package/static/index.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
|
|
10
10
|
<title>Coconut - Agentic Development Environment</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-ByTA2ZiD.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DVMcu9sQ.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body class="font-inter">
|
|
15
15
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as $,u as z,a as B,r as a,A as E,j as e,v as S,B as h,L as M,a1 as D,X as K,I as R}from"./index-UXL5-kaP.js";import{C as d,a as l,b as x,c as p}from"./card-DPLdBoa5.js";import{L as g}from"./label-8VKluf9w.js";import{M as U}from"./markdown-editor-DBdRsbP2.js";import{T as _}from"./TagInput-Ct-WRvTs.js";import{n as H,S as J}from"./SourceInput-C0iKqbQ1.js";import{A as O}from"./arrow-left-DWmf9YJp.js";import"./index-DnZKG-_7.js";import"./badge-vIqE5SOP.js";import"./external-link-DPyKt8NE.js";function se(){const y=$(),i=z(),{toast:n}=B(),r=y.filename,[m,T]=a.useState(null),[L,b]=a.useState(!0),[u,f]=a.useState(!1),[o,j]=a.useState(""),[c,v]=a.useState(""),[w,N]=a.useState([]),[k,C]=a.useState([]);a.useEffect(()=>{r&&A()},[r]);const A=async()=>{try{const t=await(await fetch(`${E}/api/v1/knowledge/${r}`)).json();t.success?(T(t.document),j(t.document.title),v(t.document.content),N(t.document.metadata.tags||[]),C(H(t.document.metadata.sources))):(n({title:"Error",description:"Failed to load knowledge document",variant:"destructive"}),i("/knowledge"))}catch(s){console.error("Error fetching document:",s),n({title:"Error",description:"Failed to load knowledge document",variant:"destructive"}),i("/knowledge")}finally{b(!1)}},F=async()=>{if(m){if(!o.trim()){n({title:"Error",description:"Please provide a title for the knowledge document",variant:"destructive"});return}if(!c.trim()){n({title:"Error",description:"Please provide content for the knowledge document",variant:"destructive"});return}f(!0);try{const t=await(await fetch(`${E}/api/v1/knowledge/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:o.trim(),content:c.trim(),metadata:{tags:w,sources:k}})})).json();if(t.success){n({title:"Success",description:"Knowledge document updated successfully"});const P=t.document.filename.replace(".md","");i(`/knowledge/${P}`,{replace:!0})}else n({title:"Error",description:t.error||"Failed to update knowledge document",variant:"destructive"})}catch(s){console.error("Error updating document:",s),n({title:"Error",description:"Failed to update knowledge document",variant:"destructive"})}finally{f(!1)}}},I=()=>{i(`/knowledge/${r}`)};return L?e.jsx("div",{className:"space-y-6",children:e.jsx(d,{children:e.jsx(l,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(S,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading knowledge document..."})]})})})}):m?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Edit Document"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 truncate",children:m.filename})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(M,{to:"/knowledge",className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(O,{className:"h-4 w-4"})})}),e.jsxs(h,{onClick:F,disabled:u||!o.trim()||!c.trim(),size:"sm",children:[u?e.jsx(S,{className:"w-4 h-4 animate-spin sm:mr-2"}):e.jsx(D,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:u?"Saving...":"Save"})]}),e.jsxs(h,{onClick:I,variant:"outline",size:"sm",children:[e.jsx(K,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Cancel"})]})]})]}),e.jsxs(d,{children:[e.jsx(x,{children:e.jsx(p,{children:"Basic Information"})}),e.jsx(l,{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(g,{htmlFor:"title",children:"Title *"}),e.jsx(R,{id:"title",value:o,onChange:s=>j(s.target.value),placeholder:"Enter document title...",className:"text-lg"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Changing the title will rename the file"})]})})]}),e.jsxs(d,{children:[e.jsx(x,{children:e.jsx(p,{children:"Metadata"})}),e.jsxs(l,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(g,{children:"Tags"}),e.jsx(_,{tags:w,onChange:N,placeholder:"Add a tag"})]}),e.jsxs("div",{children:[e.jsx(g,{children:"Sources"}),e.jsx(J,{sources:k,onChange:C})]})]})]}),e.jsxs(d,{children:[e.jsx(x,{children:e.jsx(p,{children:"Content *"})}),e.jsx(l,{children:e.jsx(U,{value:c,onChange:s=>v(s||""),placeholder:"Enter your knowledge content in Markdown..."})})]})]}):null}export{se as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A,r as i,A as N,j as e,bL as D,B as v,bM as T,v as w,k,bN as L,n as R}from"./index-UXL5-kaP.js";import{C as y,a as C}from"./card-DPLdBoa5.js";import{B as j}from"./badge-vIqE5SOP.js";import{M as B}from"./MailProcessingModal-BJIdHOqK.js";import{R as U}from"./refresh-cw-tXYl1ePu.js";import{P as M}from"./paperclip-DlLXZbru.js";import{C as $}from"./chevron-up-DFd-7wxW.js";import{C as F}from"./clock-C_9shc08.js";import"./triangle-alert-CmjG_mbF.js";function O(a){if(!a)return"";try{const s=new Date(a),x=new Date().getTime()-s.getTime(),o=Math.floor(x/(1e3*60*60*24));return o===0?s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):o<7?s.toLocaleDateString("en-US",{weekday:"short",hour:"numeric",minute:"2-digit"}):s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return a}}function z(a){const s=a.match(/^([^<]+)\s*</);return s?s[1].trim():a.split("@")[0]||a}function _(a,s=120){const c=a.replace(/\n+/g," ").trim();return c.length<=s?c:c.slice(0,s)+"..."}function J({startedAt:a}){const[s,c]=i.useState("");return i.useEffect(()=>{function x(){const f=new Date(a).getTime(),h=Date.now(),m=Math.floor((h-f)/1e3);if(m<60)c(`${m}s`);else{const p=Math.floor(m/60),d=m%60;c(`${p}m ${d}s`)}}x();const o=setInterval(x,1e3);return()=>clearInterval(o)},[a]),e.jsxs("span",{className:"flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[e.jsx(F,{className:"h-3 w-3"}),s]})}function Z(){const{toast:a}=A(),[s,c]=i.useState([]),[x,o]=i.useState(!0),[f,h]=i.useState(null),[m,p]=i.useState(null),[d,g]=i.useState(null),l=i.useRef(null),u=i.useCallback(async(t=!1)=>{try{t||o(!0);const r=await(await fetch(`${N}/api/v1/mail/inbox`)).json();r.success&&c(r.data.messages||[])}catch(n){console.error("Failed to fetch inbox:",n)}finally{t||o(!1)}},[]);i.useEffect(()=>{u()},[u]),i.useEffect(()=>{const t=s.some(n=>n.processing);return t&&!l.current?l.current=setInterval(()=>u(!0),5e3):!t&&l.current&&(clearInterval(l.current),l.current=null),()=>{l.current&&(clearInterval(l.current),l.current=null)}},[s,u]);const S=async(t,n)=>{n.stopPropagation(),p(t);try{const b=await(await fetch(`${N}/api/v1/mail/${t}/status`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"read"})})).json();b.success?(c(P=>P.filter(E=>E.id!==t)),f===t&&h(null),a({title:"Marked as read",description:"Email moved to Read folder."})):a({title:"Error",description:b.error||"Failed to mark as read",variant:"destructive"})}catch{a({title:"Error",description:"Failed to mark as read",variant:"destructive"})}finally{p(null)}},I=d?s.find(t=>t.id===d):null;return x?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("h2",{className:"text-lg font-semibold",children:"Inbox"})}),[1,2,3].map(t=>e.jsx(D,{className:"h-20 w-full"},t))]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Inbox"}),s.length>0&&e.jsx(j,{variant:"secondary",children:s.length})]}),e.jsx(v,{variant:"ghost",size:"sm",onClick:()=>u(),children:e.jsx(U,{className:"h-4 w-4"})})]}),s.length===0?e.jsx(y,{children:e.jsxs(C,{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(T,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-muted-foreground",children:"No emails in inbox"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Incoming emails will appear here when received."})]})}):e.jsx("div",{className:"space-y-2",children:s.map(t=>{const n=f===t.id;return e.jsx(y,{className:"cursor-pointer transition-colors hover:bg-accent/50",onClick:()=>h(n?null:t.id),children:e.jsxs(C,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-semibold text-sm truncate",children:z(t.from)}),t.processing&&!t.action&&e.jsxs(j,{variant:"outline",className:"text-[10px] px-1.5 py-0 border-blue-300 text-blue-600 dark:border-blue-700 dark:text-blue-400 gap-1",children:[e.jsx(w,{className:"h-2.5 w-2.5 animate-spin"}),"Processing"]}),!t.processing&&t.action&&e.jsxs(j,{variant:"outline",className:"text-[10px] px-1.5 py-0 border-green-300 text-green-600 dark:border-green-700 dark:text-green-400 gap-1",children:[e.jsx(k,{className:"h-2.5 w-2.5"}),"Processed"]}),t.attachments.length>0&&e.jsx(M,{className:"h-3.5 w-3.5 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:O(t.receivedAt)})]}),e.jsx("p",{className:"text-sm font-medium truncate",children:t.subject}),!n&&t.content&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:_(t.content)})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(v,{variant:"ghost",size:"sm",onClick:r=>S(t.id,r),disabled:m===t.id,title:"Mark as read",children:e.jsx(L,{className:"h-4 w-4"})}),n?e.jsx($,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(R,{className:"h-4 w-4 text-muted-foreground"})]})]}),n&&e.jsxs("div",{className:"mt-4 pt-4 border-t space-y-3",children:[e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"From:"})," ",t.from]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"To:"})," ",t.to.join(", ")]}),t.cc.length>0&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"CC:"})," ",t.cc.join(", ")]})]}),t.attachments.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:t.attachments.map(r=>e.jsxs(j,{variant:"outline",className:"text-xs",children:[e.jsx(M,{className:"h-3 w-3 mr-1"}),r.filename]},r.id))}),e.jsx("div",{className:"text-sm whitespace-pre-wrap bg-muted/50 rounded-md p-3",children:t.content||e.jsx("span",{className:"text-muted-foreground italic",children:"No content"})}),t.processing&&!t.action&&e.jsx("button",{type:"button",className:"w-full text-left bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-lg p-3 text-sm cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-950/50 transition-colors",onClick:r=>{r.stopPropagation(),g(t.id)},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-blue-700 dark:text-blue-400 font-medium text-xs",children:[e.jsx(w,{className:"h-3.5 w-3.5 animate-spin"}),"Processing email..."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.processingStartedAt&&e.jsx(J,{startedAt:t.processingStartedAt}),e.jsx("span",{className:"text-blue-500 dark:text-blue-400 text-[10px] font-medium",children:"View details"})]})]})}),t.action&&e.jsxs("div",{className:"bg-green-50 dark:bg-green-950/30 border border-green-200 dark:border-green-800 rounded-lg p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium text-xs mb-1",children:[e.jsx(k,{className:"h-3.5 w-3.5"}),"Agent Action"]}),e.jsx("p",{className:"text-green-900 dark:text-green-200",children:t.action})]})]})]})},t.id)})}),d&&e.jsx(B,{open:!!d,onOpenChange:t=>{t||g(null)},mailId:d,subject:I?.subject||"",onStopped:()=>u(!0)})]})}export{Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as T,r as l,A as v,j as e,bL as A,B as w,bN as L,v as k,k as C,bM as R,H as $,n as B}from"./index-UXL5-kaP.js";import{C as E,a as M}from"./card-DPLdBoa5.js";import{B as g}from"./badge-vIqE5SOP.js";import{M as F}from"./MailProcessingModal-BJIdHOqK.js";import{R as U}from"./refresh-cw-tXYl1ePu.js";import{P as S}from"./paperclip-DlLXZbru.js";import{C as z}from"./chevron-up-DFd-7wxW.js";import{C as O}from"./clock-C_9shc08.js";import"./triangle-alert-CmjG_mbF.js";function _(a){if(!a)return"";try{const s=new Date(a),x=new Date().getTime()-s.getTime(),o=Math.floor(x/(1e3*60*60*24));return o===0?s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):o<7?s.toLocaleDateString("en-US",{weekday:"short",hour:"numeric",minute:"2-digit"}):s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return a}}function H(a){const s=a.match(/^([^<]+)\s*</);return s?s[1].trim():a.split("@")[0]||a}function J(a,s=120){const i=a.replace(/\n+/g," ").trim();return i.length<=s?i:i.slice(0,s)+"..."}function V({startedAt:a}){const[s,i]=l.useState("");return l.useEffect(()=>{function x(){const f=new Date(a).getTime(),p=Date.now(),d=Math.floor((p-f)/1e3);if(d<60)i(`${d}s`);else{const u=Math.floor(d/60),m=d%60;i(`${u}m ${m}s`)}}x();const o=setInterval(x,1e3);return()=>clearInterval(o)},[a]),e.jsxs("span",{className:"flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[e.jsx(O,{className:"h-3 w-3"}),s]})}function te(){const{toast:a}=T(),[s,i]=l.useState([]),[x,o]=l.useState(!0),[f,p]=l.useState(null),[d,u]=l.useState(null),[m,y]=l.useState(null),c=l.useRef(null),h=l.useCallback(async(t=!1)=>{try{t||o(!0);const n=await(await fetch(`${v}/api/v1/mail/read`)).json();n.success&&i(n.data.messages||[])}catch(r){console.error("Failed to fetch read mail:",r)}finally{t||o(!1)}},[]);l.useEffect(()=>{h()},[h]),l.useEffect(()=>{const t=s.some(r=>r.processing);return t&&!c.current?c.current=setInterval(()=>h(!0),5e3):!t&&c.current&&(clearInterval(c.current),c.current=null),()=>{c.current&&(clearInterval(c.current),c.current=null)}},[s,h]);const I=async(t,r)=>{r.stopPropagation(),u(t);try{const j=await(await fetch(`${v}/api/v1/mail/${t}/status`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"unread"})})).json();j.success?(i(b=>b.filter(N=>N.id!==t)),f===t&&p(null),a({title:"Moved to Inbox",description:"Email moved back to Inbox."})):a({title:"Error",description:j.error||"Failed to move email",variant:"destructive"})}catch{a({title:"Error",description:"Failed to move email",variant:"destructive"})}finally{u(null)}},P=async(t,r)=>{r.stopPropagation(),u(t);try{const j=await(await fetch(`${v}/api/v1/mail/read/${t}`,{method:"DELETE"})).json();j.success?(i(b=>b.filter(N=>N.id!==t)),f===t&&p(null),a({title:"Deleted",description:"Email has been deleted."})):a({title:"Error",description:j.error||"Failed to delete email",variant:"destructive"})}catch{a({title:"Error",description:"Failed to delete email",variant:"destructive"})}finally{u(null)}},D=m?s.find(t=>t.id===m):null;return x?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("h2",{className:"text-lg font-semibold",children:"Read"})}),[1,2,3].map(t=>e.jsx(A,{className:"h-20 w-full"},t))]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Read"}),s.length>0&&e.jsx(g,{variant:"secondary",children:s.length})]}),e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>h(),children:e.jsx(U,{className:"h-4 w-4"})})]}),s.length===0?e.jsx(E,{children:e.jsxs(M,{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(L,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-muted-foreground",children:"No read emails"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Emails marked as read will appear here."})]})}):e.jsx("div",{className:"space-y-2",children:s.map(t=>{const r=f===t.id;return e.jsx(E,{className:"cursor-pointer transition-colors hover:bg-accent/50",onClick:()=>p(r?null:t.id),children:e.jsxs(M,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-muted-foreground truncate",children:H(t.from)}),t.processing&&!t.action&&e.jsxs(g,{variant:"outline",className:"text-[10px] px-1.5 py-0 border-blue-300 text-blue-600 dark:border-blue-700 dark:text-blue-400 gap-1",children:[e.jsx(k,{className:"h-2.5 w-2.5 animate-spin"}),"Processing"]}),!t.processing&&t.action&&e.jsxs(g,{variant:"outline",className:"text-[10px] px-1.5 py-0 border-green-300 text-green-600 dark:border-green-700 dark:text-green-400 gap-1",children:[e.jsx(C,{className:"h-2.5 w-2.5"}),"Processed"]}),t.attachments.length>0&&e.jsx(S,{className:"h-3.5 w-3.5 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:_(t.receivedAt)})]}),e.jsx("p",{className:"text-sm truncate",children:t.subject}),!r&&t.content&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:J(t.content)})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(w,{variant:"ghost",size:"sm",onClick:n=>I(t.id,n),disabled:d===t.id,title:"Move to Inbox",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx(w,{variant:"ghost",size:"sm",onClick:n=>P(t.id,n),disabled:d===t.id,title:"Delete",className:"text-destructive hover:text-destructive",children:e.jsx($,{className:"h-4 w-4"})}),r?e.jsx(z,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(B,{className:"h-4 w-4 text-muted-foreground"})]})]}),r&&e.jsxs("div",{className:"mt-4 pt-4 border-t space-y-3",children:[e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"From:"})," ",t.from]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"To:"})," ",t.to.join(", ")]}),t.cc.length>0&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"CC:"})," ",t.cc.join(", ")]})]}),t.attachments.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:t.attachments.map(n=>e.jsxs(g,{variant:"outline",className:"text-xs",children:[e.jsx(S,{className:"h-3 w-3 mr-1"}),n.filename]},n.id))}),e.jsx("div",{className:"text-sm whitespace-pre-wrap bg-muted/50 rounded-md p-3",children:t.content||e.jsx("span",{className:"text-muted-foreground italic",children:"No content"})}),t.processing&&!t.action&&e.jsx("button",{type:"button",className:"w-full text-left bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-lg p-3 text-sm cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-950/50 transition-colors",onClick:n=>{n.stopPropagation(),y(t.id)},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-blue-700 dark:text-blue-400 font-medium text-xs",children:[e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}),"Processing email..."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.processingStartedAt&&e.jsx(V,{startedAt:t.processingStartedAt}),e.jsx("span",{className:"text-blue-500 dark:text-blue-400 text-[10px] font-medium",children:"View details"})]})]})}),t.action&&e.jsxs("div",{className:"bg-green-50 dark:bg-green-950/30 border border-green-200 dark:border-green-800 rounded-lg p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium text-xs mb-1",children:[e.jsx(C,{className:"h-3.5 w-3.5"}),"Agent Action"]}),e.jsx("p",{className:"text-green-900 dark:text-green-200",children:t.action})]})]})]})},t.id)})}),m&&e.jsx(F,{open:!!m,onOpenChange:t=>{t||y(null)},mailId:m,subject:D?.subject||"",onStopped:()=>h(!0)})]})}export{te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,A as j,j as e,bL as p,B as N,bF as g,n as w}from"./index-UXL5-kaP.js";import{C as m,a as x}from"./card-DPLdBoa5.js";import{B as h}from"./badge-vIqE5SOP.js";import{R as v}from"./refresh-cw-tXYl1ePu.js";import{P as u}from"./paperclip-DlLXZbru.js";import{C as y}from"./chevron-up-DFd-7wxW.js";function b(t){if(!t)return"";try{const a=new Date(t),i=new Date().getTime()-a.getTime(),l=Math.floor(i/(1e3*60*60*24));return l===0?a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):l<7?a.toLocaleDateString("en-US",{weekday:"short",hour:"numeric",minute:"2-digit"}):a.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return t}}function C(t,a=120){const r=t.replace(/\n+/g," ").trim();return r.length<=a?r:r.slice(0,a)+"..."}function M(){const[t,a]=c.useState([]),[r,i]=c.useState(!0),[l,f]=c.useState(null),o=c.useCallback(async()=>{try{i(!0);const n=await(await fetch(`${j}/api/v1/mail/sent`)).json();n.success&&a(n.data.messages||[])}catch(s){console.error("Failed to fetch sent mail:",s)}finally{i(!1)}},[]);return c.useEffect(()=>{o()},[o]),r?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("h2",{className:"text-lg font-semibold",children:"Sent"})}),[1,2,3].map(s=>e.jsx(p,{className:"h-20 w-full"},s))]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sent"}),t.length>0&&e.jsx(h,{variant:"secondary",children:t.length})]}),e.jsx(N,{variant:"ghost",size:"sm",onClick:o,children:e.jsx(v,{className:"h-4 w-4"})})]}),t.length===0?e.jsx(m,{children:e.jsxs(x,{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(g,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-muted-foreground",children:"No sent emails"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Replies and sent emails will appear here."})]})}):e.jsx("div",{className:"space-y-2",children:t.map(s=>{const n=l===s.id;return e.jsx(m,{className:"cursor-pointer transition-colors hover:bg-accent/50",onClick:()=>f(n?null:s.id),children:e.jsxs(x,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("span",{className:"text-sm text-muted-foreground truncate",children:["To: ",s.to.join(", ")]}),s.attachments.length>0&&e.jsx(u,{className:"h-3.5 w-3.5 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:b(s.receivedAt)})]}),e.jsx("p",{className:"text-sm truncate",children:s.subject}),!n&&s.content&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:C(s.content)})]}),e.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:n?e.jsx(y,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(w,{className:"h-4 w-4 text-muted-foreground"})})]}),n&&e.jsxs("div",{className:"mt-4 pt-4 border-t space-y-3",children:[e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"From:"})," ",s.from]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"To:"})," ",s.to.join(", ")]}),s.cc.length>0&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"CC:"})," ",s.cc.join(", ")]})]}),s.attachments.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:s.attachments.map(d=>e.jsxs(h,{variant:"outline",className:"text-xs",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),d.filename]},d.id))}),e.jsx("div",{className:"text-sm whitespace-pre-wrap bg-muted/50 rounded-md p-3",children:s.content||e.jsx("span",{className:"text-muted-foreground italic",children:"No content"})})]})]})},s.id)})})]})}export{M as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as Oe,ac as Le,r as u,j as e,B as m,v as P,P as ce,bI as oe,z as W,E as me,H as ue,J as U,N as _,O as q,Q as V,R as Y,U as G,V as K,L as T,k as Q,bJ as He,C as he,D as ze,b as Be,d as We,f as Ue,g as _e,I as X,a4 as xe,a5 as pe,n as ge,a6 as fe,a7 as ve,a8 as je,a9 as Ne,o as qe,aa as Ve,Y as Ye,A as v}from"./index-UXL5-kaP.js";import{C as R,a as Z,c as ee,b as be}from"./card-DPLdBoa5.js";import{B as E}from"./badge-vIqE5SOP.js";import{S as Ge,a as Ke,b as Qe,c as Xe,d as Ze}from"./select-CyHFRA1Y.js";import{L as f}from"./label-8VKluf9w.js";import{S as es}from"./switch-BUpDbrux.js";import{T as ss,a as ts,b as se,c as te}from"./tabs-DkvCmQEX.js";import{R as as}from"./refresh-cw-tXYl1ePu.js";import{P as ye}from"./play-DVBhRokt.js";import{P as rs}from"./pause-zSiaxJBu.js";import{C as ns}from"./clock-C_9shc08.js";import{S as we}from"./server-lRxThHjr.js";import"./index-DnZKG-_7.js";import"./chevron-up-DFd-7wxW.js";const ne=[{id:"claude",label:"Claude Code"},{id:"gemini",label:"Google Gemini"},{id:"codex",label:"OpenAI Codex"},{id:"droid",label:"Factory Droid"},{id:"kiro",label:"Kiro"}],is=[{label:"Monday",value:"monday"},{label:"Tuesday",value:"tuesday"},{label:"Wednesday",value:"wednesday"},{label:"Thursday",value:"thursday"},{label:"Friday",value:"friday"},{label:"Saturday",value:"saturday"},{label:"Sunday",value:"sunday"}],ke=["monday","tuesday","wednesday","thursday","friday"],ls=a=>{if(!a)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(a))}catch{return a}},ae=a=>{if(!a)return"—";const x=new Date(a).getTime()-Date.now(),g=Math.round(x/(1e3*60));if(Number.isNaN(g))return ls(a);if(Math.abs(g)<1)return"now";if(g>0){if(g<60)return`in ${g}m`;const N=Math.round(g/60);return N<24?`in ${N}h`:`in ${Math.round(N/24)}d`}const j=Math.abs(g);if(j<60)return`${j}m ago`;const D=Math.round(j/60);return D<24?`${D}h ago`:`${Math.round(D/24)}d ago`},ds=a=>{if(a.type==="interval"){const c=a.daysOfWeek.map(x=>x.slice(0,3).toUpperCase()).join(", ");return`Every ${a.hours}h (${c||"All days"})`}return a.description||`Cron: ${a.expression}`},cs=a=>{const c=ne.find(x=>x.id===a);return c?c.label:a},Se=a=>{switch(a){case"active":case"succeeded":return"default";case"paused":case"running":return"secondary";case"failed":return"destructive";default:return"outline"}},re=()=>({name:"",model:"claude",prompt:"",hours:6,daysOfWeek:new Set(ke),status:!0,anchorHour:"",agentIds:[],mcpServers:[]}),Ce=a=>{if(a.schedule.type!=="interval")return re();const c=a.agentIds||(a.agentId?[a.agentId]:[]);return{name:a.name,model:ne.some(x=>x.id===a.model)?a.model:"claude",prompt:a.prompt,hours:a.schedule.hours,daysOfWeek:new Set(a.schedule.daysOfWeek),status:a.status==="active",anchorHour:a.schedule.anchorHour===void 0?"":String(a.schedule.anchorHour),agentIds:c,mcpServers:a.mcpServers||[]}},os=a=>a?Array.isArray(a)?a.filter(c=>typeof c=="string").map(c=>c.trim()).filter(Boolean):typeof a=="string"?a.split(",").map(c=>c.trim()).filter(Boolean):[]:[];function Cs(){const{toast:a}=Oe(),{refresh:c}=Le(),[x,g]=u.useState([]),[j,D]=u.useState(!0),[J,N]=u.useState(!1),[$,b]=u.useState(!1),[n,p]=u.useState(()=>re()),[O,ie]=u.useState(!1),[y,w]=u.useState(null),[d,S]=u.useState(null),[F,Ae]=u.useState([]),[L,Ie]=u.useState([]),[H,z]=u.useState({open:!1,serverToRemove:null}),C=async(s=!1)=>{try{j||N(!0);const t=await fetch(`${v}/api/v1/jobs`);if(!t.ok)throw new Error(`Failed to fetch jobs (${t.status})`);const r=await t.json();if(!r?.success)throw new Error(r?.error?.message||"Unknown error loading jobs");const i=r.data??[];if(g(i),d){const l=i.find(o=>o.id===d.id);l&&(S(l),l.schedule.type!=="cron"&&p(Ce(l)))}s&&a({title:"Schedule refreshed",description:"Latest job information loaded."})}catch(t){console.error("Failed to load jobs:",t),a({title:"Failed to load schedule",description:t?.message??"Unknown error",variant:"destructive"})}finally{D(!1),N(!1)}};u.useEffect(()=>{C()},[]),u.useEffect(()=>{$&&(async()=>{try{const t=await fetch(`${v}/api/v1/agents`);if(t.ok){const i=await t.json(),o=(Array.isArray(i?.documents)?i.documents:[]).map(h=>({id:h.filename,name:h?.metadata?.name||h.title||h.filename,tools:os(h?.metadata?.tools)}));if(Ae(o),d){const A=(d.agentIds||(d.agentId?[d.agentId]:[])).filter(I=>!o.find(B=>B.id===I));A.length>0&&(a({title:"Some agents no longer available",description:`The following agents have been removed: ${A.join(", ")}`,variant:"destructive"}),p(I=>({...I,agentIds:I.agentIds.filter(B=>o.find(Je=>Je.id===B))})))}}const r=await fetch(`${v}/api/v1/mcp`);if(r.ok){const i=await r.json();if(i?.success&&Array.isArray(i.servers)&&(Ie(i.servers),d?.mcpServers)){const l=d.mcpServers.filter(o=>!i.servers.includes(o));l.length>0&&(a({title:"Some MCP servers are no longer available",description:`The following servers have been removed: ${l.join(", ")}`,variant:"destructive"}),p(o=>({...o,mcpServers:o.mcpServers.filter(h=>i.servers.includes(h))})))}}}catch(t){console.error("Failed to load agents or MCP servers:",t)}})()},[$,d,a]);const k=s=>{p(t=>({...t,...s}))},De=(s,t)=>{p(r=>{let i;if(t){i=[...r.agentIds,s];const l=F.find(o=>o.id===s);if(l&&l.tools.length>0){const o=new Set([...r.mcpServers,...l.tools]);return{...r,agentIds:i,mcpServers:Array.from(o).filter(h=>L.includes(h))}}}else i=r.agentIds.filter(l=>l!==s);return{...r,agentIds:i}})},Te=(s,t)=>{if(!t&&F.filter(i=>n.agentIds.includes(i.id)&&i.tools.includes(s)).length>0){z({open:!0,serverToRemove:s});return}p(r=>({...r,mcpServers:t?[...r.mcpServers,s]:r.mcpServers.filter(i=>i!==s)}))},$e=()=>{const s=H.serverToRemove;s&&p(t=>({...t,mcpServers:t.mcpServers.filter(r=>r!==s)})),z({open:!1,serverToRemove:null})},Fe=(s,t)=>{p(r=>{const i=new Set(r.daysOfWeek);return t?i.add(s):i.delete(s),i.size===0&&ke.forEach(l=>i.add(l)),{...r,daysOfWeek:i}})},M=()=>{p(re())},le=()=>{S(null),M(),b(!0)},Me=s=>{if(s._error){a({title:"Cannot edit corrupted job",description:"Please fix the job file manually at .nut/jobs/"+s.id+".md",variant:"destructive"});return}if(s.schedule.type==="cron"){a({title:"Manual edit required",description:"Cron-based jobs can be edited directly in .nut/jobs/<id>.md for now.",variant:"destructive"});return}S(s),p(Ce(s)),b(!0)},Pe=async s=>{if(s.preventDefault(),!n.name.trim()){a({title:"Job name required",description:"Please provide a name for the scheduled job.",variant:"destructive"});return}if(!n.prompt.trim()){a({title:"Prompt required",description:"Please provide instructions for the scheduled job.",variant:"destructive"});return}ie(!0);const t=!!d;try{const r=Number(n.anchorHour.trim()),i=n.anchorHour.trim()===""||Number.isNaN(r)?void 0:Math.min(23,Math.max(0,r)),l={name:n.name.trim(),prompt:n.prompt.trim(),model:n.model,status:n.status?"active":"paused",schedule:{type:"interval",hours:Math.max(1,Number(n.hours)||6),daysOfWeek:Array.from(n.daysOfWeek),anchorHour:i},agentIds:n.agentIds.length>0?n.agentIds:void 0,mcpServers:n.mcpServers.length>0?n.mcpServers:void 0},o=t?`${v}/api/v1/jobs/${d?.id}`:`${v}/api/v1/jobs`,A=await fetch(o,{method:t?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!A.ok){const I=await A.json().catch(()=>({}));throw new Error(I?.error?.message||`Failed to ${t?"update":"create"} job (${A.status})`)}a({title:t?"Scheduled job updated":"Scheduled job created",description:l.name}),b(!1),S(null),M(),await C()}catch(r){console.error("Failed to submit job:",r),a({title:`Failed to ${d?"update":"create"} job`,description:r?.message??"Unknown error",variant:"destructive"})}finally{ie(!1)}},Re=async s=>{if(s._error){a({title:"Cannot run corrupted job",description:"Please fix the job file manually at .nut/jobs/"+s.id+".md",variant:"destructive"});return}w(s.id);try{const t=await fetch(`${v}/api/v1/jobs/${s.id}/run`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r?.error?.message||`Failed to run job (${t.status})`)}a({title:"Run started",description:`${s.name} is executing.`}),await C(),await c()}catch(t){console.error("Failed to run job:",t),a({title:"Run failed to start",description:t?.message??"Unknown error",variant:"destructive"})}finally{w(null)}},Ee=async s=>{if(s._error){a({title:"Cannot update corrupted job",description:"Please fix the job file manually at .nut/jobs/"+s.id+".md",variant:"destructive"});return}w(s.id);const t=s.status==="active"?"paused":"active";try{const r=await fetch(`${v}/api/v1/jobs/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i?.error?.message||`Failed to update job (${r.status})`)}a({title:t==="active"?"Job resumed":"Job paused",description:s.name}),await C(),await c()}catch(r){console.error("Failed to update job status:",r),a({title:"Failed to update job",description:r?.message??"Unknown error",variant:"destructive"})}finally{w(null)}},de=async s=>{w(s.id);try{const t=await fetch(`${v}/api/v1/jobs/${s.id}`,{method:"DELETE"});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r?.error?.message||`Failed to delete job (${t.status})`)}a({title:"Scheduled job deleted",description:s.name}),d?.id===s.id&&(b(!1),S(null),M()),await C()}catch(t){console.error("Failed to delete job:",t),a({title:"Failed to delete job",description:t?.message??"Unknown error",variant:"destructive"})}finally{w(null)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Jobs"}),e.jsx("p",{className:"text-md text-muted-foreground",children:"Automate recurring agent runs"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(m,{variant:"outline",onClick:()=>C(!0),disabled:j||J,children:[J?e.jsx(P,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(as,{className:"mr-2 h-4 w-4"}),"Refresh"]}),e.jsxs(m,{onClick:le,children:[e.jsx(ce,{className:"mr-2 h-4 w-4"}),"New Scheduled Job"]})]})]}),j?e.jsx(R,{children:e.jsxs(Z,{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2 h-5 w-5 animate-spin"}),"Loading scheduled jobs..."]})}):x.length===0?e.jsx(R,{className:"border-dashed",children:e.jsxs(Z,{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("div",{className:"rounded-full bg-muted p-6 mb-6",children:e.jsx(oe,{className:"h-12 w-12 text-muted-foreground"})}),e.jsx(ee,{className:"text-2xl mb-3",children:"No scheduled jobs yet"}),e.jsx("p",{className:"text-muted-foreground max-w-md mb-6",children:"Automate recurring tasks by scheduling an agent to run on your behalf. Set up your first job to get started."}),e.jsxs("div",{className:"bg-accent/50 rounded-lg p-6 max-w-lg space-y-3 text-sm text-left",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-xs font-bold text-primary",children:"1"})}),e.jsx("p",{className:"text-muted-foreground",children:"Choose the days of the week and cadence that fit your workflow"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-xs font-bold text-primary",children:"2"})}),e.jsx("p",{className:"text-muted-foreground",children:"Provide detailed instructions so the agent can execute safely"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-xs font-bold text-primary",children:"3"})}),e.jsx("p",{className:"text-muted-foreground",children:"All runs are logged under for review"})]})]}),e.jsxs(m,{onClick:le,className:"mt-8",size:"lg",children:[e.jsx(ce,{className:"mr-2 h-5 w-5"}),"Create Your First Job"]})]})}):e.jsx("div",{className:"grid gap-4",children:x.map(s=>s._error?e.jsx(R,{className:"border-destructive/50 bg-destructive/5",children:e.jsx(be,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs(ee,{className:"text-lg truncate text-destructive",children:["Unable to load job: ",s.id]}),e.jsx(E,{variant:"destructive",className:"text-xs shrink-0",children:"Error"})]}),e.jsx("p",{className:"text-sm text-destructive/80 mt-1",children:s._error}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Please review the job file at ",e.jsxs("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:[".nut/jobs/",s.id,".md"]})]})]}),e.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:e.jsxs(W,{children:[e.jsx(me,{asChild:!0,children:e.jsx(m,{size:"sm",variant:"ghost",disabled:y===s.id,className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(ue,{className:"h-3.5 w-3.5"})})}),e.jsxs(U,{children:[e.jsxs(_,{children:[e.jsx(q,{children:"Delete corrupted job?"}),e.jsxs(V,{children:["This will remove the corrupted job file ",e.jsx("strong",{children:s.id}),". This action cannot be undone."]})]}),e.jsxs(Y,{children:[e.jsx(G,{children:"Cancel"}),e.jsx(K,{onClick:()=>de(s),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})})]})})},s.id):e.jsxs(R,{className:"group relative overflow-hidden border-border hover:border-primary/50 transition-all hover:shadow-lg",children:[e.jsx(be,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(T,{to:`/schedule/${s.id}`,className:"hover:underline",children:e.jsx(ee,{className:"text-lg truncate",children:s.name})}),e.jsx(E,{variant:Se(s.status),className:"capitalize text-xs shrink-0",children:s.status})]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:s.description||s.prompt||"No description provided"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(m,{size:"sm",variant:"default",onClick:()=>Re(s),disabled:y===s.id,className:"h-8 px-3",children:y===s.id?e.jsx(P,{className:"h-3.5 w-3.5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{className:"mr-1.5 h-3.5 w-3.5"}),"Run"]})}),e.jsx(m,{size:"sm",variant:"outline",asChild:!0,className:"h-8 px-3 text-xs",children:e.jsx(T,{to:`/schedule/${s.id}`,children:"View"})}),e.jsx(m,{size:"sm",variant:"outline",onClick:()=>Me(s),disabled:y===s.id,className:"h-8 px-3 text-xs",children:"Edit"}),e.jsx(m,{size:"sm",variant:"outline",onClick:()=>Ee(s),disabled:y===s.id,className:"h-8 px-2",children:s.status==="active"?e.jsx(rs,{className:"h-3.5 w-3.5"}):e.jsx(ye,{className:"h-3.5 w-3.5"})}),e.jsxs(W,{children:[e.jsx(me,{asChild:!0,children:e.jsx(m,{size:"sm",variant:"ghost",disabled:y===s.id,className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(ue,{className:"h-3.5 w-3.5"})})}),e.jsxs(U,{children:[e.jsxs(_,{children:[e.jsx(q,{children:"Delete scheduled job?"}),e.jsxs(V,{children:["This will remove ",e.jsx("strong",{children:s.name}),". Existing run logs will remain in ",e.jsx("code",{children:".nut/jobs/logs"}),"."]})]}),e.jsxs(Y,{children:[e.jsx(G,{children:"Cancel"}),e.jsx(K,{onClick:()=>de(s),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]})}),e.jsxs(Z,{className:"space-y-3 pt-0",children:[e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-md bg-accent/30",children:[e.jsx(ns,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("div",{className:"min-w-0",children:e.jsx("div",{className:"font-semibold truncate",children:ds(s.schedule)})})]}),e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-md bg-accent/30",children:[e.jsx(Q,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("div",{className:"font-semibold",children:cs(s.model)})]}),e.jsx("div",{className:"flex items-center gap-2 p-2 rounded-md bg-accent/30",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-bold",children:"Next"}),e.jsx("div",{className:"font-semibold truncate",children:ae(s.metadata.nextRunAt)})]})}),e.jsx("div",{className:"flex items-center gap-2 p-2 rounded-md bg-accent/30",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-bold",children:"Last"}),e.jsx("div",{className:"font-semibold truncate",children:ae(s.metadata.lastRunAt)})]})})]}),(s.agentIds&&s.agentIds.length>0||s.agentId||s.mcpServers&&s.mcpServers.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[(s.agentIds||(s.agentId?[s.agentId]:[])).map(t=>e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800",children:[e.jsx(Q,{className:"h-3 w-3 text-blue-600 dark:text-blue-400"}),e.jsx("span",{className:"font-medium text-blue-900 dark:text-blue-100",children:t.replace(".md","")})]},t)),s.mcpServers&&s.mcpServers.length>0&&s.mcpServers.map(t=>e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-purple-50 dark:bg-purple-950/20 border border-purple-200 dark:border-purple-800",children:[e.jsx(we,{className:"h-3 w-3 text-purple-600 dark:text-purple-400"}),e.jsx("span",{className:"font-medium text-purple-900 dark:text-purple-100",children:t})]},t))]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[e.jsx(He,{className:"h-3 w-3"}),"Recent Runs"]}),s.runs.length>1&&e.jsx(m,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",asChild:!0,children:e.jsxs(T,{to:`/schedule/${s.id}`,children:["View All (",s.runs.length,")",e.jsx(he,{className:"ml-1 h-3 w-3"})]})})]}),s.runs.length===0?e.jsx("div",{className:"rounded-md border border-dashed bg-muted/20 p-4 text-center text-xs text-muted-foreground",children:'No runs yet • Click "Run" to execute'}):e.jsxs("div",{className:"space-y-1.5",children:[s.runs.slice(0,3).map(t=>e.jsxs(T,{to:`/schedule/${s.id}/run/${t.id}`,className:"flex items-center gap-2 p-2.5 rounded-md border bg-card/50 hover:bg-accent/50 transition-colors text-xs group",children:[e.jsx(E,{variant:Se(t.status),className:"capitalize text-[10px] h-5 shrink-0",children:t.status}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-muted-foreground truncate",children:ae(t.startedAt)}),t.error&&e.jsx("p",{className:"text-destructive font-medium mt-0.5 line-clamp-1",children:t.error})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[t.trigger==="manual"&&e.jsx(E,{variant:"outline",className:"text-[10px] h-5",children:"manual"}),e.jsx(he,{className:"h-3 w-3 text-muted-foreground group-hover:text-foreground transition-colors"})]})]},t.id)),s.runs.length>3&&e.jsx(m,{variant:"ghost",size:"sm",className:"w-full h-7 text-xs",asChild:!0,children:e.jsxs(T,{to:`/schedule/${s.id}`,children:["+",s.runs.length-3," more runs"]})})]})]})]})]},s.id))}),e.jsx(ze,{open:$,onOpenChange:s=>{b(s),s||(S(null),M())},children:e.jsxs(Be,{className:"max-w-4xl h-[700px] overflow-hidden flex flex-col",children:[e.jsxs(We,{className:"space-y-2 pb-4 shrink-0",children:[e.jsxs(Ue,{className:"text-xl flex items-center gap-2",children:[e.jsx(oe,{className:"h-5 w-5 text-primary"}),d?"Edit Scheduled Job":"Create New Scheduled Job"]}),e.jsx(_e,{className:"text-sm",children:d?"Update the prompt, cadence, or agent preference":"Automate recurring tasks by scheduling an agent"})]}),e.jsxs("form",{onSubmit:Pe,className:"flex flex-col flex-1 min-h-0",children:[e.jsxs(ss,{defaultValue:"basics",className:"flex-1 flex flex-col min-h-0",children:[e.jsxs(ts,{className:"grid w-full grid-cols-3 mb-4 shrink-0",children:[e.jsx(se,{value:"basics",children:"Basics"}),e.jsx(se,{value:"schedule",children:"Schedule"}),e.jsx(se,{value:"advanced",children:"Advanced"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto pr-2 -mr-2 min-h-0",children:[e.jsxs(te,{value:"basics",className:"space-y-5 mt-0",children:[e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(f,{htmlFor:"job-name",className:"text-sm font-medium flex items-center gap-1.5",children:["Job Name",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(X,{id:"job-name",placeholder:"e.g., Publish docs nightly",value:n.name,onChange:s=>k({name:s.target.value}),className:"h-11",required:!0})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx(f,{htmlFor:"job-model",className:"text-sm font-medium",children:"AI Model"}),e.jsxs(Ge,{value:n.model,onValueChange:s=>k({model:s}),children:[e.jsx(Ke,{id:"job-model",className:"h-11",children:e.jsx(Qe,{placeholder:"Select a model"})}),e.jsx(Xe,{children:ne.map(s=>e.jsx(Ze,{value:s.id,children:s.label},s.id))})]})]})]}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(f,{className:"text-sm font-medium flex items-center gap-1.5",children:[e.jsx(Q,{className:"h-4 w-4"}),"Skills",e.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"(optional)"})]}),e.jsxs(xe,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(m,{variant:"outline",className:"w-full h-11 justify-between font-normal",children:[n.agentIds.length===0?"No agents selected":`${n.agentIds.length} agent${n.agentIds.length!==1?"s":""} selected`,e.jsx(ge,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(fe,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsx(ve,{children:"Available Agents"}),e.jsx(je,{}),F.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No agents configured"}):F.map(s=>e.jsx(Ne,{checked:n.agentIds.includes(s.id),onCheckedChange:t=>De(s.id,t),children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:s.name}),s.tools.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP: ",s.tools.join(", ")]})]})},s.id))]})]})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(f,{className:"text-sm font-medium flex items-center gap-1.5",children:[e.jsx(we,{className:"h-4 w-4"}),"MCP Servers",e.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"(optional)"})]}),e.jsxs(xe,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(m,{variant:"outline",className:"w-full h-11 justify-between font-normal",children:[n.mcpServers.length===0?"No MCP servers selected":`${n.mcpServers.length} server${n.mcpServers.length!==1?"s":""} selected`,e.jsx(ge,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(fe,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsx(ve,{children:"Available MCP Servers"}),e.jsx(je,{}),L.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No MCP servers configured"}):L.map(s=>e.jsx(Ne,{checked:n.mcpServers.includes(s),onCheckedChange:t=>Te(s,t),children:s},s))]})]})]})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(f,{htmlFor:"job-prompt",className:"text-sm font-medium flex items-center gap-1.5",children:[n.agentIds.length>0?"Custom Instructions":"Instructions",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(qe,{id:"job-prompt",placeholder:n.agentIds.length>0?`Additional instructions to supplement the agent's predefined behavior...
|
|
2
|
-
Example: Focus on performance optimizations`:`Example:
|
|
3
|
-
Run the following command and append the output to .nut/knowledge/runs.md:
|
|
4
|
-
pnpm docs:publish`,rows:6,value:n.prompt,onChange:s=>k({prompt:s.target.value}),className:"resize-none font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-start gap-1.5",children:[e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:"⚠"}),e.jsx("span",{children:n.agentIds.length>0?"These custom instructions will be combined with the selected agents' predefined instructions. Jobs run with autonomous permissions.":"Provide clear, actionable instructions. Jobs run with autonomous permissions - include safety checks where needed."})]})]})]}),e.jsx(te,{value:"schedule",className:"space-y-5 mt-0",children:e.jsxs("div",{className:"grid gap-6 md:grid-cols-[1.2fr_1fr]",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(f,{className:"text-sm font-medium",children:"Days of the Week"}),e.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:is.map(s=>e.jsxs("label",{className:"flex items-center gap-2.5 text-sm rounded-md border border-input px-3.5 py-2.5 cursor-pointer hover:bg-accent/50 transition-colors",children:[e.jsx(Ve,{checked:n.daysOfWeek.has(s.value),onCheckedChange:t=>Fe(s.value,t)}),e.jsx("span",{className:"font-medium",children:s.label})]},s.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Select which days the job should run"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2.5",children:[e.jsx(f,{htmlFor:"job-hours",className:"text-sm font-medium",children:"Frequency (hours)"}),e.jsxs("div",{className:"relative",children:[e.jsx(X,{id:"job-hours",type:"number",min:1,value:n.hours,onChange:s=>k({hours:Number(s.target.value)||1}),className:"h-11 pr-16"}),e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"hours"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"How often the job runs on selected days"})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(f,{htmlFor:"job-anchor",className:"text-sm font-medium flex items-center gap-1.5",children:["Start Hour",e.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"(optional)"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(X,{id:"job-anchor",type:"number",min:0,max:23,placeholder:"Auto",value:n.anchorHour,onChange:s=>k({anchorHour:s.target.value}),className:"h-11"}),e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"0-23"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Preferred starting hour in 24h format"})]})]})]})}),e.jsx(te,{value:"advanced",className:"space-y-5 mt-0",children:e.jsxs("div",{className:"flex items-start gap-4 rounded-lg border border-border bg-accent/20 p-4",children:[e.jsx(es,{id:"job-status",checked:n.status,onCheckedChange:s=>k({status:s}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsx(f,{htmlFor:"job-status",className:"text-base font-semibold cursor-pointer",children:n.status?"Start Active":"Start Paused"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.status?"Job will begin running on the configured schedule immediately after creation.":"Job will be created in a paused state. You can activate it later from the schedule page."})]})]})})]})]}),e.jsxs(Ye,{className:"gap-2 sm:gap-2 pt-4 border-t mt-4",children:[e.jsx(m,{type:"button",variant:"outline",onClick:()=>b(!1),disabled:O,className:"min-w-24",children:"Cancel"}),e.jsx(m,{type:"submit",disabled:O||!n.name.trim()||!n.prompt.trim(),className:"min-w-32",children:O?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"mr-2 h-4 w-4 animate-spin"}),d?"Saving...":"Creating..."]}):e.jsx(e.Fragment,{children:d?"Save Changes":"Create Job"})})]})]})]})}),e.jsx(W,{open:H.open,onOpenChange:s=>{s||z({open:!1,serverToRemove:null})},children:e.jsxs(U,{children:[e.jsxs(_,{children:[e.jsx(q,{children:"Remove MCP Server?"}),e.jsxs(V,{children:["One or more selected agents require the ",e.jsx("strong",{children:H.serverToRemove})," MCP server. Removing it may lead to unexpected consequences when the job runs."]})]}),e.jsxs(Y,{children:[e.jsx(G,{children:"Cancel"}),e.jsx(K,{onClick:$e,children:"OK"})]})]})})]})}export{Cs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as h,j as t,I as x,B as d,P as j,X as N}from"./index-UXL5-kaP.js";import{E as v}from"./external-link-DPyKt8NE.js";function g(n){return typeof n=="string"?n.startsWith("http://")||n.startsWith("https://")?{title:n,url:n}:{title:n}:n}function S(n){return n?n.map(g):[]}function k({sources:n,onChange:i,disabled:a}){const[l,m]=h.useState(""),[o,c]=h.useState(""),u=()=>{const e=l.trim();if(!e)return;const s=o.trim()||void 0,r={title:e,url:s};i([...n,r]),m(""),c("")},f=e=>{i(n.filter((s,r)=>r!==e))},p=e=>{e.key==="Enter"&&(e.preventDefault(),u())};return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[t.jsx(x,{placeholder:"Source title (e.g., Design System Audit)",value:l,onChange:e=>m(e.target.value),onKeyDown:p,disabled:a,className:"flex-1"}),t.jsx(x,{placeholder:"URL (optional)",value:o,onChange:e=>c(e.target.value),onKeyDown:p,disabled:a,className:"flex-1",type:"url"}),t.jsxs(d,{type:"button",variant:"outline",onClick:u,disabled:a||!l.trim(),className:"shrink-0",children:[t.jsx(j,{className:"h-4 w-4 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:"Add"})]})]}),n.length>0&&t.jsx("ul",{className:"space-y-2",children:n.map((e,s)=>t.jsxs("li",{className:"flex items-start gap-2 rounded-md border bg-muted/50 p-2 text-sm",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium truncate",children:e.title}),e.url&&t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-primary flex items-center gap-1 truncate",children:[t.jsx(v,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:e.url})]})]}),t.jsx(d,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(s),disabled:a,className:"h-6 w-6 p-0 shrink-0","aria-label":`Remove source ${e.title}`,children:t.jsx(N,{className:"h-3 w-3"})})]},s))})]})}export{k as S,S as n};
|