@lovelybunch/api 1.0.76-alpha.9 → 1.0.76
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/git.d.ts +3 -0
- package/dist/lib/git.js +35 -0
- package/dist/routes/api/v1/ai/route.js +214 -152
- package/dist/routes/api/v1/config/route.js +13 -9
- package/dist/routes/api/v1/context/agents/route.d.ts +3 -0
- package/dist/routes/api/v1/context/agents/route.js +159 -0
- package/dist/routes/api/v1/context/index.js +6 -4
- package/dist/routes/api/v1/context/memory/route.d.ts +3 -0
- package/dist/routes/api/v1/context/memory/route.js +163 -0
- package/dist/routes/api/v1/context/team/route.d.ts +3 -0
- package/dist/routes/api/v1/context/team/route.js +159 -0
- package/dist/routes/api/v1/git/index.js +27 -1
- package/dist/routes/api/v1/jobs/[id]/route.d.ts +26 -32
- package/dist/routes/api/v1/jobs/[id]/route.js +3 -3
- package/dist/routes/api/v1/jobs/route.d.ts +33 -33
- package/dist/routes/api/v1/jobs/route.js +17 -2
- package/dist/routes/api/v1/mcp/index.js +194 -21
- package/dist/routes/api/v1/resources/generate/route.js +10 -3
- package/package.json +4 -4
- package/static/assets/ActivityPage-sJEQn6DK.js +1 -0
- package/static/assets/AgentsContextEditPage-DU3qIXk9.js +9 -0
- package/static/assets/AgentsContextPage-tJ-LhFYb.js +1 -0
- package/static/assets/{ApiKeysSettingsPage-CjrCuHHE.js → ApiKeysSettingsPage-Bg84BQHV.js} +2 -2
- package/static/assets/{AuthSettingsPage-elJX4TCV.js → AuthSettingsPage-Bwr7uP3z.js} +1 -1
- package/static/assets/{CallbackPage-CUuZYgBL.js → CallbackPage-BFn0Np2S.js} +1 -1
- package/static/assets/CodePage-kp4s3wCJ.js +2 -0
- package/static/assets/{CollapsibleSection-DfTxWX0X.js → CollapsibleSection-CNs1mvsZ.js} +1 -1
- package/static/assets/{DashboardPage-CmS8UPSm.js → DashboardPage-DMJSzzgD.js} +9 -19
- package/static/assets/{GitPage-DSfn76oO.js → GitPage-uqene8zj.js} +3 -3
- package/static/assets/{GitSettingsPage-Bu8h7hcr.js → GitSettingsPage-CLswbZsT.js} +2 -2
- package/static/assets/{IdentityPage-NFKq2FHi.js → IdentityPage-BDTPXEo7.js} +2 -2
- package/static/assets/{ImplementationStepsEditor-Cn-MshnR.js → ImplementationStepsEditor-D4cvhPhz.js} +2 -2
- package/static/assets/IntegrationsSettingsPage-o7NXZGt9.js +1 -0
- package/static/assets/JobDetailPage-DuEiPz6X.js +1 -0
- package/static/assets/KnowledgeDetailPage-DFVud_VC.js +1 -0
- package/static/assets/{KnowledgeEditPage-B28N-7vM.js → KnowledgeEditPage-XG6HKK7E.js} +1 -1
- package/static/assets/{KnowledgePage-C3zoPEcH.js → KnowledgePage-B2zI3xwW.js} +2 -2
- package/static/assets/{LoginPage-BYNLGEnz.js → LoginPage-CUJRxwXy.js} +1 -1
- package/static/assets/MailInboxPage-BlCG-tba.js +1 -0
- package/static/assets/MailProcessingModal-BJIdHOqK.js +1 -0
- package/static/assets/MailReadPage-MoNo_gmW.js +1 -0
- package/static/assets/{MailSentPage-ClaVWZCR.js → MailSentPage-QzpuIJmT.js} +1 -1
- package/static/assets/{McpSettingsPage-CfhBioEH.js → McpSettingsPage-BZcCGkGM.js} +1 -1
- package/static/assets/MemoryEditPage-DXSQoCT4.js +13 -0
- package/static/assets/MemoryPage-oBnyuvSf.js +1 -0
- package/static/assets/{NewKnowledgePage-BUwh_DFd.js → NewKnowledgePage-deMsezK8.js} +1 -1
- package/static/assets/{NewSkillPage-B2rztwzD.js → NewSkillPage-DRYWdrlV.js} +1 -1
- package/static/assets/{NewTaskPage-Cvw20nug.js → NewTaskPage-B6xdic5_.js} +2 -2
- package/static/assets/{NotFoundPage-CXvLVHsT.js → NotFoundPage-Bxu9uKFO.js} +1 -1
- package/static/assets/{NotificationsSettingsPage-Df_GZ7_p.js → NotificationsSettingsPage-CLgtsCVM.js} +1 -1
- package/static/assets/{PromptsSettingsPage-QTxJgO5-.js → PromptsSettingsPage-BWaELCjG.js} +1 -1
- package/static/assets/{ResourceDetailPage-C9RHHVKu.js → ResourceDetailPage-CMPDRdVM.js} +1 -1
- package/static/assets/ResourcesPage-DspYILfG.js +41 -0
- package/static/assets/{RoleEditPage-N2-v2MXN.js → RoleEditPage-DXtzicVZ.js} +1 -1
- package/static/assets/{RolePage-Da0kZMUH.js → RolePage-DafGURGp.js} +1 -1
- package/static/assets/{RulesSettingsPage-CSd5iz22.js → RulesSettingsPage-E8V9cexV.js} +1 -1
- package/static/assets/RunDetailPage-DsxkqFst.js +1 -0
- package/static/assets/SchedulePage-B2YvNDHr.js +4 -0
- package/static/assets/{SkillDetailPage-QjqBAuFU.js → SkillDetailPage-CWkqSfuT.js} +1 -1
- package/static/assets/{SkillEditPage-BB0x4VVH.js → SkillEditPage-DwyebzFV.js} +1 -1
- package/static/assets/{SkillsPage-BMDNxMmZ.js → SkillsPage-CauK65X_.js} +2 -2
- package/static/assets/{SkillsSettingsPage-DcdeOlAl.js → SkillsSettingsPage-DXMRv3jR.js} +1 -1
- package/static/assets/{SourceInput-rc4KSqcv.js → SourceInput-C0iKqbQ1.js} +1 -1
- package/static/assets/{TagInput-bxFcAknC.js → TagInput-Ct-WRvTs.js} +1 -1
- package/static/assets/{TaskDetailPage-CAmREdfh.js → TaskDetailPage-CApk2iBh.js} +1 -1
- package/static/assets/{TaskEditPage-BDgZtG36.js → TaskEditPage-NgOVShfK.js} +1 -1
- package/static/assets/{TasksPage-BQ6eLw0T.js → TasksPage-BoPrP_Rl.js} +3 -3
- package/static/assets/TeamEditPage-ChY6mYm8.js +9 -0
- package/static/assets/TeamPage-DH-dJhFG.js +1 -0
- package/static/assets/{TerminalPage-BhWGRGf1.js → TerminalPage-CRhcscF2.js} +1 -1
- package/static/assets/{TerminalSessionPage-Bu-WiE0d.js → TerminalSessionPage-CSCQg2sn.js} +2 -2
- package/static/assets/{UserPreferencesPage-B_Tu1a8h.js → UserPreferencesPage-DxCSWJnS.js} +1 -1
- package/static/assets/{UserSettingsPage-BnEGtrGo.js → UserSettingsPage-DKkOLNPV.js} +1 -1
- package/static/assets/UtilitiesPage-CBNSvixW.js +1 -0
- package/static/assets/{alert-C42EBWiI.js → alert-Dw_RSroN.js} +1 -1
- package/static/assets/{arrow-down-CuFFg288.js → arrow-down-UClxXzT-.js} +1 -1
- package/static/assets/{arrow-left-C8VbyW3d.js → arrow-left-DWmf9YJp.js} +1 -1
- package/static/assets/{arrow-up-down-GN3qK2mU.js → arrow-up-down-Btc3okb3.js} +1 -1
- package/static/assets/{arrow-up-vC1c-5gW.js → arrow-up-fLCh7Hvh.js} +1 -1
- package/static/assets/{badge-CKwUSKzT.js → badge-vIqE5SOP.js} +1 -1
- package/static/assets/{browser-modal-C9VBJ_El.js → browser-modal-DgMJTsMd.js} +2 -2
- package/static/assets/{card-DRBgMGuU.js → card-DPLdBoa5.js} +1 -1
- package/static/assets/{chevron-left-2sP4ienq.js → chevron-left-CiNaLX-v.js} +1 -1
- package/static/assets/{chevron-up-DJfyvHso.js → chevron-up-DFd-7wxW.js} +1 -1
- package/static/assets/{chevrons-up-DfFpzHXf.js → chevrons-up-BfU70OcQ.js} +1 -1
- package/static/assets/{circle-alert-DP4rtmEK.js → circle-alert-Mv00T-P2.js} +1 -1
- package/static/assets/{circle-check-big-3mrGMFVn.js → circle-check-big-BEY1IoIP.js} +1 -1
- package/static/assets/{circle-check-Cnp-EoKX.js → circle-check-xMiP6SLO.js} +1 -1
- package/static/assets/{circle-play-7F5AVehH.js → circle-play-iZZwaGbV.js} +1 -1
- package/static/assets/{circle-x-DxbiyJ6w.js → circle-x-z3iynaE7.js} +1 -1
- package/static/assets/{clipboard-CQNR4_yT.js → clipboard-C8wZRPDH.js} +1 -1
- package/static/assets/{clock-DGw3R_UL.js → clock-C_9shc08.js} +1 -1
- package/static/assets/{code-DSNMK8tD.js → code-DH-sRhus.js} +1 -1
- package/static/assets/{download-BWL6PFiw.js → download-CE8b59ER.js} +1 -1
- package/static/assets/{external-link-BqUE-DMN.js → external-link-DPyKt8NE.js} +1 -1
- package/static/assets/{eye-BD57N1qQ.js → eye-BpGD-yoS.js} +1 -1
- package/static/assets/{folder-git-2-CW5Zi8Bm.js → folder-git-2-BIw4zbmy.js} +1 -1
- package/static/assets/globe-CUo7eHKN.js +6 -0
- package/static/assets/{index-CheR43vH.js → index-B07hel4U.js} +1 -1
- package/static/assets/{index-B0fLM-4F.js → index-BCwmQxLC.js} +1 -1
- package/static/assets/{index-DO47L-WG.js → index-BOKaM9K-.js} +1 -1
- package/static/assets/{index-EpelXypg.js → index-BaR4iUzg.js} +1 -1
- package/static/assets/index-BcCuKdbf.css +1 -0
- package/static/assets/{index-BG5vEV31.js → index-Bfb3OTwj.js} +1 -1
- package/static/assets/{index-CMQcknsg.js → index-Bkt1rQVV.js} +1 -1
- package/static/assets/{index-BmTTXfmk.js → index-C65b3D5_.js} +1 -1
- package/static/assets/{index-CXWGFCS-.js → index-CGbmjmEy.js} +1 -1
- package/static/assets/{index-BArpuuuE.js → index-CTouvf2d.js} +1 -1
- package/static/assets/{index-D4awulBm.js → index-Cdwx6Zps.js} +1 -1
- package/static/assets/{index-CMt1ExW-.js → index-ClO9-JVh.js} +1 -1
- package/static/assets/{index-CVVL2h9f.js → index-CpJ0uBf3.js} +1 -1
- package/static/assets/{index-B9OOTqx4.js → index-CsBxEWw5.js} +1 -1
- package/static/assets/{index-stPObw-o.js → index-DZAYfTI2.js} +1 -1
- package/static/assets/{index-X4fPPLHI.js → index-Dkr9CBL7.js} +1 -1
- package/static/assets/{index-Bedu89qc.js → index-DnZKG-_7.js} +1 -1
- package/static/assets/index-UXL5-kaP.js +497 -0
- package/static/assets/{index-uxv5vQZF.js → index-iB8oed57.js} +1 -1
- package/static/assets/{index-BWktaW8U.js → index-jaRIZ6SY.js} +1 -1
- package/static/assets/{info-DMJxIp7i.js → info-D-UNBNx2.js} +1 -1
- package/static/assets/{label-DxDedS8x.js → label-8VKluf9w.js} +1 -1
- package/static/assets/{markdown-editor-DJ2CscSp.js → markdown-editor-DBdRsbP2.js} +3 -3
- package/static/assets/{message-square-DF58cqKJ.js → message-square-CO8kDUed.js} +1 -1
- package/static/assets/{paperclip-CHyfSVll.js → paperclip-DlLXZbru.js} +1 -1
- package/static/assets/{pause-B-ouFhaQ.js → pause-zSiaxJBu.js} +1 -1
- package/static/assets/{play-B0y1weCV.js → play-DVBhRokt.js} +1 -1
- package/static/assets/{radio-group-DFNQiPDU.js → radio-group-CThYUcA4.js} +1 -1
- package/static/assets/{refresh-cw-5y5jTc6x.js → refresh-cw-tXYl1ePu.js} +1 -1
- package/static/assets/{search-B5deRThk.js → search-BxF7Wwex.js} +1 -1
- package/static/assets/{select-BzOa_wZx.js → select-CyHFRA1Y.js} +1 -1
- package/static/assets/server-lRxThHjr.js +6 -0
- package/static/assets/{switch-Bf2z8aaj.js → switch-BUpDbrux.js} +1 -1
- package/static/assets/{tabs-DkdBSep3.js → tabs-DkvCmQEX.js} +1 -1
- package/static/assets/{tag-gRsTk0jY.js → tag-CkcZNLnh.js} +1 -1
- package/static/assets/{terminal-preview-BfrUN2ok.js → terminal-preview-CLWDhoOZ.js} +1 -1
- package/static/assets/triangle-alert-CmjG_mbF.js +6 -0
- package/static/assets/{use-terminal-D6Qe1nwM.js → use-terminal-D3iV7-iC.js} +1 -1
- package/static/assets/{video-DXo9sCfT.js → video-CY_dOujm.js} +1 -1
- package/static/index.html +2 -2
- package/static/assets/ActivityPage-BaSoKgwZ.js +0 -1
- package/static/assets/ArchitectureEditPage-MYU7btLs.js +0 -21
- package/static/assets/ArchitecturePage-CGqWy8b1.js +0 -1
- package/static/assets/CodePage-C_bzfOnI.js +0 -2
- package/static/assets/IntegrationsSettingsPage-Cw6ItrNf.js +0 -1
- package/static/assets/JobDetailPage-DLSD4HiU.js +0 -1
- package/static/assets/KnowledgeDetailPage-DY8PpD9X.js +0 -1
- package/static/assets/MailInboxPage-DDYg0W70.js +0 -1
- package/static/assets/MailProcessingModal-CXIrtSz0.js +0 -6
- package/static/assets/MailReadPage-CVz6oD-y.js +0 -1
- package/static/assets/ProjectEditPage-DKf6ZoiG.js +0 -11
- package/static/assets/ProjectPage-CHhx9s1k.js +0 -1
- package/static/assets/ResourcesPage-BI8tfYZ2.js +0 -41
- package/static/assets/SchedulePage-CS8g2Db-.js +0 -4
- package/static/assets/UtilitiesPage-k7ABCAig.js +0 -1
- package/static/assets/index-Cht-fo9a.css +0 -1
- package/static/assets/index-DB2Tq9wz.js +0 -487
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,B as w,p as oe,r as a,
|
|
1
|
+
import{j as e,B as w,p as oe,r as a,a3 as Ye,y as Xe,s as Qe,u as et,x as tt,a as rt,T as ve,X as ye,P as je,k as we,l as st,Z as at,G as nt,D as it,b as ct,d as lt,f as ot,a4 as Be,a5 as Oe,n as $e,a6 as Ie,a7 as _e,a8 as ze,a9 as Fe,aa as dt,A as de}from"./index-UXL5-kaP.js";import{C as mt,a as ut}from"./card-DPLdBoa5.js";import{B as De}from"./badge-vIqE5SOP.js";import{S as ke,a as Ne,b as Se,c as Ce,d as $}from"./select-CyHFRA1Y.js";import{R as xt,a as Ae}from"./radio-group-CThYUcA4.js";import{C as ht}from"./CollapsibleSection-CNs1mvsZ.js";import{L as xe}from"./label-8VKluf9w.js";import{u as ft}from"./use-terminal-D3iV7-iC.js";import{x as gt,a as pt}from"./xterm-DTxiCjtJ.js";import{A as bt}from"./arrow-down-UClxXzT-.js";/* empty css */import{b as Je,a as vt,c as yt,d as jt,e as wt}from"./pipeline-builders-Bkf0wt_O.js";import{C as Te}from"./code-DH-sRhus.js";import{R as kt}from"./refresh-cw-tXYl1ePu.js";import{P as Ee}from"./play-DVBhRokt.js";import{E as Nt}from"./eye-BpGD-yoS.js";import{S as Ge}from"./server-lRxThHjr.js";import{M as St}from"./message-square-CO8kDUed.js";import"./index-DnZKG-_7.js";import"./chevron-up-DFd-7wxW.js";var We={exports:{}},Ue;function Ct(){return Ue||(Ue=1,(function(r,k){(function(I,P){r.exports=P()})(self,(()=>(()=>{var I={6:(o,c)=>{function D(C){try{const n=new URL(C),d=n.password&&n.username?`${n.protocol}//${n.username}:${n.password}@${n.host}`:n.username?`${n.protocol}//${n.username}@${n.host}`:`${n.protocol}//${n.host}`;return C.toLocaleLowerCase().startsWith(d.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(c,"__esModule",{value:!0}),c.LinkComputer=c.WebLinkProvider=void 0,c.WebLinkProvider=class{constructor(C,n,d,u={}){this._terminal=C,this._regex=n,this._handler=d,this._options=u}provideLinks(C,n){const d=g.computeLink(C,this._regex,this._terminal,this._handler);n(this._addCallbacks(d))}_addCallbacks(C){return C.map((n=>(n.leave=this._options.leave,n.hover=(d,u)=>{if(this._options.hover){const{range:p}=n;this._options.hover(d,u,p)}},n)))}};class g{static computeLink(n,d,u,p){const M=new RegExp(d.source,(d.flags||"")+"g"),[f,y]=g._getWindowedLineStrings(n-1,u),x=f.join("");let m;const R=[];for(;m=M.exec(x);){const b=m[0];if(!D(b))continue;const[h,Y]=g._mapStrIdx(u,y,0,m.index),[X,K]=g._mapStrIdx(u,h,Y,b.length);if(h===-1||Y===-1||X===-1||K===-1)continue;const H={start:{x:Y+1,y:h+1},end:{x:K,y:X+1}};R.push({range:H,text:b,activate:p})}return R}static _getWindowedLineStrings(n,d){let u,p=n,M=n,f=0,y="";const x=[];if(u=d.buffer.active.getLine(n)){const m=u.translateToString(!0);if(u.isWrapped&&m[0]!==" "){for(f=0;(u=d.buffer.active.getLine(--p))&&f<2048&&(y=u.translateToString(!0),f+=y.length,x.push(y),u.isWrapped&&y.indexOf(" ")===-1););x.reverse()}for(x.push(m),f=0;(u=d.buffer.active.getLine(++M))&&u.isWrapped&&f<2048&&(y=u.translateToString(!0),f+=y.length,x.push(y),y.indexOf(" ")===-1););}return[x,p]}static _mapStrIdx(n,d,u,p){const M=n.buffer.active,f=M.getNullCell();let y=u;for(;p;){const x=M.getLine(d);if(!x)return[-1,-1];for(let m=y;m<x.length;++m){x.getCell(m,f);const R=f.getChars();if(f.getWidth()&&(p-=R.length||1,m===x.length-1&&R==="")){const b=M.getLine(d+1);b&&b.isWrapped&&(b.getCell(0,f),f.getWidth()===2&&(p+=1))}if(p<0)return[d,m]}d++,y=0}return[d,y]}}c.LinkComputer=g}},P={};function E(o){var c=P[o];if(c!==void 0)return c.exports;var D=P[o]={exports:{}};return I[o](D,D.exports,E),D.exports}var W={};return(()=>{var o=W;Object.defineProperty(o,"__esModule",{value:!0}),o.WebLinksAddon=void 0;const c=E(6),D=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function g(C,n){const d=window.open();if(d){try{d.opener=null}catch{}d.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}o.WebLinksAddon=class{constructor(C=g,n={}){this._handler=C,this._options=n}activate(C){this._terminal=C;const n=this._options,d=n.urlRegex||D;this._linkProvider=this._terminal.registerLinkProvider(new c.WebLinkProvider(this._terminal,d,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),W})()))})(We)),We.exports}var At=Ct();function Tt({onJumpToBottom:r,onSendKey:k}){return e.jsxs("div",{className:"w-full border-t border-gray-700/50 bg-[#252525] px-4 py-2.5 flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:r&&e.jsxs(w,{variant:"outline",size:"sm",onClick:r,className:"h-8 text-xs bg-[#2d2d2d] border-gray-600 hover:bg-[#3d3d3d] text-gray-200 hover:text-white transition-colors",title:"Jump to bottom and set focus",children:[e.jsx(bt,{className:"h-3.5 w-3.5 sm:mr-1.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Jump to Bottom"})]})}),k&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>k(""),className:"h-8 px-2 flex items-center gap-1 rounded-md bg-[#2d2d2d] border border-gray-600 hover:bg-red-900/40 hover:border-red-700 text-gray-200 hover:text-red-300 transition-colors",title:"Send Ctrl+C (interrupt)",children:[e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"⌃"}),e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"C"})]}),e.jsxs("button",{onClick:()=>k(""),className:"h-8 px-2 flex items-center gap-1 rounded-md bg-[#2d2d2d] border border-gray-600 hover:bg-[#3d3d3d] hover:border-gray-500 text-gray-200 hover:text-white transition-colors",title:"Send Ctrl+Z (suspend)",children:[e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"⌃"}),e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"Z"})]}),e.jsx("button",{onClick:()=>k("\x1B"),className:"h-8 px-2 flex items-center gap-1 rounded-md bg-[#2d2d2d] border border-gray-600 hover:bg-[#3d3d3d] hover:border-gray-500 text-gray-200 hover:text-white transition-colors",title:"Send Escape key",children:e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"Esc"})})]})]})}function Et({sessionId:r,onResize:k,onDestroy:I,pendingCommand:P,onCommandExecuted:E,showToolbar:W=!0}){const o=a.useRef(null),c=a.useRef(null),D=a.useRef(null),g=a.useRef(null),[C,n]=a.useState(!1),[d,u]=a.useState(null),[p,M]=a.useState(!0),f=a.useRef(0),y=5,x=a.useRef(null),m=a.useRef(null),R=a.useRef(P??null),b=a.useRef(!1),h=a.useRef(null),Y=a.useRef(E),X=a.useRef(I),K=a.useRef(k);a.useEffect(()=>{Y.current=E},[E]),a.useEffect(()=>{X.current=I},[I]),a.useEffect(()=>{K.current=k},[k]);const H=a.useCallback(N=>{!R.current||b.current||(h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{if(!R.current||b.current){h.current=null;return}g.current?.readyState===WebSocket.OPEN&&(g.current.send(JSON.stringify({type:"input",data:R.current+"\r"})),b.current=!0,Y.current?.()),h.current=null},N))},[]);a.useEffect(()=>{if(R.current=P??null,b.current=!1,!R.current){h.current!==null&&(window.clearTimeout(h.current),h.current=null);return}const N=g.current?.readyState===WebSocket.OPEN;return H(N?200:800),()=>{h.current!==null&&(window.clearTimeout(h.current),h.current=null)}},[P,r,H]),a.useEffect(()=>{n(!1),M(!0),u(null)},[r]),a.useEffect(()=>{if(!o.current||!r)return;const N=T=>{const v=T.getBoundingClientRect();return v.width>0&&v.height>0},A=new gt.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"'IBM Plex Mono', 'Source Code Pro', 'Fira Code', ui-monospace, Menlo, Monaco, monospace",lineHeight:1.35,letterSpacing:.5,convertEol:!0,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",cursorAccent:"#1a1b26",selectionBackground:"#33467c",selectionForeground:"#c0caf5",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"}}),_=new pt.FitAddon,fe=new At.WebLinksAddon;A.loadAddon(_),A.loadAddon(fe),A.open(o.current),c.current=A,D.current=_;let S=null,B=null;const U=()=>{if(!A||!A.element||!A.element.parentElement)return;const T=A.cols??0,v=A.rows??0;if(T>0&&v>0){g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"resize",cols:T,rows:v}));const O=K.current;O&&O(T,v)}},ae=()=>{const T=o.current;if(T&&N(T)&&!(!A||!A.element||!A.element.parentElement))try{const v=T.getBoundingClientRect();if(v.width<10||v.height<10)return;_.fit(),U()}catch(v){console.warn("xterm fit() failed, will retry if needed:",v)}},j=()=>{S&&cancelAnimationFrame(S),S=requestAnimationFrame(()=>{ae()})},Q=()=>{if(!r)return;x.current&&(window.clearTimeout(x.current),x.current=null);const T=`${Ye}/ws/terminal/${r}`,v=new WebSocket(T);return g.current=v,v.onopen=()=>{n(!0),u(null),f.current=0,console.log("Terminal WebSocket connected"),m.current&&window.clearInterval(m.current),m.current=window.setInterval(()=>{v.readyState===WebSocket.OPEN&&v.send(JSON.stringify({type:"keepalive"}))},120*1e3),j(),setTimeout(()=>{M(!1),j(),setTimeout(()=>j(),50),setTimeout(()=>j(),150)},400),H(1200)},v.onmessage=O=>{try{const L=JSON.parse(O.data);switch(L.type){case"snapshot":if(typeof L.data=="string"&&L.data.length&&c.current){const z=c.current;z.write(L.data,()=>{z.scrollToBottom()})}break;case"data":if(c.current){const z=c.current,V=z.buffer.active.viewportY+z.rows>=z.buffer.active.baseY+z.buffer.active.cursorY;z.write(L.data,()=>{V&&z.scrollToBottom()})}break;case"exit":c.current&&c.current.write(`\r
|
|
2
2
|
\x1B[31mProcess exited with code ${L.exitCode}\x1B[0m\r
|
|
3
|
-
`),X.current?.();break}}catch(L){console.error("Error parsing WebSocket message:",L)}},v.onclose=O=>{if(n(!1),console.log("Terminal WebSocket disconnected",O.code,O.reason),m.current&&(window.clearInterval(m.current),m.current=null),O.code!==1e3&&f.current<y&&r){f.current++;const L=Math.min(1e3*Math.pow(2,f.current-1),1e4);console.log(`Attempting to reconnect (${f.current}/${y}) in ${L}ms`),x.current=window.setTimeout(()=>{Q()},L)}else f.current>=y&&u("Connection lost. Please refresh the page to reconnect.")},v.onerror=O=>{console.error("Terminal WebSocket error:",O),f.current===0&&u("WebSocket connection failed")},v};Q(),A.onData(T=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"input",data:T}))});const J=()=>{j()},ne=new ResizeObserver(J);o.current&&ne.observe(o.current),window.addEventListener("resize",J),window.addEventListener("orientationchange",J);const G=()=>{document.visibilityState==="visible"&&(B&&clearTimeout(B),B=window.setTimeout(()=>{j()},50))};document.addEventListener("visibilitychange",G);let ie=0;const ce=20,me=()=>{const T=o.current;if(T){if(N(T)){ae();return}ie+=1,ie<ce?S=requestAnimationFrame(me):B=window.setTimeout(()=>{ae()},100)}};return S=requestAnimationFrame(me),()=>{ne.disconnect(),window.removeEventListener("resize",J),window.removeEventListener("orientationchange",J),document.removeEventListener("visibilitychange",G),S&&cancelAnimationFrame(S),B&&clearTimeout(B),x.current&&(window.clearTimeout(x.current),x.current=null),m.current&&(window.clearInterval(m.current),m.current=null),g.current?.readyState===WebSocket.OPEN&&g.current.close(),h.current!==null&&(window.clearTimeout(h.current),h.current=null),A.dispose()}},[r,H]);const he=a.useCallback(()=>{c.current&&(c.current.scrollToBottom(),c.current.focus())},[]),te=a.useCallback(N=>{g.current?.readyState===WebSocket.OPEN&&(g.current.send(JSON.stringify({type:"input",data:N})),c.current&&c.current.focus())},[]);return d?e.jsx("div",{className:"flex items-center justify-center h-full bg-red-50 border border-red-200 rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 font-medium",children:"Terminal Connection Error"}),e.jsx("div",{className:"text-red-500 text-sm mt-1",children:d})]})}):e.jsxs("div",{className:"relative h-full flex flex-col bg-[#1a1b26] overflow-hidden",children:[!C&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#1a1b26] bg-opacity-95 z-10 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"}),e.jsx("div",{className:"text-gray-300 mt-2",children:"Connecting to terminal..."})]})}),C&&p&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#1a1b26] bg-opacity-50 z-10 transition-opacity duration-300 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-pulse rounded-full h-6 w-6 bg-blue-500 mx-auto"}),e.jsx("div",{className:"text-gray-300 text-sm mt-2",children:"Loading terminal..."})]})}),e.jsx("div",{ref:o,className:"flex-1 w-full overflow-hidden",style:{minHeight:"400px"}}),W&&e.jsx(Tt,{onJumpToBottom:he,onSendKey:te})]})}const Wt=r=>r?Array.isArray(r)?r.filter(k=>typeof k=="string").map(k=>k.trim()).filter(Boolean):typeof r=="string"?r.split(",").map(k=>k.trim()).filter(Boolean):[]:[];function Yt(){const{taskId:r}=Xe(),k=Qe(),I=et(),[P]=tt(),{toast:E}=rt(),W=r?.startsWith("session-"),o=a.useMemo(()=>!!r&&r.startsWith("cp-"),[r]),c=a.useMemo(()=>!!r&&r.startsWith("sk-"),[r]),D=P.get("reviewOnly")==="true",g=P.get("startOnly")==="true",C=o&&!g,n=!D,d=a.useMemo(()=>c&&r?r.replace("sk-",""):null,[c,r]),{sessions:u,loading:p,error:M,createSession:f,destroySession:y,refreshSessions:x}=ft(),[m,R]=a.useState([]),[b,h]=a.useState(null),[Y,X]=a.useState(null),[K,H]=a.useState("claude"),[he,te]=a.useState(!1),[N,A]=a.useState("claude"),[_,fe]=a.useState([]),[S,B]=a.useState([]),[q,ae]=a.useState([]),[j,Q]=a.useState([]),[J,ne]=a.useState(!0),[G,ie]=a.useState(""),[ce,me]=a.useState(!1),[T,v]=a.useState({}),[O,L]=a.useState(null),z=a.useRef([]),[U,Pe]=a.useState("current"),[ue,Ue]=a.useState("main"),ee=a.useMemo(()=>r?`terminal.cp.config.${r}`:null,[r]);a.useEffect(()=>{if(!(!o&&!c||!ee))try{const t=localStorage.getItem(ee);if(t){const s=JSON.parse(t);s.cliAgent&&A(s.cliAgent),Array.isArray(s.selectedMcpServers)&&B(s.selectedMcpServers),Array.isArray(s.selectedSkillIds)&&Q(s.selectedSkillIds),typeof s.automationEnabled=="boolean"&&ne(s.automationEnabled),typeof s.customInstruction=="string"&&ie(s.customInstruction),typeof s.createWorktree=="boolean"&&me(s.createWorktree),s.branchMode&&Pe(s.branchMode)}}catch{console.error("Failed to load config",ee)}},[o,c,ee]);const ge=a.useCallback(()=>{if(!ee)return;const t={cliAgent:N,selectedMcpServers:S,selectedSkillIds:j,automationEnabled:J,customInstruction:G,createWorktree:ce,branchMode:U};try{localStorage.setItem(ee,JSON.stringify(t))}catch{console.error("Failed to persist config",ee)}},[ee,N,S,j,J,G,ce,U]);a.useEffect(()=>{ge()},[G,ge]);const re=t=>`feat/cp-${t.startsWith("cp-")?t.slice(5):t}`,Ve=async t=>{try{const s=re(t),l=await(await fetch(`${de}/api/v1/git/branches`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,from:ue})})).json();if(!l.success){const F=l.error?.message||"Unknown error";return E({title:"Branch creation failed",description:F,variant:"destructive"}),!1}return E({title:"Branch created",description:`Created branch: ${s}`}),!0}catch{return E({title:"Branch creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}},Le=async t=>{try{const s=re(t),l=await(await fetch(`${de}/api/v1/git/worktrees`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:s,from:ue})})).json();if(!l.success){const F=l.error?.message||"Unknown error";return E({title:"Worktree creation failed",description:F,variant:"destructive"}),!1}return E({title:"Worktree created",description:`Created branch: ${s}`}),!0}catch{return E({title:"Worktree creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}};a.useEffect(()=>{(o||c)&&r&&(async()=>{try{const s=await fetch(`${de}/api/v1/git/status`);if(s.ok){const l=await s.json();l?.success&&l.data?.branch&&Ue(l.data.branch)}const i=await fetch(`${de}/api/v1/mcp`);if(i.ok){const l=await i.json();l?.success&&Array.isArray(l.servers)&&(fe(l.servers),B(F=>F.filter(V=>l.servers.includes(V))),l.mcpServers&&typeof l.mcpServers=="object"&&v(l.mcpServers))}}catch(s){console.error("Failed to load MCP servers",s)}try{const s=await fetch(`${de}/api/v1/skills`);if(s.ok){const i=await s.json(),F=(Array.isArray(i?.documents)?i.documents:[]).map(V=>({id:V.id,name:V?.metadata?.name||V.id,mcpServers:Wt(V?.metadata?.metadata?.mcpServers)}));ae(F),Q(V=>{const le=V.filter(Z=>F.some(be=>be.id===Z));if(c&&d&&le.length===0){const Z=F.find(be=>be.id===d);if(Z)return[Z.id]}return le})}}catch(s){console.error("Failed to load skills",s)}})()},[o,c,r,d]),a.useEffect(()=>{const t=z.current,s=j.filter(i=>!t.includes(i));s.length>0&&B(i=>{const l=new Set(i),F=_.length>0?new Set(_):void 0;return s.forEach(V=>{const le=q.find(Z=>Z.id===V);le&&le.mcpServers.forEach(Z=>{(!F||F.has(Z))&&l.add(Z)})}),Array.from(l)}),z.current=j},[j,q,_]),a.useEffect(()=>{r&&x(r)},[r,x]),a.useEffect(()=>{if(!r)return;const s=u.filter(i=>i.taskId===r).map(i=>i.id);R(s),!b&&s.length>0&&h(s[0]),b&&!s.includes(b)&&h(s.length>0?s[0]:null)},[u,r,b]);const se=async t=>{if(!r)return;const s=t||void 0,i=await f(r,s);i&&(h(i),!s&&t&&X(t),setTimeout(()=>x(r),100))},Me=(t,s)=>{const l={taskId:r,contextType:s??(o?"change-task":c?"skill":"general"),selectedMcpServers:S,selectedSkillIds:j,automationEnabled:J,customInstruction:G};switch(t){case"claude":return Ge(l);case"gemini":return wt(l);case"codex":return jt(l);case"droid":return yt(l);case"kiro":return vt(l);default:return Ge(l)}},pe=async()=>{o&&r&&(U==="new-branch"?await Ve(r)||console.warn("Branch creation failed, continuing with terminal creation"):U==="new-worktree"&&(await Le(r)||console.warn("Worktree creation failed, continuing with terminal creation"))),o&&ce&&U==="current"&&r&&(await Le(r)||console.warn("Worktree creation failed, continuing with terminal creation"));const s=Me(o||c?N:K);await se(s)},Ke=async()=>{const s=Me(N,"prepare-task");await se(s)},Re=async t=>{if(await y(t)&&b===t){const i=m.filter(l=>l!==t);i.length>0?h(i[0]):r?.startsWith("session-")?I("/agents"):h(null)}},He=t=>{Re(t)},Ze=async()=>{for(const t of m)await y(t);I("/agents")};return r?e.jsxs("div",{className:"flex flex-col h-full",children:[W&&m.length===0&&r&&e.jsx(Pt,{taskId:r,onStart:se,locationSearch:k.search}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-lg",children:o||c?e.jsx(Te,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):e.jsx(ve,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:W?"Terminal":"Agent Session"}),!W&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:r}),W&&e.jsxs("span",{className:"text-sm text-gray-500 font-mono",children:["(",r,")"]})]})]})}),e.jsx("div",{className:"flex items-center gap-2 sm:gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>r&&x(r),disabled:p,className:"bg-white dark:bg-gray-800",children:[e.jsx(kt,{className:`h-4 w-4 sm:mr-2 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),e.jsx(w,{size:"sm",variant:"destructive",onClick:Ze,title:"Close session","aria-label":"Close session",className:"h-9 w-9 p-0",children:e.jsx(ye,{className:"h-4 w-4"})}),!W&&!o&&!c&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ke,{value:K,onValueChange:H,children:[e.jsx(Ne,{className:"w-24",children:e.jsx(Se,{})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]}),e.jsxs(w,{onClick:pe,disabled:p,size:"sm",variant:"default",className:"bg-green-600 hover:bg-green-700",children:[e.jsx(Ee,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Start Agent"})]})]}),!o&&!c&&(!W||m.length===0)&&e.jsxs(w,{onClick:()=>se(),disabled:p,size:"sm",children:[e.jsx(je,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"New Terminal"})]})]})})]}),M&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1.5 bg-red-100 dark:bg-red-900/40 rounded-lg flex-shrink-0",children:e.jsx(ye,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),e.jsx("div",{className:"text-red-800 dark:text-red-200 text-sm font-medium",children:M})]})}),m.length>0&&e.jsx("div",{className:"flex items-center gap-1 border-b dark:border-gray-700",children:m.map(t=>{const s=u.find(l=>l.id===t),i=b===t;return e.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 border-b-1 cursor-pointer rounded-t-lg transition-all duration-200 ${i?"border-gray-400 bg-white dark:bg-gray-800 dark:border-gray-500 shadow-sm":"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800 hover:border-gray-300"}`,onClick:()=>h(t),children:[e.jsx("div",{className:`p-1.5 rounded-md ${i?"bg-gray-200 dark:bg-gray-700":"bg-gray-100 dark:bg-gray-700"}`,children:e.jsx(ve,{className:`h-3.5 w-3.5 ${i?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400"}`})}),e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["Terminal ",t.split("-").slice(-1)[0].substring(0,6)]}),e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?.connected?"bg-green-500":"bg-gray-400"}`}),e.jsx(w,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-red-100 dark:hover:bg-red-900/30 rounded-md opacity-60 hover:opacity-100 transition-opacity",onClick:l=>{l.stopPropagation(),Re(t)},children:e.jsx(ye,{className:"h-3 w-3"})})]},t)})}),e.jsx("div",{className:"flex-1 min-h-0",children:m.length===0?e.jsx(mt,{className:"h-full",children:e.jsx(ut,{className:"flex items-center justify-center h-full p-8",children:e.jsxs("div",{className:"text-center w-full max-w-[33vw] min-w-[400px]",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full w-fit mx-auto mb-2",children:o||c?e.jsx(we,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"}):e.jsx(ve,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-3",children:"Prepare Agent"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6 leading-relaxed",children:W?"Create a new terminal session":e.jsxs(e.Fragment,{children:["Configure the agent to start working on ",r,"."]})}),e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!W&&!o&&!c&&e.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:[e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Choose your AI agent"}),e.jsxs(ke,{value:K,onValueChange:H,children:[e.jsx(Ne,{className:"w-full h-11 bg-white dark:bg-gray-800",children:e.jsx(Se,{})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code (default)"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs(w,{onClick:pe,disabled:p,className:"bg-green-600 hover:bg-green-700 w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(Ee,{className:"h-5 w-5 mr-2"}),"Start Agent"]}),e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[e.jsx("div",{className:"flex-1 h-px bg-gray-300 dark:bg-gray-600"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 font-medium",children:"or"}),e.jsx("div",{className:"flex-1 h-px bg-gray-300 dark:bg-gray-600"})]}),e.jsxs(w,{onClick:()=>se(),disabled:p,variant:"outline",className:"w-full h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(je,{className:"h-5 w-5 mr-2"}),"New Terminal"]})]}),!W&&(o||c)&&e.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:[C&&e.jsxs(w,{onClick:Ke,disabled:p,className:"w-full bg-blue-600 hover:bg-blue-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Nt,{className:"h-5 w-5 mr-2"}),"Review & Prepare"]}),e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsxs(w,{variant:"outline",onClick:()=>te(!0),className:"flex-1 h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(st,{className:"h-5 w-5 mr-2"}),"Configure"]}),n&&e.jsxs(w,{onClick:pe,disabled:p,className:"flex-1 bg-green-600 hover:bg-green-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Ee,{className:"h-5 w-5 mr-2"}),"Start Agent"]})]}),e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("div",{className:"text-xs uppercase font-semibold text-gray-500 dark:text-gray-400",children:"Agent Configuration"}),e.jsxs("div",{className:"text-left text-sm text-gray-700 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Agent:"}),e.jsx("span",{className:"font-mono text-sm",children:N==="claude"?"Claude Code":N.charAt(0).toUpperCase()+N.slice(1)})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Te,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400 mt-0.5"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Skills:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:j.length?j.map(t=>{const s=q.find(i=>i.id===t);return e.jsx(Je,{variant:"secondary",className:"font-mono text-xs",children:s?.name||t},t)}):e.jsx("span",{className:"font-mono text-sm text-gray-500",children:"None"})})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Be,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400 mt-0.5"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"MCP Servers:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:S.length?S.map(t=>e.jsx(Je,{variant:"secondary",className:"font-mono text-xs",children:t},t)):e.jsx("span",{className:"font-mono text-sm text-gray-500",children:"None"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Full Environment Access:"}),e.jsx("span",{className:"font-mono text-sm",children:J?"Enabled":"Disabled"})]}),o&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(nt,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Branch:"}),e.jsx("span",{className:"font-mono text-sm",children:U==="current"?`Current (${ue})`:U==="new-branch"?`New branch (${re(r||"")})`:`New worktree (${re(r||"")})`})]})]}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2 text-gray-700 dark:text-gray-300",children:[e.jsx(St,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),"Additional Instructions"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[G.length,"/500"]})]}),e.jsx("textarea",{className:"w-full min-h-[80px] rounded-md border p-3 text-sm bg-gray-50 dark:bg-gray-900/50 border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 resize-none",placeholder:"Add specific instructions to guide the agent...",value:G,onChange:t=>ie(t.target.value),rows:3}),G.length>500&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:"Custom instruction is too long (max 500 characters)"})]})]})]}),W&&m.length===0&&e.jsx("div",{className:"p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:e.jsxs(w,{onClick:()=>se(),disabled:p,className:"w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(je,{className:"h-5 w-5 mr-2"}),"New Terminal"]})})]})]})})}):b?e.jsx("div",{className:"h-full overflow-hidden rounded-b-lg",children:e.jsx(Et,{sessionId:b,onDestroy:()=>He(b),pendingCommand:Y,onCommandExecuted:()=>X(null),showToolbar:!0})}):null}),e.jsx(it,{open:he,onOpenChange:te,children:e.jsxs(ct,{className:"max-w-3xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(lt,{children:[e.jsx(ot,{children:"Configure Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Customize the agent's capabilities and configure it's environment."})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4"}),"Agent"]}),e.jsxs(ke,{value:N,onValueChange:t=>A(t),children:[e.jsx(Ne,{className:"w-full",children:e.jsx(Se,{placeholder:"Select agent"})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"droid",children:"Factory Droid"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[j.length," of ",q.length," selected"]})]}),e.jsxs(Oe,{children:[e.jsx($e,{asChild:!0,children:e.jsxs(w,{variant:"outline",className:"w-full justify-between",children:[j.length===0?"Select skills...":j.length===q.length?"All skills selected":`${j.length} skill${j.length!==1?"s":""} selected`,e.jsx(Ie,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(_e,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(ze,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Skills"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),Q(q.map(s=>s.id))},children:"All"}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),Q([])},children:"None"})]})]}),e.jsx(Fe,{}),q.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No skills found"}):q.map(t=>e.jsx(De,{checked:j.includes(t.id),onCheckedChange:s=>{Q(i=>s?i.includes(t.id)?i:[...i,t.id]:i.filter(l=>l!==t.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t.name}),t.mcpServers.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",t.mcpServers.join(", ")]}),t.mcpServers.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Inherits available MCP servers"})]})},t.id))]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Be,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[S.length," of ",_.length," selected"]})]}),e.jsxs(Oe,{children:[e.jsx($e,{asChild:!0,children:e.jsxs(w,{variant:"outline",className:"w-full justify-between",children:[S.length===0?"Select MCP servers...":S.length===_.length?"All servers selected":`${S.length} server${S.length!==1?"s":""} selected`,e.jsx(Ie,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(_e,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(ze,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),B(_)},children:"All"}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),B([])},children:"None"})]})]}),e.jsx(Fe,{}),_.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):_.map(t=>e.jsx(De,{checked:S.includes(t),onCheckedChange:s=>{B(i=>s?i.includes(t)?i:[...i,t]:i.filter(l=>l!==t))},children:t},t))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-md bg-amber-50/50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",children:[e.jsx(dt,{id:"automation",checked:J,onCheckedChange:t=>ne(t===!0),className:"data-[state=checked]:bg-red-600 data-[state=checked]:border-red-600 data-[state=checked]:text-white border-red-400",disabled:N==="droid"}),e.jsx("label",{htmlFor:"automation",className:"text-sm font-medium text-red-600 dark:text-red-400 cursor-pointer",children:"Full environment access (recommended in secure environments only)"})]}),N==="droid"&&e.jsxs("p",{className:"text-xs text-muted-foreground px-1",children:[e.jsx("span",{className:"font-medium",children:"Droid:"})," Automation level is set in the REPL. Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"shift+tab"})," to cycle through Off → Low → Medium → High."]})]}),o&&e.jsx(ht,{title:"Advanced Settings",description:"Configure branch and worktree options",defaultOpen:!1,children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(xe,{className:"text-sm font-medium mb-3 block",children:"Branch Management"}),e.jsxs(xt,{value:U,onValueChange:t=>Pe(t),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"current",id:"branch-current"}),e.jsxs(xe,{htmlFor:"branch-current",className:"cursor-pointer font-normal",children:["Stay on current branch (",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:ue}),")"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"new-branch",id:"branch-new"}),e.jsxs(xe,{htmlFor:"branch-new",className:"cursor-pointer font-normal",children:["Create new branch: ",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:re(r||"")})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"new-worktree",id:"branch-worktree"}),e.jsxs(xe,{htmlFor:"branch-worktree",className:"cursor-pointer font-normal",children:["Create new worktree: ",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:re(r||"")})]})]})]})]})})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"outline",onClick:()=>te(!1),children:"Close"}),e.jsx(w,{onClick:()=>{if(G.length>500){L("Please shorten the custom instruction to 500 characters.");return}L(null),ge(),te(!1)},children:"Save"})]}),O&&e.jsx("div",{className:"text-xs text-red-600 text-right",children:O})]})]})})]}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 font-medium",children:"Invalid Task ID"}),e.jsx(w,{onClick:()=>I("/tasks"),className:"mt-4",children:"Back to Tasks"})]})})}function Pt({taskId:r,onStart:k,locationSearch:I}){return a.useEffect(()=>{if(!r)return;const P=new URLSearchParams(I);if(!P.has("autostart"))return;const E=`terminal.autostart.${r}`;if(sessionStorage.getItem(E)==="done")return;sessionStorage.setItem(E,"done");const o=P.get("run")||void 0;k(o||void 0)},[r]),null}export{Yt as default};
|
|
3
|
+
`),X.current?.();break}}catch(L){console.error("Error parsing WebSocket message:",L)}},v.onclose=O=>{if(n(!1),console.log("Terminal WebSocket disconnected",O.code,O.reason),m.current&&(window.clearInterval(m.current),m.current=null),O.code!==1e3&&f.current<y&&r){f.current++;const L=Math.min(1e3*Math.pow(2,f.current-1),1e4);console.log(`Attempting to reconnect (${f.current}/${y}) in ${L}ms`),x.current=window.setTimeout(()=>{Q()},L)}else f.current>=y&&u("Connection lost. Please refresh the page to reconnect.")},v.onerror=O=>{console.error("Terminal WebSocket error:",O),f.current===0&&u("WebSocket connection failed")},v};Q(),A.onData(T=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"input",data:T}))});const J=()=>{j()},ne=new ResizeObserver(J);o.current&&ne.observe(o.current),window.addEventListener("resize",J),window.addEventListener("orientationchange",J);const G=()=>{document.visibilityState==="visible"&&(B&&clearTimeout(B),B=window.setTimeout(()=>{j()},50))};document.addEventListener("visibilitychange",G);let ie=0;const ce=20,me=()=>{const T=o.current;if(T){if(N(T)){ae();return}ie+=1,ie<ce?S=requestAnimationFrame(me):B=window.setTimeout(()=>{ae()},100)}};return S=requestAnimationFrame(me),()=>{ne.disconnect(),window.removeEventListener("resize",J),window.removeEventListener("orientationchange",J),document.removeEventListener("visibilitychange",G),S&&cancelAnimationFrame(S),B&&clearTimeout(B),x.current&&(window.clearTimeout(x.current),x.current=null),m.current&&(window.clearInterval(m.current),m.current=null),g.current?.readyState===WebSocket.OPEN&&g.current.close(),h.current!==null&&(window.clearTimeout(h.current),h.current=null),A.dispose()}},[r,H]);const he=a.useCallback(()=>{c.current&&(c.current.scrollToBottom(),c.current.focus())},[]),te=a.useCallback(N=>{g.current?.readyState===WebSocket.OPEN&&(g.current.send(JSON.stringify({type:"input",data:N})),c.current&&c.current.focus())},[]);return d?e.jsx("div",{className:"flex items-center justify-center h-full bg-red-50 border border-red-200 rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 font-medium",children:"Terminal Connection Error"}),e.jsx("div",{className:"text-red-500 text-sm mt-1",children:d})]})}):e.jsxs("div",{className:"relative h-full flex flex-col bg-[#1a1b26] overflow-hidden",children:[!C&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#1a1b26] bg-opacity-95 z-10 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"}),e.jsx("div",{className:"text-gray-300 mt-2",children:"Connecting to terminal..."})]})}),C&&p&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#1a1b26] bg-opacity-50 z-10 transition-opacity duration-300 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-pulse rounded-full h-6 w-6 bg-blue-500 mx-auto"}),e.jsx("div",{className:"text-gray-300 text-sm mt-2",children:"Loading terminal..."})]})}),e.jsx("div",{ref:o,className:"flex-1 w-full overflow-hidden",style:{minHeight:"400px"}}),W&&e.jsx(Tt,{onJumpToBottom:he,onSendKey:te})]})}const Wt=r=>r?Array.isArray(r)?r.filter(k=>typeof k=="string").map(k=>k.trim()).filter(Boolean):typeof r=="string"?r.split(",").map(k=>k.trim()).filter(Boolean):[]:[];function Xt(){const{taskId:r}=Xe(),k=Qe(),I=et(),[P]=tt(),{toast:E}=rt(),W=r?.startsWith("session-"),o=a.useMemo(()=>!!r&&r.startsWith("cp-"),[r]),c=a.useMemo(()=>!!r&&r.startsWith("sk-"),[r]),D=P.get("reviewOnly")==="true",g=P.get("startOnly")==="true",C=o&&!g,n=!D,d=a.useMemo(()=>c&&r?r.replace("sk-",""):null,[c,r]),{sessions:u,loading:p,error:M,createSession:f,destroySession:y,refreshSessions:x}=ft(),[m,R]=a.useState([]),[b,h]=a.useState(null),[Y,X]=a.useState(null),[K,H]=a.useState("claude"),[he,te]=a.useState(!1),[N,A]=a.useState("claude"),[_,fe]=a.useState([]),[S,B]=a.useState([]),[U,ae]=a.useState([]),[j,Q]=a.useState([]),[J,ne]=a.useState(!0),[G,ie]=a.useState(""),[ce,me]=a.useState(!1),[T,v]=a.useState({}),[O,L]=a.useState(null),z=a.useRef([]),[V,Pe]=a.useState("current"),[ue,Ve]=a.useState("main"),ee=a.useMemo(()=>r?`terminal.cp.config.${r}`:null,[r]);a.useEffect(()=>{if(!(!o&&!c||!ee))try{const t=localStorage.getItem(ee);if(t){const s=JSON.parse(t);s.cliAgent&&A(s.cliAgent),Array.isArray(s.selectedMcpServers)&&B(s.selectedMcpServers),Array.isArray(s.selectedSkillIds)&&Q(s.selectedSkillIds),typeof s.automationEnabled=="boolean"&&ne(s.automationEnabled),typeof s.customInstruction=="string"&&ie(s.customInstruction),typeof s.createWorktree=="boolean"&&me(s.createWorktree),s.branchMode&&Pe(s.branchMode)}}catch{console.error("Failed to load config",ee)}},[o,c,ee]);const ge=a.useCallback(()=>{if(!ee)return;const t={cliAgent:N,selectedMcpServers:S,selectedSkillIds:j,automationEnabled:J,customInstruction:G,createWorktree:ce,branchMode:V};try{localStorage.setItem(ee,JSON.stringify(t))}catch{console.error("Failed to persist config",ee)}},[ee,N,S,j,J,G,ce,V]);a.useEffect(()=>{ge()},[G,ge]);const re=t=>`feat/cp-${t.startsWith("cp-")?t.slice(5):t}`,qe=async t=>{try{const s=re(t),l=await(await fetch(`${de}/api/v1/git/branches`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,from:ue})})).json();if(!l.success){const F=l.error?.message||"Unknown error";return E({title:"Branch creation failed",description:F,variant:"destructive"}),!1}return E({title:"Branch created",description:`Created branch: ${s}`}),!0}catch{return E({title:"Branch creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}},Le=async t=>{try{const s=re(t),l=await(await fetch(`${de}/api/v1/git/worktrees`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:s,from:ue})})).json();if(!l.success){const F=l.error?.message||"Unknown error";return E({title:"Worktree creation failed",description:F,variant:"destructive"}),!1}return E({title:"Worktree created",description:`Created branch: ${s}`}),!0}catch{return E({title:"Worktree creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}};a.useEffect(()=>{(o||c)&&r&&(async()=>{try{const s=await fetch(`${de}/api/v1/git/status`);if(s.ok){const l=await s.json();l?.success&&l.data?.branch&&Ve(l.data.branch)}const i=await fetch(`${de}/api/v1/mcp`);if(i.ok){const l=await i.json();l?.success&&Array.isArray(l.servers)&&(fe(l.servers),B(F=>F.filter(q=>l.servers.includes(q))),l.mcpServers&&typeof l.mcpServers=="object"&&v(l.mcpServers))}}catch(s){console.error("Failed to load MCP servers",s)}try{const s=await fetch(`${de}/api/v1/skills`);if(s.ok){const i=await s.json(),F=(Array.isArray(i?.documents)?i.documents:[]).map(q=>({id:q.id,name:q?.metadata?.name||q.id,mcpServers:Wt(q?.metadata?.metadata?.mcpServers)}));ae(F),Q(q=>{const le=q.filter(Z=>F.some(be=>be.id===Z));if(c&&d&&le.length===0){const Z=F.find(be=>be.id===d);if(Z)return[Z.id]}return le})}}catch(s){console.error("Failed to load skills",s)}})()},[o,c,r,d]),a.useEffect(()=>{const t=z.current,s=j.filter(i=>!t.includes(i));s.length>0&&B(i=>{const l=new Set(i),F=_.length>0?new Set(_):void 0;return s.forEach(q=>{const le=U.find(Z=>Z.id===q);le&&le.mcpServers.forEach(Z=>{(!F||F.has(Z))&&l.add(Z)})}),Array.from(l)}),z.current=j},[j,U,_]),a.useEffect(()=>{r&&x(r)},[r,x]),a.useEffect(()=>{if(!r)return;const s=u.filter(i=>i.taskId===r).map(i=>i.id);R(s),!b&&s.length>0&&h(s[0]),b&&!s.includes(b)&&h(s.length>0?s[0]:null)},[u,r,b]);const se=async t=>{if(!r)return;const s=t||void 0,i=await f(r,s);i&&(h(i),!s&&t&&X(t),setTimeout(()=>x(r),100))},Me=(t,s)=>{const l={taskId:r,contextType:s??(o?"change-task":c?"skill":"general"),selectedMcpServers:S,selectedSkillIds:j,automationEnabled:J,customInstruction:G};switch(t){case"claude":return Je(l);case"gemini":return wt(l);case"codex":return jt(l);case"droid":return yt(l);case"kiro":return vt(l);default:return Je(l)}},pe=async()=>{o&&r&&(V==="new-branch"?await qe(r)||console.warn("Branch creation failed, continuing with terminal creation"):V==="new-worktree"&&(await Le(r)||console.warn("Worktree creation failed, continuing with terminal creation"))),o&&ce&&V==="current"&&r&&(await Le(r)||console.warn("Worktree creation failed, continuing with terminal creation"));const s=Me(o||c?N:K);await se(s)},Ke=async()=>{const s=Me(N,"prepare-task");await se(s)},Re=async t=>{if(await y(t)&&b===t){const i=m.filter(l=>l!==t);i.length>0?h(i[0]):r?.startsWith("session-")?I("/agents"):h(null)}},He=t=>{Re(t)},Ze=async()=>{for(const t of m)await y(t);I("/agents")};return r?e.jsxs("div",{className:"flex flex-col h-full",children:[W&&m.length===0&&r&&e.jsx(Pt,{taskId:r,onStart:se,locationSearch:k.search}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-lg",children:o||c?e.jsx(Te,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):e.jsx(ve,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:W?"Terminal":"Agent Session"}),!W&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:r}),W&&e.jsxs("span",{className:"text-sm text-gray-500 font-mono",children:["(",r,")"]})]})]})}),e.jsx("div",{className:"flex items-center gap-2 sm:gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>r&&x(r),disabled:p,className:"bg-white dark:bg-gray-800",children:[e.jsx(kt,{className:`h-4 w-4 sm:mr-2 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),e.jsx(w,{size:"sm",variant:"destructive",onClick:Ze,title:"Close session","aria-label":"Close session",className:"h-9 w-9 p-0",children:e.jsx(ye,{className:"h-4 w-4"})}),!W&&!o&&!c&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ke,{value:K,onValueChange:H,children:[e.jsx(Ne,{className:"w-24",children:e.jsx(Se,{})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]}),e.jsxs(w,{onClick:pe,disabled:p,size:"sm",variant:"default",className:"bg-green-600 hover:bg-green-700",children:[e.jsx(Ee,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Start Agent"})]})]}),!o&&!c&&(!W||m.length===0)&&e.jsxs(w,{onClick:()=>se(),disabled:p,size:"sm",children:[e.jsx(je,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"New Terminal"})]})]})})]}),M&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1.5 bg-red-100 dark:bg-red-900/40 rounded-lg flex-shrink-0",children:e.jsx(ye,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),e.jsx("div",{className:"text-red-800 dark:text-red-200 text-sm font-medium",children:M})]})}),m.length>0&&e.jsx("div",{className:"flex items-center gap-1 border-b dark:border-gray-700",children:m.map(t=>{const s=u.find(l=>l.id===t),i=b===t;return e.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 border-b-1 cursor-pointer rounded-t-lg transition-all duration-200 ${i?"border-gray-400 bg-white dark:bg-gray-800 dark:border-gray-500 shadow-sm":"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800 hover:border-gray-300"}`,onClick:()=>h(t),children:[e.jsx("div",{className:`p-1.5 rounded-md ${i?"bg-gray-200 dark:bg-gray-700":"bg-gray-100 dark:bg-gray-700"}`,children:e.jsx(ve,{className:`h-3.5 w-3.5 ${i?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400"}`})}),e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["Terminal ",t.split("-").slice(-1)[0].substring(0,6)]}),e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?.connected?"bg-green-500":"bg-gray-400"}`}),e.jsx(w,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-red-100 dark:hover:bg-red-900/30 rounded-md opacity-60 hover:opacity-100 transition-opacity",onClick:l=>{l.stopPropagation(),Re(t)},children:e.jsx(ye,{className:"h-3 w-3"})})]},t)})}),e.jsx("div",{className:"flex-1 min-h-0",children:m.length===0?e.jsx(mt,{className:"h-full",children:e.jsx(ut,{className:"flex items-center justify-center h-full p-8",children:e.jsxs("div",{className:"text-center w-full max-w-[33vw] min-w-[400px]",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full w-fit mx-auto mb-2",children:o||c?e.jsx(we,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"}):e.jsx(ve,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-3",children:"Prepare Agent"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6 leading-relaxed",children:W?"Create a new terminal session":e.jsxs(e.Fragment,{children:["Configure the agent to start working on ",r,"."]})}),e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!W&&!o&&!c&&e.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:[e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Choose your AI agent"}),e.jsxs(ke,{value:K,onValueChange:H,children:[e.jsx(Ne,{className:"w-full h-11 bg-white dark:bg-gray-800",children:e.jsx(Se,{})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code (default)"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs(w,{onClick:pe,disabled:p,className:"bg-green-600 hover:bg-green-700 w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(Ee,{className:"h-5 w-5 mr-2"}),"Start Agent"]}),e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[e.jsx("div",{className:"flex-1 h-px bg-gray-300 dark:bg-gray-600"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 font-medium",children:"or"}),e.jsx("div",{className:"flex-1 h-px bg-gray-300 dark:bg-gray-600"})]}),e.jsxs(w,{onClick:()=>se(),disabled:p,variant:"outline",className:"w-full h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(je,{className:"h-5 w-5 mr-2"}),"New Terminal"]})]}),!W&&(o||c)&&e.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:[C&&e.jsxs(w,{onClick:Ke,disabled:p,className:"w-full bg-blue-600 hover:bg-blue-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Nt,{className:"h-5 w-5 mr-2"}),"Review & Prepare"]}),e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsxs(w,{variant:"outline",onClick:()=>te(!0),className:"flex-1 h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(st,{className:"h-5 w-5 mr-2"}),"Configure"]}),n&&e.jsxs(w,{onClick:pe,disabled:p,className:"flex-1 bg-green-600 hover:bg-green-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Ee,{className:"h-5 w-5 mr-2"}),"Start Agent"]})]}),e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("div",{className:"text-xs uppercase font-semibold text-gray-500 dark:text-gray-400",children:"Agent Configuration"}),e.jsxs("div",{className:"text-left text-sm text-gray-700 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Agent:"}),e.jsx("span",{className:"font-mono text-sm",children:N==="claude"?"Claude Code":N.charAt(0).toUpperCase()+N.slice(1)})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Te,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400 mt-0.5"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Skills:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:j.length?j.map(t=>{const s=U.find(i=>i.id===t);return e.jsx(De,{variant:"secondary",className:"font-mono text-xs",children:s?.name||t},t)}):e.jsx("span",{className:"font-mono text-sm text-gray-500",children:"None"})})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ge,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400 mt-0.5"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"MCP Servers:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:S.length?S.map(t=>e.jsx(De,{variant:"secondary",className:"font-mono text-xs",children:t},t)):e.jsx("span",{className:"font-mono text-sm text-gray-500",children:"None"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Full Environment Access:"}),e.jsx("span",{className:"font-mono text-sm",children:J?"Enabled":"Disabled"})]}),o&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(nt,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Branch:"}),e.jsx("span",{className:"font-mono text-sm",children:V==="current"?`Current (${ue})`:V==="new-branch"?`New branch (${re(r||"")})`:`New worktree (${re(r||"")})`})]})]}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2 text-gray-700 dark:text-gray-300",children:[e.jsx(St,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),"Additional Instructions"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[G.length,"/500"]})]}),e.jsx("textarea",{className:"w-full min-h-[80px] rounded-md border p-3 text-sm bg-gray-50 dark:bg-gray-900/50 border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 resize-none",placeholder:"Add specific instructions to guide the agent...",value:G,onChange:t=>ie(t.target.value),rows:3}),G.length>500&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:"Custom instruction is too long (max 500 characters)"})]})]})]}),W&&m.length===0&&e.jsx("div",{className:"p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:e.jsxs(w,{onClick:()=>se(),disabled:p,className:"w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(je,{className:"h-5 w-5 mr-2"}),"New Terminal"]})})]})]})})}):b?e.jsx("div",{className:"h-full overflow-hidden rounded-b-lg",children:e.jsx(Et,{sessionId:b,onDestroy:()=>He(b),pendingCommand:Y,onCommandExecuted:()=>X(null),showToolbar:!0})}):null}),e.jsx(it,{open:he,onOpenChange:te,children:e.jsxs(ct,{className:"max-w-3xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(lt,{children:[e.jsx(ot,{children:"Configure Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Customize the agent's capabilities and configure it's environment."})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4"}),"Agent"]}),e.jsxs(ke,{value:N,onValueChange:t=>A(t),children:[e.jsx(Ne,{className:"w-full",children:e.jsx(Se,{placeholder:"Select agent"})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"droid",children:"Factory Droid"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[j.length," of ",U.length," selected"]})]}),e.jsxs(Be,{children:[e.jsx(Oe,{asChild:!0,children:e.jsxs(w,{variant:"outline",className:"w-full justify-between",children:[j.length===0?"Select skills...":j.length===U.length?"All skills selected":`${j.length} skill${j.length!==1?"s":""} selected`,e.jsx($e,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(Ie,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(_e,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Skills"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),Q(U.map(s=>s.id))},children:"All"}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),Q([])},children:"None"})]})]}),e.jsx(ze,{}),U.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No skills found"}):U.map(t=>e.jsx(Fe,{checked:j.includes(t.id),onCheckedChange:s=>{Q(i=>s?i.includes(t.id)?i:[...i,t.id]:i.filter(l=>l!==t.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t.name}),t.mcpServers.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",t.mcpServers.join(", ")]}),t.mcpServers.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Inherits available MCP servers"})]})},t.id))]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[S.length," of ",_.length," selected"]})]}),e.jsxs(Be,{children:[e.jsx(Oe,{asChild:!0,children:e.jsxs(w,{variant:"outline",className:"w-full justify-between",children:[S.length===0?"Select MCP servers...":S.length===_.length?"All servers selected":`${S.length} server${S.length!==1?"s":""} selected`,e.jsx($e,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(Ie,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(_e,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),B(_)},children:"All"}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),B([])},children:"None"})]})]}),e.jsx(ze,{}),_.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):_.map(t=>e.jsx(Fe,{checked:S.includes(t),onCheckedChange:s=>{B(i=>s?i.includes(t)?i:[...i,t]:i.filter(l=>l!==t))},children:t},t))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-md bg-amber-50/50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",children:[e.jsx(dt,{id:"automation",checked:J,onCheckedChange:t=>ne(t===!0),className:"data-[state=checked]:bg-red-600 data-[state=checked]:border-red-600 data-[state=checked]:text-white border-red-400",disabled:N==="droid"}),e.jsx("label",{htmlFor:"automation",className:"text-sm font-medium text-red-600 dark:text-red-400 cursor-pointer",children:"Full environment access (recommended in secure environments only)"})]}),N==="droid"&&e.jsxs("p",{className:"text-xs text-muted-foreground px-1",children:[e.jsx("span",{className:"font-medium",children:"Droid:"})," Automation level is set in the REPL. Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"shift+tab"})," to cycle through Off → Low → Medium → High."]})]}),o&&e.jsx(ht,{title:"Advanced Settings",description:"Configure branch and worktree options",defaultOpen:!1,children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(xe,{className:"text-sm font-medium mb-3 block",children:"Branch Management"}),e.jsxs(xt,{value:V,onValueChange:t=>Pe(t),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"current",id:"branch-current"}),e.jsxs(xe,{htmlFor:"branch-current",className:"cursor-pointer font-normal",children:["Stay on current branch (",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:ue}),")"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"new-branch",id:"branch-new"}),e.jsxs(xe,{htmlFor:"branch-new",className:"cursor-pointer font-normal",children:["Create new branch: ",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:re(r||"")})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"new-worktree",id:"branch-worktree"}),e.jsxs(xe,{htmlFor:"branch-worktree",className:"cursor-pointer font-normal",children:["Create new worktree: ",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:re(r||"")})]})]})]})]})})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"outline",onClick:()=>te(!1),children:"Close"}),e.jsx(w,{onClick:()=>{if(G.length>500){L("Please shorten the custom instruction to 500 characters.");return}L(null),ge(),te(!1)},children:"Save"})]}),O&&e.jsx("div",{className:"text-xs text-red-600 text-right",children:O})]})]})})]}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 font-medium",children:"Invalid Task ID"}),e.jsx(w,{onClick:()=>I("/tasks"),className:"mt-4",children:"Back to Tasks"})]})})}function Pt({taskId:r,onStart:k,locationSearch:I}){return a.useEffect(()=>{if(!r)return;const P=new URLSearchParams(I);if(!P.has("autostart"))return;const E=`terminal.autostart.${r}`;if(sessionStorage.getItem(E)==="done")return;sessionStorage.setItem(E,"done");const o=P.get("run")||void 0;k(o||void 0)},[r]),null}export{Xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,a as k,
|
|
1
|
+
import{r as i,a as k,bu as N,A as g,j as e,bx as b,I as P,B as C}from"./index-UXL5-kaP.js";import{C as F,b as w,c as T,d as L,a as D}from"./card-DPLdBoa5.js";import{L as o}from"./label-8VKluf9w.js";import{S as h,a as u,b as m,c as f,d as a}from"./select-CyHFRA1Y.js";import"./index-DnZKG-_7.js";import"./chevron-up-DFd-7wxW.js";const r={theme:"coconut",defaultEditor:"cursor",terminalShell:"bash",autoSaveInterval:60,notifications:{email:!1,desktop:!1,slack:!1}};function V(s){return{theme:s?.theme??r.theme,defaultEditor:s?.defaultEditor??r.defaultEditor,terminalShell:s?.terminalShell??r.terminalShell,autoSaveInterval:s?.autoSaveInterval??r.autoSaveInterval,notifications:{email:s?.notifications?.email??r.notifications.email,desktop:s?.notifications?.desktop??r.notifications.desktop,slack:s?.notifications?.slack??r.notifications.slack}}}function $(){const[s,x]=i.useState(r),[y,E]=i.useState(!0),[c,v]=i.useState(!1),{toast:d}=k(),{theme:j,setTheme:p}=N();i.useEffect(()=>{S()},[]),i.useEffect(()=>{s.theme!==j&&p(s.theme)},[s.theme,j,p]);const S=async()=>{try{const l=await(await fetch(`${g}/api/v1/user/settings`)).json();l.success&&x(V(l.data.preferences))}catch(t){console.error("Failed to load preferences:",t),d({title:"Error",description:"Failed to load user preferences",variant:"destructive"})}finally{E(!1)}},I=async()=>{v(!0);try{const l=await(await fetch(`${g}/api/v1/user/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:s})})).json();if(l.success)d({title:"Preferences saved",description:"Your personal preferences have been updated."});else throw new Error(l.error)}catch(t){console.error("Failed to save preferences:",t),d({title:"Error",description:"Failed to save preferences",variant:"destructive"})}finally{v(!1)}},n=t=>{x(l=>({...l,...t,notifications:{...l.notifications,...t.notifications}}))};return y?e.jsx("div",{children:"Loading..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"User Preferences"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure defaults for editors, shells, themes, and notifications."})]}),e.jsx(b,{}),e.jsxs(F,{children:[e.jsxs(w,{children:[e.jsx(T,{children:"Workspace Defaults"}),e.jsx(L,{children:"Set the defaults Coconut uses when creating sessions and surfaces."})]}),e.jsxs(D,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"theme",children:"Theme"}),e.jsxs(h,{value:s.theme,onValueChange:t=>n({theme:t}),children:[e.jsx(u,{id:"theme",children:e.jsx(m,{placeholder:"Select theme"})}),e.jsxs(f,{children:[e.jsx(a,{value:"coconut",children:"Coconut"}),e.jsx(a,{value:"system",children:"System"}),e.jsx(a,{value:"light",children:"Light"}),e.jsx(a,{value:"dark",children:"Dark"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"System follows your OS preference. Coconut is the default branded theme."})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"defaultEditor",children:"Default Editor"}),e.jsxs(h,{value:s.defaultEditor,onValueChange:t=>n({defaultEditor:t}),children:[e.jsx(u,{id:"defaultEditor",children:e.jsx(m,{placeholder:"Select editor"})}),e.jsxs(f,{children:[e.jsx(a,{value:"cursor",children:"Cursor"}),e.jsx(a,{value:"vscode",children:"VS Code"}),e.jsx(a,{value:"vim",children:"Vim"}),e.jsx(a,{value:"emacs",children:"Emacs"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"terminalShell",children:"Preferred Shell"}),e.jsxs(h,{value:s.terminalShell,onValueChange:t=>n({terminalShell:t}),children:[e.jsx(u,{id:"terminalShell",children:e.jsx(m,{placeholder:"Select shell"})}),e.jsxs(f,{children:[e.jsx(a,{value:"bash",children:"Bash"}),e.jsx(a,{value:"zsh",children:"Zsh"}),e.jsx(a,{value:"fish",children:"Fish"}),e.jsx(a,{value:"sh",children:"sh"}),e.jsx(a,{value:"system",children:"System Default"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"autoSaveInterval",children:"Auto-save Interval (seconds)"}),e.jsx(P,{id:"autoSaveInterval",type:"number",min:10,max:600,value:s.autoSaveInterval,onChange:t=>n({autoSaveInterval:Number.parseInt(t.target.value,10)||r.autoSaveInterval})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Controls how often Coconut persists draft work to disk."})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(C,{variant:"outline",onClick:S,disabled:c,children:"Reset"}),e.jsx(C,{onClick:I,disabled:c,children:c?"Saving...":"Save Preferences"})]})]})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,a as S,A as j,j as e,
|
|
1
|
+
import{r as i,a as S,A as j,j as e,bx as b,B as m,I as u,L as w}from"./index-UXL5-kaP.js";import{C as E,b as I,c as F,d as L,a as k}from"./card-DPLdBoa5.js";import{L as h}from"./label-8VKluf9w.js";import{C as D,a as P}from"./clipboard-C8wZRPDH.js";function B(){const[r,l]=i.useState({}),[o,c]=i.useState(null),[f,x]=i.useState(!1),[v,C]=i.useState(!0),[d,p]=i.useState(!1),{toast:n}=S();i.useEffect(()=>{g()},[]);const g=async()=>{try{try{const t=await fetch(`${j}/api/v1/config`),s=await t.json();if(t.ok&&s?.success){const a=s.data?.coconut||{};c(a.id??null),(a.firstName||a.lastName||a.email)&&l({firstName:a.firstName,lastName:a.lastName,email:a.email})}else c(null)}catch(t){console.error("Failed to load coconut config:",t),c(null)}}catch(t){console.error("Failed to load settings:",t),n({title:"Error",description:"Failed to load user settings",variant:"destructive"})}finally{C(!1)}},N=async()=>{p(!0);try{const s=await(await fetch(`${j}/api/v1/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({coconut:{...r,id:o||void 0}})})).json();if(s.success)window.dispatchEvent(new CustomEvent("config-updated")),n({title:"Success",description:"Settings saved successfully"});else throw new Error(s.error||"Failed to save settings")}catch(t){console.error("Failed to save settings:",t),n({title:"Error",description:"Failed to save settings",variant:"destructive"})}finally{p(!1)}},y=async()=>{if(o)try{await navigator.clipboard.writeText(o),x(!0),n({title:"Copied",description:"Coconut ID copied to clipboard."}),setTimeout(()=>x(!1),1500)}catch(t){console.error("Failed to copy coconut ID:",t),n({title:"Copy failed",description:"Unable to copy the Coconut ID to the clipboard.",variant:"destructive"})}};return v?e.jsx("div",{children:"Loading..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Coconut Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage the Coconut's profile information."})]}),e.jsx(b,{}),e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/40 p-4",children:o?e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Coconut ID"}),e.jsx("p",{className:"mt-1 font-mono text-sm",children:o})]}),e.jsxs(m,{variant:"outline",size:"sm",onClick:y,children:[f?e.jsx(D,{className:"h-4 w-4"}):e.jsx(P,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2",children:f?"Copied":"Copy"})]})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Coconut ID not configured"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Add an `id` under the `coconut` section in `.nut/config.json` to register this Coconut instance."})]})}),e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsx(F,{children:"Coconut Profile"}),e.jsx(L,{children:"Update the Coconut's identifying details."})]}),e.jsxs(k,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(h,{htmlFor:"firstName",children:"First Name"}),e.jsx(u,{id:"firstName",value:r.firstName||"",onChange:t=>l(s=>({...s,firstName:t.target.value})),placeholder:"Enter first name"})]}),e.jsxs("div",{children:[e.jsx(h,{htmlFor:"lastName",children:"Last Name"}),e.jsx(u,{id:"lastName",value:r.lastName||"",onChange:t=>l(s=>({...s,lastName:t.target.value})),placeholder:"Enter last name"})]})]}),e.jsxs("div",{children:[e.jsx(h,{htmlFor:"email",children:"Email"}),e.jsx(u,{id:"email",type:"email",value:r.email||"",onChange:t=>l(s=>({...s,email:t.target.value})),placeholder:"Enter email address"})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can also manage the Coconut's identity to other agents on the"," ",e.jsx(w,{to:"/identity",className:"underline underline-offset-4 hover:text-primary",children:"Identity page"}),"."]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(m,{variant:"outline",onClick:g,disabled:d,children:"Cancel"}),e.jsx(m,{onClick:N,disabled:d,children:d?"Saving...":"Save Changes"})]})]})}export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as L,a as F,r as n,A as C,j as s,B as m,v as b,a1 as M,I,H as Q,P as R,ab as W,a2 as q}from"./index-UXL5-kaP.js";import{C as G,a as K}from"./card-DPLdBoa5.js";import{u as V}from"./use-terminal-D3iV7-iC.js";import{C as X}from"./circle-play-iZZwaGbV.js";import{P as Y}from"./play-DVBhRokt.js";function A(){return`script-${Date.now()}-${Math.floor(Math.random()*1e3)}`}function T(o){return Object.entries(o).map(([l,r])=>({id:A(),name:l,command:r}))}function $(o){const l={};for(const r of o){const x=r.name.trim();x&&(l[x]=r.command)}return l}function ns(){const o=L(),{loading:l,createSession:r,refreshSessions:x}=V(),{toast:c}=F(),[O,h]=n.useState(!1),[P,p]=n.useState(!1),[g,j]=n.useState(!1),[B,D]=n.useState(!0),[d,u]=n.useState([]),[E,v]=n.useState({}),[,N]=n.useState([]),_=JSON.stringify($(d))!==JSON.stringify(E);n.useEffect(()=>{try{const e=localStorage.getItem("terminal.commandHistory");e&&N(JSON.parse(e))}catch{}},[]),n.useEffect(()=>{(async()=>{try{const t=await fetch(`${C}/api/v1/config`);if(!t.ok)return;const i=(await t.json())?.data?.scripts||{};v(i),u(T(i))}catch{}finally{D(!1)}})()},[]);const y=e=>{e&&N(t=>{const a=[e,...t.filter(i=>i!==e)].slice(0,5);try{localStorage.setItem("terminal.commandHistory",JSON.stringify(a))}catch{}return a})},z=n.useCallback(async()=>{const e=$(d),t=d.filter(a=>!a.name.trim()&&!a.command.trim()).length;j(!0);try{if(!(await fetch(`${C}/api/v1/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scripts:e})})).ok)throw new Error("Save failed");v(e),u(T(e)),c({title:"Scripts saved",description:t>0?`${t} blank row${t>1?"s":""} removed`:void 0})}catch{c({title:"Failed to save scripts",variant:"destructive"})}finally{j(!1)}},[d,c]),S=()=>{u(e=>[...e,{id:A(),name:"",command:""}])},k=(e,t,a)=>{u(i=>i.map(f=>f.id===e?{...f,[t]:a}:f))},H=e=>{u(t=>t.filter(a=>a.id!==e))},J=async e=>{const t=(e||"").trim();if(!t)return;const a=`session-${Date.now()}`;h(!0);try{await r(a,t)?(y(t),c({title:"Session started",description:a}),o(`/terminal/${a}`)):c({title:"Failed to start",variant:"destructive"})}finally{h(!1)}},U=async e=>{const t=(e||"").trim();if(!t)return;const a=`session-${Date.now()}`;p(!0);try{await r(a,t)?(y(t),setTimeout(()=>x(),150),c({title:"Started in background",description:a,action:s.jsx(q,{altText:"Open session",onClick:()=>o(`/terminal/${a}`),children:"Open"})})):c({title:"Failed to start",variant:"destructive"})}finally{p(!1)}},w=l||O||P;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Utilities"}),s.jsx("p",{className:"text-muted-foreground",children:"Quick commands and shortcuts"})]}),s.jsx("div",{className:"flex items-center gap-2",children:_&&s.jsxs(m,{onClick:z,disabled:g,size:"sm",children:[g?s.jsx(b,{className:"h-4 w-4 mr-1 animate-spin"}):s.jsx(M,{className:"h-4 w-4 mr-1"}),"Save"]})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Scripts"}),s.jsx(G,{children:s.jsx(K,{className:"pt-6",children:B?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(b,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.length>0?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[1fr_2fr_auto] gap-2 px-2 pb-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Name"}),s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Command"}),s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide w-[200px]",children:"Actions"})]}),s.jsx("div",{className:"rounded-md border divide-y",children:d.map(e=>s.jsxs("div",{className:"flex flex-col sm:grid sm:grid-cols-[1fr_2fr_auto] gap-2 p-2 items-start sm:items-center",children:[s.jsx(I,{value:e.name,onChange:t=>k(e.id,"name",t.target.value),placeholder:"script name",className:"h-8 text-sm font-medium"}),s.jsx(I,{value:e.command,onChange:t=>k(e.id,"command",t.target.value),placeholder:"command to run",className:"h-8 text-sm font-mono"}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsxs(m,{onClick:()=>U(e.command),variant:"secondary",size:"sm",disabled:w||!e.command.trim(),title:"Run in background",children:[s.jsx(X,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Background"})]}),s.jsxs(m,{onClick:()=>J(e.command),size:"sm",disabled:w||!e.command.trim(),title:"Run",children:[s.jsx(Y,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Run"})]}),s.jsx(m,{onClick:()=>H(e.id),variant:"ghost",size:"sm",title:"Remove script",children:s.jsx(Q,{className:"h-4 w-4"})})]})]},e.id))}),s.jsxs(m,{variant:"outline",size:"sm",onClick:S,className:"mt-2",children:[s.jsx(R,{className:"h-4 w-4 mr-1"}),"Add Script"]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3 py-8",children:[s.jsx(W,{className:"h-12 w-12 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No scripts configured"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-md leading-relaxed",children:"Scripts let you run common tasks with one click, like starting your development server or running build commands."})]}),s.jsxs(m,{variant:"outline",onClick:S,children:[s.jsx(R,{className:"h-4 w-4 mr-1"}),"Add Script"]})]})})})]})]})}export{ns as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as a,e as o}from"./index-
|
|
1
|
+
import{r,j as a,e as o}from"./index-UXL5-kaP.js";const v=r.forwardRef(({className:e,variant:t="default",...s},d)=>{const l="relative w-full rounded-lg border px-4 py-3 text-sm [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",i=t==="destructive"?"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive":"bg-background text-foreground";return a.jsx("div",{ref:d,role:"alert",className:o(l,i,e),...s})});v.displayName="Alert";const c=r.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:o("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{v as A,c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,e as n,by as a}from"./index-
|
|
1
|
+
import{j as o,e as n,by as a}from"./index-UXL5-kaP.js";const s=a("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",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i({className:r,variant:e,...t}){return o.jsx("div",{className:n(s({variant:e}),r),...t})}export{i as B};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as $,r,j as e,D as z,b as G,d as J,f as K,I as Q,
|
|
1
|
+
import{c as $,r,j as e,D as z,b as G,d as J,f as K,I as Q,v as M,S as V,e as W,Y as X,B}from"./index-UXL5-kaP.js";import{B as v}from"./badge-vIqE5SOP.js";import{a as Z}from"./registry-ANRa5WBi.js";import{S as O}from"./search-BxF7Wwex.js";/**
|
|
2
2
|
* @license lucide-react v0.542.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 ee=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],ne=$("library",ee),te="Browse Registry",se="Import";function oe({open:f,categoryId:n,onOpenChange:x,title:F=te,confirmLabel:A=se,filterTags:o,onConfirm:I,getDetail:R,renderPreview:_}){const[c,y]=r.useState([]),[P,N]=r.useState(!1),[w,S]=r.useState(null),[l,b]=r.useState(null),[h,L]=r.useState({}),[T,g]=r.useState(!1),[E,j]=r.useState(null),[d,C]=r.useState(""),[p,k]=r.useState(!1);r.useEffect(()=>{if(!f)return;N(!0),S(null),b(null),j(null),g(!1),L({}),C("");const t=Array.isArray(n)?n:[n];Promise.all(t.map(s=>Z(s))).then(s=>{const a=s.flatMap(u=>u.elements??[]);y(a)}).catch(s=>{console.error("Failed to load registry category",s),y([]),S("Failed to load registry entries")}).finally(()=>N(!1))},[f,n]);const D=r.useMemo(()=>{let t=c;if(o&&o.length>0&&(t=t.filter(a=>{const u=a.tags??[];return o.some(H=>u.some(
|
|
6
|
+
*/const ee=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],ne=$("library",ee),te="Browse Registry",se="Import";function oe({open:f,categoryId:n,onOpenChange:x,title:F=te,confirmLabel:A=se,filterTags:o,onConfirm:I,getDetail:R,renderPreview:_}){const[c,y]=r.useState([]),[P,N]=r.useState(!1),[w,S]=r.useState(null),[l,b]=r.useState(null),[h,L]=r.useState({}),[T,g]=r.useState(!1),[E,j]=r.useState(null),[d,C]=r.useState(""),[p,k]=r.useState(!1);r.useEffect(()=>{if(!f)return;N(!0),S(null),b(null),j(null),g(!1),L({}),C("");const t=Array.isArray(n)?n:[n];Promise.all(t.map(s=>Z(s))).then(s=>{const a=s.flatMap(u=>u.elements??[]);y(a)}).catch(s=>{console.error("Failed to load registry category",s),y([]),S("Failed to load registry entries")}).finally(()=>N(!1))},[f,n]);const D=r.useMemo(()=>{let t=c;if(o&&o.length>0&&(t=t.filter(a=>{const u=a.tags??[];return o.some(H=>u.some(Y=>Y.toLowerCase()===H.toLowerCase()))})),!d.trim())return t;const s=d.trim().toLowerCase();return t.filter(a=>[a.name,a.description,a.preview,...a.tags??[]].filter(Boolean).join(" ").toLowerCase().includes(s))},[c,d,o]),i=r.useMemo(()=>l?c.find(t=>t.id===l)??null:null,[c,l]),m=r.useMemo(()=>l?h[l]?.detail??null:null,[l,h]),U=async t=>{if(b(t.id),j(null),!h?.[t.id]?.detail){g(!0);try{const s=await R(t);L(a=>({...a??{},[t.id]:{detail:s,fetchedAt:Date.now()}}))}catch(s){console.error("Failed to load registry element detail",s),j("Unable to load detail for this entry")}finally{g(!1)}}},q=async()=>{if(!(!i||!m)){k(!0);try{await I(i,m),x(!1)}catch(t){console.error("Failed to import registry element",t)}finally{k(!1)}}};return e.jsx(z,{open:f,onOpenChange:x,children:e.jsxs(G,{className:"max-w-5xl h-[80vh] flex flex-col",children:[e.jsx(J,{children:e.jsx(K,{children:F})}),e.jsx("div",{className:"flex flex-col gap-4",children:e.jsxs("div",{className:"relative",children:[e.jsx(O,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Q,{value:d,onChange:t=>C(t.target.value),placeholder:"Search registry entries",className:"pl-9"})]})}),e.jsxs("div",{className:"flex-1 flex gap-4 min-h-0",children:[e.jsx("div",{className:"w-1/3 border-r pr-3",children:P?e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(M,{className:"h-4 w-4 animate-spin mr-2"}),"Loading entries…"]}):w?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:w}):D.length===0?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"No entries found"}):e.jsx(V,{className:"h-full",children:e.jsx("div",{className:"space-y-1 pb-4",children:D.map(t=>e.jsxs("button",{onClick:()=>U(t),className:W("w-full rounded-md border border-transparent p-3 text-left transition-colors hover:border-border hover:bg-muted/40",l===t.id&&"border-primary bg-muted"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:t.name}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:t.description||t.preview})]}),t.version&&e.jsxs(v,{variant:"outline",className:"text-[10px] font-medium uppercase",children:["v",t.version]})]}),t.tags&&t.tags.length>0&&e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[t.tags.slice(0,4).map(s=>e.jsx(v,{variant:"secondary",className:"text-[10px] font-normal",children:s},s)),t.tags.length>4&&e.jsxs(v,{variant:"outline",className:"text-[10px] font-normal",children:["+",t.tags.length-4]})]})]},t.id))})})}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:T?e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(M,{className:"h-5 w-5 animate-spin mr-2"}),"Loading detail…"]}):E?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:E}):i?e.jsx("div",{className:"h-full overflow-hidden",children:_(i,m)}):e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Select an entry to preview"})})]}),e.jsxs(X,{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:i?`Selected: ${i.name}`:"No entry selected"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(B,{variant:"outline",onClick:()=>x(!1),disabled:p,children:"Cancel"}),e.jsx(B,{onClick:q,disabled:!i||!m||p,children:p?"Importing…":A})]})]})]})})}export{ne as L,oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as d,e as t}from"./index-
|
|
1
|
+
import{r,j as d,e as t}from"./index-UXL5-kaP.js";const o=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("rounded-xl border bg-card text-card-foreground shadow",a),...e}));o.displayName="Card";const c=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("flex flex-col space-y-1.5 p-6",a),...e}));c.displayName="CardHeader";const i=r.forwardRef(({className:a,...e},s)=>d.jsx("h3",{ref:s,className:t("font-semibold leading-none tracking-tight",a),...e}));i.displayName="CardTitle";const n=r.forwardRef(({className:a,...e},s)=>d.jsx("p",{ref:s,className:t("text-sm text-muted-foreground",a),...e}));n.displayName="CardDescription";const l=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("p-6 pt-0",a),...e}));l.displayName="CardContent";const f=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("flex items-center p-6 pt-0",a),...e}));f.displayName="CardFooter";export{o as C,l as a,c as b,i as c,n as d,f as e};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c}from"./index-UXL5-kaP.js";/**
|
|
2
|
+
* @license lucide-react v0.542.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],a=c("globe",e);export{a as G};
|