@lovelybunch/api 1.0.74 → 1.0.75-alpha.1

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 (100) hide show
  1. package/dist/lib/storage/file-storage.js +14 -5
  2. package/dist/routes/api/v1/events/status/route.d.ts +1 -1
  3. package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
  4. package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
  5. package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
  6. package/dist/routes/api/v1/proposals/[id]/route.d.ts +12 -10
  7. package/dist/routes/api/v1/proposals/[id]/route.js +1 -1
  8. package/dist/routes/api/v1/proposals/route.d.ts +4 -2
  9. package/dist/routes/api/v1/proposals/route.js +8 -3
  10. package/package.json +4 -4
  11. package/static/assets/{ActivityPage-AWTVFLmK.js → ActivityPage-BYrDJlH6.js} +1 -1
  12. package/static/assets/{AgentDetailPage-DtGFrHzZ.js → AgentDetailPage-D6yg4CtT.js} +1 -1
  13. package/static/assets/{AgentEditPage-1026aJox.js → AgentEditPage-CTnjxjX7.js} +1 -1
  14. package/static/assets/{AgentsPage-9Hre8AD1.js → AgentsPage-NdB5OB1C.js} +1 -1
  15. package/static/assets/{AgentsSettingsPage-CILCHaO9.js → AgentsSettingsPage-CYXp908g.js} +1 -1
  16. package/static/assets/{ApiKeysSettingsPage-D-l8q30N.js → ApiKeysSettingsPage-Jl6vvVmW.js} +1 -1
  17. package/static/assets/{ArchitectureEditPage-DiRR28Rx.js → ArchitectureEditPage-Bw2d_hmk.js} +1 -1
  18. package/static/assets/{ArchitecturePage-FcRJGw8O.js → ArchitecturePage-36wO0UD7.js} +1 -1
  19. package/static/assets/{AuthSettingsPage-D528tGhc.js → AuthSettingsPage-CKifiWsx.js} +1 -1
  20. package/static/assets/{CallbackPage-BMZOjCy_.js → CallbackPage-Ck0dddEW.js} +1 -1
  21. package/static/assets/{CodePage-CCNmmkv_.js → CodePage-b3JR4eWW.js} +1 -1
  22. package/static/assets/{CollapsibleSection-CG5gAVWB.js → CollapsibleSection-BKY-lfsm.js} +1 -1
  23. package/static/assets/{DashboardPage-D5C34QbO.js → DashboardPage-Cv2-duAx.js} +3 -3
  24. package/static/assets/{GitPage-ofZrdSSl.js → GitPage-BgCxzm-C.js} +1 -1
  25. package/static/assets/{GitSettingsPage-Cld_sN5t.js → GitSettingsPage-CKIWkAnw.js} +1 -1
  26. package/static/assets/{IdentityPage-Dj-Do8q7.js → IdentityPage-BsZnszF-.js} +1 -1
  27. package/static/assets/{ImplementationStepsEditor-BZQKPJ1C.js → ImplementationStepsEditor-iqrCqyOb.js} +1 -1
  28. package/static/assets/{IntegrationsSettingsPage-DTT6nX3v.js → IntegrationsSettingsPage-C1dC_vVy.js} +1 -1
  29. package/static/assets/{JobDetailPage-CWexORzH.js → JobDetailPage-BgGQJkND.js} +1 -1
  30. package/static/assets/{KnowledgeDetailPage-C-a0njhy.js → KnowledgeDetailPage-Dzy2V7yT.js} +1 -1
  31. package/static/assets/{KnowledgeEditPage-B93ffsgz.js → KnowledgeEditPage-av1ALt0h.js} +1 -1
  32. package/static/assets/{KnowledgePage-DS7xi1qJ.js → KnowledgePage-C_UDfD9X.js} +1 -1
  33. package/static/assets/{LoginPage-FUflG9B8.js → LoginPage-DqbNxfY6.js} +1 -1
  34. package/static/assets/{McpSettingsPage-A6uws8gQ.js → McpSettingsPage-BqbErEWS.js} +1 -1
  35. package/static/assets/{NewAgentPage-CqBlVqdy.js → NewAgentPage-UEVIYkt3.js} +1 -1
  36. package/static/assets/{NewKnowledgePage-ue0ZRgKf.js → NewKnowledgePage-CzYXdoDb.js} +1 -1
  37. package/static/assets/NewProposalPage-DrU0ihJX.js +90 -0
  38. package/static/assets/{ProjectEditPage-_a9hJTgi.js → ProjectEditPage-j4KporiC.js} +1 -1
  39. package/static/assets/{ProjectPage-DAlEu9Af.js → ProjectPage-BQNa0qA-.js} +1 -1
  40. package/static/assets/{PromptsSettingsPage-4_C5zvq6.js → PromptsSettingsPage-sYphs8Dn.js} +1 -1
  41. package/static/assets/ProposalDetailPage-CHR1MmwC.js +1 -0
  42. package/static/assets/ProposalEditPage-CkcZqgax.js +1 -0
  43. package/static/assets/{ProposalsPage-DaR_KuZx.js → ProposalsPage-CUB_aLXW.js} +2 -2
  44. package/static/assets/{ResourcesPage-WMPlFn0S.js → ResourcesPage-DzjwPoyS.js} +1 -1
  45. package/static/assets/{RoleEditPage-DIoamJfW.js → RoleEditPage-DhVneoNR.js} +1 -1
  46. package/static/assets/RolePage-BOI2T8QG.js +1 -0
  47. package/static/assets/{RulesSettingsPage-CerRq_kE.js → RulesSettingsPage-VsteFA-j.js} +1 -1
  48. package/static/assets/{SchedulePage-DF9TqOA6.js → SchedulePage-_v4YfdHo.js} +1 -1
  49. package/static/assets/{SourceInput-CXv23vkE.js → SourceInput-BFxoOvqS.js} +1 -1
  50. package/static/assets/{TagInput-DL_48L0p.js → TagInput-BWLBdW8h.js} +1 -1
  51. package/static/assets/{TerminalPage-BL8pa_9k.js → TerminalPage-DtVDWX7G.js} +1 -1
  52. package/static/assets/TerminalSessionPage-BUHzje8A.js +13 -0
  53. package/static/assets/{UserPreferencesPage-DoMyvwD4.js → UserPreferencesPage-CkXJuogz.js} +1 -1
  54. package/static/assets/{UserSettingsPage-CqibuEiq.js → UserSettingsPage-Dz-R1ijS.js} +1 -1
  55. package/static/assets/{UtilitiesPage-6BGeolw9.js → UtilitiesPage-CRqQYVsb.js} +1 -1
  56. package/static/assets/{alert-DQ9shGSz.js → alert-C7sSXJf0.js} +1 -1
  57. package/static/assets/{arrow-down-D5oSUxtq.js → arrow-down-DNa4SyO2.js} +1 -1
  58. package/static/assets/{arrow-left-BJ9vzpff.js → arrow-left-DkoECaEJ.js} +1 -1
  59. package/static/assets/{arrow-up-DWNinaN_.js → arrow-up-DQlu6uQE.js} +1 -1
  60. package/static/assets/{badge-BLbqPEov.js → badge-2ZOe5ynf.js} +1 -1
  61. package/static/assets/{browser-modal-Dh2dy_2x.js → browser-modal-DUCXGaha.js} +1 -1
  62. package/static/assets/{calendar-CaBty4QE.js → calendar-tNgwmWmG.js} +1 -1
  63. package/static/assets/{card-BTg0Fecj.js → card-By4vbQ_f.js} +1 -1
  64. package/static/assets/{chevron-left-V0REBjky.js → chevron-left-CJfNRqcH.js} +1 -1
  65. package/static/assets/{chevrons-up-BvR9KFeO.js → chevrons-up-DoBrp0tt.js} +1 -1
  66. package/static/assets/{circle-alert-DR1DiLh5.js → circle-alert-B4JJ0jKl.js} +1 -1
  67. package/static/assets/{circle-check-DED-Ne-m.js → circle-check-DC5Ek4MP.js} +1 -1
  68. package/static/assets/{circle-check-big-CFsUUo2_.js → circle-check-big-Dw4YJZos.js} +1 -1
  69. package/static/assets/{circle-play-DQ32zg60.js → circle-play-D9VS6Vdc.js} +1 -1
  70. package/static/assets/{circle-x-CDTWutj4.js → circle-x-BReHgv4g.js} +1 -1
  71. package/static/assets/{clipboard-CTFAlaYo.js → clipboard-CuF9OlXN.js} +1 -1
  72. package/static/assets/{clock-pVWUoJDo.js → clock-CDTi2Cen.js} +1 -1
  73. package/static/assets/{download-Bt7lWWYL.js → download-DHIAgGlY.js} +1 -1
  74. package/static/assets/droid-BvMEm3eg.js +8 -0
  75. package/static/assets/{eye-o7gPa7E6.js → eye-Ch7ecV9Z.js} +1 -1
  76. package/static/assets/{folder-git-2-CHwnYB8a.js → folder-git-2-BYI_osdA.js} +1 -1
  77. package/static/assets/{index-DaqYJNAM.js → index-CCs6x1Au.js} +10 -10
  78. package/static/assets/{index-BhlZ_D1Y.css → index-CzjbtPHw.css} +1 -1
  79. package/static/assets/{label-BtnLfquf.js → label-BUv8Ltyw.js} +1 -1
  80. package/static/assets/{markdown-editor-Cmsc5nNu.js → markdown-editor-BP8Xkecg.js} +1 -1
  81. package/static/assets/{pause-EIDnvByV.js → pause-B0clczfE.js} +1 -1
  82. package/static/assets/{play-D_fLXyLR.js → play-BHUpJCX1.js} +1 -1
  83. package/static/assets/{plus-ZCd709aN.js → plus-D0SUNNMH.js} +1 -1
  84. package/static/assets/{radio-group-STvlCDl-.js → radio-group-CSBH8ca-.js} +1 -1
  85. package/static/assets/{refresh-cw-BF0hXtxu.js → refresh-cw-C-yGwsHL.js} +1 -1
  86. package/static/assets/{search-kmqzieAc.js → search-DFtqbVgP.js} +1 -1
  87. package/static/assets/{switch-CjDKvzd0.js → switch-WtOd8h5Z.js} +1 -1
  88. package/static/assets/{tabs-DPohYGac.js → tabs-D93ZjKR7.js} +1 -1
  89. package/static/assets/{tag-Dg9notds.js → tag-EEDDoCc_.js} +1 -1
  90. package/static/assets/{terminal-preview-CnytxbzD.js → terminal-preview-sns5QTN_.js} +1 -1
  91. package/static/assets/{use-terminal-LpFJK0k7.js → use-terminal-BW9XYY8N.js} +1 -1
  92. package/static/assets/{zap-DBKgrFQ_.js → zap-BYFYWzmj.js} +1 -1
  93. package/static/coconut.svg +19 -20
  94. package/static/index.html +2 -2
  95. package/static/assets/NewProposalPage-BDbStKts.js +0 -90
  96. package/static/assets/ProposalDetailPage-mZ9qj0wJ.js +0 -1
  97. package/static/assets/ProposalEditPage-DqJ3Po23.js +0 -1
  98. package/static/assets/RolePage-4aL0vR7F.js +0 -1
  99. package/static/assets/TerminalSessionPage-DcC_o_sA.js +0 -13
  100. package/static/assets/droid-Caom7ttu.js +0 -4
@@ -0,0 +1,13 @@
1
+ import{c as qe,j as e,B as S,aa as Ee,ab as Pe,ac as Le,ad as Me,ae as We,af as Ze,x as ce,r as n,ag as Ye,Q as Ke,z as Xe,u as Qe,a as et,q as ue,T as je,ah as $e,h as ve,i as ye,k as we,l as Ne,m as H,X as Oe,s as tt,p as Ie,ai as _e,v as ke,D as rt,b as st,d as nt,f as at,aj as ze,A as oe}from"./index-CCs6x1Au.js";import{C as it,a as ct}from"./card-By4vbQ_f.js";import{B as De}from"./badge-2ZOe5ynf.js";import{R as ot,a as Se}from"./radio-group-CSBH8ca-.js";import{C as lt}from"./CollapsibleSection-BKY-lfsm.js";import{L as he}from"./label-BUv8Ltyw.js";import{u as dt}from"./use-terminal-BW9XYY8N.js";import{x as mt,a as ut}from"./xterm-DTxiCjtJ.js";import{A as ht}from"./arrow-down-DNa4SyO2.js";/* empty css */import{b as Fe,a as xt,c as gt,d as ft}from"./droid-BvMEm3eg.js";import{R as pt}from"./refresh-cw-C-yGwsHL.js";import{P as Ce}from"./play-BHUpJCX1.js";import{P as Ae}from"./plus-D0SUNNMH.js";import{Z as bt}from"./zap-BYFYWzmj.js";/**
2
+ * @license lucide-react v0.542.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const jt=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],vt=qe("book-marked",jt);/**
7
+ * @license lucide-react v0.542.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const yt=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Je=qe("message-square",yt);var Te={exports:{}},Ue;function wt(){return Ue||(Ue=1,(function(r,E){(function(R,j){r.exports=j()})(self,(()=>(()=>{var R={6:(d,w)=>{function x(o){try{const i=new URL(o),c=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return o.toLocaleLowerCase().startsWith(c.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(w,"__esModule",{value:!0}),w.LinkComputer=w.WebLinkProvider=void 0,w.WebLinkProvider=class{constructor(o,i,c,u={}){this._terminal=o,this._regex=i,this._handler=c,this._options=u}provideLinks(o,i){const c=C.computeLink(o,this._regex,this._terminal,this._handler);i(this._addCallbacks(c))}_addCallbacks(o){return o.map((i=>(i.leave=this._options.leave,i.hover=(c,u)=>{if(this._options.hover){const{range:f}=i;this._options.hover(c,u,f)}},i)))}};class C{static computeLink(i,c,u,f){const U=new RegExp(c.source,(c.flags||"")+"g"),[h,m]=C._getWindowedLineStrings(i-1,u),A=h.join("");let N;const P=[];for(;N=U.exec(A);){const M=N[0];if(!x(M))continue;const[D,k]=C._mapStrIdx(u,m,0,N.index),[K,G]=C._mapStrIdx(u,D,k,M.length);if(D===-1||k===-1||K===-1||G===-1)continue;const $={start:{x:k+1,y:D+1},end:{x:G,y:K+1}};P.push({range:$,text:M,activate:f})}return P}static _getWindowedLineStrings(i,c){let u,f=i,U=i,h=0,m="";const A=[];if(u=c.buffer.active.getLine(i)){const N=u.translateToString(!0);if(u.isWrapped&&N[0]!==" "){for(h=0;(u=c.buffer.active.getLine(--f))&&h<2048&&(m=u.translateToString(!0),h+=m.length,A.push(m),u.isWrapped&&m.indexOf(" ")===-1););A.reverse()}for(A.push(N),h=0;(u=c.buffer.active.getLine(++U))&&u.isWrapped&&h<2048&&(m=u.translateToString(!0),h+=m.length,A.push(m),m.indexOf(" ")===-1););}return[A,f]}static _mapStrIdx(i,c,u,f){const U=i.buffer.active,h=U.getNullCell();let m=u;for(;f;){const A=U.getLine(c);if(!A)return[-1,-1];for(let N=m;N<A.length;++N){A.getCell(N,h);const P=h.getChars();if(h.getWidth()&&(f-=P.length||1,N===A.length-1&&P==="")){const M=U.getLine(c+1);M&&M.isWrapped&&(M.getCell(0,h),h.getWidth()===2&&(f+=1))}if(f<0)return[c,N]}c++,m=0}return[c,m]}}w.LinkComputer=C}},j={};function v(d){var w=j[d];if(w!==void 0)return w.exports;var x=j[d]={exports:{}};return R[d](x,x.exports,v),x.exports}var y={};return(()=>{var d=y;Object.defineProperty(d,"__esModule",{value:!0}),d.WebLinksAddon=void 0;const w=v(6),x=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function C(o,i){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}d.WebLinksAddon=class{constructor(o=C,i={}){this._handler=o,this._options=i}activate(o){this._terminal=o;const i=this._options,c=i.urlRegex||x;this._linkProvider=this._terminal.registerLinkProvider(new w.WebLinkProvider(this._terminal,c,this._handler,i))}dispose(){this._linkProvider?.dispose()}}})(),y})()))})(Te)),Te.exports}var Nt=wt();const kt=[{label:"Save to knowledge base",command:"Save this to the knowledge base (.nut/context/knowledge/) using the following schema as reference .nut/.schema/knowledge.schema.md",description:"Save content to knowledge base with schema reference"},{label:"Update project document",command:"Update the project document (.nut/context/project.md) using the following schema as reference .nut/.schema/project.schema.md",description:"Update project.md using schema reference"},{label:"Update architecture document",command:"Update the architecture document (.nut/context/architecture.md) using the following schema as reference .nut/.schema/architecture.schema.md",description:"Update architecture.md using schema reference"}];function St({onJumpToBottom:r,onSnippet:E,onSendKey:R}){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.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.jsxs(S,{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(ht,{className:"h-3.5 w-3.5 sm:mr-1.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Jump to Bottom"})]}),E&&e.jsxs(Ee,{children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"h-8 text-xs bg-[#2d2d2d] border-gray-600 hover:bg-[#3d3d3d] text-gray-200 hover:text-white transition-colors",children:[e.jsx(vt,{className:"h-3.5 w-3.5 sm:mr-1.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Snippets"})]})}),e.jsxs(Le,{align:"start",className:"w-72",children:[e.jsx(Me,{children:"Command Snippets"}),e.jsx(We,{}),kt.map((j,v)=>e.jsxs(Ze,{onClick:()=>E(j.command),className:"cursor-pointer flex flex-col items-start py-2",children:[e.jsx("span",{className:"font-medium",children:j.label}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono mt-0.5",children:j.command})]},v))]})]})]}),R&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>R(""),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(ce,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"⌃"}),e.jsx(ce,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"C"})]}),e.jsxs("button",{onClick:()=>R(""),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(ce,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"⌃"}),e.jsx(ce,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"Z"})]}),e.jsx("button",{onClick:()=>R("\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(ce,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"Esc"})})]})]})}function Ct({sessionId:r,onResize:E,onDestroy:R,pendingCommand:j,onCommandExecuted:v,showToolbar:y=!0,onSnippet:d}){const w=n.useRef(null),x=n.useRef(null),C=n.useRef(null),o=n.useRef(null),[i,c]=n.useState(!1),[u,f]=n.useState(null),[U,h]=n.useState(!0),m=n.useRef(0),A=5,N=n.useRef(null),P=n.useRef(null),M=n.useRef(j??null),D=n.useRef(!1),k=n.useRef(null),K=n.useRef(v),G=n.useRef(R),$=n.useRef(E);n.useEffect(()=>{K.current=v},[v]),n.useEffect(()=>{G.current=R},[R]),n.useEffect(()=>{$.current=E},[E]);const X=n.useCallback(L=>{!M.current||D.current||(k.current!==null&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>{if(!M.current||D.current){k.current=null;return}o.current?.readyState===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"input",data:M.current+"\r"})),D.current=!0,K.current?.()),k.current=null},L))},[]);n.useEffect(()=>{if(M.current=j??null,D.current=!1,!M.current){k.current!==null&&(window.clearTimeout(k.current),k.current=null);return}const L=o.current?.readyState===WebSocket.OPEN;return X(L?200:800),()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)}},[j,r,X]),n.useEffect(()=>{c(!1),h(!0),f(null)},[r]),n.useEffect(()=>{if(!w.current||!r)return;const L=g=>{const b=g.getBoundingClientRect();return b.width>0&&b.height>0},p=new mt.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"}}),re=new ut.FitAddon,W=new Nt.WebLinksAddon;p.loadAddon(re),p.loadAddon(W),p.open(w.current),x.current=p,C.current=re;let I=null,F=null;const le=()=>{if(!p||!p.element||!p.element.parentElement)return;const g=p.cols??0,b=p.rows??0;if(g>0&&b>0){o.current?.readyState===WebSocket.OPEN&&o.current.send(JSON.stringify({type:"resize",cols:g,rows:b}));const B=$.current;B&&B(g,b)}},_=()=>{const g=w.current;if(g&&L(g)&&!(!p||!p.element||!p.element.parentElement))try{const b=g.getBoundingClientRect();if(b.width<10||b.height<10)return;re.fit(),le()}catch(b){console.warn("xterm fit() failed, will retry if needed:",b)}},Z=()=>{I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{_()})},ee=()=>{if(!r)return;N.current&&(window.clearTimeout(N.current),N.current=null);const g=`${Ye}/ws/terminal/${r}`,b=new WebSocket(g);return o.current=b,b.onopen=()=>{c(!0),f(null),m.current=0,console.log("Terminal WebSocket connected"),P.current&&window.clearInterval(P.current),P.current=window.setInterval(()=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"keepalive"}))},120*1e3),Z(),setTimeout(()=>{h(!1),Z(),setTimeout(()=>Z(),50),setTimeout(()=>Z(),150)},400),X(1200)},b.onmessage=B=>{try{const z=JSON.parse(B.data);switch(z.type){case"snapshot":if(typeof z.data=="string"&&z.data.length&&x.current){const T=x.current;T.write(z.data,()=>{T.scrollToBottom()})}break;case"data":if(x.current){const T=x.current,fe=T.buffer.active.viewportY+T.rows>=T.buffer.active.baseY+T.buffer.active.cursorY;T.write(z.data,()=>{fe&&T.scrollToBottom()})}break;case"exit":x.current&&x.current.write(`\r
12
+ \x1B[31mProcess exited with code ${z.exitCode}\x1B[0m\r
13
+ `),G.current?.();break}}catch(z){console.error("Error parsing WebSocket message:",z)}},b.onclose=B=>{if(c(!1),console.log("Terminal WebSocket disconnected",B.code,B.reason),P.current&&(window.clearInterval(P.current),P.current=null),B.code!==1e3&&m.current<A&&r){m.current++;const z=Math.min(1e3*Math.pow(2,m.current-1),1e4);console.log(`Attempting to reconnect (${m.current}/${A}) in ${z}ms`),N.current=window.setTimeout(()=>{ee()},z)}else m.current>=A&&f("Connection lost. Please refresh the page to reconnect.")},b.onerror=B=>{console.error("Terminal WebSocket error:",B),m.current===0&&f("WebSocket connection failed")},b};ee(),p.onData(g=>{o.current?.readyState===WebSocket.OPEN&&o.current.send(JSON.stringify({type:"input",data:g}))});const Q=()=>{Z()},ge=new ResizeObserver(Q);w.current&&ge.observe(w.current),window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q);const de=()=>{document.visibilityState==="visible"&&(F&&clearTimeout(F),F=window.setTimeout(()=>{Z()},50))};document.addEventListener("visibilitychange",de);let se=0;const me=20,ne=()=>{const g=w.current;if(g){if(L(g)){_();return}se+=1,se<me?I=requestAnimationFrame(ne):F=window.setTimeout(()=>{_()},100)}};return I=requestAnimationFrame(ne),()=>{ge.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),document.removeEventListener("visibilitychange",de),I&&cancelAnimationFrame(I),F&&clearTimeout(F),N.current&&(window.clearTimeout(N.current),N.current=null),P.current&&(window.clearInterval(P.current),P.current=null),o.current?.readyState===WebSocket.OPEN&&o.current.close(),k.current!==null&&(window.clearTimeout(k.current),k.current=null),p.dispose()}},[r,X]);const V=n.useCallback(()=>{x.current&&(x.current.scrollToBottom(),x.current.focus())},[]),xe=n.useCallback(L=>{o.current?.readyState===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"input",data:L})),x.current&&x.current.focus())},[]),O=n.useCallback(L=>{o.current?.readyState===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"input",data:L})),x.current&&x.current.focus())},[]);return u?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:u})]})}):e.jsxs("div",{className:"relative h-full flex flex-col bg-[#1a1b26] overflow-hidden",children:[!i&&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..."})]})}),i&&U&&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:w,className:"flex-1 w-full overflow-hidden",style:{minHeight:"400px"}}),y&&e.jsx(St,{onJumpToBottom:V,onSnippet:d||xe,onSendKey:O})]})}const At=r=>r?Array.isArray(r)?r.filter(E=>typeof E=="string").map(E=>E.trim()).filter(Boolean):typeof r=="string"?r.split(",").map(E=>E.trim()).filter(Boolean):[]:[];function Ut(){const{proposalId:r}=Ke(),E=Xe(),R=Qe(),{toast:j}=et(),v=r?.startsWith("session-"),y=n.useMemo(()=>!!r&&r.startsWith("cp-"),[r]),d=n.useMemo(()=>!!r&&r.startsWith("ag-"),[r]),w=n.useMemo(()=>d&&r?r.replace("ag-","")+".md":null,[d,r]),{sessions:x,loading:C,error:o,createSession:i,destroySession:c,refreshSessions:u}=dt(),[f,U]=n.useState([]),[h,m]=n.useState(null),[A,N]=n.useState(!1),[P,M]=n.useState(null),[D,k]=n.useState("claude"),[K,G]=n.useState(!1),[$,X]=n.useState("claude"),[V,xe]=n.useState([]),[O,L]=n.useState([]),[p,re]=n.useState([]),[W,I]=n.useState([]),[F,le]=n.useState(!0),[_,Z]=n.useState(""),[ee,Q]=n.useState(!1),[ge,de]=n.useState({}),[se,me]=n.useState(null),ne=n.useRef([]),[g,b]=n.useState("current"),[B,z]=n.useState("main"),T=n.useMemo(()=>r?`terminal.cp.config.${r}`:null,[r]);n.useEffect(()=>{if(!(!y&&!d||!T))try{const t=localStorage.getItem(T);if(t){const s=JSON.parse(t);s.cliAgent&&X(s.cliAgent),Array.isArray(s.selectedMcpServers)&&L(s.selectedMcpServers),Array.isArray(s.selectedAgentIds)&&I(s.selectedAgentIds),typeof s.automationEnabled=="boolean"&&le(s.automationEnabled),typeof s.customInstruction=="string"&&Z(s.customInstruction),typeof s.createWorktree=="boolean"&&Q(s.createWorktree),s.branchMode&&b(s.branchMode)}}catch{console.error("Failed to load config",T)}},[y,d,T]);const fe=n.useCallback(()=>{if(!T)return;const t={cliAgent:$,selectedMcpServers:O,selectedAgentIds:W,automationEnabled:F,customInstruction:_,createWorktree:ee,branchMode:g};try{localStorage.setItem(T,JSON.stringify(t))}catch{console.error("Failed to persist config",T)}},[T,$,O,W,F,_,ee,g]),te=t=>`feat/cp-${t.startsWith("cp-")?t.slice(3):t}`,Ge=async t=>{try{const s=te(t),l=await(await fetch(`${oe}/api/v1/git/branches`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,from:B})})).json();if(!l.success){const J=l.error?.message||"Unknown error";return j({title:"Branch creation failed",description:J,variant:"destructive"}),!1}return j({title:"Branch created",description:`Created branch: ${s}`}),!0}catch{return j({title:"Branch creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}},Re=async t=>{try{const s=te(t),l=await(await fetch(`${oe}/api/v1/git/worktrees`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:s,from:B})})).json();if(!l.success){const J=l.error?.message||"Unknown error";return j({title:"Worktree creation failed",description:J,variant:"destructive"}),!1}return j({title:"Worktree created",description:`Created branch: ${s}`}),!0}catch{return j({title:"Worktree creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}};n.useEffect(()=>{(y||d)&&r&&(async()=>{try{const s=await fetch(`${oe}/api/v1/git/status`);if(s.ok){const l=await s.json();l?.success&&l.data?.branch&&z(l.data.branch)}const a=await fetch(`${oe}/api/v1/mcp`);if(a.ok){const l=await a.json();l?.success&&Array.isArray(l.servers)&&(xe(l.servers),L(J=>J.filter(q=>l.servers.includes(q))),l.mcpServers&&typeof l.mcpServers=="object"&&de(l.mcpServers))}}catch(s){console.error("Failed to load MCP servers",s)}try{const s=await fetch(`${oe}/api/v1/agents`);if(s.ok){const a=await s.json(),J=(Array.isArray(a?.documents)?a.documents:[]).map(q=>({id:q.filename,name:q?.metadata?.name||q.title||q.filename,tools:At(q?.metadata?.tools)}));re(J),I(q=>{const ie=q.filter(Y=>J.some(be=>be.id===Y));if(d&&w&&ie.length===0){const Y=J.find(be=>be.id===w);if(Y)return[Y.id]}return ie})}}catch(s){console.error("Failed to load agents",s)}})()},[y,d,r,w]),n.useEffect(()=>{const t=ne.current,s=W.filter(a=>!t.includes(a));s.length>0&&L(a=>{const l=new Set(a),J=V.length>0?new Set(V):void 0;return s.forEach(q=>{const ie=p.find(Y=>Y.id===q);ie&&ie.tools.forEach(Y=>{(!J||J.has(Y))&&l.add(Y)})}),Array.from(l)}),ne.current=W},[W,p,V]),n.useEffect(()=>{r&&u(r)},[r,u]),n.useEffect(()=>{if(!r)return;const s=x.filter(a=>a.proposalId===r).map(a=>a.id);U(s),!h&&s.length>0&&m(s[0]),h&&!s.includes(h)&&m(s.length>0?s[0]:null)},[x,r,h]);const ae=async t=>{if(!r)return;const s=t||void 0,a=await i(r,A,s);a&&(m(a),!s&&t&&M(t),setTimeout(()=>u(r),100))},Ve=t=>{const a={proposalId:r,contextType:y?"change-proposal":d?"agent":"general",selectedMcpServers:O,selectedAgentIds:W,automationEnabled:F,customInstruction:_};switch(t){case"claude":return Fe(a);case"gemini":return ft(a);case"codex":return gt(a);case"droid":return xt(a);default:return Fe(a)}},pe=async()=>{y&&r&&(g==="new-branch"?await Ge(r)||console.warn("Branch creation failed, continuing with terminal creation"):g==="new-worktree"&&(await Re(r)||console.warn("Worktree creation failed, continuing with terminal creation"))),y&&ee&&g==="current"&&r&&(await Re(r)||console.warn("Worktree creation failed, continuing with terminal creation"));const s=Ve(y||d?$:D);await ae(s)},Be=async t=>{if(await c(t)&&h===t){const a=f.filter(l=>l!==t);m(a.length>0?a[0]:null)}},He=t=>{Be(t)};return r?e.jsxs("div",{className:"flex flex-col h-full",children:[v&&f.length===0&&r&&e.jsx(Tt,{proposalId:r,onStart:ae,locationSearch:E.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:y||d?e.jsx(ue,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):e.jsx(je,{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:v?"Terminal":"Agent Session"}),!v&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:r}),v&&e.jsxs("span",{className:"text-sm text-gray-500 font-mono",children:["(",r,")"]})]})]})}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsxs("div",{className:"hidden sm:flex items-center space-x-2 px-3 py-2 bg-gray-50 dark:bg-gray-800 rounded-lg border",children:[e.jsx($e,{id:"enable-logging",checked:A,onCheckedChange:t=>N(t===!0)}),e.jsx("label",{htmlFor:"enable-logging",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Log sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>r&&u(r),disabled:C,className:"bg-white dark:bg-gray-800",children:[e.jsx(pt,{className:`h-4 w-4 sm:mr-2 ${C?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),!v&&!y&&!d&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ve,{value:D,onValueChange:k,children:[e.jsx(ye,{className:"w-24",children:e.jsx(we,{})}),e.jsxs(Ne,{children:[e.jsx(H,{value:"claude",children:"Claude Code"}),e.jsx(H,{value:"gemini",children:"Google Gemini"}),e.jsx(H,{value:"codex",children:"OpenAI Codex"})]})]}),e.jsxs(S,{onClick:pe,disabled:C,size:"sm",variant:"default",className:"bg-green-600 hover:bg-green-700",children:[e.jsx(Ce,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Start Agent"})]})]}),!y&&!d&&(!v||f.length===0)&&e.jsxs(S,{onClick:()=>ae(),disabled:C,size:"sm",children:[e.jsx(Ae,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"New Terminal"})]})]})]})]}),o&&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(Oe,{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:o})]})}),f.length>0&&e.jsx("div",{className:"flex items-center gap-1 border-b dark:border-gray-700",children:f.map(t=>{const s=x.find(l=>l.id===t),a=h===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 ${a?"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:()=>m(t),children:[e.jsx("div",{className:`p-1.5 rounded-md ${a?"bg-gray-200 dark:bg-gray-700":"bg-gray-100 dark:bg-gray-700"}`,children:e.jsx(je,{className:`h-3.5 w-3.5 ${a?"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(S,{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(),Be(t)},children:e.jsx(Oe,{className:"h-3 w-3"})})]},t)})}),e.jsx("div",{className:"flex-1 min-h-0",children:f.length===0?e.jsx(it,{className:"h-full border-0 shadow-lg",children:e.jsx(ct,{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:y||d?e.jsx(ue,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"}):e.jsx(je,{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:v?"Create a new terminal session":`Configure the agent to start working on ${r}.`}),e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!v&&!y&&!d&&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(ve,{value:D,onValueChange:k,children:[e.jsx(ye,{className:"w-full h-11 bg-white dark:bg-gray-800",children:e.jsx(we,{})}),e.jsxs(Ne,{children:[e.jsx(H,{value:"claude",children:"Claude Code (default)"}),e.jsx(H,{value:"gemini",children:"Google Gemini"}),e.jsx(H,{value:"codex",children:"OpenAI Codex"})]})]})]}),e.jsxs(S,{onClick:pe,disabled:C,className:"bg-green-600 hover:bg-green-700 w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(Ce,{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(S,{onClick:()=>ae(),disabled:C,variant:"outline",className:"w-full h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(Ae,{className:"h-5 w-5 mr-2"}),"New Terminal"]})]}),!v&&(y||d)&&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:"flex gap-3 w-full",children:[e.jsxs(S,{variant:"outline",onClick:()=>G(!0),className:"flex-1 h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(tt,{className:"h-5 w-5 mr-2"}),"Configure"]}),e.jsxs(S,{onClick:pe,disabled:C,className:"flex-1 bg-green-600 hover:bg-green-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Ce,{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:"Current 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(Ie,{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:$==="claude"?"Claude Code":$.charAt(0).toUpperCase()+$.slice(1)})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ue,{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:W.length?W.map(t=>{const s=p.find(a=>a.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(_e,{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:O.length?O.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(bt,{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:F?"Enabled":"Disabled"})]}),y&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{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:g==="current"?`Current (${B})`:g==="new-branch"?`New branch (${te(r||"")})`:`New worktree (${te(r||"")})`})]})]}),_&&e.jsxs("div",{className:"text-left text-sm bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[e.jsxs("div",{className:"font-medium text-blue-700 dark:text-blue-300 mb-1 flex items-center gap-2",children:[e.jsx(Je,{className:"h-3.5 w-3.5"}),"Custom Instructions"]}),e.jsx("div",{className:"text-gray-700 dark:text-gray-300 font-mono",children:_})]})]})]}),v&&f.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(S,{onClick:()=>ae(),disabled:C,className:"w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(Ae,{className:"h-5 w-5 mr-2"}),"New Terminal"]})})]})]})})}):h?e.jsx("div",{className:"h-full overflow-hidden rounded-b-lg",children:e.jsx(Ct,{sessionId:h,onDestroy:()=>He(h),pendingCommand:P,onCommandExecuted:()=>M(null),showToolbar:!0})}):null}),e.jsx(rt,{open:K,onOpenChange:G,children:e.jsxs(st,{className:"max-w-3xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(nt,{children:[e.jsx(at,{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(Ie,{className:"h-4 w-4"}),"Agent"]}),e.jsxs(ve,{value:$,onValueChange:t=>X(t),children:[e.jsx(ye,{className:"w-full",children:e.jsx(we,{placeholder:"Select agent"})}),e.jsxs(Ne,{children:[e.jsx(H,{value:"claude",children:"Claude Code"}),e.jsx(H,{value:"gemini",children:"Google Gemini"}),e.jsx(H,{value:"codex",children:"OpenAI Codex"}),e.jsx(H,{value:"droid",children:"Factory Droid"})]})]})]}),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(ue,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[W.length," of ",p.length," selected"]})]}),e.jsxs(Ee,{children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(S,{variant:"outline",className:"w-full justify-between",children:[W.length===0?"Select skills...":W.length===p.length?"All skills selected":`${W.length} agent${W.length!==1?"s":""} selected`,e.jsx(ke,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(Le,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(Me,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Skills"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(S,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),I(p.map(s=>s.id))},children:"All"}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),I([])},children:"None"})]})]}),e.jsx(We,{}),p.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No agents found"}):p.map(t=>e.jsx(ze,{checked:W.includes(t.id),onCheckedChange:s=>{I(a=>s?a.includes(t.id)?a:[...a,t.id]:a.filter(l=>l!==t.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t.name}),t.tools.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",t.tools.join(", ")]}),t.tools.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(_e,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[O.length," of ",V.length," selected"]})]}),e.jsxs(Ee,{children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(S,{variant:"outline",className:"w-full justify-between",children:[O.length===0?"Select MCP servers...":O.length===V.length?"All servers selected":`${O.length} server${O.length!==1?"s":""} selected`,e.jsx(ke,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(Le,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(Me,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(S,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),L(V)},children:"All"}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),L([])},children:"None"})]})]}),e.jsx(We,{}),V.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):V.map(t=>e.jsx(ze,{checked:O.includes(t),onCheckedChange:s=>{L(a=>s?a.includes(t)?a:[...a,t]:a.filter(l=>l!==t))},children:t},t))]})]})]}),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(Je,{className:"h-4 w-4"}),"Additional instructions"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[_.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:_,onChange:t=>Z(t.target.value),rows:3}),_.length>500&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:"Custom instruction is too long (max 500 characters)"})]}),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($e,{id:"automation",checked:F,onCheckedChange:t=>le(t===!0),className:"data-[state=checked]:bg-red-600 data-[state=checked]:border-red-600 data-[state=checked]:text-white border-red-400",disabled:$==="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)"})]}),$==="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."]})]}),y&&e.jsx(lt,{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(he,{className:"text-sm font-medium mb-3 block",children:"Branch Management"}),e.jsxs(ot,{value:g,onValueChange:t=>b(t),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Se,{value:"current",id:"branch-current"}),e.jsxs(he,{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:B}),")"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Se,{value:"new-branch",id:"branch-new"}),e.jsxs(he,{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:te(r||"")})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Se,{value:"new-worktree",id:"branch-worktree"}),e.jsxs(he,{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:te(r||"")})]})]})]})]})})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>G(!1),children:"Close"}),e.jsx(S,{onClick:()=>{if(_.length>500){me("Please shorten the custom instruction to 500 characters.");return}me(null),fe(),G(!1)},children:"Save"})]}),se&&e.jsx("div",{className:"text-xs text-red-600 text-right",children:se})]})]})})]}):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 Proposal ID"}),e.jsx(S,{onClick:()=>R("/proposals"),className:"mt-4",children:"Back to Proposals"})]})})}function Tt({proposalId:r,onStart:E,locationSearch:R}){return n.useEffect(()=>{if(!r)return;const j=new URLSearchParams(R);if(!j.has("autostart"))return;const v=`terminal.autostart.${r}`;if(sessionStorage.getItem(v)==="done")return;sessionStorage.setItem(v,"done");const d=j.get("run")||void 0;E(d||void 0)},[r]),null}export{Ut as default};
@@ -1 +1 @@
1
- import{r as n,a as k,b4 as N,A as g,j as e,a7 as P,h,i as u,k as m,l as f,m as a,I as b,B as C}from"./index-DaqYJNAM.js";import{C as F,b as w,c as T,d as L,a as D}from"./card-BTg0Fecj.js";import{L as o}from"./label-BtnLfquf.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 B(){const[s,v]=n.useState(r),[y,E]=n.useState(!0),[c,x]=n.useState(!1),{toast:d}=k(),{theme:j,setTheme:p}=N();n.useEffect(()=>{S()},[]),n.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&&v(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()=>{x(!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{x(!1)}},i=t=>{v(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(P,{}),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=>i({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=>i({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=>i({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(b,{id:"autoSaveInterval",type:"number",min:10,max:600,value:s.autoSaveInterval,onChange:t=>i({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{B as default};
1
+ import{r as n,a as k,b4 as N,A as g,j as e,a7 as P,h,i as u,k as m,l as f,m as a,I as b,B as C}from"./index-CCs6x1Au.js";import{C as F,b as w,c as T,d as L,a as D}from"./card-By4vbQ_f.js";import{L as o}from"./label-BUv8Ltyw.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 B(){const[s,v]=n.useState(r),[y,E]=n.useState(!0),[c,x]=n.useState(!1),{toast:d}=k(),{theme:j,setTheme:p}=N();n.useEffect(()=>{S()},[]),n.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&&v(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()=>{x(!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{x(!1)}},i=t=>{v(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(P,{}),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=>i({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=>i({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=>i({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(b,{id:"autoSaveInterval",type:"number",min:10,max:600,value:s.autoSaveInterval,onChange:t=>i({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{B as default};
@@ -1 +1 @@
1
- import{r as a,a as I,A as S,j as e,a7 as D,B as g,I as p,h as F,i as P,k as L,l as z,m as A,L as R}from"./index-DaqYJNAM.js";import{C as q,b as T,c as M,d as O,a as U}from"./card-BTg0Fecj.js";import{L as c}from"./label-BtnLfquf.js";import{C as B,a as Q}from"./clipboard-CTFAlaYo.js";const m=[{id:"software-engineer",title:"Software Engineer",description:"Builds, refactors, and reviews high-quality code across stacks. Excellent at translating specs into implementation and optimizing system performance. Strong at debugging, architecture patterns, and accelerating development velocity."},{id:"product-strategist",title:"Product Strategist",description:"Defines product direction, clarifies requirements, and aligns work with user and business goals. Skilled in roadmap planning, prioritization, and transforming ambiguous ideas into actionable plans."},{id:"researcher",title:"Researcher",description:"Investigates topics deeply, synthesizes information, and produces evidence-based insights. Strong at literature review, competitive analysis, and generating clear summaries to inform decisions."},{id:"designer",title:"Designer",description:"Creates intuitive interfaces, user flows, and visual assets. Focused on usability, accessibility, and crafting polished experiences. Strong at wireframing and turning requirements into elegant solutions."},{id:"qa-engineer",title:"QA Engineer",description:"Identifies bugs, edge cases, and reliability gaps. Produces test plans, automated tests, and reproducible reports. Strong at ensuring product quality and preventing regressions."},{id:"devops-engineer",title:"DevOps Engineer",description:"Manages infrastructure, deployments, and operational reliability. Skilled with CI/CD, observability, automation, and environment provisioning. Ensures systems are scalable and fault-tolerant."},{id:"data-analyst",title:"Data Analyst",description:"Analyzes data, defines metrics, and generates actionable insights. Strong in SQL, visualization, experimentation, and turning raw data into strategic recommendations."},{id:"marketer",title:"Marketer",description:"Creates campaigns, messaging, and positioning to reach target audiences. Skilled in content, funnels, and brand strategy. Strong at synthesizing market needs and shaping demand."},{id:"sales-partnerships-agent",title:"Sales & Partnerships Agent",description:"Identifies prospects, crafts outreach, and develops strategic relationships. Strong at value articulation, objection handling, and mapping product capabilities to customer needs."},{id:"growth-operator",title:"Growth Operator",description:"Optimizes acquisition, activation, and retention through experimentation. Skilled in funnel analysis, rapid testing, and leveraging data for compounding growth."},{id:"customer-success-specialist",title:"Customer Success Specialist",description:"Ensures users succeed by providing onboarding, guidance, and proactive support. Strong at diagnosing user challenges and improving long-term satisfaction and retention."},{id:"orchestration-engineer",title:"Orchestration Engineer",description:"Coordinates multi-agent workflows, dependencies, and handoffs. Strong at breaking large tasks into sequenced steps and ensuring agents operate cohesively and efficiently."},{id:"context-curator",title:"Context Curator",description:"Maintains clean, accurate project context by organizing files, logs, and knowledge. Strong at eliminating ambiguity, ensuring agents have the right information at the right time."},{id:"documentation-writer",title:"Documentation Writer",description:"Produces clear technical docs, guides, READMEs, and CP summaries. Strong at structuring complex information and keeping knowledge bases up to date and accessible."}];function H(){const[n,h]=a.useState({}),[r,d]=a.useState(null),[f,x]=a.useState(!1),[b,N]=a.useState(!0),[u,v]=a.useState(!1),{toast:o}=I();a.useEffect(()=>{j()},[]);const j=async()=>{try{try{const t=await fetch(`${S}/api/v1/config`),s=await t.json();if(t.ok&&s?.success){const i=s.data?.coconut||{};d(i.id??null),(i.firstName||i.lastName||i.email||i.role||i.roleDescription)&&h({firstName:i.firstName,lastName:i.lastName,email:i.email,role:i.role,roleDescription:i.roleDescription})}else d(null)}catch(t){console.error("Failed to load coconut config:",t),d(null)}}catch(t){console.error("Failed to load settings:",t),o({title:"Error",description:"Failed to load user settings",variant:"destructive"})}finally{N(!1)}},w=async()=>{v(!0);try{const s=await(await fetch(`${S}/api/v1/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({coconut:{...n,id:r||void 0}})})).json();if(s.success)window.dispatchEvent(new CustomEvent("config-updated")),o({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),o({title:"Error",description:"Failed to save settings",variant:"destructive"})}finally{v(!1)}},l=t=>{h(s=>{const i={...s,...t};if(t.role!==void 0){const C=m.find(k=>k.id===t.role);C?.description&&(i.roleDescription=C.description)}return i})},y=a.useMemo(()=>n.role&&m.find(s=>s.id===n.role)?.description||null,[n.role]),E=async()=>{if(r)try{await navigator.clipboard.writeText(r),x(!0),o({title:"Copied",description:"Coconut ID copied to clipboard."}),setTimeout(()=>x(!1),1500)}catch(t){console.error("Failed to copy coconut ID:",t),o({title:"Copy failed",description:"Unable to copy the Coconut ID to the clipboard.",variant:"destructive"})}};return b?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(D,{}),e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/40 p-4",children:r?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:r})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:E,children:[f?e.jsx(B,{className:"h-4 w-4"}):e.jsx(Q,{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(q,{children:[e.jsxs(T,{children:[e.jsx(M,{children:"Coconut Profile"}),e.jsx(O,{children:"Update the Coconut's identifying details and role."})]}),e.jsxs(U,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(c,{htmlFor:"firstName",children:"First Name"}),e.jsx(p,{id:"firstName",value:n.firstName||"",onChange:t=>l({firstName:t.target.value}),placeholder:"Enter first name"})]}),e.jsxs("div",{children:[e.jsx(c,{htmlFor:"lastName",children:"Last Name"}),e.jsx(p,{id:"lastName",value:n.lastName||"",onChange:t=>l({lastName:t.target.value}),placeholder:"Enter last name"})]})]}),e.jsxs("div",{children:[e.jsx(c,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",value:n.email||"",onChange:t=>l({email:t.target.value}),placeholder:"Enter email address"})]}),e.jsxs("div",{children:[e.jsx(c,{htmlFor:"role",children:"Role"}),e.jsxs(F,{value:n.role,onValueChange:t=>l({role:t}),children:[e.jsx(P,{children:e.jsx(L,{placeholder:"Select role"})}),e.jsx(z,{children:m.map(t=>e.jsx(A,{value:t.id,children:t.title},t.id))})]}),y&&e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:y})]})]})]}),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(R,{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(g,{variant:"outline",onClick:j,disabled:u,children:"Cancel"}),e.jsx(g,{onClick:w,disabled:u,children:u?"Saving...":"Save Changes"})]})]})}export{H as default};
1
+ import{r as a,a as I,A as S,j as e,a7 as D,B as g,I as p,h as F,i as P,k as L,l as z,m as A,L as R}from"./index-CCs6x1Au.js";import{C as q,b as T,c as M,d as O,a as U}from"./card-By4vbQ_f.js";import{L as c}from"./label-BUv8Ltyw.js";import{C as B,a as Q}from"./clipboard-CuF9OlXN.js";const m=[{id:"software-engineer",title:"Software Engineer",description:"Builds, refactors, and reviews high-quality code across stacks. Excellent at translating specs into implementation and optimizing system performance. Strong at debugging, architecture patterns, and accelerating development velocity."},{id:"product-strategist",title:"Product Strategist",description:"Defines product direction, clarifies requirements, and aligns work with user and business goals. Skilled in roadmap planning, prioritization, and transforming ambiguous ideas into actionable plans."},{id:"researcher",title:"Researcher",description:"Investigates topics deeply, synthesizes information, and produces evidence-based insights. Strong at literature review, competitive analysis, and generating clear summaries to inform decisions."},{id:"designer",title:"Designer",description:"Creates intuitive interfaces, user flows, and visual assets. Focused on usability, accessibility, and crafting polished experiences. Strong at wireframing and turning requirements into elegant solutions."},{id:"qa-engineer",title:"QA Engineer",description:"Identifies bugs, edge cases, and reliability gaps. Produces test plans, automated tests, and reproducible reports. Strong at ensuring product quality and preventing regressions."},{id:"devops-engineer",title:"DevOps Engineer",description:"Manages infrastructure, deployments, and operational reliability. Skilled with CI/CD, observability, automation, and environment provisioning. Ensures systems are scalable and fault-tolerant."},{id:"data-analyst",title:"Data Analyst",description:"Analyzes data, defines metrics, and generates actionable insights. Strong in SQL, visualization, experimentation, and turning raw data into strategic recommendations."},{id:"marketer",title:"Marketer",description:"Creates campaigns, messaging, and positioning to reach target audiences. Skilled in content, funnels, and brand strategy. Strong at synthesizing market needs and shaping demand."},{id:"sales-partnerships-agent",title:"Sales & Partnerships Agent",description:"Identifies prospects, crafts outreach, and develops strategic relationships. Strong at value articulation, objection handling, and mapping product capabilities to customer needs."},{id:"growth-operator",title:"Growth Operator",description:"Optimizes acquisition, activation, and retention through experimentation. Skilled in funnel analysis, rapid testing, and leveraging data for compounding growth."},{id:"customer-success-specialist",title:"Customer Success Specialist",description:"Ensures users succeed by providing onboarding, guidance, and proactive support. Strong at diagnosing user challenges and improving long-term satisfaction and retention."},{id:"orchestration-engineer",title:"Orchestration Engineer",description:"Coordinates multi-agent workflows, dependencies, and handoffs. Strong at breaking large tasks into sequenced steps and ensuring agents operate cohesively and efficiently."},{id:"context-curator",title:"Context Curator",description:"Maintains clean, accurate project context by organizing files, logs, and knowledge. Strong at eliminating ambiguity, ensuring agents have the right information at the right time."},{id:"documentation-writer",title:"Documentation Writer",description:"Produces clear technical docs, guides, READMEs, and CP summaries. Strong at structuring complex information and keeping knowledge bases up to date and accessible."}];function H(){const[n,h]=a.useState({}),[r,d]=a.useState(null),[f,x]=a.useState(!1),[b,N]=a.useState(!0),[u,v]=a.useState(!1),{toast:o}=I();a.useEffect(()=>{j()},[]);const j=async()=>{try{try{const t=await fetch(`${S}/api/v1/config`),s=await t.json();if(t.ok&&s?.success){const i=s.data?.coconut||{};d(i.id??null),(i.firstName||i.lastName||i.email||i.role||i.roleDescription)&&h({firstName:i.firstName,lastName:i.lastName,email:i.email,role:i.role,roleDescription:i.roleDescription})}else d(null)}catch(t){console.error("Failed to load coconut config:",t),d(null)}}catch(t){console.error("Failed to load settings:",t),o({title:"Error",description:"Failed to load user settings",variant:"destructive"})}finally{N(!1)}},w=async()=>{v(!0);try{const s=await(await fetch(`${S}/api/v1/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({coconut:{...n,id:r||void 0}})})).json();if(s.success)window.dispatchEvent(new CustomEvent("config-updated")),o({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),o({title:"Error",description:"Failed to save settings",variant:"destructive"})}finally{v(!1)}},l=t=>{h(s=>{const i={...s,...t};if(t.role!==void 0){const C=m.find(k=>k.id===t.role);C?.description&&(i.roleDescription=C.description)}return i})},y=a.useMemo(()=>n.role&&m.find(s=>s.id===n.role)?.description||null,[n.role]),E=async()=>{if(r)try{await navigator.clipboard.writeText(r),x(!0),o({title:"Copied",description:"Coconut ID copied to clipboard."}),setTimeout(()=>x(!1),1500)}catch(t){console.error("Failed to copy coconut ID:",t),o({title:"Copy failed",description:"Unable to copy the Coconut ID to the clipboard.",variant:"destructive"})}};return b?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(D,{}),e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/40 p-4",children:r?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:r})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:E,children:[f?e.jsx(B,{className:"h-4 w-4"}):e.jsx(Q,{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(q,{children:[e.jsxs(T,{children:[e.jsx(M,{children:"Coconut Profile"}),e.jsx(O,{children:"Update the Coconut's identifying details and role."})]}),e.jsxs(U,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(c,{htmlFor:"firstName",children:"First Name"}),e.jsx(p,{id:"firstName",value:n.firstName||"",onChange:t=>l({firstName:t.target.value}),placeholder:"Enter first name"})]}),e.jsxs("div",{children:[e.jsx(c,{htmlFor:"lastName",children:"Last Name"}),e.jsx(p,{id:"lastName",value:n.lastName||"",onChange:t=>l({lastName:t.target.value}),placeholder:"Enter last name"})]})]}),e.jsxs("div",{children:[e.jsx(c,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",value:n.email||"",onChange:t=>l({email:t.target.value}),placeholder:"Enter email address"})]}),e.jsxs("div",{children:[e.jsx(c,{htmlFor:"role",children:"Role"}),e.jsxs(F,{value:n.role,onValueChange:t=>l({role:t}),children:[e.jsx(P,{children:e.jsx(L,{placeholder:"Select role"})}),e.jsx(z,{children:m.map(t=>e.jsx(A,{value:t.id,children:t.title},t.id))})]}),y&&e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:y})]})]})]}),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(R,{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(g,{variant:"outline",onClick:j,disabled:u,children:"Cancel"}),e.jsx(g,{onClick:w,disabled:u,children:u?"Saving...":"Save Changes"})]})]})}export{H as default};
@@ -1 +1 @@
1
- import{u as v,a as w,r as n,j as e,B as g,ak as b,L as C,A as S,a9 as I}from"./index-DaqYJNAM.js";import{C as R,a as B}from"./card-BTg0Fecj.js";import{u as Q}from"./use-terminal-LpFJK0k7.js";import{C as $}from"./circle-play-DQ32zg60.js";import{P as O}from"./play-D_fLXyLR.js";function L(){const o=v(),{loading:l,createSession:d,refreshSessions:j}=Q(),{toast:i}=w(),[m,u]=n.useState(!1),[x,h]=n.useState(!1),[,f]=n.useState([]),[c,y]=n.useState({});n.useEffect(()=>{try{const t=localStorage.getItem("terminal.commandHistory");t&&f(JSON.parse(t))}catch{}},[]),n.useEffect(()=>{(async()=>{try{const s=await fetch(`${S}/api/v1/context/architecture`);if(!s.ok)return;const a=await s.json();a?.success&&a?.document?.metadata?.commands&&y(a.document.metadata.commands)}catch{}})()},[]);const p=t=>{t&&f(s=>{const a=[t,...s.filter(r=>r!==t)].slice(0,5);try{localStorage.setItem("terminal.commandHistory",JSON.stringify(a))}catch{}return a})},N=async t=>{const s=(t||"").trim();if(!s)return;const a=`session-${Date.now()}`;u(!0);try{await d(a,!1,s)?(p(s),i({title:"Session started",description:`${a}`}),o(`/terminal/${a}`)):i({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{u(!1)}},k=async t=>{const s=(t||"").trim();if(!s)return;const a=`session-${Date.now()}`;h(!0);try{await d(a,!1,s)?(p(s),setTimeout(()=>j(),150),i({title:"Started in background",description:`${a}`,action:e.jsx(I,{altText:"Open session",onClick:()=>o(`/terminal/${a}`),children:"Open"})})):i({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{h(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Utilities"}),e.jsx("p",{className:"text-muted-foreground",children:"Quick commands and shortcuts"})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Quick Commands"}),e.jsx(R,{children:e.jsx(B,{className:"pt-6",children:c&&Object.keys(c).length>0?e.jsx("div",{className:"space-y-2",children:e.jsx("div",{className:"rounded-md border divide-y",children:Object.entries(c).map(([t,s])=>e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 p-2",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:t}),e.jsx("span",{className:"text-muted-foreground hidden sm:inline",children:":"}),e.jsx("span",{className:"truncate max-w-full",children:e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-xs",children:s})})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 flex-shrink-0",children:[e.jsxs(g,{onClick:()=>k(s),variant:"secondary",size:"sm",disabled:l||x||m,title:"Run in background",children:[e.jsx($,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Background"})]}),e.jsxs(g,{onClick:()=>N(s),size:"sm",disabled:l||m||x,title:"Run",children:[e.jsx(O,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Run"})]})]})]},t))})}):e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3 py-8",children:[e.jsx(b,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No quick commands configured"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md leading-relaxed",children:"Quick commands let you run common tasks with one click, like starting your development server or running build scripts."}),e.jsxs("p",{className:"text-sm text-muted-foreground max-w-md mt-2",children:["Set them up in the"," ",e.jsx(C,{to:"/context/architecture/edit",className:"text-primary hover:underline font-medium",children:"Quick Commands section"}),"."]})]})]})})})]})]})}export{L as default};
1
+ import{u as v,a as w,r as n,j as e,B as g,ak as b,L as C,A as S,a9 as I}from"./index-CCs6x1Au.js";import{C as R,a as B}from"./card-By4vbQ_f.js";import{u as Q}from"./use-terminal-BW9XYY8N.js";import{C as $}from"./circle-play-D9VS6Vdc.js";import{P as O}from"./play-BHUpJCX1.js";function L(){const o=v(),{loading:l,createSession:d,refreshSessions:j}=Q(),{toast:i}=w(),[m,u]=n.useState(!1),[x,h]=n.useState(!1),[,f]=n.useState([]),[c,y]=n.useState({});n.useEffect(()=>{try{const t=localStorage.getItem("terminal.commandHistory");t&&f(JSON.parse(t))}catch{}},[]),n.useEffect(()=>{(async()=>{try{const s=await fetch(`${S}/api/v1/context/architecture`);if(!s.ok)return;const a=await s.json();a?.success&&a?.document?.metadata?.commands&&y(a.document.metadata.commands)}catch{}})()},[]);const p=t=>{t&&f(s=>{const a=[t,...s.filter(r=>r!==t)].slice(0,5);try{localStorage.setItem("terminal.commandHistory",JSON.stringify(a))}catch{}return a})},N=async t=>{const s=(t||"").trim();if(!s)return;const a=`session-${Date.now()}`;u(!0);try{await d(a,!1,s)?(p(s),i({title:"Session started",description:`${a}`}),o(`/terminal/${a}`)):i({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{u(!1)}},k=async t=>{const s=(t||"").trim();if(!s)return;const a=`session-${Date.now()}`;h(!0);try{await d(a,!1,s)?(p(s),setTimeout(()=>j(),150),i({title:"Started in background",description:`${a}`,action:e.jsx(I,{altText:"Open session",onClick:()=>o(`/terminal/${a}`),children:"Open"})})):i({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{h(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Utilities"}),e.jsx("p",{className:"text-muted-foreground",children:"Quick commands and shortcuts"})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Quick Commands"}),e.jsx(R,{children:e.jsx(B,{className:"pt-6",children:c&&Object.keys(c).length>0?e.jsx("div",{className:"space-y-2",children:e.jsx("div",{className:"rounded-md border divide-y",children:Object.entries(c).map(([t,s])=>e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 p-2",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:t}),e.jsx("span",{className:"text-muted-foreground hidden sm:inline",children:":"}),e.jsx("span",{className:"truncate max-w-full",children:e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-xs",children:s})})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 flex-shrink-0",children:[e.jsxs(g,{onClick:()=>k(s),variant:"secondary",size:"sm",disabled:l||x||m,title:"Run in background",children:[e.jsx($,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Background"})]}),e.jsxs(g,{onClick:()=>N(s),size:"sm",disabled:l||m||x,title:"Run",children:[e.jsx(O,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Run"})]})]})]},t))})}):e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3 py-8",children:[e.jsx(b,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No quick commands configured"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md leading-relaxed",children:"Quick commands let you run common tasks with one click, like starting your development server or running build scripts."}),e.jsxs("p",{className:"text-sm text-muted-foreground max-w-md mt-2",children:["Set them up in the"," ",e.jsx(C,{to:"/context/architecture/edit",className:"text-primary hover:underline font-medium",children:"Quick Commands section"}),"."]})]})]})})})]})]})}export{L as default};
@@ -1 +1 @@
1
- import{r,j as a,e as o}from"./index-DaqYJNAM.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-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as o}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as o}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as o}from"./index-CCs6x1Au.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,b8 as a}from"./index-DaqYJNAM.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{j as o,e as n,b8 as a}from"./index-CCs6x1Au.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,4 +1,4 @@
1
- import{c as $,r,j as e,D as z,b as G,d as K,f as Q,I as V,J as M,S as W,e as X,a6 as Y,B}from"./index-DaqYJNAM.js";import{B as v}from"./badge-BLbqPEov.js";import{a as Z}from"./registry-ANRa5WBi.js";import{S as O}from"./search-kmqzieAc.js";/**
1
+ import{c as $,r,j as e,D as z,b as G,d as K,f as Q,I as V,J as M,S as W,e as X,a6 as Y,B}from"./index-CCs6x1Au.js";import{B as v}from"./badge-2ZOe5ynf.js";import{a as Z}from"./registry-ANRa5WBi.js";import{S as O}from"./search-DFtqbVgP.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-DaqYJNAM.js";/**
1
+ import{c as e}from"./index-CCs6x1Au.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-DaqYJNAM.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-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as e}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as o}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as e}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as a}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c as o}from"./index-CCs6x1Au.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,8 @@
1
+ const l="Use .nut/context/project.md and .nut/context/architecture.md for reference.";function p(e,t,n,o=!0){const s=[];return o&&(s.push(["## Task","","- Review and begin working on the following task proposal:",` .nut/proposals/${e}.md`,"- Retrieve your firstName, lastName, and email address from: .nut/config.json and use this identity to address yourself in any task updates, comments, git commits, etc."].join(`
2
+ `)),s.push(["## Task Lifecycle","",`- Before beginning any work: nut task update ${e} --status active`,`- Add appropriate steps with: nut task step ${e} "Step description" --author "firstName lastName"`,"",`- If you need human clarification or input: nut task update ${e} --status blocked. The clarification can be communicated as follows: nut task comment ${e} "Comments here" --author "firstName lastName". At this point please stop work.`,"",`- When implementation is complete and ready for approval: nut task update ${e} --status review`,`- Only mark the task complete once approval criteria are satisfied: nut task update ${e} --status done`].join(`
3
+ `)),s.push(["## Operational Rules","","- DO use the nut CLI to update task status as progress changes"," (nut --help or nut task --help for details)","- DO NOT edit files outside the scope of the approved proposal (unless instructed by the Additional Instructions below)"].join(`
4
+ `))),t.length>0&&s.push(["## Agents","","These agents are available to you if needed:",...t.map(i=>`- ${i}`)].join(`
5
+ `)),n&&n.trim()&&s.push(["## Additional Instructions","","DO strictly adhere to these additional instructions:",n.trim()].join(`
6
+ `)),[s.join(`
7
+
8
+ `)]}function u(e,t){const n=[];return n.push(l),e.length>0&&n.push(`Please use these agents: ${e.join(", ")}`),t&&t.trim()&&n.push(`Additional instruction: ${t.trim()}`),n}const m=e=>{const t=e.selectedAgentIds.map(d=>`.nut/agents/${d}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):u(t,e.customInstruction)).join(" "),s=[e.automationEnabled?"--dangerously-skip-permissions":""].filter(Boolean).join(" "),i=e.selectedMcpServers.map(d=>`'${d.replace(/'/g,"'\\''")}'`).join(","),a=[JSON.stringify(o)].concat(s?[JSON.stringify("--dangerously-skip-permissions")]:[]);return`node -e "${`const fs=require('fs'),{spawn}=require('child_process');const s=new Set([${i}]);const c=require('./.nut/mcp/config.json');const filtered=Object.entries(c.mcpServers||{}).filter(([k])=>s.has(k)).map(([k,v])=>[k,{...v,type:v.type||(v.url?'http':'stdio')}]);const o={mcpServers:Object.fromEntries(filtered)};fs.writeFileSync('.mcp.json',JSON.stringify(o,null,2));const p=spawn('claude',[${a.join(",")}],{stdio:'inherit'});p.on('exit',code=>process.exit(code));`.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`},h=e=>{const t=e.selectedAgentIds.map(c=>`.nut/agents/${c}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):u(t,e.customInstruction)).join(" ");return`node -e "${`const fs=require('fs'),path=require('path'),{spawn}=require('child_process');const s=new Set([${e.selectedMcpServers.map(c=>`'${c.replace(/'/g,"'\\''")}'`).join(",")}]);const c=require('./.nut/mcp/config.json');const geminiPath=path.join(require('os').homedir(),'.gemini','settings.json');let settings={};try{settings=JSON.parse(fs.readFileSync(geminiPath,'utf8'))}catch(e){}settings.mcpServers=Object.fromEntries(Object.entries(c.mcpServers||{}).filter(([k])=>s.has(k)));fs.writeFileSync(geminiPath,JSON.stringify(settings,null,2));const p=spawn('gemini',['-i',${JSON.stringify(o)}],{stdio:'inherit'});p.on('exit',code=>process.exit(code));`.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`},f=e=>{const t=e.selectedAgentIds.map(r=>`.nut/agents/${r}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):u(t,e.customInstruction)).join(" "),s=e.selectedMcpServers.map(r=>`'${r.replace(/'/g,"'\\''")}'`).join(","),i=[JSON.stringify(o)].concat(e.automationEnabled?[JSON.stringify("--dangerously-bypass-approvals-and-sandbox")]:[]);return`node -e "${`const fs=require('fs'),{spawn}=require('child_process');const s=new Set([${s}]);const c=require('./.nut/mcp/config.json');const filtered=Object.entries(c.mcpServers||{}).filter(([k])=>s.has(k)).map(([k,v])=>[k,{...v,type:v.type||(v.url?'http':'stdio')}]);const o={mcpServers:Object.fromEntries(filtered)};fs.writeFileSync('.mcp.json',JSON.stringify(o,null,2));const p=spawn('codex',[${i.join(",")}],{stdio:'inherit'});p.on('exit',code=>process.exit(code));`.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`},g=e=>{const t=e.selectedAgentIds.map(r=>`.nut/agents/${r}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):u(t,e.customInstruction)).join(" "),s=e.selectedMcpServers.map(r=>`'${r.replace(/'/g,"'\\''")}'`).join(","),i=[JSON.stringify(o)];return`node -e "${`const fs=require('fs'),{spawn}=require('child_process');const s=new Set([${s}]);const c=require('./.nut/mcp/config.json');const filtered=Object.entries(c.mcpServers||{}).filter(([k])=>s.has(k)).map(([k,v])=>[k,{...v,type:v.type||(v.url?'http':'stdio')}]);const o={mcpServers:Object.fromEntries(filtered)};fs.writeFileSync('.mcp.json',JSON.stringify(o,null,2));const p=spawn('droid',[${i.join(",")}],{stdio:'inherit'});p.on('exit',code=>process.exit(code));`.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`};export{g as a,m as b,f as c,h as d};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.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-DaqYJNAM.js";/**
1
+ import{c}from"./index-CCs6x1Au.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.