@puddle-code/cli 0.0.5 → 0.0.7
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/CHANGELOG.md +3 -16
- package/dist/index.js +206 -13
- package/dist/public/assets/Dashboard-DHkzWFd7.js +1 -0
- package/dist/public/assets/{EditorTabClose-82Z5eiQN.js → EditorTabClose-DziQNlDZ.js} +1 -1
- package/dist/public/assets/{ModelRefcount-DuJU1nuj.js → ModelRefcount-BD4m7wnM.js} +1 -1
- package/dist/public/assets/{PaneEditorBody-DmMOCV_I.js → PaneEditorBody-6h7v53Gs.js} +1 -1
- package/dist/public/assets/SettingsDialog-DEVVkj7N.js +1 -0
- package/dist/public/assets/{Terminal-CD3LbItq.js → Terminal-DP-hFsEc.js} +2 -2
- package/dist/public/assets/Workspace-BoKA3JKo.js +6 -0
- package/dist/public/assets/{api-BJKPJeFZ.js → api-L5qtWa7E.js} +1 -1
- package/dist/public/assets/{buffer-store--EObrd7i.js → buffer-store-C23koXgg.js} +2 -2
- package/dist/public/assets/context-menu-0Mq8MFLs.js +1 -0
- package/dist/public/assets/{cssMode-Dgj8FXvj.js → cssMode-BBQ4UYhd.js} +1 -1
- package/dist/public/assets/{editor-tabs-Cw21CVB0.js → editor-tabs-CFnvx1pN.js} +1 -1
- package/dist/public/assets/{htmlMode-r2nOt3Tp.js → htmlMode-CiqvxxB5.js} +1 -1
- package/dist/public/assets/index-Dg2mfzDf.css +2 -0
- package/dist/public/assets/index-bqEa9yZh.js +10 -0
- package/dist/public/assets/{jsonMode-te9Xmu_C.js → jsonMode-B7C2cbcC.js} +1 -1
- package/dist/public/assets/session-seed-BafHkB3F.js +1 -0
- package/dist/public/assets/ssh-mode-DIXigRzL.js +1 -0
- package/dist/public/assets/{tsMode-Cs7L_kKV.js → tsMode-ByErjETq.js} +1 -1
- package/dist/public/index.html +3 -3
- package/package.json +1 -1
- package/dist/public/assets/Dashboard-C1H7r1Al.js +0 -1
- package/dist/public/assets/SettingsDialog-aRqM2FKI.js +0 -1
- package/dist/public/assets/Workspace-ChM_ssfz.js +0 -6
- package/dist/public/assets/context-menu-CGL06LiB.js +0 -1
- package/dist/public/assets/index-D994oCvG.js +0 -10
- package/dist/public/assets/index-YunCFzL-.css +0 -2
- package/dist/public/assets/ssh-mode-DWHs6m9n.js +0 -1
- package/dist/public/assets/switch-BbnQDPjG.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,p as t}from"./editor.api2-4X9Vh9Zw.js";import{m as n}from"./buffer-store
|
|
1
|
+
import{h as e,p as t}from"./editor.api2-4X9Vh9Zw.js";import{m as n}from"./buffer-store-C23koXgg.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b}from"./lspLanguageFeatures-x2nWJpem.js";var x=120*1e3,S=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=n({moduleId:`vs/language/json/jsonWorker`,createWorker:()=>new Worker(new URL(`/assets/json.worker-Oa9UrkKE.js`,``+import.meta.url),{type:`module`}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};function C(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&E(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&E(e.charCodeAt(r)))for(r++;r<e.length&&E(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&E(e.charCodeAt(r))){for(r++;r<e.length&&E(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
2
2
|
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(T(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(w(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(w(t));return o=15}if(T(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
3
3
|
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!T(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,T(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!E(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(w(e)||T(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function w(e){return e===32||e===9}function T(e){return e===10||e===13}function E(e){return e>=48&&e<=57}var D;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(D||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var O=200;Array(O).fill(0).map((e,t)=>`
|
|
4
4
|
`+` `.repeat(t)),Array(O).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(O).fill(0).map((e,t)=>`\r
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{A as i,C as a,E as o,O as s,S as c,_ as l,b as u,d,f,j as p,m,p as h,v as g,w as _,x as v,y}from"./dialog-B43iKmfK.js";import{t as b}from"./utils-B6KiDbIe.js";import{t as x}from"./createLucideIcon-DyMAgLa3.js";import{n as S,t as C}from"./dist-fdPAlKke.js";import{At as w,Dt as T,Et as E,Ot as ee,Tt as D,bt as O,kt as k,vt as A,wt as te,yt as ne}from"./index-bqEa9yZh.js";var re=x(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),j=x(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),M=x(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),N=e(t(),1),P=e(n(),1);function F(e,[t,n]){return Math.min(n,Math.max(t,e))}function I(e){let t=N.useRef({value:e,previous:e});return N.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var L=r(),R=[` `,`Enter`,`ArrowUp`,`ArrowDown`],z=[` `,`Enter`],B=`Select`,[V,H,ie]=S(B),[U,ae]=s(B,[ie,k]),W=k(),[oe,G]=U(B),[se,ce]=U(B),le=`SelectProvider`;function ue(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,v=W(t),[y,b]=N.useState(null),[x,S]=N.useState(null),[w,T]=N.useState(!1),E=C(d),[D,O]=l({prop:r,defaultProp:i??!1,onChange:a,caller:B}),[k,A]=l({prop:o,defaultProp:s,onChange:c,caller:B}),te=N.useRef(null),ne=N.useRef(k);N.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=()=>A(ne.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,A]);let re=!y||!!g||!!y.closest(`form`),[j,M]=N.useState(new Set),P=u(),F=Array.from(j).map(e=>e.props.value).join(`;`),I=N.useCallback(e=>{M(t=>new Set(t).add(e))},[]),R=N.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:h,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:P,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:te,disabled:m,name:f,autoComplete:p,form:g,nativeOptions:j,nativeSelectKey:F,isFormControl:re};return(0,L.jsx)(ee,{...v,children:(0,L.jsx)(oe,{scope:t,...z,children:(0,L.jsx)(V.Provider,{scope:t,children:(0,L.jsx)(se,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:R,children:it(_)?_(z):n})})})})}ue.displayName=le;var de=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(ue,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(rt,{__scopeSelect:t}):null]})})};de.displayName=B;var fe=`SelectTrigger`,pe=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...a}=e,o=W(n),s=G(fe,n),c=s.disabled||r,l=i(t,s.onTriggerChange),u=H(n),d=N.useRef(`touch`),[f,m,h]=at(e=>{let t=u().filter(e=>!e.disabled),n=ot(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,L.jsx)(D,{asChild:!0,...o,children:(0,L.jsx)(_.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":Q(s.value)?``:void 0,...a,ref:l,onClick:p(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:p(a.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:p(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&R.includes(e.key)&&(g(),e.preventDefault())})})})});pe.displayName=fe;var me=`SelectValue`,he=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,l=G(me,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=i(t,l.onValueNodeChange);v(()=>{u(d)},[u,d]);let p=Q(l.value);return(0,L.jsx)(_.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,L.jsx)(N.Fragment,{children:p?s:o},p?`placeholder`:`value`)})});he.displayName=me;var ge=`SelectIcon`,_e=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});_e.displayName=ge;var ve=`SelectPortal`,[ye,be]=U(ve,{forceMount:void 0}),xe=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(ye,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(y,{asChild:!0,...r})})};xe.displayName=ve;var K=`SelectContent`,Se=N.forwardRef((e,t)=>{let n=be(K,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=G(K,e.__scopeSelect),[o,s]=N.useState();return v(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(g,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(De,{...i,ref:t}):(0,L.jsx)(Ce,{...i,fragment:o})})});Se.displayName=K;var Ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?P.createPortal((0,L.jsx)(we,{scope:n,children:(0,L.jsx)(V.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null});Ce.displayName=`SelectContentFragment`;var q=10,[we,J]=U(K),Te=`SelectContentImpl`,Ee=o(`SelectContent.RemoveScroll`),De=N.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:g,alignOffset:_,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=G(K,n),[E,ee]=N.useState(null),[D,O]=N.useState(null),k=i(t,ee),[A,te]=N.useState(null),[ne,re]=N.useState(null),j=H(n),[M,P]=N.useState(!1),F=N.useRef(!1);N.useEffect(()=>{if(E)return d(E)},[E]),h();let I=N.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,D]),R=N.useCallback(()=>I([A,E]),[I,A,E]);N.useEffect(()=>{M&&R()},[M,R]);let{onOpenChange:z,triggerPointerDownPosRef:B}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(B.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||z(!1),document.removeEventListener(`pointermove`,t),B.current=null};return B.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,z,B]),N.useEffect(()=>{let e=()=>z(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[z]);let[V,ie]=at(e=>{let t=j().filter(e=>!e.disabled),n=ot(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),U=N.useCallback((e,t,n)=>{let r=!F.current&&!n;(T.value!==void 0&&T.value===t||r)&&(te(e),r&&(F.current=!0))},[T.value]),ae=N.useCallback(()=>E?.focus(),[E]),W=N.useCallback((e,t,n)=>{let r=!F.current&&!n;(T.value!==void 0&&T.value===t||r)&&re(e)},[T.value]),oe=r===`popper`?je:ke,se=oe===je?{side:l,sideOffset:u,align:g,alignOffset:_,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,L.jsx)(we,{scope:n,content:E,viewport:D,onViewportChange:O,itemRefCallback:U,selectedItem:A,onItemLeave:ae,itemTextRefCallback:W,focusSelectedItem:R,selectedItemText:ne,position:r,isPositioned:M,searchRef:V,children:(0,L.jsx)(f,{as:Ee,allowPinchZoom:!0,children:(0,L.jsx)(m,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(a,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,L.jsx)(oe,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...se,onPlaced:()=>P(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:p(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});De.displayName=Te;var Oe=`SelectItemAlignedPosition`,ke=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...a}=e,o=G(K,n),s=J(K,n),[c,l]=N.useState(null),[u,d]=N.useState(null),f=i(t,d),p=H(n),m=N.useRef(!1),h=N.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=N.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&g&&y&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-q,d=F(a,[q,Math.max(q,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-q,d=F(a,[q,Math.max(q,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-q*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),_=parseInt(d.borderBottomWidth,10),v=parseInt(d.paddingBottom,10),x=f+h+l+v+_,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-q,ee=s-E,D=y.offsetHeight/2,O=y.offsetTop+D,k=f+h+O,A=x-k;if(k<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=k+Math.max(ee,D+(e?T:0)+t+_);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+D)+A;c.style.height=t+`px`,g.scrollTop=k-E+g.offsetTop}c.style.margin=`${q}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,g,y,b,o.dir,r]);v(()=>S(),[S]);let[C,w]=N.useState();return v(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,L.jsx)(Me,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:N.useCallback(e=>{e&&h.current===!0&&(S(),x?.(),h.current=!1)},[S,x]),children:(0,L.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,L.jsx)(_.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});ke.displayName=Oe;var Ae=`SelectPopperPosition`,je=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=q,...a}=e,o=W(n);return(0,L.jsx)(T,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});je.displayName=Ae;var[Me,Y]=U(K,{}),Ne=`SelectViewport`,Pe=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...a}=e,o=J(Ne,n),s=Y(Ne,n),c=i(t,o.onViewportChange),l=N.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,L.jsx)(V.Slot,{scope:n,children:(0,L.jsx)(_.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:p(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-q*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});Pe.displayName=Ne;var Fe=`SelectGroup`,[Ie,Le]=U(Fe),Re=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=u();return(0,L.jsx)(Ie,{scope:n,id:i,children:(0,L.jsx)(_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Re.displayName=Fe;var ze=`SelectLabel`,Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Le(ze,n);return(0,L.jsx)(_.div,{id:i.id,...r,ref:t})});Be.displayName=ze;var X=`SelectItem`,[Ve,He]=U(X),Ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...c}=e,l=G(X,n),d=J(X,n),f=l.value===r,[m,h]=N.useState(s??``),[g,v]=N.useState(!1),y=i(t,a(e=>d.itemRefCallback?.(e,r,o))),b=u(),x=N.useRef(`touch`),S=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};return(0,L.jsx)(Ve,{scope:n,value:r,disabled:o,textId:b,isSelected:f,onItemTextChange:N.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(V.ItemSlot,{scope:n,value:r,disabled:o,textValue:m,children:(0,L.jsx)(_.div,{role:`option`,"aria-labelledby":b,"data-highlighted":g?``:void 0,"aria-selected":f&&g,"data-state":f?`checked`:`unchecked`,"aria-disabled":o||void 0,"data-disabled":o?``:void 0,tabIndex:o?void 0:-1,...c,ref:y,onFocus:p(c.onFocus,()=>v(!0)),onBlur:p(c.onBlur,()=>v(!1)),onClick:p(c.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:p(c.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:p(c.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:p(c.onPointerMove,e=>{x.current=e.pointerType,o?d.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:p(c.onKeyDown,e=>{o||e.target!==e.currentTarget||d.searchRef?.current!==``&&e.key===` `||(z.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Ue.displayName=X;var Z=`SelectItemText`,We=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:o,...s}=e,c=G(Z,n),l=J(Z,n),u=He(Z,n),d=ce(Z,n),[f,p]=N.useState(null),m=a(e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),h=i(t,p,u.onItemTextChange,m),g=f?.textContent,y=N.useMemo(()=>(0,L.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=d;return v(()=>(b(y),()=>x(y)),[b,x,y]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(_.span,{id:u.textId,...s,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!Q(c.value)?P.createPortal(s.children,c.valueNode):null]})});We.displayName=Z;var Ge=`SelectItemIndicator`,Ke=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return He(Ge,n).isSelected?(0,L.jsx)(_.span,{"aria-hidden":!0,...r,ref:t}):null});Ke.displayName=Ge;var qe=`SelectScrollUpButton`,Je=N.forwardRef((e,t)=>{let n=J(qe,e.__scopeSelect),r=Y(qe,e.__scopeSelect),[a,o]=N.useState(!1),s=i(t,r.onScrollButtonChange);return v(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,L.jsx)(Ze,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Je.displayName=qe;var Ye=`SelectScrollDownButton`,Xe=N.forwardRef((e,t)=>{let n=J(Ye,e.__scopeSelect),r=Y(Ye,e.__scopeSelect),[a,o]=N.useState(!1),s=i(t,r.onScrollButtonChange);return v(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,L.jsx)(Ze,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Xe.displayName=Ye;var Ze=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=J(`SelectScrollButton`,n),o=N.useRef(null),s=H(n),c=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>c(),[c]),v(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:p(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:p(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:p(i.onPointerLeave,()=>{c()})})}),Qe=`SelectSeparator`,$e=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,L.jsx)(_.div,{"aria-hidden":!0,...r,ref:t})});$e.displayName=Qe;var et=`SelectArrow`,tt=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n);return J(et,n).position===`popper`?(0,L.jsx)(E,{...i,...r,ref:t}):null});tt.displayName=et;var nt=`SelectBubbleInput`,rt=N.forwardRef(({__scopeSelect:e,...t},n)=>{let r=G(nt,e),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=N.useRef(null),h=i(n,m),g=a??``,v=I(g),y=Array.from(f).some(e=>(e.props.value??``)===``);return N.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[v,g]),(0,L.jsxs)(_.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...t,style:{...te,...t.style},ref:h,defaultValue:g,children:[Q(a)&&!y?(0,L.jsx)(`option`,{value:``}):null,Array.from(f)]},p)});rt.displayName=nt;function it(e){return typeof e==`function`}function Q(e){return e===``||e===void 0}function at(e){let t=a(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),o=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function ot(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=st(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function st(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ct=de,lt=he;function ut({className:e,children:t,...n}){return(0,L.jsxs)(pe,{className:b(`flex h-8 w-full cursor-pointer items-center justify-between gap-2 px-2.5 [&>span]:truncate`,A,e),...n,children:[t,(0,L.jsx)(_e,{asChild:!0,children:(0,L.jsx)(j,{className:`size-3.5 shrink-0 text-fg-muted`})})]})}function dt({className:e,children:t,position:n=`popper`,...r}){return(0,L.jsx)(xe,{children:(0,L.jsx)(Se,{position:n,sideOffset:4,className:b(`z-50 max-h-72 min-w-[var(--radix-select-trigger-width)] overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,e),...r,children:(0,L.jsx)(Pe,{children:t})})})}function ft({className:e,children:t,...n}){return(0,L.jsxs)(Ue,{className:b(O,ne,`py-1.5 pl-7 pr-2`,e),...n,children:[(0,L.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,L.jsx)(Ke,{children:(0,L.jsx)(re,{className:`size-3.5`})})}),(0,L.jsx)(We,{children:t})]})}var $=`Switch`,[pt,mt]=s($),[ht,gt]=pt($);function _t(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=l({prop:n,defaultProp:i??!1,onChange:c,caller:$}),[h,g]=N.useState(null),[_,v]=N.useState(null),y={checked:p,setChecked:m,disabled:a,control:h,setControl:g,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:N.useRef(!1),required:u,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,L.jsx)(ht,{scope:t,...y,children:Tt(f)?f(y):r})}var vt=`SwitchTrigger`,yt=N.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:a,form:o,value:s,disabled:c,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:g}=gt(vt,e),v=i(r,d),y=N.useRef(l);return N.useEffect(()=>{let e=o?a?.ownerDocument.getElementById(o):a?.form;if(e instanceof HTMLFormElement){let t=()=>f(y.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,f]),(0,L.jsx)(_.button,{type:`button`,role:`switch`,"aria-checked":l,"aria-required":u,"data-state":Et(l),"data-disabled":c?``:void 0,disabled:c,value:s,...n,ref:v,onClick:p(t,e=>{f(e=>!e),g&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});yt.displayName=vt;var bt=N.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(_t,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(yt,{...d,ref:t,__scopeSwitch:n}),e&&(0,L.jsx)(wt,{__scopeSwitch:n})]})})});bt.displayName=$;var xt=`SwitchThumb`,St=N.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=gt(xt,n);return(0,L.jsx)(_.span,{"data-state":Et(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});St.displayName=xt;var Ct=`SwitchBubbleInput`,wt=N.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=gt(Ct,e),h=i(n,m),g=I(o),v=w(r);N.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!a.current;if(g!==o&&n){let t=new Event(`click`,{bubbles:r});n.call(e,o),e.dispatchEvent(t)}},[p,g,o,a]);let y=N.useRef(o);return(0,L.jsx)(_.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??y.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});wt.displayName=Ct;function Tt(e){return typeof e==`function`}function Et(e){return e?`checked`:`unchecked`}function Dt({className:e,...t}){return(0,L.jsx)(bt,{className:b(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full transition-colors data-[state=checked]:bg-action data-[state=unchecked]:bg-border data-[state=unchecked]:hover:bg-border/70 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,L.jsx)(St,{className:`pointer-events-none block size-4 rounded-full bg-ground shadow-sm transition-transform data-[state=checked]:translate-x-[1.125rem] data-[state=unchecked]:translate-x-0.5`})})}var Ot={agent:{baseBranch:``,separateBranch:!0,separateWorktree:!0},terminal:{baseBranch:``,separateBranch:!1,separateWorktree:!1}};function kt(e,t){let n=t?.sessionDefaults?.[e],r=Ot[e],i=n?.separateBranch??r.separateBranch;return{baseBranch:n?.baseBranch??r.baseBranch,separateBranch:i,separateWorktree:i?!0:n?.separateWorktree??r.separateWorktree}}export{ft as a,M as c,dt as i,j as l,Dt as n,ut as o,ct as r,lt as s,kt as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./index-bqEa9yZh.js";function t(){return e.get()}export{t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,f as n,h as r,o as i,p as a}from"./editor.api2-4X9Vh9Zw.js";import{m as o,p as s}from"./buffer-store
|
|
1
|
+
import{a as e,c as t,f as n,h as r,o as i,p as a}from"./editor.api2-4X9Vh9Zw.js";import{m as o,p as s}from"./buffer-store-C23koXgg.js";var c=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=o({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(`/assets/ts.worker-BtjBFNHX.js`,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(a.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},l={};l[`lib.d.ts`]=!0,l[`lib.decorators.d.ts`]=!0,l[`lib.decorators.legacy.d.ts`]=!0,l[`lib.dom.asynciterable.d.ts`]=!0,l[`lib.dom.d.ts`]=!0,l[`lib.dom.iterable.d.ts`]=!0,l[`lib.es2015.collection.d.ts`]=!0,l[`lib.es2015.core.d.ts`]=!0,l[`lib.es2015.d.ts`]=!0,l[`lib.es2015.generator.d.ts`]=!0,l[`lib.es2015.iterable.d.ts`]=!0,l[`lib.es2015.promise.d.ts`]=!0,l[`lib.es2015.proxy.d.ts`]=!0,l[`lib.es2015.reflect.d.ts`]=!0,l[`lib.es2015.symbol.d.ts`]=!0,l[`lib.es2015.symbol.wellknown.d.ts`]=!0,l[`lib.es2016.array.include.d.ts`]=!0,l[`lib.es2016.d.ts`]=!0,l[`lib.es2016.full.d.ts`]=!0,l[`lib.es2016.intl.d.ts`]=!0,l[`lib.es2017.arraybuffer.d.ts`]=!0,l[`lib.es2017.d.ts`]=!0,l[`lib.es2017.date.d.ts`]=!0,l[`lib.es2017.full.d.ts`]=!0,l[`lib.es2017.intl.d.ts`]=!0,l[`lib.es2017.object.d.ts`]=!0,l[`lib.es2017.sharedmemory.d.ts`]=!0,l[`lib.es2017.string.d.ts`]=!0,l[`lib.es2017.typedarrays.d.ts`]=!0,l[`lib.es2018.asyncgenerator.d.ts`]=!0,l[`lib.es2018.asynciterable.d.ts`]=!0,l[`lib.es2018.d.ts`]=!0,l[`lib.es2018.full.d.ts`]=!0,l[`lib.es2018.intl.d.ts`]=!0,l[`lib.es2018.promise.d.ts`]=!0,l[`lib.es2018.regexp.d.ts`]=!0,l[`lib.es2019.array.d.ts`]=!0,l[`lib.es2019.d.ts`]=!0,l[`lib.es2019.full.d.ts`]=!0,l[`lib.es2019.intl.d.ts`]=!0,l[`lib.es2019.object.d.ts`]=!0,l[`lib.es2019.string.d.ts`]=!0,l[`lib.es2019.symbol.d.ts`]=!0,l[`lib.es2020.bigint.d.ts`]=!0,l[`lib.es2020.d.ts`]=!0,l[`lib.es2020.date.d.ts`]=!0,l[`lib.es2020.full.d.ts`]=!0,l[`lib.es2020.intl.d.ts`]=!0,l[`lib.es2020.number.d.ts`]=!0,l[`lib.es2020.promise.d.ts`]=!0,l[`lib.es2020.sharedmemory.d.ts`]=!0,l[`lib.es2020.string.d.ts`]=!0,l[`lib.es2020.symbol.wellknown.d.ts`]=!0,l[`lib.es2021.d.ts`]=!0,l[`lib.es2021.full.d.ts`]=!0,l[`lib.es2021.intl.d.ts`]=!0,l[`lib.es2021.promise.d.ts`]=!0,l[`lib.es2021.string.d.ts`]=!0,l[`lib.es2021.weakref.d.ts`]=!0,l[`lib.es2022.array.d.ts`]=!0,l[`lib.es2022.d.ts`]=!0,l[`lib.es2022.error.d.ts`]=!0,l[`lib.es2022.full.d.ts`]=!0,l[`lib.es2022.intl.d.ts`]=!0,l[`lib.es2022.object.d.ts`]=!0,l[`lib.es2022.regexp.d.ts`]=!0,l[`lib.es2022.string.d.ts`]=!0,l[`lib.es2023.array.d.ts`]=!0,l[`lib.es2023.collection.d.ts`]=!0,l[`lib.es2023.d.ts`]=!0,l[`lib.es2023.full.d.ts`]=!0,l[`lib.es2023.intl.d.ts`]=!0,l[`lib.es2024.arraybuffer.d.ts`]=!0,l[`lib.es2024.collection.d.ts`]=!0,l[`lib.es2024.d.ts`]=!0,l[`lib.es2024.full.d.ts`]=!0,l[`lib.es2024.object.d.ts`]=!0,l[`lib.es2024.promise.d.ts`]=!0,l[`lib.es2024.regexp.d.ts`]=!0,l[`lib.es2024.sharedmemory.d.ts`]=!0,l[`lib.es2024.string.d.ts`]=!0,l[`lib.es5.d.ts`]=!0,l[`lib.es6.d.ts`]=!0,l[`lib.esnext.array.d.ts`]=!0,l[`lib.esnext.collection.d.ts`]=!0,l[`lib.esnext.d.ts`]=!0,l[`lib.esnext.decorators.d.ts`]=!0,l[`lib.esnext.disposable.d.ts`]=!0,l[`lib.esnext.error.d.ts`]=!0,l[`lib.esnext.float16.d.ts`]=!0,l[`lib.esnext.full.d.ts`]=!0,l[`lib.esnext.intl.d.ts`]=!0,l[`lib.esnext.iterator.d.ts`]=!0,l[`lib.esnext.promise.d.ts`]=!0,l[`lib.esnext.sharedmemory.d.ts`]=!0,l[`lib.scripthost.d.ts`]=!0,l[`lib.webworker.asynciterable.d.ts`]=!0,l[`lib.webworker.d.ts`]=!0,l[`lib.webworker.importscripts.d.ts`]=!0,l[`lib.webworker.iterable.d.ts`]=!0;function u(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=u(i,t,n);return r}function d(e){return e?e.map(e=>e.text).join(``):``}var f=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},p=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e?e.path.indexOf(`/lib.`)===0&&!!l[e.path.slice(1)]:!1}getOrCreateModel(e){let t=n.parse(e),r=a.getModel(t);if(r)return r;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return a.createModel(this._libFiles[t.path.slice(1)],`typescript`,t);let i=s.getExtraLibs()[e];return i?a.createModel(i.content,`typescript`,t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},m=class extends f{constructor(e,t,n,r){super(r),this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=e=>{if(e.getLanguageId()!==n)return;let t=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},r,i=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(t,500)}),o=e.onDidChangeAttached(()=>{let{onlyVisible:n}=this._defaults.getDiagnosticsOptions();n&&(e.isAttachedToEditor()?t():a.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){i.dispose(),o.dispose(),clearTimeout(r)}},t()},o=e=>{a.setModelMarkers(e,this._selector,[]);let t=e.uri.toString();this._listener[t]&&(this._listener[t].dispose(),delete this._listener[t])};this._disposables.push(a.onDidCreateModel(e=>i(e))),this._disposables.push(a.onWillDisposeModel(o)),this._disposables.push(a.onDidChangeModelLanguage(e=>{o(e.model),i(e.model)})),this._disposables.push({dispose(){for(let e of a.getModels())o(e)}});let s=()=>{for(let e of a.getModels())o(e),i(e)};this._disposables.push(this._defaults.onDidChange(s)),this._disposables.push(this._defaults.onDidExtraLibsChange(s)),a.getModels().forEach(e=>i(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let r=[],{noSyntaxValidation:i,noSemanticValidation:o,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();i||r.push(t.getSyntacticDiagnostics(e.uri.toString())),o||r.push(t.getSemanticDiagnostics(e.uri.toString())),s||r.push(t.getSuggestionDiagnostics(e.uri.toString()));let c=await Promise.all(r);if(!c||e.isDisposed())return;let l=c.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),u=l.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?n.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&a.setModelMarkers(e,this._selector,l.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){let n=t.start||0,r=t.length||1,{lineNumber:a,column:o}=e.getPositionAt(n),{lineNumber:s,column:c}=e.getPositionAt(n+r),l=[];return t.reportsUnnecessary&&l.push(i.Unnecessary),t.reportsDeprecated&&l.push(i.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:a,startColumn:o,endLineNumber:s,endColumn:c,message:u(t.messageText,`
|
|
2
2
|
`),code:t.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach(t=>{let r=e;if(t.file&&(r=this._libFiles.getOrCreateModel(t.file.fileName)),!r)return;let i=t.start||0,a=t.length||1,{lineNumber:o,column:s}=r.getPositionAt(i),{lineNumber:c,column:l}=r.getPositionAt(i+a);n.push({resource:r.uri,startLineNumber:o,startColumn:s,endLineNumber:c,endColumn:l,message:u(t.messageText,`
|
|
3
3
|
`)})}),n}_tsDiagnosticCategoryToMarkerSeverity(t){switch(t){case 1:return e.Error;case 3:return e.Info;case 0:return e.Warning;case 2:return e.Hint}return e.Info}},h=class e extends f{get triggerCharacters(){return[`.`]}async provideCompletionItems(n,i,a,o){let s=n.getWordUntilPosition(i),c=new t(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn),l=n.uri,u=n.getOffsetAt(i),d=await this._worker(l);if(n.isDisposed())return;let f=await d.getCompletionsAtPosition(l.toString(),u);if(!(!f||n.isDisposed()))return{suggestions:f.entries.map(a=>{let o=c;if(a.replacementSpan){let e=n.getPositionAt(a.replacementSpan.start),r=n.getPositionAt(a.replacementSpan.start+a.replacementSpan.length);o=new t(e.lineNumber,e.column,r.lineNumber,r.column)}let s=[];return a.kindModifiers!==void 0&&a.kindModifiers.indexOf(`deprecated`)!==-1&&s.push(r.CompletionItemTag.Deprecated),{uri:l,position:i,offset:u,range:o,label:a.name,insertText:a.name,sortText:a.sortText,kind:e.convertKind(a.kind),tags:s}})}}async resolveCompletionItem(t,n){let r=t,i=r.uri,a=r.position,o=r.offset,s=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),o,r.label);return s?{uri:i,position:a,label:s.name,kind:e.convertKind(s.kind),detail:d(s.displayParts),documentation:{value:e.createDocumentationString(s)}}:r}static convertKind(e){switch(e){case C.primitiveType:case C.keyword:return r.CompletionItemKind.Keyword;case C.variable:case C.localVariable:return r.CompletionItemKind.Variable;case C.memberVariable:case C.memberGetAccessor:case C.memberSetAccessor:return r.CompletionItemKind.Field;case C.function:case C.memberFunction:case C.constructSignature:case C.callSignature:case C.indexSignature:return r.CompletionItemKind.Function;case C.enum:return r.CompletionItemKind.Enum;case C.module:return r.CompletionItemKind.Module;case C.class:return r.CompletionItemKind.Class;case C.interface:return r.CompletionItemKind.Interface;case C.warning:return r.CompletionItemKind.File}return r.CompletionItemKind.Property}static createDocumentationString(e){let t=d(e.documentation);if(e.tags)for(let n of e.tags)t+=`
|
|
4
4
|
|
package/dist/public/index.html
CHANGED
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/puddle.svg" />
|
|
7
7
|
<title>puddle</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-bqEa9yZh.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/react-CZI7_Jkm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ffCh33zF.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/useMutation-Da9b4jwS.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/api-
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/api-L5qtWa7E.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/utils-B6KiDbIe.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DyMAgLa3.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/dialog-B43iKmfK.js">
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Dg2mfzDf.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puddle-code/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "puddle — self-hosted orchestrator for CLI coding agents: serves the cockpit UI and connects it to local or SSH hosts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/PerceptronV/puddle-code#readme",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{g as r}from"./api-BJKPJeFZ.js";import{a as i,g as a,i as o,n as s,o as c,t as l}from"./dialog-B43iKmfK.js";import{t as u}from"./utils-B6KiDbIe.js";import{A as d,M as f,N as p,O as m,c as h,j as g,k as _,n as v,r as y,t as b}from"./context-menu-CGL06LiB.js";import{r as x}from"./dist-fdPAlKke.js";import{$ as S,Pt as C,X as w,Z as T,ft as E,k as D,m as O,nt as k,pt as A,st as j,ut as M}from"./index-D994oCvG.js";var N=e(t(),1),P=n(),F=[{status:`running`,colour:`bg-running`},{status:`waiting_input`,colour:`bg-waiting`},{status:`interrupted`,colour:`bg-interrupted`}];function I({projectId:e}){let t=M(e),n=(0,N.useMemo)(()=>{let e=new Map;for(let n of t.data??[])e.set(n.status,(e.get(n.status)??0)+1);return e},[t.data]),r=(t.data??[]).filter(e=>e.status!==`archived`).length;return(0,P.jsxs)(`div`,{className:`flex items-center gap-3 text-2xs text-fg-muted tabular-nums`,children:[(0,P.jsxs)(`span`,{children:[r,` session`,r===1?``:`s`]}),F.map(({status:e,colour:t})=>{let r=n.get(e)??0;return r===0?null:(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full ${t}`}),r,` `,e.replace(`_`,` `)]},e)})]})}function L({icon:e,label:t,onClick:n}){return(0,P.jsx)(`button`,{type:`button`,"aria-label":t,title:t,onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:`flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-ground hover:text-fg`,children:(0,P.jsx)(e,{className:`size-4`})})}function R({project:e,repoPath:t,draggable:n,dragging:m,onDragStart:g,onDragEnd:_,onDragOver:x}){let S=T(),[w,D]=(0,N.useState)(!1),[O,k]=(0,N.useState)(e.name),j=t=>S.mutate({id:e.id,archived:t},{onError:e=>r.error(e.message)}),M=()=>{let t=O.trim();if(!t||t===e.name){D(!1);return}S.mutate({id:e.id,name:t},{onSuccess:()=>D(!1),onError:e=>r.error(e.message)})};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(b,{children:[(0,P.jsx)(h,{asChild:!0,children:(0,P.jsxs)(`div`,{draggable:n,onDragStart:g,onDragEnd:_,onDragOver:x,className:u(`group relative transition-opacity`,m&&`opacity-50`),children:[(0,P.jsxs)(C,{draggable:!1,to:`/project/${e.id}`,className:`block rounded-lg bg-surface p-4 transition-colors hover:bg-elevated`,children:[(0,P.jsx)(`h2`,{className:`truncate pr-16 text-base font-semibold text-fg group-hover:text-accent`,children:e.name}),(0,P.jsx)(`p`,{className:`mt-1 truncate font-mono text-2xs text-fg-muted`,children:t??`…`}),(0,P.jsx)(`div`,{className:`mt-3`,children:(0,P.jsx)(I,{projectId:e.id})})]}),(0,P.jsx)(`div`,{className:`absolute right-2 top-2 hidden gap-0.5 group-hover:flex has-[[data-state=open]]:flex`,children:e.archived?(0,P.jsx)(L,{icon:p,label:`Reopen project`,onClick:()=>j(!1)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(L,{icon:d,label:`Rename project`,onClick:()=>{k(e.name),D(!0)}}),(0,P.jsx)(L,{icon:f,label:`Archive project`,onClick:()=>j(!0)})]})})]})}),(0,P.jsx)(v,{children:e.archived?(0,P.jsxs)(y,{onSelect:()=>j(!1),children:[(0,P.jsx)(p,{}),` Reopen`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(y,{onSelect:()=>{k(e.name),D(!0)},children:[(0,P.jsx)(d,{}),` Rename`]}),(0,P.jsxs)(y,{onSelect:()=>j(!0),children:[(0,P.jsx)(f,{}),` Archive`]})]})})]}),(0,P.jsx)(l,{open:w,onOpenChange:D,children:(0,P.jsxs)(s,{children:[(0,P.jsx)(i,{children:(0,P.jsx)(c,{children:`Rename project`})}),(0,P.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),M()},children:[(0,P.jsx)(A,{value:O,onChange:e=>k(e.target.value),autoFocus:!0}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(E,{className:`text-fg-muted`,children:`Path`}),(0,P.jsx)(`p`,{className:`truncate font-mono text-2xs text-fg-muted`,children:t??`…`})]}),(0,P.jsxs)(o,{children:[(0,P.jsx)(a,{type:`button`,variant:`ghost`,onClick:()=>D(!1),children:`Cancel`}),(0,P.jsx)(a,{type:`submit`,disabled:!O.trim()||S.isPending,children:`Rename`})]})]})]})})]})}function z(){let e=D(),t=k(e??void 0),n=j(),r=S(e??void 0),i=w(e??``),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(null),[d,p]=(0,N.useState)(!1),h=e=>n.data?.find(t=>t.id===e)?.path,v=t.data??[],y=r.data?.projectOrder??[],b=m(v.filter(e=>!e.archived),y),C=v.filter(e=>e.archived),T=(e,t)=>{e!==t&&i.mutate({projectOrder:_(b.map(e=>e.id),e,t)})};return(0,P.jsxs)(`div`,{className:`mx-auto max-w-4xl p-6`,children:[v.length===0&&(0,P.jsxs)(`div`,{className:`mt-24 flex flex-col items-center gap-6 text-center`,children:[(0,P.jsx)(x,{className:`size-8 text-fg-muted`}),(0,P.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:`No projects yet — press ⌘K or create one to get started.`}),(0,P.jsx)(a,{onClick:()=>s(!0),children:`New project`})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:b.map(e=>(0,P.jsx)(R,{project:e,repoPath:h(e.repo_id),draggable:!0,dragging:c===e.id,onDragStart:()=>l(e.id),onDragEnd:()=>l(null),onDragOver:t=>{t.preventDefault(),c&&c!==e.id&&T(c,e.id)}},e.id))}),C.length>0&&(0,P.jsxs)(`div`,{className:`mt-6`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1.5 px-1 py-1.5 text-2xs uppercase tracking-wide text-fg-muted transition-colors hover:text-fg`,children:[(0,P.jsx)(g,{className:u(`size-3 transition-transform`,d&&`rotate-90`)}),(0,P.jsx)(f,{className:`size-3`}),(0,P.jsx)(`span`,{children:`Archived`}),(0,P.jsx)(`span`,{className:`tabular-nums`,children:C.length})]}),d&&(0,P.jsx)(`div`,{className:`mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2`,children:C.map(e=>(0,P.jsx)(R,{project:e,repoPath:h(e.repo_id),draggable:!1,dragging:!1,onDragStart:()=>{},onDragEnd:()=>{},onDragOver:()=>{}},e.id))})]}),e!==null&&(0,P.jsx)(O,{profileId:e,open:o,onOpenChange:s})]})}export{z as Dashboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{c as r,d as i,g as a,l as o,o as s,s as c,u as l}from"./api-BJKPJeFZ.js";import{a as u,g as d,i as f,n as p,o as m,r as h,t as g}from"./dialog-B43iKmfK.js";import{t as _}from"./utils-B6KiDbIe.js";import{t as v}from"./createLucideIcon-DyMAgLa3.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./switch-BbnQDPjG.js";import{r as D}from"./dist-fdPAlKke.js";import{$ as O,C as k,E as A,G as j,H as ee,I as M,J as N,L as te,M as P,Mt as ne,N as re,O as ie,Ot as ae,Q as oe,S as se,T as ce,U as le,V as ue,X as F,Y as de,b as fe,et as I,f as pe,ft as L,g as me,h as he,i as ge,k as R,l as z,mt as B,nt as _e,o as V,pt as H,q as ve,s as U,st as ye,v as W,y as be,z as xe}from"./index-D994oCvG.js";var Se=v(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),G=v(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Ce=v(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),we=v(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Te=v(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ee=v(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),De=v(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),K=e(t(),1),q=n();function J({label:e,description:t,htmlFor:n,children:r,className:i}){return(0,q.jsxs)(`div`,{className:_(`flex items-center gap-4 py-2.5`,i),children:[(0,q.jsxs)(`label`,{htmlFor:n,className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{className:`text-sm text-fg`,children:e}),t&&(0,q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:r})]})}function Y({children:e,note:t}){return(0,q.jsxs)(`div`,{className:`mb-2 flex flex-col gap-0.5`,children:[(0,q.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e}),t&&(0,q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t})]})}function Oe(){let e=U(),[t,n]=(0,K.useState)(ne());return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{note:`This browser only`,children:`Appearance`}),(0,q.jsx)(J,{label:`Theme`,description:`Chrome, terminal, and editor restyle together.`,children:(0,q.jsxs)(S,{value:t,onValueChange:e=>{n(e),ae(e)},children:[(0,q.jsx)(y,{className:`w-32`,children:(0,q.jsx)(C,{})}),(0,q.jsxs)(w,{children:[(0,q.jsx)(x,{value:`dark`,children:`Dark`}),(0,q.jsx)(x,{value:`light`,children:`Light`}),(0,q.jsx)(x,{value:`system`,children:`System`})]})]})}),(0,q.jsx)(J,{label:`UI font size`,htmlFor:`ui-font-size`,children:(0,q.jsx)(H,{id:`ui-font-size`,type:`number`,min:12,max:24,step:.5,className:`w-20 tabular-nums`,value:e.uiFontSize,onChange:e=>V({uiFontSize:Number(e.target.value)||ge.uiFontSize})})}),(0,q.jsx)(J,{label:`Terminal font size`,htmlFor:`terminal-font-size`,children:(0,q.jsx)(H,{id:`terminal-font-size`,type:`number`,min:9,max:24,className:`w-20 tabular-nums`,value:e.terminalFontSize,onChange:e=>V({terminalFontSize:Number(e.target.value)||13})})}),(0,q.jsx)(J,{label:`Density`,children:(0,q.jsxs)(S,{value:e.density,onValueChange:e=>V({density:e}),children:[(0,q.jsx)(y,{className:`w-36`,children:(0,q.jsx)(C,{})}),(0,q.jsxs)(w,{children:[(0,q.jsx)(x,{value:`compact`,children:`Compact`}),(0,q.jsx)(x,{value:`comfortable`,children:`Comfortable`})]})]})}),(0,q.jsx)(J,{label:`Reduced motion`,description:`Status ripples become static dots.`,htmlFor:`reduced-motion`,children:(0,q.jsx)(E,{id:`reduced-motion`,checked:e.reducedMotion,onCheckedChange:e=>V({reducedMotion:e})})}),(0,q.jsx)(J,{label:`All projects in the sidebar`,description:`Show every project's sessions in the right sidebar, grouped by project.`,htmlFor:`all-project-sessions`,children:(0,q.jsx)(E,{id:`all-project-sessions`,checked:e.showAllProjectSessions,onCheckedChange:e=>V({showAllProjectSessions:e})})})]})}var X=`__none__`;function ke(){let e=R(),t=I().data?.find(t=>t.id===e),n=P(e??void 0),r=O(e??void 0),i=de(),o=F(e??``),c=ue(),[l,_]=(0,K.useState)(``),[v,b]=(0,K.useState)(``),[T,E]=(0,K.useState)(!1),[D,k]=(0,K.useState)(``);if((0,K.useEffect)(()=>{t&&(_(t.name),b(t.branch_prefix))},[t]),!t)return null;let A=r.data?.default_account_id;return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{children:`Profile`}),(0,q.jsxs)(J,{label:`Name`,description:`A display label. Letters, digits, dot, underscore and hyphen; must be unique.`,htmlFor:`profile-name`,children:[(0,q.jsx)(H,{id:`profile-name`,value:l,onChange:e=>_(e.target.value),className:`w-44 font-mono`}),(0,q.jsx)(d,{size:`sm`,variant:`secondary`,disabled:l===t.name||l.trim()===``||i.isPending,onClick:()=>i.mutate({id:t.id,name:l},{onError:e=>a.error(e.message)}),children:`Save`})]}),(0,q.jsxs)(J,{label:`Branch prefix`,description:`Session branches become <prefix><slug(title)>.`,htmlFor:`branch-prefix`,children:[(0,q.jsx)(H,{id:`branch-prefix`,value:v,onChange:e=>b(e.target.value),placeholder:s,className:`w-44 font-mono`}),(0,q.jsx)(d,{size:`sm`,variant:`secondary`,disabled:v===t.branch_prefix||i.isPending,onClick:()=>i.mutate({id:t.id,branch_prefix:v},{onError:e=>a.error(e.message)}),children:`Save`})]}),(0,q.jsx)(J,{label:`Default account`,description:`Preselected in the new-session modal.`,children:(0,q.jsxs)(S,{value:typeof A==`number`?String(A):X,onValueChange:e=>o.mutate({default_account_id:e===X?null:Number(e)},{onError:e=>a.error(e.message)}),children:[(0,q.jsx)(y,{className:`w-56`,children:(0,q.jsx)(C,{})}),(0,q.jsxs)(w,{children:[(0,q.jsx)(x,{value:X,children:`First available`}),n.data?.map(e=>(0,q.jsx)(x,{value:String(e.id),children:(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.agent_type,`/`,e.label]})},e.id))]})]})}),(0,q.jsx)(J,{label:`Delete profile`,description:`Removes its projects, accounts (logging them out), and archived history. Non-archived sessions block deletion.`,className:`mt-4`,children:(0,q.jsx)(d,{variant:`danger`,size:`sm`,onClick:()=>E(!0),children:`Delete…`})}),(0,q.jsx)(g,{open:T,onOpenChange:e=>{e||(E(!1),k(``))},children:(0,q.jsxs)(p,{children:[(0,q.jsxs)(u,{children:[(0,q.jsxs)(m,{children:[`Delete profile `,(0,q.jsx)(`span`,{className:`font-mono`,children:t.name}),`?`]}),(0,q.jsx)(h,{children:`Everything this profile owns goes with it: projects, workspace layouts, accounts and their credential directories, and archived session history. Branches, repositories, and terminal logs on disk are untouched. This cannot be undone.`})]}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsxs)(L,{htmlFor:`delete-confirm-name`,children:[`Type `,(0,q.jsx)(`span`,{className:`font-mono text-fg`,children:t.name}),` to confirm`]}),(0,q.jsx)(H,{id:`delete-confirm-name`,value:D,onChange:e=>k(e.target.value),className:`font-mono`,autoFocus:!0})]}),(0,q.jsxs)(f,{children:[(0,q.jsx)(d,{variant:`ghost`,onClick:()=>{E(!1),k(``)},children:`Cancel`}),(0,q.jsx)(d,{variant:`danger`,disabled:D!==t.name||c.isPending,onClick:()=>c.mutate(t.id,{onSuccess:()=>{W(),ie.set(null)},onError:e=>{E(!1),k(``),a.error(e.message)}}),children:`Delete profile`})]})]})})]})}function Ae({agentId:e,profileId:t,onClose:n}){let r=te(),[i,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),l=ee(he(s,150)),_=i.trim()!==``&&(s.startsWith(`/`)||s.startsWith(`~`));return(0,q.jsx)(g,{open:!0,onOpenChange:e=>!e&&n(),children:(0,q.jsxs)(p,{children:[(0,q.jsxs)(u,{children:[(0,q.jsx)(m,{children:`Import an existing account`}),(0,q.jsx)(h,{children:`The directory is copied into a puddle-owned account; the original is never touched. If credentials do not travel (macOS keychain), log in once afterwards.`})]}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,q.jsx)(H,{placeholder:`label, e.g. personal`,value:i,onChange:e=>o(e.target.value),className:`font-mono`}),(0,q.jsx)(me,{value:s,onValueChange:c,placeholder:`config dir on the host, e.g. ~/.claude`,hints:(l.data?.entries??[]).map(e=>({value:e.path,label:e.name})),className:`font-mono`})]}),(0,q.jsxs)(f,{children:[(0,q.jsx)(d,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,q.jsxs)(d,{disabled:!_||r.isPending,onClick:()=>r.mutate({profile_id:t,agent_type:e,label:i.trim(),import_dir:s.trim()},{onSuccess:e=>{n(),e.logged_in||a.info(`Imported without credentials — press Login to authenticate.`)},onError:e=>a.error(e.message)}),children:[(0,q.jsx)(G,{}),`Import`]})]})]})})}function je({account:e,gateOpen:t}){let n=j(),r=ve(),i=xe(),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[_,v]=(0,K.useState)(e.label);return(0,K.useEffect)(()=>v(e.label),[e.label]),(0,q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md bg-surface px-3 py-2`,children:[(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),onBlur:()=>{let t=_.trim();if(t!==e.label){if(t===``){v(e.label);return}r.mutate({id:e.id,label:t},{onError:t=>{a.error(t.message),v(e.label)}})}},onKeyDown:t=>{t.key===`Enter`?t.currentTarget.blur():t.key===`Escape`&&(v(e.label),t.currentTarget.blur())},"aria-label":`Account name`,className:`-mx-1 block w-full truncate rounded-sm bg-transparent px-1 py-0.5 font-mono text-sm text-fg transition-colors hover:bg-elevated focus:bg-elevated focus:outline-none`}),(0,q.jsx)(`span`,{className:`text-2xs ${e.logged_in?`text-running`:`text-waiting`}`,children:e.logged_in?`logged in`:`not logged in`})]}),t&&(0,q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-secondary`,children:[`skip prompts`,(0,q.jsx)(E,{checked:e.skip_permissions_default,onCheckedChange:t=>r.mutate({id:e.id,skip_permissions_default:t},{onError:e=>a.error(e.message)})})]}),(0,q.jsxs)(d,{size:`sm`,variant:`secondary`,disabled:n.isPending,onClick:()=>n.mutate(e.id,{onSuccess:e=>s(e.stream),onError:e=>a.error(e.message)}),children:[(0,q.jsx)(A,{}),e.logged_in?`Re-login`:`Login`]}),(0,q.jsxs)(d,{size:`icon`,variant:`ghost`,className:`size-7 text-fg-muted hover:text-danger`,onClick:()=>l(!0),children:[(0,q.jsx)(T,{}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Delete account`})]}),o&&(0,q.jsx)(z,{stream:o,label:`${e.agent_type}/${e.label}`,onClose:()=>s(null)}),(0,q.jsx)(g,{open:c,onOpenChange:l,children:(0,q.jsxs)(p,{children:[(0,q.jsxs)(u,{children:[(0,q.jsxs)(m,{children:[`Delete `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.label}),`?`]}),(0,q.jsx)(h,{children:`Removes the account, its archived session history, and its credential directory — this logs the account out. Non-archived sessions block deletion.`})]}),(0,q.jsxs)(f,{children:[(0,q.jsx)(d,{variant:`ghost`,onClick:()=>l(!1),children:`Cancel`}),(0,q.jsx)(d,{variant:`danger`,disabled:i.isPending,onClick:()=>i.mutate(e.id,{onSuccess:()=>l(!1),onError:e=>{l(!1),a.error(e.message)}}),children:`Delete account`})]})]})})]})}function Me(){let e=R(),t=re(),n=P(e??void 0),r=O(e??void 0),i=te(),o=j(),[s,c]=(0,K.useState)({}),[l,u]=(0,K.useState)(null),[f,p]=(0,K.useState)(null),m=r.data?.allowSkipPermissions===!0,h=t=>{let n=(s[t]??``).trim();!n||e===null||i.mutate({profile_id:e,agent_type:t,label:n},{onSuccess:e=>{c(e=>({...e,[t]:``})),o.mutate(e.id,{onSuccess:n=>u({stream:n.stream,label:`${t}/${e.label}`})})},onError:e=>a.error(e.message)})};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{children:`Accounts`}),t.data?.map(e=>{let t=n.data?.filter(t=>t.agent_type===e.id)??[];return(0,q.jsxs)(`div`,{className:`mb-5`,children:[(0,q.jsx)(J,{label:e.display_name,description:`Accounts are isolated config dirs under this profile.`,className:`py-1`,children:(0,q.jsx)(`span`,{className:`font-mono text-2xs text-fg-muted`,children:e.id})}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t.map(t=>(0,q.jsx)(je,{account:t,gateOpen:m&&e.capabilities.skip_permissions},t.id)),(0,q.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),h(e.id)},children:[(0,q.jsx)(H,{placeholder:`label, e.g. personal`,value:s[e.id]??``,onChange:t=>c(n=>({...n,[e.id]:t.target.value})),className:`w-48 font-mono`}),(0,q.jsxs)(d,{type:`submit`,size:`sm`,variant:`secondary`,disabled:!(s[e.id]??``).trim()||i.isPending,children:[(0,q.jsx)(ce,{}),`Add account`]}),(0,q.jsxs)(d,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>p(e.id),children:[(0,q.jsx)(G,{}),`Import existing…`]})]})]})]},e.id)}),l&&(0,q.jsx)(z,{stream:l.stream,label:l.label,onClose:()=>u(null)}),f!==null&&e!==null&&(0,q.jsx)(Ae,{agentId:f,profileId:e,onClose:()=>p(null)})]})}function Z({id:e,label:t,description:n,initial:r,defaultText:i,onSave:a,pending:o}){let[s,c]=(0,K.useState)(r);return(0,q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,q.jsxs)(`label`,{htmlFor:e,className:`flex flex-col gap-0.5 text-sm text-fg`,children:[t,(0,q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:n})]}),(0,q.jsx)(B,{id:e,value:s,onChange:e=>c(e.target.value),rows:6,className:`font-mono`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(d,{size:`sm`,variant:`secondary`,disabled:s===r||o,onClick:()=>a(s),children:`Save`}),(0,q.jsx)(d,{size:`sm`,variant:`ghost`,disabled:s===i||o,onClick:()=>{c(i),a(i)},children:`Reset to default`})]})]})}var Ne={id:`4f3c2b1a-7e6d-5c4b-3a2f-1e0d9c8b7a6f`,title:null,agent_title:`Refactor the auth flow`,osc_title:`claude`,branch:`alice/refactor-auth`,worktree_path:`/home/alice/code/app--refactor-auth`,status:`waiting_input`,agent_type:`claude-code`};function Pe({initial:e,onSave:t,pending:n}){let[r,a]=(0,K.useState)(e),o=r.length>0?r:l;return(0,q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,q.jsxs)(`label`,{htmlFor:`tab-title-template`,className:`flex flex-col gap-0.5 text-sm text-fg`,children:[`Template`,(0,q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Compose the label from the parts below. Empty falls back to the default.`})]}),(0,q.jsx)(H,{id:`tab-title-template`,value:r,onChange:e=>a(e.target.value),className:`font-mono`,placeholder:l}),(0,q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[`Preview`,` `,(0,q.jsx)(`span`,{className:`ml-1 font-sans text-fg`,children:pe(Ne,o)})]}),(0,q.jsx)(`dl`,{className:`mt-1 flex flex-col gap-0.5 text-xs`,children:i.map(([e,t])=>(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`dt`,{className:`w-24 shrink-0 font-mono text-fg-secondary`,children:`\${${e}}`}),(0,q.jsx)(`dd`,{className:`text-fg-muted`,children:t})]},e))}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(d,{size:`sm`,variant:`secondary`,disabled:r===e||n,onClick:()=>t(r),children:`Save`}),(0,q.jsx)(d,{size:`sm`,variant:`ghost`,disabled:r==="${name}"||n,onClick:()=>{a(l),t(l)},children:`Reset to default`})]})]})}function Fe(){let e=R(),t=I().data?.find(t=>t.id===e),n=O(e??void 0),i=F(e??``),[s,l]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),y=n.data?.allowSkipPermissions===!0,b=e=>i.mutate({allowSkipPermissions:e},{onSuccess:()=>{l(!1),v(``)},onError:e=>a.error(e.message)}),x=e=>t=>i.mutate({[e]:t},{onError:e=>a.error(e.message)});return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{children:`Sessions`}),(0,q.jsx)(`p`,{className:`mb-3 text-xs text-fg-secondary`,children:`Permission prompts are on by default, everywhere. Skipping them requires this profile gate, a per-account opt-in, and a per-session toggle — and the daemon re-checks all three on every launch, resume, and hand-off.`}),(0,q.jsx)(J,{label:`Allow skipping permission prompts`,description:y?`The gate is open: opted-in accounts can start prompt-free sessions.`:`The gate is closed: every session keeps its permission prompts.`,htmlFor:`gate`,children:(0,q.jsx)(E,{id:`gate`,checked:y,onCheckedChange:e=>{e?l(!0):b(!1)}})}),(0,q.jsxs)(`div`,{className:`mt-5`,children:[(0,q.jsx)(Y,{note:`Sent to the agent as its opening message when a session starts. Leave a box empty to send no preamble.`,children:`Launch text`}),n.data&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Z,{id:`onboarding-template`,label:`New worktree`,description:`For a freshly created worktree. Use {{rules}} where the repo's onboarding notes should appear.`,initial:n.data.onboardingTemplate??r,defaultText:r,onSave:x(`onboardingTemplate`),pending:i.isPending},`${e}:onboarding`),(0,q.jsx)(Z,{id:`concurrent-template`,label:`Existing / shared worktree`,description:`For a session joining a worktree other agents may already be working in.`,initial:n.data.concurrentTemplate??c,defaultText:c,onSave:x(`concurrentTemplate`),pending:i.isPending},`${e}:concurrent`),(0,q.jsx)(Z,{id:`restart-template`,label:`Resume after restart`,description:`Sent when a session resumes after a daemon restart or machine reboot — its processes are gone.`,initial:n.data.restartTemplate??o,defaultText:o,onSave:x(`restartTemplate`),pending:i.isPending},`${e}:restart`)]})]}),(0,q.jsxs)(`div`,{className:`mt-5`,children:[(0,q.jsx)(Y,{note:`How each session's tab and sidebar label is composed from its parts.`,children:`Tab title`}),n.data&&(0,q.jsx)(Pe,{initial:n.data.tabTitleTemplate??"${name}",onSave:x(`tabTitleTemplate`),pending:i.isPending},`${e}:tab-title`)]}),(0,q.jsx)(g,{open:s,onOpenChange:e=>{e||(l(!1),v(``))},children:(0,q.jsxs)(p,{children:[(0,q.jsxs)(u,{children:[(0,q.jsxs)(m,{className:`flex items-center gap-2`,children:[(0,q.jsx)(Te,{className:`size-5 text-danger`}),`Run agents without permission prompts?`]}),(0,q.jsx)(h,{asChild:!0,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{children:`A prompt-free agent acts unattended, with your credentials, inside its worktree — and nothing technically stops a shell command from reaching outside it. It can:`}),(0,q.jsxs)(`ul`,{className:`list-disc pl-5 text-fg-secondary`,children:[(0,q.jsx)(`li`,{children:`run any shell command without asking first,`}),(0,q.jsx)(`li`,{children:`modify, delete, or exfiltrate files your user can reach,`}),(0,q.jsx)(`li`,{children:`install dependencies and execute the network requests they make,`}),(0,q.jsx)(`li`,{children:`push branches or call remote APIs with the credentials it finds.`})]}),(0,q.jsx)(`p`,{children:`Only open this gate if every account you opt in runs work you would trust a colleague to run unsupervised on this machine.`}),(0,q.jsx)(`p`,{className:`text-fg-muted`,children:`Opening it also records the agent’s own bypass-permissions acceptance for this profile’s accounts, so the skip actually takes effect.`})]})})]}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsxs)(L,{htmlFor:`confirm-name`,children:[`Type `,(0,q.jsx)(`span`,{className:`font-mono text-fg`,children:t?.name}),` to confirm`]}),(0,q.jsx)(H,{id:`confirm-name`,value:_,onChange:e=>v(e.target.value),className:`font-mono`,autoFocus:!0})]}),(0,q.jsxs)(f,{children:[(0,q.jsx)(d,{variant:`ghost`,onClick:()=>{l(!1),v(``)},children:`Cancel`}),(0,q.jsx)(d,{variant:`danger`,disabled:_!==t?.name||i.isPending,onClick:()=>b(!0),children:`Open the gate`})]})]})})]})}var Ie={desktop:!0,sound:!1,muted_projects:[]};function Le(){let e=R(),t=O(e??void 0),n=F(e??``),r=_e(e??void 0),i={...Ie,...t.data?.notifications??{}},o=e=>n.mutate({notifications:e},{onError:e=>a.error(e.message)});return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{note:`Delivery lands in a later phase`,children:`Notifications`}),(0,q.jsx)(J,{label:`Desktop notification on waiting`,description:`When a session flips to waiting for input.`,htmlFor:`notify-desktop`,children:(0,q.jsx)(E,{id:`notify-desktop`,checked:i.desktop,onCheckedChange:e=>o({...i,desktop:e})})}),(0,q.jsx)(J,{label:`Sound`,htmlFor:`notify-sound`,children:(0,q.jsx)(E,{id:`notify-sound`,checked:i.sound,onCheckedChange:e=>o({...i,sound:e})})}),(0,q.jsx)(J,{label:`Muted projects`,description:`No notifications from these projects.`,children:(0,q.jsxs)(`span`,{className:`text-2xs text-fg-muted tabular-nums`,children:[i.muted_projects.length,` muted`]})}),(0,q.jsx)(`div`,{className:`flex flex-col gap-1`,children:r.data?.map(e=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-secondary hover:bg-elevated`,children:[(0,q.jsx)(E,{checked:i.muted_projects.includes(e.id),onCheckedChange:t=>o({...i,muted_projects:t?[...i.muted_projects,e.id]:i.muted_projects.filter(t=>t!==e.id)})}),e.name]},e.id))})]})}function Re(){let e=M(),t=N(),[n,r]=(0,K.useState)(``);return(0,K.useEffect)(()=>{e.data&&r(e.data.agentPath)},[e.data]),(0,q.jsx)(J,{label:`Agent search path (host-wide)`,description:`Colon-separated dirs the daemon prepends to PATH to find agent CLIs like claude (e.g. ~/.local/bin). Applies after the daemon restarts.`,htmlFor:`agent-path`,children:(0,q.jsx)(H,{id:`agent-path`,type:`text`,className:`w-64 font-mono text-2xs`,value:n,onChange:e=>r(e.target.value),onBlur:()=>{e.data&&n!==e.data.agentPath&&t.mutate({agentPath:n})}})})}function ze(){let e=U();return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{note:`This browser only`,children:`Terminal & editor`}),(0,q.jsx)(J,{label:`Terminal scrollback`,description:`Lines kept per terminal.`,htmlFor:`scrollback`,children:(0,q.jsx)(H,{id:`scrollback`,type:`number`,min:500,max:1e5,step:500,className:`w-28 tabular-nums`,value:e.terminalScrollback,onChange:e=>V({terminalScrollback:Number(e.target.value)||5e3})})}),(0,q.jsx)(J,{label:`Editor tab size`,description:`Consumed when the editor lands in Phase 3.`,htmlFor:`tab-size`,children:(0,q.jsx)(H,{id:`tab-size`,type:`number`,min:1,max:8,className:`w-20 tabular-nums`,value:e.editorTabSize,onChange:e=>V({editorTabSize:Number(e.target.value)||2})})}),(0,q.jsx)(J,{label:`Editor word wrap`,htmlFor:`word-wrap`,children:(0,q.jsx)(E,{id:`word-wrap`,checked:e.editorWordWrap,onCheckedChange:e=>V({editorWordWrap:e})})}),(0,q.jsx)(J,{label:`SSH host for editor links`,description:`Used for vscode:// and cursor:// remote links until the CLI supplies it automatically.`,htmlFor:`editor-link-host`,children:(0,q.jsx)(H,{id:`editor-link-host`,type:`text`,placeholder:`user@host`,className:`w-48`,value:e.editorLinkSshHost,onChange:e=>V({editorLinkSshHost:e.target.value})})}),(0,q.jsx)(Re,{})]})}function Be({repo:e}){let t=oe(),n=le(),[r,i]=(0,K.useState)(e.default_base_branch),[o,s]=(0,K.useState)(e.onboarding_notes??``),c=e=>a.error(e.message);return(0,q.jsxs)(`div`,{className:`mb-4 rounded-lg bg-surface p-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-sm text-fg`,children:e.path}),(0,q.jsx)(`span`,{className:`shrink-0 text-2xs text-fg-muted tabular-nums`,children:e.last_fetched_at?`fetched ${new Date(e.last_fetched_at).toLocaleString()}`:`never fetched`}),(0,q.jsxs)(d,{size:`sm`,variant:`ghost`,disabled:n.isPending,onClick:()=>n.mutate(e.id,{onSuccess:()=>a.success(`Fetched.`),onError:c}),children:[(0,q.jsx)(b,{}),`Fetch now`]})]}),(0,q.jsxs)(J,{label:`Default base branch`,htmlFor:`base-${e.id}`,className:`py-1.5`,children:[(0,q.jsx)(H,{id:`base-${e.id}`,value:r,onChange:e=>i(e.target.value),className:`w-40 font-mono`}),(0,q.jsx)(d,{size:`sm`,variant:`secondary`,disabled:r===e.default_base_branch||t.isPending,onClick:()=>t.mutate({id:e.id,default_base_branch:r},{onError:c}),children:`Save`})]}),(0,q.jsx)(J,{label:`Periodic fetch`,description:`Fetched on open and on the daemon's interval while sessions are active.`,htmlFor:`fetch-${e.id}`,className:`py-1.5`,children:(0,q.jsx)(E,{id:`fetch-${e.id}`,checked:e.fetch_enabled,onCheckedChange:n=>t.mutate({id:e.id,fetch_enabled:n},{onError:c})})}),(0,q.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,q.jsxs)(`label`,{htmlFor:`notes-${e.id}`,className:`flex flex-col gap-0.5 text-sm text-fg`,children:[`Onboarding notes`,(0,q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Standing setup rules, injected into every fresh worktree. Agents update them via .puddle/onboarding-notes.md.`})]}),(0,q.jsx)(B,{id:`notes-${e.id}`,value:o,onChange:e=>s(e.target.value),rows:4,className:`font-mono`}),(0,q.jsx)(`div`,{children:(0,q.jsx)(d,{size:`sm`,variant:`secondary`,disabled:o===(e.onboarding_notes??``)||t.isPending,onClick:()=>t.mutate({id:e.id,onboarding_notes:o},{onError:c}),children:`Save notes`})})]}),e.orphan_worktrees.length>0&&(0,q.jsxs)(`div`,{className:`mt-3 rounded-md bg-elevated p-2`,children:[(0,q.jsx)(`p`,{className:`text-xs text-fg-secondary`,children:`Orphan worktrees — directories no session claims. Puddle never deletes these automatically; remove them by hand if unwanted.`}),(0,q.jsx)(`ul`,{className:`mt-1 flex flex-col gap-0.5`,children:e.orphan_worktrees.map(e=>(0,q.jsx)(`li`,{className:`truncate font-mono text-2xs text-fg-muted`,children:e},e))})]})]})}function Ve(){let e=ye();return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{children:`Repositories`}),e.data?.length===0&&(0,q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:`No repositories yet — register one from the new-project flow on the dashboard.`}),e.data?.map(e=>(0,q.jsx)(Be,{repo:e},e.id))]})}function Q({label:e,description:t,field:n,config:r,min:i,step:o=1}){let s=N();return(0,q.jsx)(J,{label:e,description:t,htmlFor:`host-${n}`,children:(0,q.jsx)(H,{id:`host-${n}`,type:`number`,min:i,step:o,className:`w-32 tabular-nums`,defaultValue:r[n],onBlur:e=>{let t=Number(e.target.value);Number.isFinite(t)&&t!==r[n]&&s.mutate({[n]:t},{onError:e=>a.error(e.message)})}})})}function He(){let e=M(),t=N();return e.data?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Y,{note:`Affects all profiles on this host`,children:`Host`}),(0,q.jsx)(Q,{label:`Fetch interval (minutes)`,description:`Periodic git fetch for repos with active sessions.`,field:`fetchIntervalMinutes`,config:e.data,min:1}),(0,q.jsx)(Q,{label:`Log size cap (bytes)`,description:`Per-terminal on-disk log cap.`,field:`logMaxBytes`,config:e.data,min:65536,step:1048576}),(0,q.jsx)(Q,{label:`Replay size (bytes)`,description:`Log tail sent to a terminal on attach.`,field:`replayBytes`,config:e.data,min:1024,step:65536}),(0,q.jsx)(Q,{label:`UI-state retention (days)`,description:`Stale workspace snapshots are swept at boot.`,field:`uiStateRetentionDays`,config:e.data,min:1}),(0,q.jsx)(J,{label:`Auto-resume`,description:`Resume interrupted sessions automatically after a daemon restart.`,htmlFor:`host-autoResume`,children:(0,q.jsx)(E,{id:`host-autoResume`,checked:e.data.autoResume,onCheckedChange:e=>t.mutate({autoResume:e},{onError:e=>a.error(e.message)})})})]}):null}var $=[{id:`appearance`,label:`Appearance`,icon:Ce,render:()=>(0,q.jsx)(Oe,{})},{id:`profile`,label:`Profile`,icon:se,render:()=>(0,q.jsx)(ke,{})},{id:`accounts`,label:`Accounts`,icon:De,render:()=>(0,q.jsx)(Me,{})},{id:`sessions`,label:`Sessions`,icon:Ee,render:()=>(0,q.jsx)(Fe,{})},{id:`notifications`,label:`Notifications`,icon:Se,render:()=>(0,q.jsx)(Le,{})},{id:`terminal`,label:`Terminal & Editor`,icon:k,render:()=>(0,q.jsx)(ze,{})},{id:`repositories`,label:`Repositories`,icon:D,render:()=>(0,q.jsx)(Ve,{})},{id:`host`,label:`Host`,icon:we,render:()=>(0,q.jsx)(He,{})}];function Ue(){let e=fe(),t=$.find(t=>t.id===e)??$[0];return(0,q.jsx)(g,{open:e!==null,onOpenChange:e=>!e&&W(),children:(0,q.jsxs)(p,{wide:!0,className:`grid h-[34rem] grid-cols-[14rem_1fr] gap-0 overflow-hidden p-0`,children:[(0,q.jsx)(m,{className:`sr-only`,children:`Settings`}),(0,q.jsxs)(`nav`,{className:`flex flex-col gap-1 bg-surface p-2.5 pr-6`,children:[(0,q.jsx)(`span`,{className:`px-2.5 py-2 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`Settings`}),$.map(({id:e,label:n,icon:r})=>(0,q.jsxs)(`button`,{onClick:()=>be(e),className:_(`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors`,e===t.id?`bg-elevated text-fg`:`text-fg-secondary hover:bg-elevated hover:text-fg`),children:[(0,q.jsx)(r,{className:`size-4 shrink-0`}),n]},e))]}),(0,q.jsx)(`div`,{className:`overflow-y-auto p-5`,children:t.render()})]})})}export{Ue as SettingsDialog};
|