@lovelybunch/api 1.0.75-alpha.0 → 1.0.75-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/storage/file-storage.js +30 -25
- package/dist/routes/api/v1/events/status/route.d.ts +1 -1
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
- package/dist/routes/api/v1/proposals/[id]/route.d.ts +8 -8
- package/dist/server-with-static.js +2 -2
- package/dist/server.js +1 -1
- package/package.json +4 -4
- package/static/assets/{ActivityPage-Dl3u61DF.js → ActivityPage-Cr4Adhtq.js} +1 -1
- package/static/assets/{AgentDetailPage-BJD22FSv.js → AgentDetailPage-NkpmJjNT.js} +1 -1
- package/static/assets/{AgentEditPage-ZYd0Rode.js → AgentEditPage-D7AiUjwA.js} +1 -1
- package/static/assets/{AgentsPage-CUuxxQ2o.js → AgentsPage-9xKFyGGL.js} +1 -1
- package/static/assets/{AgentsSettingsPage-Dd8MrsKx.js → AgentsSettingsPage-Dj-HuL78.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-DTZStkII.js → ApiKeysSettingsPage-vU1wUbIY.js} +1 -1
- package/static/assets/{ArchitectureEditPage-CVxBD88N.js → ArchitectureEditPage-B0C-1qRZ.js} +1 -1
- package/static/assets/{ArchitecturePage-GchbFR8L.js → ArchitecturePage-CskvR090.js} +1 -1
- package/static/assets/{AuthSettingsPage-B7a-i1_T.js → AuthSettingsPage-DvaqGyUi.js} +1 -1
- package/static/assets/{CallbackPage-xYgfYT1Z.js → CallbackPage-zFxlz7kI.js} +1 -1
- package/static/assets/{CodePage-xpXX0hlR.js → CodePage-CgxQpGSJ.js} +1 -1
- package/static/assets/{CollapsibleSection-ka7CEJhS.js → CollapsibleSection-CZW08ZKh.js} +1 -1
- package/static/assets/{DashboardPage-DQFlhP54.js → DashboardPage-COeTibbV.js} +1 -1
- package/static/assets/{GitPage-B-aSKe9Z.js → GitPage-oEi9w-hk.js} +1 -1
- package/static/assets/{GitSettingsPage-vLNJs4r3.js → GitSettingsPage-BnPfdhTA.js} +1 -1
- package/static/assets/{IdentityPage-ZAp_iARt.js → IdentityPage-Cua8aLR0.js} +1 -1
- package/static/assets/{ImplementationStepsEditor-BC8bzHNj.js → ImplementationStepsEditor-CyvJGM66.js} +1 -1
- package/static/assets/{IntegrationsSettingsPage-CqWZ8GUI.js → IntegrationsSettingsPage-C9__C_tB.js} +1 -1
- package/static/assets/{JobDetailPage-BWq4XLO2.js → JobDetailPage-BWx8UZd_.js} +1 -1
- package/static/assets/{KnowledgeDetailPage-C8evStGp.js → KnowledgeDetailPage-BFh6kBpe.js} +1 -1
- package/static/assets/{KnowledgeEditPage-DquJprU_.js → KnowledgeEditPage-y3Wi396w.js} +1 -1
- package/static/assets/{KnowledgePage-BBUKBhzS.js → KnowledgePage-CpuHKEdX.js} +1 -1
- package/static/assets/{LoginPage-Dp6lQSZW.js → LoginPage-BjaxhLcD.js} +1 -1
- package/static/assets/{McpSettingsPage-BGIEripM.js → McpSettingsPage-C5PK67QZ.js} +1 -1
- package/static/assets/{NewAgentPage-D9hL7NY6.js → NewAgentPage-ClQZ4e2q.js} +1 -1
- package/static/assets/{NewKnowledgePage-CEdd8Yns.js → NewKnowledgePage-JunSFFzT.js} +1 -1
- package/static/assets/{NewProposalPage-B152OXnT.js → NewProposalPage-BGQY4vQl.js} +1 -1
- package/static/assets/{ProjectEditPage-D0uSaGy0.js → ProjectEditPage-BbdJOl5X.js} +1 -1
- package/static/assets/{ProjectPage-DzWJky4Y.js → ProjectPage-3OntoNbq.js} +1 -1
- package/static/assets/{PromptsSettingsPage-DH-4vcbF.js → PromptsSettingsPage-Dynk-a14.js} +1 -1
- package/static/assets/ProposalDetailPage-BTp5nJNV.js +1 -0
- package/static/assets/{ProposalEditPage-D4412azZ.js → ProposalEditPage-DvSBzBsa.js} +1 -1
- package/static/assets/{ProposalsPage-D2gMbCBV.js → ProposalsPage-BBnEWZi-.js} +2 -2
- package/static/assets/{ResourcesPage-7tbvXxDb.js → ResourcesPage-DzOgzqML.js} +1 -1
- package/static/assets/{RoleEditPage-Ne8Dh8Tt.js → RoleEditPage-xVF7hGh5.js} +1 -1
- package/static/assets/{RolePage-3sb7lhw8.js → RolePage-CrIG3o0W.js} +1 -1
- package/static/assets/{RulesSettingsPage-CEWEvNFC.js → RulesSettingsPage-Cvgwk4Ag.js} +1 -1
- package/static/assets/{SchedulePage-Crd-VMiL.js → SchedulePage-BJP6J8AN.js} +1 -1
- package/static/assets/{SourceInput-fvbAHpzT.js → SourceInput-BUwwPoS8.js} +1 -1
- package/static/assets/{TagInput-DRSgjTau.js → TagInput-nkfZlUWc.js} +1 -1
- package/static/assets/{TerminalPage-BGZJDqvR.js → TerminalPage-gmDler5A.js} +1 -1
- package/static/assets/{TerminalSessionPage-DILvcnLG.js → TerminalSessionPage-1F9k8Hc5.js} +1 -1
- package/static/assets/{UserPreferencesPage-ChHrBs8H.js → UserPreferencesPage-Sx7qJbGE.js} +1 -1
- package/static/assets/{UserSettingsPage-Cv60YInV.js → UserSettingsPage-DzLFJZGl.js} +1 -1
- package/static/assets/{UtilitiesPage-ChLTn_u9.js → UtilitiesPage-Bk_tpZIU.js} +1 -1
- package/static/assets/{alert-CBWqAyb9.js → alert-rryEJd9j.js} +1 -1
- package/static/assets/{arrow-down-PY3QZW33.js → arrow-down-BMFUtIE3.js} +1 -1
- package/static/assets/{arrow-left-JpEq5x30.js → arrow-left-VCCT3jZw.js} +1 -1
- package/static/assets/{arrow-up-qJ-_eNlY.js → arrow-up-DFFtVRCW.js} +1 -1
- package/static/assets/{badge-D6QJCkgl.js → badge-CiH2OuTe.js} +1 -1
- package/static/assets/{browser-modal-DT5zGtM2.js → browser-modal-DHDmCl54.js} +1 -1
- package/static/assets/{calendar-sFw_mHQb.js → calendar-BK9Swtme.js} +1 -1
- package/static/assets/{card-CjY6k9qN.js → card-B1w4zvds.js} +1 -1
- package/static/assets/{chevron-left-DiMUBSvf.js → chevron-left-CGwZTSs2.js} +1 -1
- package/static/assets/{chevrons-up-CKVPmJ25.js → chevrons-up-AJ8jYSs5.js} +1 -1
- package/static/assets/{circle-alert-Bc4Eo-aL.js → circle-alert-3u8tIhSK.js} +1 -1
- package/static/assets/{circle-check-C8DZc7FJ.js → circle-check-PsumpemW.js} +1 -1
- package/static/assets/{circle-check-big-D_PvuS7-.js → circle-check-big-D6vRERf1.js} +1 -1
- package/static/assets/{circle-play-Ba60SPvN.js → circle-play-u7kgzh9e.js} +1 -1
- package/static/assets/{circle-x-BYe1-ctZ.js → circle-x-KHdyqN0c.js} +1 -1
- package/static/assets/{clipboard-DZHDxSAN.js → clipboard-CDRBqaZo.js} +1 -1
- package/static/assets/{clock-E0FNqZih.js → clock-CtMC0ymf.js} +1 -1
- package/static/assets/{download-DbHXGD3a.js → download-DoydMFSH.js} +1 -1
- package/static/assets/droid-BvMEm3eg.js +8 -0
- package/static/assets/{eye-CvcvqrS0.js → eye-Chrleq_G.js} +1 -1
- package/static/assets/{folder-git-2-DK9b1q2x.js → folder-git-2-snelGVlk.js} +1 -1
- package/static/assets/index-3wZrFTdl.js +468 -0
- package/static/assets/{label-DGhQh35t.js → label-C3WSTIyx.js} +1 -1
- package/static/assets/{markdown-editor-52vxb0rp.js → markdown-editor-CU67ABnM.js} +1 -1
- package/static/assets/{pause-B7dyLcuH.js → pause-TcYxeiAk.js} +1 -1
- package/static/assets/{play-C3zkOZiK.js → play-DVmnMPTC.js} +1 -1
- package/static/assets/{plus-BCs8PAn6.js → plus-CZn0_tNm.js} +1 -1
- package/static/assets/{radio-group-BseQ4OVV.js → radio-group-COwda0W5.js} +1 -1
- package/static/assets/{refresh-cw-ucF4I6xx.js → refresh-cw-CbXq5Ai_.js} +1 -1
- package/static/assets/{search-TqAjHy3_.js → search-uIFy7Nf3.js} +1 -1
- package/static/assets/{switch-B6px80Oh.js → switch-D1qMlMAm.js} +1 -1
- package/static/assets/{tabs-BHSWuVOa.js → tabs-CPUuRnHE.js} +1 -1
- package/static/assets/{tag-DjI_1POr.js → tag-CllkgvWM.js} +1 -1
- package/static/assets/{terminal-preview-C0DTE3G7.js → terminal-preview-DjxxurOo.js} +1 -1
- package/static/assets/{use-terminal-KpWB08HL.js → use-terminal-CGL7SCNO.js} +1 -1
- package/static/assets/{zap-DruahTJJ.js → zap-6uLoaMfY.js} +1 -1
- package/static/index.html +1 -1
- package/static/assets/ProposalDetailPage-BI5HDp5I.js +0 -1
- package/static/assets/droid-Caom7ttu.js +0 -4
- package/static/assets/index-C4LGSoHO.js +0 -468
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,ba as E,au as K,ao as T,j as a,ap as N,bb as U,as as y,at as g,bc as V,ar as w,bd as z,ax as H,aw as $,e as I,be as W}from"./index-
|
|
1
|
+
import{r as n,ba as E,au as K,ao as T,j as a,ap as N,bb as U,as as y,at as g,bc as V,ar as w,bd as z,ax as H,aw as $,e as I,be as W}from"./index-3wZrFTdl.js";var C="Radio",[X,_]=N(C),[Y,J]=X(C),j=n.forwardRef((r,t)=>{const{__scopeRadio:e,name:d,checked:o=!1,required:s,disabled:i,value:p="on",onCheck:f,form:R,...v}=r,[l,m]=n.useState(null),c=g(t,x=>m(x)),u=n.useRef(!1),b=l?R||!!l.closest("form"):!0;return a.jsxs(Y,{scope:e,checked:o,disabled:i,children:[a.jsx(y.button,{type:"button",role:"radio","aria-checked":o,"data-state":S(o),"data-disabled":i?"":void 0,disabled:i,value:p,...v,ref:c,onClick:w(r.onClick,x=>{o||f?.(),b&&(u.current=x.isPropagationStopped(),u.current||x.stopPropagation())})}),b&&a.jsx(P,{control:l,bubbles:!u.current,name:d,value:p,checked:o,required:s,disabled:i,form:R,style:{transform:"translateX(-100%)"}})]})});j.displayName=C;var k="RadioIndicator",G=n.forwardRef((r,t)=>{const{__scopeRadio:e,forceMount:d,...o}=r,s=J(k,e);return a.jsx(z,{present:d||s.checked,children:a.jsx(y.span,{"data-state":S(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});G.displayName=k;var Q="RadioBubbleInput",P=n.forwardRef(({__scopeRadio:r,control:t,checked:e,bubbles:d=!0,...o},s)=>{const i=n.useRef(null),p=g(i,s),f=H(e),R=$(t);return n.useEffect(()=>{const v=i.current;if(!v)return;const l=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(l,"checked").set;if(f!==e&&c){const u=new Event("click",{bubbles:d});c.call(v,e),v.dispatchEvent(u)}},[f,e,d]),a.jsx(y.input,{type:"radio","aria-hidden":!0,defaultChecked:e,...o,tabIndex:-1,ref:p,style:{...o.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});P.displayName=Q;function S(r){return r?"checked":"unchecked"}var Z=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h="RadioGroup",[ee,de]=N(h,[E,_]),A=E(),D=_(),[oe,re]=ee(h),M=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,name:d,defaultValue:o,value:s,required:i=!1,disabled:p=!1,orientation:f,dir:R,loop:v=!0,onValueChange:l,...m}=r,c=A(e),u=K(R),[b,x]=T({prop:s,defaultProp:o??null,onChange:l,caller:h});return a.jsx(oe,{scope:e,name:d,required:i,disabled:p,value:b,onValueChange:x,children:a.jsx(U,{asChild:!0,...c,orientation:f,dir:u,loop:v,children:a.jsx(y.div,{role:"radiogroup","aria-required":i,"aria-orientation":f,"data-disabled":p?"":void 0,dir:u,...m,ref:t})})})});M.displayName=h;var O="RadioGroupItem",F=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,disabled:d,...o}=r,s=re(O,e),i=s.disabled||d,p=A(e),f=D(e),R=n.useRef(null),v=g(t,R),l=s.value===o.value,m=n.useRef(!1);return n.useEffect(()=>{const c=b=>{Z.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",c),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",c),document.removeEventListener("keyup",u)}},[]),a.jsx(V,{asChild:!0,...p,focusable:!i,active:l,children:a.jsx(j,{disabled:i,required:s.required,checked:l,...f,...o,name:s.name,ref:v,onCheck:()=>s.onValueChange(o.value),onKeyDown:w(c=>{c.key==="Enter"&&c.preventDefault()}),onFocus:w(o.onFocus,()=>{m.current&&R.current?.click()})})})});F.displayName=O;var ae="RadioGroupIndicator",L=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,...d}=r,o=D(e);return a.jsx(G,{...o,...d,ref:t})});L.displayName=ae;var q=M,B=F,te=L;const se=n.forwardRef(({className:r,...t},e)=>a.jsx(q,{className:I("grid gap-2",r),...t,ref:e}));se.displayName=q.displayName;const ne=n.forwardRef(({className:r,...t},e)=>a.jsx(B,{ref:e,className:I("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),...t,children:a.jsx(te,{className:"flex items-center justify-center",children:a.jsx(W,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ne.displayName=B.displayName;export{se as R,ne as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e,e as i}from"./index-
|
|
1
|
+
import{r as c,j as e,e as i}from"./index-3wZrFTdl.js";const d=c.forwardRef(({className:s,onCheckedChange:r,onChange:t,...o},n)=>{const l=a=>{t?.(a),r?.(a.target.checked)};return e.jsxs("label",{className:i("relative inline-flex cursor-pointer",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",onChange:l,ref:n,...o}),e.jsx("div",{className:"block bg-gray-300 w-9 h-5 rounded-full transition-colors duration-200 ease-in-out peer-checked:bg-blue-600"}),e.jsx("div",{className:"absolute left-0 top-0 bg-white w-4 h-4 rounded-full mt-0.5 ml-0.5 transition-transform duration-200 ease-in-out transform peer-checked:translate-x-4 shadow"})]})});d.displayName="Switch";export{d as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,au as F,ao as $,j as c,ap as D,b9 as V,as as g,ba as y,bb as k,bc as G,ar as m,bd as L,e as T}from"./index-
|
|
1
|
+
import{r as l,au as F,ao as $,j as c,ap as D,b9 as V,as as g,ba as y,bb as k,bc as G,ar as m,bd as L,e as T}from"./index-3wZrFTdl.js";var p="Tabs",[K,Q]=D(p,[y]),h=y(),[B,x]=K(p),N=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,onValueChange:r,defaultValue:d,orientation:n="horizontal",dir:u,activationMode:f="automatic",...v}=e,i=F(u),[s,b]=$({prop:o,onChange:r,defaultProp:d??"",caller:p});return c.jsx(B,{scope:t,baseId:V(),value:s,onValueChange:b,orientation:n,dir:i,activationMode:f,children:c.jsx(g.div,{dir:i,"data-orientation":n,...v,ref:a})})});N.displayName=p;var C="TabsList",I=l.forwardRef((e,a)=>{const{__scopeTabs:t,loop:o=!0,...r}=e,d=x(C,t),n=h(t);return c.jsx(k,{asChild:!0,...n,orientation:d.orientation,dir:d.dir,loop:o,children:c.jsx(g.div,{role:"tablist","aria-orientation":d.orientation,...r,ref:a})})});I.displayName=C;var R="TabsTrigger",j=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,disabled:r=!1,...d}=e,n=x(R,t),u=h(t),f=A(n.baseId,o),v=E(n.baseId,o),i=o===n.value;return c.jsx(G,{asChild:!0,...u,focusable:!r,active:i,children:c.jsx(g.button,{type:"button",role:"tab","aria-selected":i,"aria-controls":v,"data-state":i?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...d,ref:a,onMouseDown:m(e.onMouseDown,s=>{!r&&s.button===0&&s.ctrlKey===!1?n.onValueChange(o):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&n.onValueChange(o)}),onFocus:m(e.onFocus,()=>{const s=n.activationMode!=="manual";!i&&!r&&s&&n.onValueChange(o)})})})});j.displayName=R;var w="TabsContent",_=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,forceMount:r,children:d,...n}=e,u=x(w,t),f=A(u.baseId,o),v=E(u.baseId,o),i=o===u.value,s=l.useRef(i);return l.useEffect(()=>{const b=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(b)},[]),c.jsx(L,{present:r||i,children:({present:b})=>c.jsx(g.div,{"data-state":i?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!b,id:v,tabIndex:0,...n,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:b&&d})})});_.displayName=w;function A(e,a){return`${e}-trigger-${a}`}function E(e,a){return`${e}-content-${a}`}var q=N,S=I,M=j,P=_;const U=q,z=l.forwardRef(({className:e,...a},t)=>c.jsx(S,{ref:t,className:T("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...a}));z.displayName=S.displayName;const H=l.forwardRef(({className:e,...a},t)=>c.jsx(M,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...a}));H.displayName=M.displayName;const O=l.forwardRef(({className:e,...a},t)=>c.jsx(P,{ref:t,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...a}));O.displayName=P.displayName;export{U as T,z as a,H as b,O as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,ag as j,j as u}from"./index-
|
|
1
|
+
import{r as t,ag as j,j as u}from"./index-3wZrFTdl.js";import{x as k,a as B}from"./xterm-DTxiCjtJ.js";function A({sessionId:l,className:p,heightPx:d=160,maxScrollback:m=200}){const h=t.useRef(null),v=t.useRef(null),w=t.useRef(null),y=t.useRef(null),[x,R]=t.useState(!0),o=t.useRef([]),i=t.useRef(null);return t.useEffect(()=>{const a=h.current;if(!a||!l)return;const e=new k.Terminal({disableStdin:!0,cursorBlink:!1,convertEol:!0,scrollback:Math.max(50,Math.min(m,1e3)),fontSize:12,fontFamily:"'IBM Plex Mono', 'Source Code Pro', 'Fira Code', ui-monospace, Menlo, Monaco, monospace",lineHeight:1.25,letterSpacing:.3,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}}),f=new B.FitAddon;e.loadAddon(f),e.open(a),a.style.height=`${d}px`,v.current=e,w.current=f;const s=()=>{try{const n=a.getBoundingClientRect();n.width>8&&n.height>8&&e.element&&f.fit()}catch{}},S=setTimeout(()=>s(),100),g=new ResizeObserver(()=>s());g.observe(a);const b=()=>{document.visibilityState==="visible"&&setTimeout(s,50)};document.addEventListener("visibilitychange",b);const c=new WebSocket(`${j}/ws/terminal-preview/${l}`);y.current=c,c.onopen=()=>R(!1);const E=()=>{i.current=null;const n=o.current;if(n.length){o.current=[];try{e.write(n.join(""))}catch{}}},F=()=>{i.current===null&&(i.current=requestAnimationFrame(E))};return c.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}if(r?.type==="snapshot"){if(e.reset(),o.current=[],r.data)try{e.write(r.data)}catch{}s()}else r?.type==="data"&&r.data&&(o.current.push(String(r.data)),F())},c.onclose=()=>{},c.onerror=()=>{},()=>{clearTimeout(S),g.disconnect(),document.removeEventListener("visibilitychange",b);try{c.close()}catch{}i.current!==null&&cancelAnimationFrame(i.current),i.current=null,o.current=[],e.dispose()}},[l,d,m]),u.jsxs("div",{className:`relative w-full ${p||""}`.trim(),children:[x&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/60 z-10",children:u.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading preview…"})}),u.jsx("div",{ref:h,className:"border border-muted rounded overflow-hidden"})]})}export{A as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,al as b,A as f}from"./index-
|
|
1
|
+
import{r as i,al as b,A as f}from"./index-3wZrFTdl.js";function j(){const[y,u]=i.useState([]),[m,c]=i.useState(!1),[g,o]=i.useState(null),{refresh:p}=b(),d=i.useCallback(async(s,n,r)=>{try{c(!0),o(null);const e=await fetch(`${f}/api/v1/terminal/${s}/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableLogging:n||!1,startupCommand:r})});if(!e.ok){const a=await e.json();throw new Error(a.error||"Failed to create terminal session")}const t=await e.json();return await p(),t.sessionId}catch(e){const t=e instanceof Error?e.message:"Unknown error";return o(t),null}finally{c(!1)}},[p]),S=i.useCallback(async s=>{try{c(!0),o(null);let n;if(s.startsWith("session-")){const e=s.split("-");n=`${e[0]}-${e[1]}`}else{const e=s.split("-");n=`${e[0]}-${e[1]}`}const r=await fetch(`${f}/api/v1/terminal/${n}/destroy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})});if(!r.ok){const e=await r.json();throw new Error(e.error||"Failed to destroy terminal session")}return u(e=>e.filter(t=>t.id!==s)),await p(),!0}catch(n){const r=n instanceof Error?n.message:"Unknown error";return o(r),!1}finally{c(!1)}},[p]),$=i.useCallback(async(s,n,r)=>{try{o(null);let e;if(s.startsWith("session-")){const a=s.split("-");e=`${a[0]}-${a[1]}`}else{const a=s.split("-");e=`${a[0]}-${a[1]}`}const t=await fetch(`${f}/api/v1/terminal/${e}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s,cols:n,rows:r})});if(!t.ok){const a=await t.json();throw new Error(a.error||"Failed to resize terminal session")}return!0}catch(e){const t=e instanceof Error?e.message:"Unknown error";return o(t),!1}},[]),k=i.useCallback(async(s,n,r)=>{try{c(!0),o(null);const e=new URLSearchParams;s&&e.set("proposalId",s),n&&(e.set("withPreview","true"),r&&Number.isFinite(r)&&e.set("lines",String(r)));const t=`${f}/api/v1/terminal/sessions${e.toString()?`?${e.toString()}`:""}`,a=await fetch(t);if(!a.ok){const l=await a.json();throw new Error(l.error||"Failed to fetch terminal sessions")}const w=await a.json();u(w.sessions)}catch(e){const t=e instanceof Error?e.message:"Unknown error";o(t)}finally{c(!1)}},[]),E=i.useCallback(async(s,n=8)=>{try{o(null);const r=new URLSearchParams;r.set("sessionId",s),r.set("withPreview","true"),r.set("lines",String(n)),r.set("colorize","true");const e=`${f}/api/v1/terminal/sessions?${r.toString()}`,t=await fetch(e);if(!t.ok){const l=await t.json().catch(()=>({}));throw new Error(l.error||"Failed to fetch preview")}const a=await t.json(),w=Array.isArray(a?.sessions)&&a.sessions[0]?.preview?a.sessions[0].preview:[];return u(l=>l.map(h=>h.id===s?{...h,preview:w}:h)),w}catch(r){const e=r instanceof Error?r.message:"Unknown error";return o(e),[]}},[]);return{sessions:y,loading:m,error:g,createSession:d,destroySession:S,resizeSession:$,refreshSessions:k,fetchPreview:E}}export{j as u};
|
package/static/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
|
|
10
10
|
<title>Coconut - Agentic Development Environment</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-3wZrFTdl.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-CzjbtPHw.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body class="font-inter">
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as re,u as ne,r as l,a as le,j as e,B as n,L as h,R as ie,U as ce,V as oe,W as de,Y as me,Z as he,_ as xe,$ as ue,a0 as pe,a1 as je,a2 as fe,a3 as I,a4 as F,q as ge,D as B,a5 as R,b as V,d as z,f as H,g as q,h as ve,i as Ne,k as ye,l as Ce,m as i,a6 as J,w as we,a7 as be,A as g}from"./index-C4LGSoHO.js";import{c as Se}from"./clipboard-B9ndUJKl.js";import{C as d,b as x,a as m,c as p,d as _}from"./card-CjY6k9qN.js";import{B as u}from"./badge-D6QJCkgl.js";import{L as Q}from"./label-DGhQh35t.js";import{A as b}from"./arrow-left-JpEq5x30.js";import{C as De,a as Ae}from"./clipboard-DZHDxSAN.js";import{D as ke}from"./download-DbHXGD3a.js";import{C as Te}from"./calendar-sFw_mHQb.js";import{C as Ee}from"./clock-E0FNqZih.js";function M(r){switch(r){case"ready":case"done":return"default";case"queued":case"active":case"review":return"secondary";case"blocked":case"canceled":return"destructive";default:return"outline"}}function W(r){switch(r){case"high":case"critical":return"destructive";case"medium":return"secondary";default:return"outline"}}function ze(){const{id:r}=re(),Y=ne(),[s,v]=l.useState(null),[Z,S]=l.useState(!0),[N,D]=l.useState(null),[A,k]=l.useState(!1),[T,E]=l.useState(!1),[P,$]=l.useState(!1),[j,y]=l.useState(""),[G,C]=l.useState(!1),[K,w]=l.useState(!1),[f,U]=l.useState("draft"),[X,L]=l.useState(!1),{toast:O}=le();l.useEffect(()=>{async function a(){if(r)try{S(!0);const o=await(await fetch(`${g}/api/v1/proposals/${r}`)).json();o.success?v(o.data):D(o.error?.message||"Failed to fetch proposal")}catch(t){D(t instanceof Error?t.message:"Unknown error")}finally{S(!1)}}a()},[r]);const ee=async()=>{if(r){k(!0);try{const t=await(await fetch(`${g}/api/v1/proposals/${r}`,{method:"DELETE"})).json();t.success?Y("/proposals"):alert(t.error?.message||"Failed to delete proposal")}catch(a){alert(`Error deleting proposal: ${a instanceof Error?a.message:"Unknown error"}`)}finally{k(!1)}}},se=async()=>{if(!(!s||!r||f===s.status)){E(!0);try{const t=await(await fetch(`${g}/api/v1/proposals/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:f})})).json();t.success?(v(t.data),C(!1)):alert(t.error?.message||"Failed to update status")}catch(a){alert(`Error updating status: ${a instanceof Error?a.message:"Unknown error"}`)}finally{E(!1)}}},ae=async()=>{if(!(!s||!r||!j.trim())){$(!0);try{const a={id:`comment-${Date.now()}`,text:j,author:"current-user",timestamp:new Date().toISOString()},t=[...s.metadata.comments||[],a],c=await(await fetch(`${g}/api/v1/proposals/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:t})})).json();c.success?(v(c.data),y(""),w(!1)):alert(c.error?.message||"Failed to add comment")}catch(a){alert(`Error adding comment: ${a instanceof Error?a.message:"Unknown error"}`)}finally{$(!1)}}},te=()=>{if(!s)return;const a={...s,exportedAt:new Date().toISOString()},t=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),o=URL.createObjectURL(t),c=document.createElement("a");c.href=o,c.download=`proposal-${s.id}.json`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(o)};return Z?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(n,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(h,{to:"/proposals",className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(b,{className:"h-4 w-4"})})})})]}),e.jsxs(d,{children:[e.jsx(x,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-1/2 animate-pulse"})]})}),e.jsx(m,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-5/6 animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-4/6 animate-pulse"})]})})]})]}):N||!s?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:N||"Proposal not found"})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(n,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(h,{to:"/proposals",className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(b,{className:"h-4 w-4"})})})})]}),e.jsx(d,{children:e.jsx(m,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:N||"Proposal not found"}),e.jsxs("p",{className:"text-muted-foreground mt-2",children:['The proposal with ID "',r,'" could not be found.']}),e.jsx(n,{asChild:!0,className:"mt-4",children:e.jsx(h,{to:"/proposals",children:"Back to Proposals"})})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight min-w-0",children:s.title||s.intent}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(n,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(h,{to:"/proposals",className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(b,{className:"h-4 w-4"})})}),e.jsx(n,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs(h,{to:`/proposals/${r}/edit`,children:[e.jsx(ie,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})}),e.jsxs(ce,{children:[e.jsx(oe,{asChild:!0,children:e.jsxs(n,{variant:"destructive",size:"sm",disabled:A,children:[e.jsx(de,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:A?"Deleting...":"Delete"})]})}),e.jsxs(me,{children:[e.jsxs(he,{children:[e.jsx(xe,{children:"Are you absolutely sure?"}),e.jsxs(ue,{children:["This action cannot be undone. This will permanently delete the change proposal",e.jsxs("span",{className:"font-semibold",children:[' "',s.title||s.intent,'"']})," and remove it from the system."]})]}),e.jsxs(pe,{children:[e.jsx(je,{children:"Cancel"}),e.jsx(fe,{onClick:ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Proposal"})]})]})]})]})]}),e.jsxs("button",{type:"button",onClick:async()=>{const a=`.nut/proposals/${s.id}.md`;try{await Se(a),L(!0),O({title:"Copied!",description:`${a} copied to clipboard`}),setTimeout(()=>L(!1),2e3)}catch(t){console.error("Failed to copy path:",t),O({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors font-mono",children:[e.jsx("span",{children:`.nut/proposals/${s.id}.md`}),X?e.jsx(De,{className:"h-3.5 w-3.5"}):e.jsx(Ae,{className:"h-3.5 w-3.5"})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(d,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(p,{children:"Task Details"}),e.jsxs("div",{className:"flex gap-2",children:[s.metadata.priority&&e.jsx(u,{variant:W(s.metadata.priority),children:s.metadata.priority}),e.jsx(u,{variant:M(s.status),children:s.status})]})]})}),e.jsx(m,{className:"space-y-4",children:s.content?e.jsx(I,{children:s.content}):e.jsx("p",{className:"text-muted-foreground",children:"No detailed content available for this proposal."})})]}),s.planSteps&&s.planSteps.length>0&&e.jsxs(d,{children:[e.jsxs(x,{children:[e.jsx(p,{children:"Implementation Steps"}),e.jsxs(_,{children:[s.planSteps.length," step",s.planSteps.length!==1?"s":""," planned"]})]}),e.jsx(m,{children:e.jsx("div",{className:"space-y-3",children:s.planSteps.map((a,t)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-muted text-xs font-medium",children:t+1}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:a.description}),e.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:e.jsx(u,{variant:"outline",className:"text-xs",children:a.status})})]})]},a.id))})})]}),s.metadata.comments&&s.metadata.comments.length>0&&e.jsxs(d,{children:[e.jsxs(x,{children:[e.jsx(p,{children:"Comments"}),e.jsxs(_,{children:[s.metadata.comments.length," comment",s.metadata.comments.length!==1?"s":""]})]}),e.jsx(m,{children:e.jsx("div",{className:"space-y-4",children:s.metadata.comments.map((a,t)=>e.jsxs("div",{className:"border-l-2 border-muted pl-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(F,{className:"h-3 w-3"}),e.jsx("span",{children:a.author}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(a.timestamp).toLocaleString()})]}),e.jsx(I,{className:"prose-sm prose-p:mb-2 prose-ul:my-2 prose-ol:my-2",children:a.text})]},a.id||t))})})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(d,{children:[e.jsx(x,{children:e.jsx(p,{children:"Task Actions"})}),e.jsxs(m,{className:"space-y-2",children:[e.jsx(n,{variant:"default",className:"w-full justify-start",asChild:!0,children:e.jsxs(h,{to:`/terminal/${r}`,children:[e.jsx(ge,{className:"h-4 w-4 mr-2"}),"Prepare Agent"]})}),e.jsxs(B,{open:G,onOpenChange:C,children:[e.jsx(R,{asChild:!0,children:e.jsx(n,{variant:"outline",className:"w-full justify-start",onClick:()=>U(s?.status||"draft"),children:"Change Status"})}),e.jsxs(V,{children:[e.jsxs(z,{children:[e.jsx(H,{children:"Change Proposal Status"}),e.jsx(q,{children:"Update the status of this change proposal."})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(Q,{htmlFor:"status",children:"Status"}),e.jsxs(ve,{value:f,onValueChange:a=>U(a),children:[e.jsx(Ne,{children:e.jsx(ye,{placeholder:"Select status"})}),e.jsxs(Ce,{children:[e.jsx(i,{value:"draft",children:"Draft"}),e.jsx(i,{value:"backlog",children:"Backlog"}),e.jsx(i,{value:"ready",children:"Ready"}),e.jsx(i,{value:"queued",children:"Queued"}),e.jsx(i,{value:"active",children:"Active"}),e.jsx(i,{value:"blocked",children:"Blocked"}),e.jsx(i,{value:"review",children:"Review"}),e.jsx(i,{value:"done",children:"Done"}),e.jsx(i,{value:"canceled",children:"Canceled"}),e.jsx(i,{value:"duplicate",children:"Duplicate"})]})]})]})}),e.jsxs(J,{children:[e.jsx(n,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),e.jsx(n,{onClick:se,disabled:T||f===s?.status,children:T?"Updating...":"Update Status"})]})]})]}),e.jsxs(B,{open:K,onOpenChange:w,children:[e.jsx(R,{asChild:!0,children:e.jsx(n,{variant:"outline",className:"w-full justify-start",children:"Add Comment"})}),e.jsxs(V,{children:[e.jsxs(z,{children:[e.jsx(H,{children:"Add Comment"}),e.jsx(q,{children:"Add a comment to this change proposal."})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(Q,{htmlFor:"comment",children:"Comment"}),e.jsx(we,{id:"comment",placeholder:"Enter your comment...",value:j,onChange:a=>y(a.target.value),rows:4})]})}),e.jsxs(J,{children:[e.jsx(n,{variant:"outline",onClick:()=>{w(!1),y("")},children:"Cancel"}),e.jsx(n,{onClick:ae,disabled:P||!j.trim(),children:P?"Adding...":"Add Comment"})]})]})]}),e.jsxs(n,{variant:"outline",className:"w-full justify-start",onClick:te,children:[e.jsx(ke,{className:"h-4 w-4 mr-2"}),"Export"]})]})]}),e.jsxs(d,{children:[e.jsx(x,{children:e.jsx(p,{children:"Information"})}),e.jsxs(m,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(F,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Author:"}),e.jsx("span",{children:s.author.name})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Te,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Created:"}),e.jsx("span",{children:new Date(s.metadata.createdAt).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Ee,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Updated:"}),e.jsx("span",{children:new Date(s.metadata.updatedAt).toLocaleString()})]}),e.jsx(be,{}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-sm",children:"Status:"}),e.jsx("div",{className:"mt-1",children:e.jsx(u,{variant:M(s.status),children:s.status})})]}),s.metadata.priority&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-sm",children:"Priority:"}),e.jsx("div",{className:"mt-1",children:e.jsx(u,{variant:W(s.metadata.priority),children:s.metadata.priority})})]}),s.metadata.tags&&s.metadata.tags.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-sm",children:"Tags:"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:s.metadata.tags.map(a=>e.jsx(u,{variant:"outline",className:"text-xs",children:a},a))})]})]})]})]})]})]})}export{ze as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const u="Consult the schema references in .nut/.schema (proposal.schema.md, project.schema.md, architecture.schema.md, agent.schema.md, knowledge.schema.md) so any updates you make follow the documented structure and include complete arrays for plan steps, dependencies, tags, labels, and comments.",m="Use .nut/context/project.md and .nut/context/architecture.md for reference.";function p(e,t,s,o=!0){const n=[];return o&&n.push(`
|
|
2
|
-
## Task
|
|
3
|
-
|
|
4
|
-
`,`Review .nut/proposals/${e}.md and begin implementing.`,"Update the assignment to yourself (Coconut AI), the implementation steps (updated as you progress), and set the status upon completion to Code Complete.",u,`Lastly, please add notable comments to the proposal (.nut/proposals/${e}.md) from your chain-of-thought upon completion, particularly for ideas for future suggestions and/or improvements related to the proposal or wider project.`),t.length>0&&n.push(`Please also use these agents: ${t.join(", ")}`),s&&s.trim()&&n.push(s.trim()),n}function d(e,t){const s=[];return s.push(m),e.length>0&&s.push(`Please use these agents: ${e.join(", ")}`),t&&t.trim()&&s.push(`Additional instruction: ${t.trim()}`),s}const h=e=>{const t=e.selectedAgentIds.map(l=>`.nut/agents/${l}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):d(t,e.customInstruction)).join(" "),n=[e.automationEnabled?"--dangerously-skip-permissions":""].filter(Boolean).join(" "),i=e.selectedMcpServers.map(l=>`'${l.replace(/'/g,"'\\''")}'`).join(","),a=[JSON.stringify(o)].concat(n?[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,'\\"')}"`},g=e=>{const t=e.selectedAgentIds.map(c=>`.nut/agents/${c}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):d(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):d(t,e.customInstruction)).join(" "),n=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([${n}]);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,'\\"')}"`},y=e=>{const t=e.selectedAgentIds.map(r=>`.nut/agents/${r}`),o=(e.contextType==="change-proposal"?p(e.proposalId,t,e.customInstruction,e.includeDefaultInstructions??!0):d(t,e.customInstruction)).join(" "),n=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([${n}]);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{y as a,h as b,f as c,g as d};
|