@lovelybunch/api 1.0.76 → 1.0.77-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/lib/terminal/terminal-manager.js +2 -1
  2. package/dist/routes/api/v1/events/status/route.d.ts +1 -1
  3. package/dist/routes/api/v1/jobs/[id]/route.d.ts +16 -16
  4. package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
  5. package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
  6. package/dist/routes/api/v1/jobs/route.d.ts +16 -16
  7. package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
  8. package/dist/routes/api/v1/mail/route.d.ts +3 -3
  9. package/dist/routes/api/v1/slack/route.d.ts +6 -6
  10. package/dist/routes/api/v1/tasks/[id]/route.d.ts +4 -4
  11. package/dist/routes/api/v1/tasks/[id]/steps/[stepId]/route.d.ts +2 -2
  12. package/dist/routes/api/v1/tasks/route.d.ts +1 -1
  13. package/dist/server-with-static.js +23 -17
  14. package/dist/server.js +1 -0
  15. package/package.json +24 -23
  16. package/static/assets/{ActivityPage-sJEQn6DK.js → ActivityPage-rASRHKYj.js} +1 -1
  17. package/static/assets/{AgentsContextEditPage-DU3qIXk9.js → AgentsContextEditPage-CMWD-7mS.js} +1 -1
  18. package/static/assets/{AgentsContextPage-tJ-LhFYb.js → AgentsContextPage-VfMmxxr6.js} +1 -1
  19. package/static/assets/{ApiKeysSettingsPage-Bg84BQHV.js → ApiKeysSettingsPage-DxtuyXwn.js} +1 -1
  20. package/static/assets/{AuthSettingsPage-Bwr7uP3z.js → AuthSettingsPage-CWTpS6BA.js} +2 -2
  21. package/static/assets/{CallbackPage-BFn0Np2S.js → CallbackPage-CjlTVuif.js} +1 -1
  22. package/static/assets/{CodePage-kp4s3wCJ.js → CodePage-DwjtGxQi.js} +1 -1
  23. package/static/assets/{CollapsibleSection-CNs1mvsZ.js → CollapsibleSection-LrQJlSxD.js} +1 -1
  24. package/static/assets/{DashboardPage-DMJSzzgD.js → DashboardPage-DnyFyDO0.js} +2 -2
  25. package/static/assets/{GitPage-uqene8zj.js → GitPage-o37iQMYQ.js} +1 -1
  26. package/static/assets/{GitSettingsPage-CLswbZsT.js → GitSettingsPage-O0fe5kxm.js} +1 -1
  27. package/static/assets/{IdentityPage-BDTPXEo7.js → IdentityPage-KWjruliO.js} +1 -1
  28. package/static/assets/{ImplementationStepsEditor-D4cvhPhz.js → ImplementationStepsEditor-h_Mxu1tF.js} +1 -1
  29. package/static/assets/{IntegrationsSettingsPage-o7NXZGt9.js → IntegrationsSettingsPage-DeFQd6af.js} +1 -1
  30. package/static/assets/{JobDetailPage-DuEiPz6X.js → JobDetailPage-HOLpF7Sx.js} +1 -1
  31. package/static/assets/{KnowledgeDetailPage-DFVud_VC.js → KnowledgeDetailPage-C5egPQ54.js} +1 -1
  32. package/static/assets/KnowledgeEditPage-DrdvEGuR.js +1 -0
  33. package/static/assets/{KnowledgePage-B2zI3xwW.js → KnowledgePage-CK5rtZcv.js} +1 -1
  34. package/static/assets/{LoginPage-CUJRxwXy.js → LoginPage-DajEouCN.js} +1 -1
  35. package/static/assets/MailInboxPage-CewILL7o.js +1 -0
  36. package/static/assets/{MailProcessingModal-BJIdHOqK.js → MailProcessingModal-B1ZLXyYl.js} +1 -1
  37. package/static/assets/MailReadPage--LnQ743i.js +1 -0
  38. package/static/assets/MailSentPage-BqO4iBq6.js +1 -0
  39. package/static/assets/{McpSettingsPage-BZcCGkGM.js → McpSettingsPage-BZ6GJOtk.js} +1 -1
  40. package/static/assets/{MemoryEditPage-DXSQoCT4.js → MemoryEditPage-BLfdKEDu.js} +1 -1
  41. package/static/assets/{MemoryPage-oBnyuvSf.js → MemoryPage-BV0RlvUS.js} +1 -1
  42. package/static/assets/{NewKnowledgePage-deMsezK8.js → NewKnowledgePage-SrBhXpH6.js} +1 -1
  43. package/static/assets/{NewSkillPage-DRYWdrlV.js → NewSkillPage-vt-0rIkv.js} +1 -1
  44. package/static/assets/{NewTaskPage-B6xdic5_.js → NewTaskPage-CBUpwIFP.js} +1 -1
  45. package/static/assets/{NotFoundPage-Bxu9uKFO.js → NotFoundPage-CWF5qOC0.js} +1 -1
  46. package/static/assets/{NotificationsSettingsPage-CLgtsCVM.js → NotificationsSettingsPage-3ZvMrqiq.js} +1 -1
  47. package/static/assets/{PromptsSettingsPage-BWaELCjG.js → PromptsSettingsPage-pHKoiUPI.js} +1 -1
  48. package/static/assets/{ResourceDetailPage-CMPDRdVM.js → ResourceDetailPage-CE4iDbv7.js} +1 -1
  49. package/static/assets/{ResourcesPage-DspYILfG.js → ResourcesPage-4_5NA4RF.js} +1 -1
  50. package/static/assets/{RoleEditPage-DXtzicVZ.js → RoleEditPage-4sSELIRX.js} +1 -1
  51. package/static/assets/{RolePage-DafGURGp.js → RolePage-Ds17xn4X.js} +1 -1
  52. package/static/assets/{RulesSettingsPage-E8V9cexV.js → RulesSettingsPage-DnyGaden.js} +1 -1
  53. package/static/assets/{RunDetailPage-DsxkqFst.js → RunDetailPage-D2ajvKfh.js} +1 -1
  54. package/static/assets/SchedulePage-oEGct1B1.js +4 -0
  55. package/static/assets/{SkillDetailPage-CWkqSfuT.js → SkillDetailPage-mSypV_JK.js} +1 -1
  56. package/static/assets/{SkillEditPage-DwyebzFV.js → SkillEditPage-DeI8uu3S.js} +1 -1
  57. package/static/assets/{SkillsPage-CauK65X_.js → SkillsPage-Bb_dEdun.js} +1 -1
  58. package/static/assets/{SkillsSettingsPage-DXMRv3jR.js → SkillsSettingsPage-CMWf2O9y.js} +1 -1
  59. package/static/assets/SourceInput-CtyUOXOG.js +1 -0
  60. package/static/assets/{TagInput-Ct-WRvTs.js → TagInput-C0NyMxlY.js} +1 -1
  61. package/static/assets/{TaskDetailPage-CApk2iBh.js → TaskDetailPage-6DDI0juh.js} +1 -1
  62. package/static/assets/{TaskEditPage-NgOVShfK.js → TaskEditPage-Btc1NXtR.js} +1 -1
  63. package/static/assets/{TasksPage-BoPrP_Rl.js → TasksPage-C9TYvqRz.js} +1 -1
  64. package/static/assets/{TeamEditPage-ChY6mYm8.js → TeamEditPage-CLvNy6Ss.js} +1 -1
  65. package/static/assets/{TeamPage-DH-dJhFG.js → TeamPage-DSWax4fa.js} +1 -1
  66. package/static/assets/{TerminalPage-CRhcscF2.js → TerminalPage-DNDHEYJZ.js} +1 -1
  67. package/static/assets/{TerminalSessionPage-CSCQg2sn.js → TerminalSessionPage-nNCw_oDE.js} +1 -1
  68. package/static/assets/{UserPreferencesPage-DxCSWJnS.js → UserPreferencesPage-jc1SA79x.js} +1 -1
  69. package/static/assets/{UserSettingsPage-DKkOLNPV.js → UserSettingsPage-pr6n15Pz.js} +1 -1
  70. package/static/assets/{UtilitiesPage-CBNSvixW.js → UtilitiesPage-CjLb989o.js} +1 -1
  71. package/static/assets/{alert-Dw_RSroN.js → alert-BtkLXQ3p.js} +1 -1
  72. package/static/assets/{arrow-down-UClxXzT-.js → arrow-down-DnNLmXEs.js} +1 -1
  73. package/static/assets/{arrow-left-DWmf9YJp.js → arrow-left-B9NBHEkS.js} +1 -1
  74. package/static/assets/{arrow-up-down-Btc3okb3.js → arrow-up-down-DIuMvAne.js} +1 -1
  75. package/static/assets/{arrow-up-fLCh7Hvh.js → arrow-up-eMUJY7J9.js} +1 -1
  76. package/static/assets/{badge-vIqE5SOP.js → badge-BbfU_aPt.js} +1 -1
  77. package/static/assets/{browser-modal-DgMJTsMd.js → browser-modal-J9l3o5os.js} +1 -1
  78. package/static/assets/{card-DPLdBoa5.js → card-CL5bB4cs.js} +1 -1
  79. package/static/assets/{chevron-left-CiNaLX-v.js → chevron-left-B-7K6MNx.js} +1 -1
  80. package/static/assets/{chevron-up-DFd-7wxW.js → chevron-up-BwTmMEW2.js} +1 -1
  81. package/static/assets/{chevrons-up-BfU70OcQ.js → chevrons-up-jI6nxhrz.js} +1 -1
  82. package/static/assets/{circle-alert-Mv00T-P2.js → circle-alert-vJFSz39V.js} +1 -1
  83. package/static/assets/{circle-check-xMiP6SLO.js → circle-check-D2LVHMl-.js} +1 -1
  84. package/static/assets/{circle-check-big-BEY1IoIP.js → circle-check-big-BwQ_q1N7.js} +1 -1
  85. package/static/assets/{circle-play-iZZwaGbV.js → circle-play-CLKDBkrK.js} +1 -1
  86. package/static/assets/{circle-x-z3iynaE7.js → circle-x-CuUVLiI-.js} +1 -1
  87. package/static/assets/{clipboard-C8wZRPDH.js → clipboard-BHOFelnW.js} +1 -1
  88. package/static/assets/{clock-C_9shc08.js → clock-D-X3KCw6.js} +1 -1
  89. package/static/assets/{code-DH-sRhus.js → code-DqYaanki.js} +1 -1
  90. package/static/assets/{download-CE8b59ER.js → download-DeEju9jg.js} +1 -1
  91. package/static/assets/{external-link-DPyKt8NE.js → external-link-CrRz0sU-.js} +1 -1
  92. package/static/assets/{eye-BpGD-yoS.js → eye-Cx9ZGkg5.js} +1 -1
  93. package/static/assets/{folder-git-2-BIw4zbmy.js → folder-git-2-Cizv1NA6.js} +1 -1
  94. package/static/assets/{globe-CUo7eHKN.js → globe-lpD9Jv31.js} +1 -1
  95. package/static/assets/{index-jaRIZ6SY.js → index-BCYTbJRb.js} +1 -1
  96. package/static/assets/{index-CTouvf2d.js → index-BL-5Bhtg.js} +1 -1
  97. package/static/assets/{index-BaR4iUzg.js → index-BPdWQ0rI.js} +1 -1
  98. package/static/assets/{index-B07hel4U.js → index-BVrOTqTm.js} +1 -1
  99. package/static/assets/{index-iB8oed57.js → index-BknCCMZK.js} +1 -1
  100. package/static/assets/{index-CpJ0uBf3.js → index-BvZJRqTz.js} +1 -1
  101. package/static/assets/{index-UXL5-kaP.js → index-ByTA2ZiD.js} +6 -6
  102. package/static/assets/{index-ClO9-JVh.js → index-CMaK0hpv.js} +1 -1
  103. package/static/assets/{index-Bkt1rQVV.js → index-CkT4WgqR.js} +1 -1
  104. package/static/assets/{index-DnZKG-_7.js → index-CuLP7P_G.js} +1 -1
  105. package/static/assets/{index-CsBxEWw5.js → index-D12O6wM3.js} +1 -1
  106. package/static/assets/{index-DZAYfTI2.js → index-DIt703WU.js} +1 -1
  107. package/static/assets/{index-CGbmjmEy.js → index-DK1gGyTZ.js} +1 -1
  108. package/static/assets/index-DVMcu9sQ.css +1 -0
  109. package/static/assets/{index-Bfb3OTwj.js → index-Dc9Njo8L.js} +1 -1
  110. package/static/assets/{index-BCwmQxLC.js → index-DgAcL75U.js} +1 -1
  111. package/static/assets/{index-C65b3D5_.js → index-Djzp98Vj.js} +1 -1
  112. package/static/assets/{index-BOKaM9K-.js → index-Dnj5cWsp.js} +1 -1
  113. package/static/assets/{index-Dkr9CBL7.js → index-Hy3cH93B.js} +1 -1
  114. package/static/assets/{index-Cdwx6Zps.js → index-ihWq-CVE.js} +1 -1
  115. package/static/assets/{info-D-UNBNx2.js → info-DxhTCbw1.js} +1 -1
  116. package/static/assets/{label-8VKluf9w.js → label-Dp0-28_O.js} +1 -1
  117. package/static/assets/{markdown-editor-DBdRsbP2.js → markdown-editor-DUmrf1eN.js} +3 -3
  118. package/static/assets/{message-square-CO8kDUed.js → message-square-BPOApeM3.js} +1 -1
  119. package/static/assets/{paperclip-DlLXZbru.js → paperclip-Bfjc1WLZ.js} +1 -1
  120. package/static/assets/{pause-zSiaxJBu.js → pause-Bfz-QQZp.js} +1 -1
  121. package/static/assets/{pipeline-builders-Bkf0wt_O.js → pipeline-builders-DrEjlsbH.js} +1 -1
  122. package/static/assets/{play-DVBhRokt.js → play-fOwEoIcu.js} +1 -1
  123. package/static/assets/{radio-group-CThYUcA4.js → radio-group-B8RB7N01.js} +1 -1
  124. package/static/assets/{refresh-cw-tXYl1ePu.js → refresh-cw-Cj_5MZiJ.js} +1 -1
  125. package/static/assets/{search-BxF7Wwex.js → search-BgbqRUnf.js} +1 -1
  126. package/static/assets/{select-CyHFRA1Y.js → select-CfwLZl55.js} +1 -1
  127. package/static/assets/{server-lRxThHjr.js → server-u9FLHclt.js} +1 -1
  128. package/static/assets/{switch-BUpDbrux.js → switch-CX_Inx_p.js} +1 -1
  129. package/static/assets/{tabs-DkvCmQEX.js → tabs-Bj0YyeRI.js} +1 -1
  130. package/static/assets/{tag-CkcZNLnh.js → tag-rYG4CdRx.js} +1 -1
  131. package/static/assets/terminal-preview-BNm5-Umi.js +1 -0
  132. package/static/assets/{triangle-alert-CmjG_mbF.js → triangle-alert-C0ovMJwZ.js} +1 -1
  133. package/static/assets/{use-terminal-D3iV7-iC.js → use-terminal-D1UnvAVs.js} +1 -1
  134. package/static/assets/{video-CY_dOujm.js → video-CuyRES-H.js} +1 -1
  135. package/static/index.html +2 -2
  136. package/static/assets/KnowledgeEditPage-XG6HKK7E.js +0 -1
  137. package/static/assets/MailInboxPage-BlCG-tba.js +0 -1
  138. package/static/assets/MailReadPage-MoNo_gmW.js +0 -1
  139. package/static/assets/MailSentPage-QzpuIJmT.js +0 -1
  140. package/static/assets/SchedulePage-B2YvNDHr.js +0 -4
  141. package/static/assets/SourceInput-C0iKqbQ1.js +0 -1
  142. package/static/assets/index-BcCuKdbf.css +0 -1
  143. package/static/assets/terminal-preview-CLWDhoOZ.js +0 -1
@@ -1 +1 @@
1
- import{y as R,u as U,a as H,r as c,A,j as e,B as h,L as p,I as O,X as V,a1 as _}from"./index-UXL5-kaP.js";import{L as j}from"./label-8VKluf9w.js";import{S as D,a as L,b as F,c as I,d as r}from"./select-CyHFRA1Y.js";import{C as f,b as $,a as v,c as q,d as J}from"./card-DPLdBoa5.js";import{M as K}from"./markdown-editor-DBdRsbP2.js";import{C as W}from"./CollapsibleSection-CNs1mvsZ.js";import{I as X,L as G}from"./ImplementationStepsEditor-D4cvhPhz.js";import{T as Q}from"./TagInput-Ct-WRvTs.js";import{A as N}from"./arrow-left-DWmf9YJp.js";import"./index-DnZKG-_7.js";import"./chevron-up-DFd-7wxW.js";import"./badge-vIqE5SOP.js";function oe(){const{id:i}=R(),P=U(),{toast:y}=H(),[z,S]=c.useState(!0),[u,k]=c.useState(!1),[C,w]=c.useState(null),[n,o]=c.useState({title:"",description:"",priority:"medium",status:"draft",author:{id:"current-user",name:"Current User",email:"user@example.com"}}),[m,b]=c.useState([]),[T,E]=c.useState([]);c.useEffect(()=>{i&&B()},[i]);const B=async()=>{try{S(!0);const t=await fetch(`${A}/api/v1/tasks/${i}`),s=await t.json();if(s.success||s.data||t.ok){const a=s.data||s;o({title:a.title||a.intent||"",description:a.content||"",priority:a.metadata?.priority||"medium",status:a.status||"draft",author:{id:a.author?.id||"current-user",name:a.author?.name||"Current User",email:a.author?.email||"user@example.com"}});const g=Array.isArray(a.planSteps)?a.planSteps:[];b(g.map((d,x)=>({id:d.id||`step-${x+1}`,description:d.description||"",status:d.status||"pending"}))),E(a.metadata?.tags||[])}else w(s.error?.message||"Failed to fetch task")}catch(t){w(t instanceof Error?t.message:"An error occurred")}finally{S(!1)}},M=async t=>{t.preventDefault(),k(!0);try{const s=m.map(l=>({id:l.id,description:l.description.trim(),status:l.status})).filter(l=>l.description.length>0),a=T.map(l=>l.trim()).filter(l=>l.length>0),g={title:n.title,status:n.status,planSteps:s,metadata:{priority:n.priority,tags:a},content:n.description},d=await fetch(`${A}/api/v1/tasks/${i}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),x=await d.json();if(x.success||d.ok)y({title:"Success",description:"Task updated successfully."}),P(`/tasks/${i}`);else throw new Error(x.error?.message||"Failed to update task")}catch(s){y({title:"Error",description:`Failed to update task: ${s instanceof Error?s.message:"An error occurred"}`,variant:"destructive"})}finally{k(!1)}};return z?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Edit Task"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading task data..."})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(p,{to:`/tasks/${i}`,className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(N,{className:"h-4 w-4"})})})})]}),e.jsxs(f,{children:[e.jsx($,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-6 bg-muted rounded w-1/2 animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-3/4 animate-pulse"})]})}),e.jsx(v,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-10 bg-muted rounded animate-pulse"}),e.jsx("div",{className:"h-64 bg-muted rounded animate-pulse"})]})})]})]}):C?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Error"})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(p,{to:"/tasks",className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(N,{className:"h-4 w-4"})})})})]}),e.jsx(f,{children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Error"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:C})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Edit Task"}),e.jsxs("p",{className:"text-muted-foreground",children:["Editing ",i]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(p,{to:`/tasks/${i}`,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(N,{className:"h-4 w-4"})})})})]}),e.jsx("form",{onSubmit:M,children:e.jsxs(f,{children:[e.jsxs($,{children:[e.jsx(q,{children:"Task Details"}),e.jsx(J,{children:"Update the information for your task"})]}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"title",children:"Title *"}),e.jsx(O,{id:"title",placeholder:"Brief description of what you want to change",value:n.title,onChange:t=>o(s=>({...s,title:t.target.value})),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"description",children:"Description"}),e.jsx(K,{value:n.description,onChange:t=>o(s=>({...s,description:t||""})),placeholder:"Write your task description in markdown...",height:400})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"status",children:"Status"}),e.jsxs(D,{value:n.status,onValueChange:t=>o(s=>({...s,status:t})),children:[e.jsx(L,{children:e.jsx(F,{placeholder:"Select status"})}),e.jsxs(I,{children:[e.jsx(r,{value:"draft",children:"Draft"}),e.jsx(r,{value:"proposed",children:"Proposed"}),e.jsx(r,{value:"in-review",children:"In Review"}),e.jsx(r,{value:"approved",children:"Approved"}),e.jsx(r,{value:"code-complete",children:"Code Complete"}),e.jsx(r,{value:"rejected",children:"Rejected"}),e.jsx(r,{value:"merged",children:"Merged"})]})]})]}),e.jsx(W,{defaultOpen:!0,icon:e.jsx(G,{className:"h-4 w-4"}),title:"Optional Implementation Detail",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"priority",children:"Priority"}),e.jsxs(D,{value:n.priority,onValueChange:t=>o(s=>({...s,priority:t})),children:[e.jsx(L,{children:e.jsx(F,{placeholder:"Select priority"})}),e.jsxs(I,{children:[e.jsx(r,{value:"low",children:"Low"}),e.jsx(r,{value:"medium",children:"Medium"}),e.jsx(r,{value:"high",children:"High"}),e.jsx(r,{value:"critical",children:"Critical"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Implementation Steps"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Keep the implementation plan accurate as work progresses."})]}),m.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," step",m.length===1?"":"s"]})]}),e.jsx(X,{steps:m,onChange:b,disabled:u})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Tags"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tags power filtering and discovery across the task list."}),e.jsx(Q,{tags:T,onChange:E,disabled:u,placeholder:"Add a tag (e.g. backend, rollout)"})]})]})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(h,{type:"button",variant:"outline",asChild:!0,children:e.jsxs(p,{to:`/tasks/${i}`,children:[e.jsx(V,{className:"mr-2 h-4 w-4"}),"Cancel"]})}),e.jsx(h,{type:"submit",disabled:u||!n.title,children:u?e.jsx(e.Fragment,{children:"Saving..."}):e.jsxs(e.Fragment,{children:[e.jsx(_,{className:"mr-2 h-4 w-4"}),"Save Changes"]})})]})]})]})})]})}export{oe as TaskEditPage};
1
+ import{y as R,u as U,a as H,r as c,A,j as e,B as h,L as p,I as O,X as V,a1 as _}from"./index-ByTA2ZiD.js";import{L as j}from"./label-Dp0-28_O.js";import{S as D,a as L,b as F,c as I,d as r}from"./select-CfwLZl55.js";import{C as f,b as $,a as v,c as q,d as J}from"./card-CL5bB4cs.js";import{M as K}from"./markdown-editor-DUmrf1eN.js";import{C as W}from"./CollapsibleSection-LrQJlSxD.js";import{I as X,L as G}from"./ImplementationStepsEditor-h_Mxu1tF.js";import{T as Q}from"./TagInput-C0NyMxlY.js";import{A as N}from"./arrow-left-B9NBHEkS.js";import"./index-CuLP7P_G.js";import"./chevron-up-BwTmMEW2.js";import"./badge-BbfU_aPt.js";function oe(){const{id:i}=R(),P=U(),{toast:y}=H(),[z,S]=c.useState(!0),[u,k]=c.useState(!1),[C,w]=c.useState(null),[n,o]=c.useState({title:"",description:"",priority:"medium",status:"draft",author:{id:"current-user",name:"Current User",email:"user@example.com"}}),[m,b]=c.useState([]),[T,E]=c.useState([]);c.useEffect(()=>{i&&B()},[i]);const B=async()=>{try{S(!0);const t=await fetch(`${A}/api/v1/tasks/${i}`),s=await t.json();if(s.success||s.data||t.ok){const a=s.data||s;o({title:a.title||a.intent||"",description:a.content||"",priority:a.metadata?.priority||"medium",status:a.status||"draft",author:{id:a.author?.id||"current-user",name:a.author?.name||"Current User",email:a.author?.email||"user@example.com"}});const g=Array.isArray(a.planSteps)?a.planSteps:[];b(g.map((d,x)=>({id:d.id||`step-${x+1}`,description:d.description||"",status:d.status||"pending"}))),E(a.metadata?.tags||[])}else w(s.error?.message||"Failed to fetch task")}catch(t){w(t instanceof Error?t.message:"An error occurred")}finally{S(!1)}},M=async t=>{t.preventDefault(),k(!0);try{const s=m.map(l=>({id:l.id,description:l.description.trim(),status:l.status})).filter(l=>l.description.length>0),a=T.map(l=>l.trim()).filter(l=>l.length>0),g={title:n.title,status:n.status,planSteps:s,metadata:{priority:n.priority,tags:a},content:n.description},d=await fetch(`${A}/api/v1/tasks/${i}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),x=await d.json();if(x.success||d.ok)y({title:"Success",description:"Task updated successfully."}),P(`/tasks/${i}`);else throw new Error(x.error?.message||"Failed to update task")}catch(s){y({title:"Error",description:`Failed to update task: ${s instanceof Error?s.message:"An error occurred"}`,variant:"destructive"})}finally{k(!1)}};return z?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Edit Task"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading task data..."})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(p,{to:`/tasks/${i}`,className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(N,{className:"h-4 w-4"})})})})]}),e.jsxs(f,{children:[e.jsx($,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-6 bg-muted rounded w-1/2 animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-3/4 animate-pulse"})]})}),e.jsx(v,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-10 bg-muted rounded animate-pulse"}),e.jsx("div",{className:"h-64 bg-muted rounded animate-pulse"})]})})]})]}):C?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Error"})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(p,{to:"/tasks",className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(N,{className:"h-4 w-4"})})})})]}),e.jsx(f,{children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Error"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:C})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Edit Task"}),e.jsxs("p",{className:"text-muted-foreground",children:["Editing ",i]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(p,{to:`/tasks/${i}`,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(N,{className:"h-4 w-4"})})})})]}),e.jsx("form",{onSubmit:M,children:e.jsxs(f,{children:[e.jsxs($,{children:[e.jsx(q,{children:"Task Details"}),e.jsx(J,{children:"Update the information for your task"})]}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"title",children:"Title *"}),e.jsx(O,{id:"title",placeholder:"Brief description of what you want to change",value:n.title,onChange:t=>o(s=>({...s,title:t.target.value})),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"description",children:"Description"}),e.jsx(K,{value:n.description,onChange:t=>o(s=>({...s,description:t||""})),placeholder:"Write your task description in markdown...",height:400})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"status",children:"Status"}),e.jsxs(D,{value:n.status,onValueChange:t=>o(s=>({...s,status:t})),children:[e.jsx(L,{children:e.jsx(F,{placeholder:"Select status"})}),e.jsxs(I,{children:[e.jsx(r,{value:"draft",children:"Draft"}),e.jsx(r,{value:"proposed",children:"Proposed"}),e.jsx(r,{value:"in-review",children:"In Review"}),e.jsx(r,{value:"approved",children:"Approved"}),e.jsx(r,{value:"code-complete",children:"Code Complete"}),e.jsx(r,{value:"rejected",children:"Rejected"}),e.jsx(r,{value:"merged",children:"Merged"})]})]})]}),e.jsx(W,{defaultOpen:!0,icon:e.jsx(G,{className:"h-4 w-4"}),title:"Optional Implementation Detail",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"priority",children:"Priority"}),e.jsxs(D,{value:n.priority,onValueChange:t=>o(s=>({...s,priority:t})),children:[e.jsx(L,{children:e.jsx(F,{placeholder:"Select priority"})}),e.jsxs(I,{children:[e.jsx(r,{value:"low",children:"Low"}),e.jsx(r,{value:"medium",children:"Medium"}),e.jsx(r,{value:"high",children:"High"}),e.jsx(r,{value:"critical",children:"Critical"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Implementation Steps"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Keep the implementation plan accurate as work progresses."})]}),m.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," step",m.length===1?"":"s"]})]}),e.jsx(X,{steps:m,onChange:b,disabled:u})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Tags"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tags power filtering and discovery across the task list."}),e.jsx(Q,{tags:T,onChange:E,disabled:u,placeholder:"Add a tag (e.g. backend, rollout)"})]})]})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(h,{type:"button",variant:"outline",asChild:!0,children:e.jsxs(p,{to:`/tasks/${i}`,children:[e.jsx(V,{className:"mr-2 h-4 w-4"}),"Cancel"]})}),e.jsx(h,{type:"submit",disabled:u||!n.title,children:u?e.jsx(e.Fragment,{children:"Saving..."}):e.jsxs(e.Fragment,{children:[e.jsx(_,{className:"mr-2 h-4 w-4"}),"Save Changes"]})})]})]})]})})]})}export{oe as TaskEditPage};
@@ -1,4 +1,4 @@
1
- import{c as Ce,x as Ke,u as ze,s as Ve,r as A,j as t,B as P,L as te,P as ue,I as We,X,K as Ue,p as Ge,n as He,G as Qe,C as Ye,A as Xe}from"./index-UXL5-kaP.js";import{C as J,a as Z,c as Je}from"./card-DPLdBoa5.js";import{B as se}from"./badge-vIqE5SOP.js";import{S as oe,a as he,b as de,c as me,d as B}from"./select-CyHFRA1Y.js";import{A as Ze,a as Ee,T as qe,g as et}from"./status-utils-PwF3DXLL.js";import{S as tt}from"./search-BxF7Wwex.js";import{C as st}from"./chevron-up-DFd-7wxW.js";import{C as rt}from"./chevron-left-CiNaLX-v.js";import"./index-DnZKG-_7.js";/**
1
+ import{c as Ce,x as Ke,u as ze,s as Ve,r as A,j as t,B as P,L as te,P as ue,I as We,X,K as Ue,p as Ge,n as He,G as Qe,C as Ye,A as Xe}from"./index-ByTA2ZiD.js";import{C as J,a as Z,c as Je}from"./card-CL5bB4cs.js";import{B as se}from"./badge-BbfU_aPt.js";import{S as oe,a as he,b as de,c as me,d as B}from"./select-CfwLZl55.js";import{A as Ze,a as Ee,T as qe,g as et}from"./status-utils-PwF3DXLL.js";import{S as tt}from"./search-BgbqRUnf.js";import{C as st}from"./chevron-up-BwTmMEW2.js";import{C as rt}from"./chevron-left-B-7K6MNx.js";import"./index-CuLP7P_G.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{u as p,a as v,r as a,A as l,j as e,B as m,L as g,a1 as N}from"./index-UXL5-kaP.js";import{C as h,a as x,b as C,c as S}from"./card-DPLdBoa5.js";import{M as w}from"./markdown-editor-DBdRsbP2.js";import{A as y}from"./arrow-left-DWmf9YJp.js";import{C as b}from"./circle-check-big-BEY1IoIP.js";import"./index-DnZKG-_7.js";function F(){const u=p(),{toast:t}=v(),[n,i]=a.useState(""),[f,r]=a.useState(!0),[o,c]=a.useState(!1);a.useEffect(()=>{fetch(`${l}/api/v1/context/team`).then(s=>s.json()).then(s=>{s.success&&i(s.document.content.trim()),r(!1)}).catch(s=>{console.error("Failed to load context:",s),t({title:"Error",description:"Failed to load team definition",variant:"destructive"}),r(!1)})},[t]);const j=async()=>{c(!0);try{const d=await(await fetch(`${l}/api/v1/context/team`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,metadata:{}})})).json();if(d.success)t({title:"Success",description:"Team definition saved successfully",action:e.jsx(b,{className:"h-4 w-4"})}),u("/context/team");else throw new Error(d.error||"Failed to save")}catch(s){console.error("Save error:",s),t({title:"Error",description:"Failed to save team definition",variant:"destructive"})}finally{c(!1)}};return f?e.jsx("div",{className:"space-y-6",children:e.jsx(h,{children:e.jsx(x,{className:"pt-6",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{children:"Loading..."})})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Edit Team Definition"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Define team structure, members, and communication"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(m,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(g,{to:"/context/team",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(y,{className:"w-4 h-4"})})}),e.jsxs(m,{onClick:j,disabled:o,size:"sm",children:[e.jsx(N,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save"})]})]})]}),e.jsxs(h,{children:[e.jsx(C,{children:e.jsx(S,{children:"Team Documentation"})}),e.jsx(x,{children:e.jsx(w,{value:n,onChange:s=>i(s||""),placeholder:`Write your team definition in markdown...
1
+ import{u as p,a as v,r as a,A as l,j as e,B as m,L as g,a1 as N}from"./index-ByTA2ZiD.js";import{C as h,a as x,b as C,c as S}from"./card-CL5bB4cs.js";import{M as w}from"./markdown-editor-DUmrf1eN.js";import{A as y}from"./arrow-left-B9NBHEkS.js";import{C as b}from"./circle-check-big-BwQ_q1N7.js";import"./index-CuLP7P_G.js";function F(){const u=p(),{toast:t}=v(),[n,i]=a.useState(""),[f,r]=a.useState(!0),[o,c]=a.useState(!1);a.useEffect(()=>{fetch(`${l}/api/v1/context/team`).then(s=>s.json()).then(s=>{s.success&&i(s.document.content.trim()),r(!1)}).catch(s=>{console.error("Failed to load context:",s),t({title:"Error",description:"Failed to load team definition",variant:"destructive"}),r(!1)})},[t]);const j=async()=>{c(!0);try{const d=await(await fetch(`${l}/api/v1/context/team`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,metadata:{}})})).json();if(d.success)t({title:"Success",description:"Team definition saved successfully",action:e.jsx(b,{className:"h-4 w-4"})}),u("/context/team");else throw new Error(d.error||"Failed to save")}catch(s){console.error("Save error:",s),t({title:"Error",description:"Failed to save team definition",variant:"destructive"})}finally{c(!1)}};return f?e.jsx("div",{className:"space-y-6",children:e.jsx(h,{children:e.jsx(x,{className:"pt-6",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{children:"Loading..."})})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Edit Team Definition"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Define team structure, members, and communication"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(m,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(g,{to:"/context/team",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(y,{className:"w-4 h-4"})})}),e.jsxs(m,{onClick:j,disabled:o,size:"sm",children:[e.jsx(N,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save"})]})]})]}),e.jsxs(h,{children:[e.jsx(C,{children:e.jsx(S,{children:"Team Documentation"})}),e.jsx(x,{children:e.jsx(w,{value:n,onChange:s=>i(s||""),placeholder:`Write your team definition in markdown...
2
2
 
3
3
  ## Team Members
4
4
 
@@ -1 +1 @@
1
- import{a as N,r as t,A as v,j as e,v as C,aw as w,B as a,L as o,_ as d,M as g,au as y,aq as b}from"./index-UXL5-kaP.js";import{C as i,a as r,b as E}from"./card-DPLdBoa5.js";import{c as T}from"./clipboard-B9ndUJKl.js";function D(){const{toast:c}=N(),[l,m]=t.useState(null),[x,h]=t.useState(!0),[u,n]=t.useState(!1);t.useEffect(()=>{fetch(`${v}/api/v1/context/team`).then(s=>{if(s.ok)return s.json();throw new Error("Not found")}).then(s=>{s.success?(m(s.document),n(!0)):n(!1)}).catch(()=>{n(!1)}).finally(()=>{h(!1)})},[]);const p=async()=>{const s=".nut/context/team.md";try{await T(s),c({title:"Copied!",description:`Path ${s} copied to clipboard`})}catch(f){console.error("Failed to copy path:",f),c({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},j=()=>{const s=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"team-md",filename:"team.md",name:"team.md",path:".nut/context/team.md"}});window.dispatchEvent(s)};return x?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(C,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading team definition..."})]})})})}):!u||!l?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Team Definition Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Team definition will appear here once created."}),e.jsx(a,{className:"mt-4",asChild:!0,children:e.jsxs(o,{to:"/context/team/edit",children:[e.jsx(d,{className:"h-4 w-4 mr-2"}),"Create Team Definition"]})})]})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Team"}),e.jsx("p",{className:"text-muted-foreground",children:"Team structure and member information"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{variant:"outline",size:"sm",onClick:j,children:[e.jsx(g,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:p,children:[e.jsx(y,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(a,{size:"sm",asChild:!0,children:e.jsxs(o,{to:"/context/team/edit",children:[e.jsx(d,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),e.jsxs(i,{children:[e.jsx(E,{className:"pb-0"}),e.jsx(r,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(b,{children:l.content||"No content available"})})})]})]})}export{D as default};
1
+ import{a as N,r as t,A as v,j as e,v as C,aw as w,B as a,L as o,_ as d,M as g,au as y,aq as b}from"./index-ByTA2ZiD.js";import{C as i,a as r,b as E}from"./card-CL5bB4cs.js";import{c as T}from"./clipboard-B9ndUJKl.js";function D(){const{toast:c}=N(),[l,m]=t.useState(null),[x,h]=t.useState(!0),[u,n]=t.useState(!1);t.useEffect(()=>{fetch(`${v}/api/v1/context/team`).then(s=>{if(s.ok)return s.json();throw new Error("Not found")}).then(s=>{s.success?(m(s.document),n(!0)):n(!1)}).catch(()=>{n(!1)}).finally(()=>{h(!1)})},[]);const p=async()=>{const s=".nut/context/team.md";try{await T(s),c({title:"Copied!",description:`Path ${s} copied to clipboard`})}catch(f){console.error("Failed to copy path:",f),c({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},j=()=>{const s=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"team-md",filename:"team.md",name:"team.md",path:".nut/context/team.md"}});window.dispatchEvent(s)};return x?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(C,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading team definition..."})]})})})}):!u||!l?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Team Definition Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Team definition will appear here once created."}),e.jsx(a,{className:"mt-4",asChild:!0,children:e.jsxs(o,{to:"/context/team/edit",children:[e.jsx(d,{className:"h-4 w-4 mr-2"}),"Create Team Definition"]})})]})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Team"}),e.jsx("p",{className:"text-muted-foreground",children:"Team structure and member information"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{variant:"outline",size:"sm",onClick:j,children:[e.jsx(g,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:p,children:[e.jsx(y,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(a,{size:"sm",asChild:!0,children:e.jsxs(o,{to:"/context/team/edit",children:[e.jsx(d,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),e.jsxs(i,{children:[e.jsx(E,{className:"pb-0"}),e.jsx(r,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(b,{children:l.content||"No content available"})})})]})]})}export{D as default};
@@ -1 +1 @@
1
- import{u as U,a as J,r as i,j as e,B as r,T as C,n as K,X as L,v as H,a2 as G}from"./index-UXL5-kaP.js";import{C as p,a as W}from"./card-DPLdBoa5.js";import{u as X}from"./use-terminal-D3iV7-iC.js";import{T as _}from"./terminal-preview-CLWDhoOZ.js";/* empty css */import{R as q}from"./refresh-cw-tXYl1ePu.js";import{C as Q,a as V}from"./chevrons-up-BfU70OcQ.js";import{C as Y}from"./chevron-up-DFd-7wxW.js";import{P as M}from"./play-DVBhRokt.js";import{C as Z}from"./circle-play-iZZwaGbV.js";import"./xterm-DTxiCjtJ.js";function he(){const m=U(),{sessions:f,loading:d,error:S,refreshSessions:h,createSession:j,destroySession:B}=X(),{toast:l}=J(),[x,u]=i.useState(""),[g,T]=i.useState(!1),[v,I]=i.useState(!1),[N,$]=i.useState([]),[,w]=i.useState(null),O=s=>{const t=Date.now(),a=new Date(s).getTime(),n=Math.max(0,Math.floor((t-a)/1e3));if(n<60)return`${n}s ago`;const b=Math.floor(n/60);if(b<60)return`${b}m ago`;const k=Math.floor(b/60);return k<24?`${k}h ago`:`${Math.floor(k/24)}d ago`};i.useEffect(()=>{h()},[h]),i.useEffect(()=>{y(s=>{const t={...s};return f.forEach(a=>{a.id in t||(t[a.id]=!0)}),t})},[f]),i.useEffect(()=>{try{const s=localStorage.getItem("terminal.commandHistory");s&&$(JSON.parse(s))}catch{}},[]);const D=s=>{s&&($(t=>{const a=[s,...t.filter(n=>n!==s)].slice(0,5);try{localStorage.setItem("terminal.commandHistory",JSON.stringify(a))}catch{}return a}),w(null))},c=f.filter(s=>!s.taskId?.startsWith("cp-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[o,y]=i.useState(()=>{const s={};return f.forEach(t=>{s[t.id]=!0}),s}),R=async()=>{const s=`session-${Date.now()}`;await j(s)&&(l({title:"New terminal started",description:`${s}`}),m(`/terminal/${s}`))},E=async()=>{const s=x.trim();if(!s)return;const t=`session-${Date.now()}`;T(!0);try{await j(t,s)?(D(s),l({title:"Session started",description:`${t}`}),m(`/terminal/${t}`)):l({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{T(!1)}},A=async()=>{const s=x.trim();if(!s)return;const t=`session-${Date.now()}`;I(!0);try{await j(t,s)?(D(s),setTimeout(()=>h(),150),u(""),l({title:"Started in background",description:`${t}`,action:e.jsx(G,{altText:"Open session",onClick:()=>m(`/terminal/${t}`),children:"Open"})})):l({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{I(!1)}},P=async s=>{await B(s)?(l({title:"Session closed",description:s}),setTimeout(()=>h(),100)):l({title:"Failed to close session",description:s,variant:"destructive"})},F=()=>{const s=c.every(a=>o[a.id]),t={};c.forEach(a=>{t[a.id]=!s}),y(t)},z=c.length>0&&c.every(s=>o[s.id]);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Terminal"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage terminal sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",onClick:()=>h(),disabled:d,children:[e.jsx(q,{className:`h-4 w-4 sm:mr-2 ${d?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),c.length>0&&e.jsx(r,{variant:"outline",onClick:F,children:z?e.jsxs(e.Fragment,{children:[e.jsx(Q,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Hide All"})]}):e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Show All"})]})}),e.jsxs(r,{onClick:R,disabled:d,children:[e.jsx(C,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"New Terminal"})]})]})]}),S&&e.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("div",{className:"text-red-600",children:S})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sessions"}),d?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(p,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 rounded bg-muted animate-pulse"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]})]}),e.jsx("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"})]})},t))}):c.length===0?e.jsx(p,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(C,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No active sessions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Get started by launching a new terminal session with the"," ",e.jsx("button",{onClick:R,className:"text-primary hover:underline font-medium",children:"New Terminal"})," ","button above."]})]})]})}):e.jsx("div",{className:"space-y-2",children:c.slice(0,10).map(s=>e.jsxs(p,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(C,{className:"h-4 w-4"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:s.taskId}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Session ",s.id.split("-").slice(-1)[0].substring(0,8)," • Last activity ",O(s.lastActivity)]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[e.jsx("div",{className:`flex items-center gap-1 ${s.connected?"text-green-600":"text-gray-400"}`,title:s.connected?"Connected":"Disconnected",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${s.connected?"bg-green-500":"bg-gray-400"}`})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>{y(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":o[s.id]?"Hide preview":"Show preview",title:o[s.id]?"Hide preview":"Show preview",children:o[s.id]?e.jsx(Y,{className:"h-4 w-4"}):e.jsx(K,{className:"h-4 w-4"})}),e.jsxs(r,{size:"sm",variant:"outline",onClick:()=>m(`/terminal/${s.taskId}`),children:[e.jsx(M,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Open"})]}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>P(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(L,{className:"h-4 w-4"})})]})]}),o[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>m(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(_,{sessionId:s.id,heightPx:160,maxScrollback:200})})]},s.id))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Run Custom Command"}),e.jsx(p,{children:e.jsxs(W,{className:"py-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:x,onChange:s=>u(s.target.value),onKeyDown:s=>{s.key==="Enter"?(s.preventDefault(),s.shiftKey?A():E()):s.key==="ArrowUp"?(s.preventDefault(),w(t=>{const a=t===null?0:Math.min((t??0)+1,N.length-1),n=N[a];return n&&u(n),a})):s.key==="ArrowDown"&&(s.preventDefault(),w(t=>{if(t===null)return null;const a=t-1;if(a<0)return u(""),null;const n=N[a];return n&&u(n),a}))},placeholder:"npm run dev",className:"flex-1 h-9 rounded-md border px-3 text-sm bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400"}),e.jsxs(r,{onClick:A,variant:"secondary",disabled:d||!x.trim()||v||g,children:[v?e.jsx(H,{className:"h-4 w-4 animate-spin sm:mr-1"}):e.jsx(Z,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Background"})]}),e.jsxs(r,{onClick:E,disabled:d||!x.trim()||g||v,children:[g?e.jsx(H,{className:"h-4 w-4 animate-spin sm:mr-2"}):e.jsx(M,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Run"})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:"Enter to Run • Shift+Enter to Run in background"})]})})]})]})}export{he as default};
1
+ import{u as U,a as J,r as i,j as e,B as r,T as C,n as K,X as L,v as H,a2 as G}from"./index-ByTA2ZiD.js";import{C as p,a as W}from"./card-CL5bB4cs.js";import{u as X}from"./use-terminal-D1UnvAVs.js";import{T as _}from"./terminal-preview-BNm5-Umi.js";/* empty css */import{R as q}from"./refresh-cw-Cj_5MZiJ.js";import{C as Q,a as V}from"./chevrons-up-jI6nxhrz.js";import{C as Y}from"./chevron-up-BwTmMEW2.js";import{P as M}from"./play-fOwEoIcu.js";import{C as Z}from"./circle-play-CLKDBkrK.js";import"./xterm-DTxiCjtJ.js";function he(){const m=U(),{sessions:f,loading:d,error:S,refreshSessions:h,createSession:j,destroySession:B}=X(),{toast:l}=J(),[x,u]=i.useState(""),[g,T]=i.useState(!1),[v,I]=i.useState(!1),[N,$]=i.useState([]),[,w]=i.useState(null),O=s=>{const t=Date.now(),a=new Date(s).getTime(),n=Math.max(0,Math.floor((t-a)/1e3));if(n<60)return`${n}s ago`;const b=Math.floor(n/60);if(b<60)return`${b}m ago`;const k=Math.floor(b/60);return k<24?`${k}h ago`:`${Math.floor(k/24)}d ago`};i.useEffect(()=>{h()},[h]),i.useEffect(()=>{y(s=>{const t={...s};return f.forEach(a=>{a.id in t||(t[a.id]=!0)}),t})},[f]),i.useEffect(()=>{try{const s=localStorage.getItem("terminal.commandHistory");s&&$(JSON.parse(s))}catch{}},[]);const D=s=>{s&&($(t=>{const a=[s,...t.filter(n=>n!==s)].slice(0,5);try{localStorage.setItem("terminal.commandHistory",JSON.stringify(a))}catch{}return a}),w(null))},c=f.filter(s=>!s.taskId?.startsWith("cp-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[o,y]=i.useState(()=>{const s={};return f.forEach(t=>{s[t.id]=!0}),s}),R=async()=>{const s=`session-${Date.now()}`;await j(s)&&(l({title:"New terminal started",description:`${s}`}),m(`/terminal/${s}`))},E=async()=>{const s=x.trim();if(!s)return;const t=`session-${Date.now()}`;T(!0);try{await j(t,s)?(D(s),l({title:"Session started",description:`${t}`}),m(`/terminal/${t}`)):l({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{T(!1)}},A=async()=>{const s=x.trim();if(!s)return;const t=`session-${Date.now()}`;I(!0);try{await j(t,s)?(D(s),setTimeout(()=>h(),150),u(""),l({title:"Started in background",description:`${t}`,action:e.jsx(G,{altText:"Open session",onClick:()=>m(`/terminal/${t}`),children:"Open"})})):l({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{I(!1)}},P=async s=>{await B(s)?(l({title:"Session closed",description:s}),setTimeout(()=>h(),100)):l({title:"Failed to close session",description:s,variant:"destructive"})},F=()=>{const s=c.every(a=>o[a.id]),t={};c.forEach(a=>{t[a.id]=!s}),y(t)},z=c.length>0&&c.every(s=>o[s.id]);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Terminal"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage terminal sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",onClick:()=>h(),disabled:d,children:[e.jsx(q,{className:`h-4 w-4 sm:mr-2 ${d?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),c.length>0&&e.jsx(r,{variant:"outline",onClick:F,children:z?e.jsxs(e.Fragment,{children:[e.jsx(Q,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Hide All"})]}):e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Show All"})]})}),e.jsxs(r,{onClick:R,disabled:d,children:[e.jsx(C,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"New Terminal"})]})]})]}),S&&e.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("div",{className:"text-red-600",children:S})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sessions"}),d?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(p,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 rounded bg-muted animate-pulse"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]})]}),e.jsx("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"})]})},t))}):c.length===0?e.jsx(p,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(C,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No active sessions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Get started by launching a new terminal session with the"," ",e.jsx("button",{onClick:R,className:"text-primary hover:underline font-medium",children:"New Terminal"})," ","button above."]})]})]})}):e.jsx("div",{className:"space-y-2",children:c.slice(0,10).map(s=>e.jsxs(p,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(C,{className:"h-4 w-4"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:s.taskId}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Session ",s.id.split("-").slice(-1)[0].substring(0,8)," • Last activity ",O(s.lastActivity)]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[e.jsx("div",{className:`flex items-center gap-1 ${s.connected?"text-green-600":"text-gray-400"}`,title:s.connected?"Connected":"Disconnected",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${s.connected?"bg-green-500":"bg-gray-400"}`})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>{y(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":o[s.id]?"Hide preview":"Show preview",title:o[s.id]?"Hide preview":"Show preview",children:o[s.id]?e.jsx(Y,{className:"h-4 w-4"}):e.jsx(K,{className:"h-4 w-4"})}),e.jsxs(r,{size:"sm",variant:"outline",onClick:()=>m(`/terminal/${s.taskId}`),children:[e.jsx(M,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Open"})]}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>P(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(L,{className:"h-4 w-4"})})]})]}),o[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>m(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(_,{sessionId:s.id,heightPx:160,maxScrollback:200})})]},s.id))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Run Custom Command"}),e.jsx(p,{children:e.jsxs(W,{className:"py-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:x,onChange:s=>u(s.target.value),onKeyDown:s=>{s.key==="Enter"?(s.preventDefault(),s.shiftKey?A():E()):s.key==="ArrowUp"?(s.preventDefault(),w(t=>{const a=t===null?0:Math.min((t??0)+1,N.length-1),n=N[a];return n&&u(n),a})):s.key==="ArrowDown"&&(s.preventDefault(),w(t=>{if(t===null)return null;const a=t-1;if(a<0)return u(""),null;const n=N[a];return n&&u(n),a}))},placeholder:"npm run dev",className:"flex-1 h-9 rounded-md border px-3 text-sm bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400"}),e.jsxs(r,{onClick:A,variant:"secondary",disabled:d||!x.trim()||v||g,children:[v?e.jsx(H,{className:"h-4 w-4 animate-spin sm:mr-1"}):e.jsx(Z,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Background"})]}),e.jsxs(r,{onClick:E,disabled:d||!x.trim()||g||v,children:[g?e.jsx(H,{className:"h-4 w-4 animate-spin sm:mr-2"}):e.jsx(M,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Run"})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:"Enter to Run • Shift+Enter to Run in background"})]})})]})]})}export{he as default};
@@ -1,3 +1,3 @@
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
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-ByTA2ZiD.js";import{C as mt,a as ut}from"./card-CL5bB4cs.js";import{B as De}from"./badge-BbfU_aPt.js";import{S as ke,a as Ne,b as Se,c as Ce,d as $}from"./select-CfwLZl55.js";import{R as xt,a as Ae}from"./radio-group-B8RB7N01.js";import{C as ht}from"./CollapsibleSection-LrQJlSxD.js";import{L as xe}from"./label-Dp0-28_O.js";import{u as ft}from"./use-terminal-D1UnvAVs.js";import{x as gt,a as pt}from"./xterm-DTxiCjtJ.js";import{A as bt}from"./arrow-down-DnNLmXEs.js";/* empty css */import{b as Je,a as vt,c as yt,d as jt,e as wt}from"./pipeline-builders-DrEjlsbH.js";import{C as Te}from"./code-DqYaanki.js";import{R as kt}from"./refresh-cw-Cj_5MZiJ.js";import{P as Ee}from"./play-fOwEoIcu.js";import{E as Nt}from"./eye-Cx9ZGkg5.js";import{S as Ge}from"./server-u9FLHclt.js";import{M as St}from"./message-square-BPOApeM3.js";import"./index-CuLP7P_G.js";import"./chevron-up-BwTmMEW2.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
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,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
+ 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-ByTA2ZiD.js";import{C as F,b as w,c as T,d as L,a as D}from"./card-CL5bB4cs.js";import{L as o}from"./label-Dp0-28_O.js";import{S as h,a as u,b as m,c as f,d as a}from"./select-CfwLZl55.js";import"./index-CuLP7P_G.js";import"./chevron-up-BwTmMEW2.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,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};
1
+ import{r as i,a as S,A as x,j as e,bx as b,B as g,I as d,L as w}from"./index-ByTA2ZiD.js";import{C as E,b as I,c as F,d as L,a as D}from"./card-CL5bB4cs.js";import{L as m}from"./label-Dp0-28_O.js";import{C as P,a as T}from"./clipboard-BHOFelnW.js";function B(){const[r,c]=i.useState({}),[o,l]=i.useState(null),[u,h]=i.useState(!1),[j,v]=i.useState(!0),[f,p]=i.useState(!1),{toast:n}=S();i.useEffect(()=>{C()},[]);const C=async()=>{try{try{const t=await fetch(`${x}/api/v1/config`),s=await t.json();if(t.ok&&s?.success){const a=s.data?.coconut||{};l(a.id??null),(a.firstName||a.lastName||a.email)&&c({firstName:a.firstName,lastName:a.lastName,email:a.email})}else l(null)}catch(t){console.error("Failed to load coconut config:",t),l(null)}}catch(t){console.error("Failed to load settings:",t),n({title:"Error",description:"Failed to load user settings",variant:"destructive"})}finally{v(!1)}},N=async()=>{p(!0);try{const s=await(await fetch(`${x}/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),h(!0),n({title:"Copied",description:"Coconut ID copied to clipboard."}),setTimeout(()=>h(!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 j?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(g,{variant:"outline",size:"sm",onClick:y,children:[u?e.jsx(P,{className:"h-4 w-4"}):e.jsx(T,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2",children:u?"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(D,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"firstName",children:"First Name"}),e.jsx(d,{id:"firstName",value:r.firstName||"",onChange:t=>c(s=>({...s,firstName:t.target.value})),placeholder:"Enter first name"})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"lastName",children:"Last Name"}),e.jsx(d,{id:"lastName",value:r.lastName||"",onChange:t=>c(s=>({...s,lastName:t.target.value})),placeholder:"Enter last name"})]})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"email",children:"Email"}),e.jsx(d,{id:"email",type:"email",value:r.email||"",onChange:t=>c(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.jsx("div",{className:"flex justify-end",children:e.jsx(g,{onClick:N,disabled:f,children:f?"Saving...":"Save Changes"})})]})}export{B as default};
@@ -1 +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
+ 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-ByTA2ZiD.js";import{C as G,a as K}from"./card-CL5bB4cs.js";import{u as V}from"./use-terminal-D1UnvAVs.js";import{C as X}from"./circle-play-CLKDBkrK.js";import{P as Y}from"./play-fOwEoIcu.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-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
+ import{r,j as a,e as o}from"./index-ByTA2ZiD.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,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
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
+ import{by as o,j as n,e as a}from"./index-ByTA2ZiD.js";const s=o("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 n.jsx("div",{className:a(s({variant:e}),r),...t})}export{i as B};
@@ -1,4 +1,4 @@
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";/**
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-ByTA2ZiD.js";import{B as v}from"./badge-BbfU_aPt.js";import{a as Z}from"./registry-ANRa5WBi.js";import{S as O}from"./search-BgbqRUnf.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
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};
1
+ import{r,j as d,e as t}from"./index-ByTA2ZiD.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};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-UXL5-kaP.js";/**
1
+ import{c as e}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-UXL5-kaP.js";/**
1
+ import{c as e}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-UXL5-kaP.js";/**
1
+ import{c as a}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-UXL5-kaP.js";/**
1
+ import{c as o}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-UXL5-kaP.js";/**
1
+ import{c as a}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-UXL5-kaP.js";/**
1
+ import{c}from"./index-ByTA2ZiD.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{L as O,b as r,a as b,i as s,f as a,s as t,j as P,l as n,t as e}from"./markdown-editor-DBdRsbP2.js";import"./index-UXL5-kaP.js";import"./index-DnZKG-_7.js";const S={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},i=b.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["isolate",-3,1,2,11,""],["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"0o~R^XY}YZ}]^}pq}rs!Stu#pxy'Uyz(e{|(j}!O(j!Q!R(s!R![*p!]!^.^#T#o.{~!SO_~~!VVOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j<%lO!S~!qOZ~~!tRO;'S!S;'S;=`!};=`O!S~#QWOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j;=`<%l!S<%lO!S~#mP;=`<%l!S~#siqr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~%giV~qr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~'ZPT~!]!^'^~'aTO!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~'sVOy'^yz(Yz!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~(_OQ~~(bP;=`<%l'^~(jOS~~(mQ!Q!R(s!R![*p~(xUY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){#l#m+[~)aRY~!Q![)j!g!h){#X#Y){~)oSY~!Q![)j!g!h){#R#S*j#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dQY~!Q![*_#R#S*X~*mP!Q![)j~*uTY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){~+XP!Q![*p~+_R!Q![+h!c!i+h#T#Z+h~+mVY~!O!P,S!Q![+h!c!i+h!r!s-P#R#S+[#T#Z+h#d#e-P~,XTY~!Q![,h!c!i,h!r!s-P#T#Z,h#d#e-P~,mUY~!Q![,h!c!i,h!r!s-P#R#S.Q#T#Z,h#d#e-P~-ST{|-c}!O-c!Q![-o!c!i-o#T#Z-o~-fR!Q![-o!c!i-o#T#Z-o~-tSY~!Q![-o!c!i-o#R#S-c#T#Z-o~.TR!Q![,h!c!i,h#T#Z,h~.aP!]!^.d~.iSP~OY.dZ;'S.d;'S;=`.u<%lO.d~.xP;=`<%l.d~/QiX~qr.{st.{tu.{uv.{vw.{wx.{z{.{{|.{}!O.{!O!P.{!P!Q.{!Q![.{![!].{!^!_.{!_!`.{!`!a.{!a!b.{!b!c.{!c!}.{#Q#R.{#R#S.{#S#T.{#T#o.{#p#q.{#r#s.{",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:o=>S[o]||-1}],tokenPrec:0}),Q=O.define({name:"wast",parser:i.configure({props:[s.add({App:P({closing:")",align:!1})}),a.add({App:n,BlockComment(o){return{from:o.from+2,to:o.to-2}}}),t({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function m(){return new r(Q)}export{m as wast,Q as wastLanguage};
1
+ import{L as O,b as r,a as b,i as s,f as a,s as t,j as P,l as n,t as e}from"./markdown-editor-DUmrf1eN.js";import"./index-ByTA2ZiD.js";import"./index-CuLP7P_G.js";const S={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},i=b.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["isolate",-3,1,2,11,""],["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"0o~R^XY}YZ}]^}pq}rs!Stu#pxy'Uyz(e{|(j}!O(j!Q!R(s!R![*p!]!^.^#T#o.{~!SO_~~!VVOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j<%lO!S~!qOZ~~!tRO;'S!S;'S;=`!};=`O!S~#QWOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j;=`<%l!S<%lO!S~#mP;=`<%l!S~#siqr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~%giV~qr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~'ZPT~!]!^'^~'aTO!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~'sVOy'^yz(Yz!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~(_OQ~~(bP;=`<%l'^~(jOS~~(mQ!Q!R(s!R![*p~(xUY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){#l#m+[~)aRY~!Q![)j!g!h){#X#Y){~)oSY~!Q![)j!g!h){#R#S*j#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dQY~!Q![*_#R#S*X~*mP!Q![)j~*uTY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){~+XP!Q![*p~+_R!Q![+h!c!i+h#T#Z+h~+mVY~!O!P,S!Q![+h!c!i+h!r!s-P#R#S+[#T#Z+h#d#e-P~,XTY~!Q![,h!c!i,h!r!s-P#T#Z,h#d#e-P~,mUY~!Q![,h!c!i,h!r!s-P#R#S.Q#T#Z,h#d#e-P~-ST{|-c}!O-c!Q![-o!c!i-o#T#Z-o~-fR!Q![-o!c!i-o#T#Z-o~-tSY~!Q![-o!c!i-o#R#S-c#T#Z-o~.TR!Q![,h!c!i,h#T#Z,h~.aP!]!^.d~.iSP~OY.dZ;'S.d;'S;=`.u<%lO.d~.xP;=`<%l.d~/QiX~qr.{st.{tu.{uv.{vw.{wx.{z{.{{|.{}!O.{!O!P.{!P!Q.{!Q![.{![!].{!^!_.{!_!`.{!`!a.{!a!b.{!b!c.{!c!}.{#Q#R.{#R#S.{#S#T.{#T#o.{#p#q.{#r#s.{",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:o=>S[o]||-1}],tokenPrec:0}),Q=O.define({name:"wast",parser:i.configure({props:[s.add({App:P({closing:")",align:!1})}),a.add({App:n,BlockComment(o){return{from:o.from+2,to:o.to-2}}}),t({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function m(){return new r(Q)}export{m as wast,Q as wastLanguage};