@puddle-code/cli 0.4.5 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/dist/index.js +5 -2
  3. package/dist/install.sh +13 -2
  4. package/dist/public/assets/App-Ckp6kzac.css +1 -0
  5. package/dist/public/assets/App-D-hMqX7b.js +13 -0
  6. package/dist/public/assets/{CompilationCommandForm-C71yC-_B.js → CompilationCommandForm-Csg3VkC6.js} +1 -1
  7. package/dist/public/assets/{Dashboard-CB_H-DLw.js → Dashboard-C0AvtM5m.js} +1 -1
  8. package/dist/public/assets/EditorTabClose-QgdaqA1X.js +1 -0
  9. package/dist/public/assets/FindWidget-DG1YP6Zx.js +1 -0
  10. package/dist/public/assets/{LazyTerminal-BoKGfXrR.js → LazyTerminal-Dp2CN0Y8.js} +2 -2
  11. package/dist/public/assets/{ModelRefcount-B7HGdIpN.js → ModelRefcount-CHKuXiJY.js} +1 -1
  12. package/dist/public/assets/{NewProjectDialog-CdXJRYKt.js → NewProjectDialog-DMixZDC_.js} +1 -1
  13. package/dist/public/assets/{NotebookWidget-kFo_mQZh.js → NotebookWidget-CCRsiBIE.js} +1 -1
  14. package/dist/public/assets/{PaneEditorBody-DPzHCCV7.js → PaneEditorBody-DD8UshBi.js} +19 -19
  15. package/dist/public/assets/{PdfViewer-C-dXDOjG.js → PdfViewer-BX025YLW.js} +1 -1
  16. package/dist/public/assets/ReleaseNotesDialog-CbFYKoYM.js +1 -0
  17. package/dist/public/assets/SettingsDialog-CJX0gDhJ.css +1 -0
  18. package/dist/public/assets/SettingsDialog-DgMm212x.js +8 -0
  19. package/dist/public/assets/Terminal-CYeh8_uU.js +66 -0
  20. package/dist/public/assets/Workspace-Bf0VMnaa.css +1 -0
  21. package/dist/public/assets/Workspace-CrZkK55U.js +20 -0
  22. package/dist/public/assets/{buffer-store-D78ZR3kb.js → buffer-store-DIOiWz9q.js} +1 -1
  23. package/dist/public/assets/button-C_Rvtcwg.js +1 -0
  24. package/dist/public/assets/{chevron-right-BP2NLwlG.js → chevron-right-BEy-IXEZ.js} +1 -1
  25. package/dist/public/assets/client-settings-DhfHheKR.js +1 -0
  26. package/dist/public/assets/command-BV8ZEhQz.js +1 -0
  27. package/dist/public/assets/{context-C3-WejyN.js → context-CSOKgBuW.js} +1 -1
  28. package/dist/public/assets/context-menu-D3ZhKA9s.js +1 -0
  29. package/dist/public/assets/control-tray-CdoVaVhT.js +1 -0
  30. package/dist/public/assets/control-tray-DE2RhHP3.css +1 -0
  31. package/dist/public/assets/dialog-BX0tebJL.css +1 -0
  32. package/dist/public/assets/dialog-D-Axqpzg.js +41 -0
  33. package/dist/public/assets/dist-BmSuHjIq.js +1 -0
  34. package/dist/public/assets/{dist-CGlwr6Pc.js → dist-Cq-O0n8n.js} +1 -1
  35. package/dist/public/assets/{dist-BHBQY7ao.js → dist-Dge3wHdO.js} +1 -1
  36. package/dist/public/assets/{index-BKT8bLLH.js → index-BqOVeoIr.js} +3 -3
  37. package/dist/public/assets/index-LpAqnBR3.css +2 -0
  38. package/dist/public/assets/{markdown-mermaid-A8_2kS9k.js → markdown-mermaid-SyDYdSZz.js} +1 -1
  39. package/dist/public/assets/media-refresh-store-NSkvkBxN.js +1 -0
  40. package/dist/public/assets/motion-OSLfKoC0.js +1 -0
  41. package/dist/public/assets/{notification-delivery-CoEqmE8J.js → notification-delivery-BBt_CJ19.js} +1 -1
  42. package/dist/public/assets/popover-D-jcaKGN.js +1 -0
  43. package/dist/public/assets/{protocol-support-CsLR9u7d.js → protocol-support-BApsXw77.js} +1 -1
  44. package/dist/public/assets/select-p5KTVHbg.js +1 -0
  45. package/dist/public/assets/selection-actions-Cm0Oytya.js +1 -0
  46. package/dist/public/assets/{switch-DihTSmnc.js → switch-OMx-_DY7.js} +1 -1
  47. package/dist/public/assets/use-ui-state-DdnTFosh.js +1 -0
  48. package/dist/public/index.html +3 -3
  49. package/package.json +1 -1
  50. package/dist/public/assets/App-Cr5uXso0.js +0 -7
  51. package/dist/public/assets/EditorTabClose-wG0D8Zxq.js +0 -1
  52. package/dist/public/assets/FindWidget-CaVwYvST.js +0 -1
  53. package/dist/public/assets/ReleaseNotesDialog-BXqx8SP6.js +0 -1
  54. package/dist/public/assets/SettingsDialog-D7eSDoiW.js +0 -8
  55. package/dist/public/assets/Terminal-BEHawoLK.js +0 -66
  56. package/dist/public/assets/Workspace-D5qlJNnU.css +0 -1
  57. package/dist/public/assets/Workspace-PBHY5dWY.js +0 -20
  58. package/dist/public/assets/button-q0ardkfx.js +0 -1
  59. package/dist/public/assets/client-settings-CwqpIric.js +0 -1
  60. package/dist/public/assets/command-BkdEYC1b.js +0 -1
  61. package/dist/public/assets/context-menu-C0cOAj0E.js +0 -1
  62. package/dist/public/assets/control-tray-D7OXXkAy.css +0 -1
  63. package/dist/public/assets/control-tray-OJfh0_ml.js +0 -1
  64. package/dist/public/assets/dialog-IU2fjIs9.js +0 -41
  65. package/dist/public/assets/dist-eLNGMhYC.js +0 -1
  66. package/dist/public/assets/index-C3TPFFMc.css +0 -2
  67. package/dist/public/assets/media-refresh-store-CHPkX-XV.js +0 -1
  68. package/dist/public/assets/popover-B5Bw2ljC.js +0 -1
  69. package/dist/public/assets/select-C0UTbo8D.js +0 -1
  70. package/dist/public/assets/selection-actions-Ccf4ZuaR.js +0 -1
  71. package/dist/public/assets/use-ui-state-e6mUjW-H.js +0 -1
  72. package/dist/public/assets/whole-word-BJjKpISQ.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{S as n,at as r,b as i}from"./protocol-support-CsLR9u7d.js";import{F as a}from"./auth-olLlgxc3.js";import{t as o}from"./jsx-runtime-By8HlURe.js";import{g as s}from"./hotkeys-Cu0t6sbz.js";import{S as c,T as l,_ as u,b as d,g as f,h as p,v as ee,w as m}from"./dialog-IU2fjIs9.js";import{i as h,o as g}from"./x-Dq6POV20.js";import{c as _,d as te,f as v,l as y,u as ne}from"./chevron-right-BP2NLwlG.js";import{i as b}from"./dist-BHBQY7ao.js";import{n as x,t as S}from"./createLucideIcon-C9A1vLE-.js";import{c as re,n as ie}from"./switch-DihTSmnc.js";import{a as C,n as ae,o as w}from"./preview-kind-CPkO-rSz.js";import{t as oe}from"./debounce-B9DrqirV.js";var T=e(t(),1),E=o(),[D,se]=m(`Tooltip`,[v]),O=v(),ce=`TooltipProvider`,le=700,k=`tooltip.open`,[ue,A]=D(ce),de=e=>{let{__scopeTooltip:t,delayDuration:n=le,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=T.useRef(!0),s=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,E.jsx)(ue,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:T.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};de.displayName=ce;var j=`Tooltip`,[fe,M]=D(j),pe=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=A(j,e.__scopeTooltip),l=O(t),[u,d]=T.useState(null),f=ee(),m=T.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=T.useRef(!1),[v,y]=p({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(k))):c.onClose(),a?.(e)},caller:j}),ne=T.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),b=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,y(!0)},[y]),x=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),S=T.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,y(!0),m.current=0},g)},[g,y]);return T.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,E.jsx)(te,{...l,children:(0,E.jsx)(fe,{scope:t,contentId:f,open:v,stateAttribute:ne,trigger:u,onTriggerChange:d,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:T.useCallback(()=>{h?x():(window.clearTimeout(m.current),m.current=0)},[x,h]),onOpen:b,onClose:x,disableHoverableContent:h,children:n})})};pe.displayName=j;var me=`TooltipTrigger`,he=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=M(me,n),a=A(me,n),o=O(n),s=g(t,T.useRef(null),i.onTriggerChange),u=T.useRef(!1),d=T.useRef(!1),f=T.useCallback(()=>u.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,E.jsx)(_,{asChild:!0,...o,children:(0,E.jsx)(c.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:l(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:l(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:l(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:l(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:l(e.onBlur,i.onClose),onClick:l(e.onClick,i.onClose)})})});he.displayName=me;var N=`TooltipPortal`,[ge,_e]=D(N,{forceMount:void 0}),ve=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(N,t);return(0,E.jsx)(ge,{scope:t,forceMount:n,children:(0,E.jsx)(f,{present:n||a.open,children:(0,E.jsx)(u,{asChild:!0,container:i,children:r})})})};ve.displayName=N;var P=`TooltipContent`,ye=T.forwardRef((e,t)=>{let n=_e(P,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(P,e.__scopeTooltip);return(0,E.jsx)(f,{present:r||o.open,children:o.disableHoverableContent?(0,E.jsx)(we,{side:i,...a,ref:t}):(0,E.jsx)(be,{side:i,...a,ref:t})})}),be=T.forwardRef((e,t)=>{let n=M(P,e.__scopeTooltip),r=A(P,e.__scopeTooltip),i=T.useRef(null),a=g(t,i),[o,s]=T.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=T.useCallback(()=>{s(null),d(!1)},[d]),p=T.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Oe(r,De(r,n.getBoundingClientRect())),a=ke(t.getBoundingClientRect()),o=je([...i,...a]);s(o),d(!0)},[d]);return T.useEffect(()=>()=>f(),[f]),T.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),T.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Ae(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,E.jsx)(we,{...e,ref:a})}),[xe,Se]=D(j,{isInside:!1}),Ce=h(`TooltipContent`),we=T.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(P,n),l=O(n),{onClose:u}=c;return T.useEffect(()=>(document.addEventListener(k,u),()=>document.removeEventListener(k,u)),[u]),T.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,E.jsx)(d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,E.jsxs)(ne,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,E.jsx)(Ce,{children:r}),(0,E.jsx)(xe,{scope:n,isInside:!0,children:(0,E.jsx)(b,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});ye.displayName=P;var Te=`TooltipArrow`,Ee=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=O(n);return Se(Te,n).isInside?null:(0,E.jsx)(y,{...i,...r,ref:t})});Ee.displayName=Te;function De(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Oe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ke(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function je(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Me(t)}function Me(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ne=de,Pe=pe,Fe=he,Ie=ve,Le=ye,Re=Ne,ze=Pe,Be=Fe;function Ve({className:e,sideOffset:t=4,...n}){return(0,E.jsx)(Ie,{children:(0,E.jsx)(Le,{sideOffset:t,className:x(`z-50 overflow-hidden rounded-md bg-elevated px-2 py-1 text-xs text-fg shadow-lg`,e),...n})})}var He=S(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function Ue({initial:e,maxLength:t,className:n,fitContent:r=!1,onCommit:i,onCancel:a}){let[o,s]=(0,T.useState)(e),c=(0,E.jsx)(`input`,{autoFocus:!0,value:o,maxLength:t,onFocus:e=>e.currentTarget.select(),onChange:e=>s(e.target.value),onBlur:()=>i(o),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?i(o):e.key===`Escape`&&a()},className:x(`bg-transparent outline-none`,r?`col-start-1 row-start-1 w-0 min-w-full p-0`:n)});return r?(0,E.jsxs)(`span`,{className:x(`inline-grid min-w-px`,n),children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`invisible col-start-1 row-start-1 whitespace-pre`,children:o||`​`}),c]}):c}function We(e){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:t=>{t.preventDefault(),e()}}}var F=null;function Ge(e){return F=e,()=>{F===e&&(F=null)}}function Ke(){F?.()}var I=null;function qe(e){return I=e,()=>{I===e&&(I=null)}}async function Je(e){if(!I)throw Error(`Open a project before opening a path.`);await I(e)}function Ye(){let e=r(s()??void 0).data?.tabTitleTemplate;return(0,T.useCallback)(t=>ie(t,e),[e])}var Xe=(0,T.createContext)({open:()=>void 0,handler:null,setHandler:()=>void 0});function Ze({children:e}){let[t,n]=(0,T.useState)(null),r=(0,T.useCallback)(e=>n(()=>e),[]),i=(0,T.useCallback)(e=>t?.(e),[t]),a=(0,T.useMemo)(()=>({open:i,handler:t,setHandler:r}),[i,t,r]);return(0,E.jsx)(Xe.Provider,{value:a,children:e})}function Qe(){return(0,T.useContext)(Xe)}function $e({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function et({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6*t,"aria-hidden":!0,children:[(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function tt({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`path`,{d:`M8 4H4v16h4`}),(0,E.jsx)(`path`,{d:`M16 4h4v16h-4`}),(0,E.jsx)(`rect`,{x:`10.5`,y:`10.5`,width:`3`,height:`3`,fill:`currentColor`,stroke:`none`})]})}function nt({className:e}){return(0,E.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,"aria-hidden":!0,children:(0,E.jsx)(`path`,{d:`M12 1.5c0 5.8 4.7 10.5 10.5 10.5C16.7 12 12 16.7 12 22.5 12 16.7 7.3 12 1.5 12 7.3 12 12 7.3 12 1.5Z`})})}function rt({type:e,className:t,strokeScale:n=1}){switch(e){case`claude-code`:return(0,E.jsx)($e,{className:t,strokeScale:n});case`codex`:return(0,E.jsx)(et,{className:t,strokeScale:n});case`opencode`:return(0,E.jsx)(tt,{className:t,strokeScale:n});case`gemini-cli`:return(0,E.jsx)(nt,{className:t});default:return(0,E.jsx)(re,{className:t,strokeWidth:2*n})}}var L=new Set,R=!1,it=null;function at(){for(let e of L)e()}function ot(e){return L.add(e),()=>L.delete(e)}function st(e){R!==e&&(R=e,at())}function ct(){st(!R)}function lt(){return(0,T.useSyncExternalStore)(ot,()=>R)}function ut(e){it=e,at()}function dt(){return(0,T.useSyncExternalStore)(ot,()=>it)}function z(){return crypto.randomUUID()}function B(e){return e.type===`terminal`?`term:${e.session}`:`editor:${C(e.tab)}`}function V(e,t){return B(e)===B(t)}function ft(e){return e.type===`terminal`}function pt(e){return e.type===`editor`&&(e.tab.view===`linked`||e.tab.view===`locked`)}function H(e=[],t){let n=e.map(B),r=t&&n.includes(t)?t:n.length>0?n[0]:null;return{kind:`leaf`,id:z(),tabs:e,activeKey:r,previewKey:null}}function U(e,t,n){return{kind:`split`,id:z(),direction:e,children:t,sizes:n??t.map(()=>100/Math.max(1,t.length))}}function W(e,t){if(e.kind===`leaf`)return e.id===t?e:null;for(let n of e.children){let e=W(n,t);if(e)return e}return null}function G(e,t){if(e.kind===`leaf`)return e.tabs.some(e=>B(e)===t)?e:null;for(let n of e.children){let e=G(n,t);if(e)return e}return null}function K(e){return e.kind===`leaf`?[e]:e.children.flatMap(K)}function q(e){return K(e).flatMap(e=>e.tabs)}function mt(e){return e.kind===`leaf`?[e.id]:[e.id,...e.children.flatMap(mt)]}function ht(e){let t=mt(e);return new Set(t).size!==t.length}function gt(e){return e.kind===`leaf`?{...e,id:z()}:{...e,id:z(),children:e.children.map(gt)}}function _t(e){if(!ht(e))return e;let t=new Set,n=e=>{let r=t.has(e.id)?z():e.id;return t.add(r),e.kind===`leaf`?{...e,id:r}:{...e,id:r,children:e.children.map(n)}};return n(e)}function vt(e){let t=e.tabs.map(B),n=e.activeKey&&t.includes(e.activeKey)?e.activeKey:t[0]??null,r=e.previewKey&&t.includes(e.previewKey)?e.previewKey:null;return n===e.activeKey&&r===(e.previewKey??null)?e:{...e,activeKey:n,previewKey:r}}function J(e){if(e.kind===`leaf`)return vt(e);let t=e.children.map(J),n=[],r=[];t.forEach((t,i)=>{let a=e.sizes[i]??1;if(t.kind===`split`&&t.direction===e.direction){let e=t.sizes.reduce((e,t)=>e+t,0)||t.children.length;t.children.forEach((i,o)=>{n.push(i),r.push(a*(t.sizes[o]??1)/e)})}else n.push(t),r.push(a)});let i=[],a=[];return n.forEach((e,t)=>{e.kind===`leaf`&&e.tabs.length===0||(i.push(e),a.push(r[t]??1))}),i.length===0?H([]):i.length===1?i[0]:{...e,children:i,sizes:a}}function Y(e,t,n){return e.kind===`leaf`?e.id===t?n(e):e:{...e,children:e.children.map(e=>Y(e,t,n))}}function yt(e,t,n){return Y(e,t,e=>{if(!e.tabs.some(e=>B(e)===n))return e;let t=e.tabs.filter(e=>B(e)!==n),r=e.activeKey===n?bt(e,n):e.activeKey;return{...e,tabs:t,activeKey:r}})}function bt(e,t){let n=e.tabs.findIndex(e=>B(e)===t);if(n===-1)return e.activeKey;let r=e.tabs.filter(e=>B(e)!==t);return r.length===0?null:B(r[Math.min(n,r.length-1)])}function xt(e,t,n){let r=e.tabs.filter(e=>!V(e,t)),i=n===void 0?r.length:Math.max(0,Math.min(n,r.length)),a=[...r.slice(0,i),t,...r.slice(i)];return{...e,tabs:a,activeKey:B(t)}}function St(e,t,n,r){let i=n===`left`||n===`right`?`row`:`col`,a=n===`left`||n===`top`;return J(Y(e,t,e=>{let t=H([r]);return U(i,a?[t,e]:[e,t],[50,50])}))}function Ct(e,t){let{fromLeafId:n,toLeafId:r,edge:i}=t;if(n===r)return e;let a=W(e,n),o=W(e,r);if(!a||!o)return e;if(i===`center`){let t=e=>e.kind===`leaf`?e.id===n?o:e.id===r?a:e:{...e,children:e.children.map(t)};return t(e)}let s=J(Y(e,n,e=>({...e,tabs:[],activeKey:null,previewKey:null}))),c=i===`left`||i===`right`?`row`:`col`,l=i===`left`||i===`top`;return J(Y(s,r,e=>U(c,l?[a,e]:[e,a],[50,50])))}function wt(e,t){let{ref:n,toLeafId:r,edge:i}=t,a=B(n),o=t.copy===!0&&!ft(n),s=t.index;if(i===`center`&&s!==void 0){let t=W(e,r)?.tabs.findIndex(e=>B(e)===a)??-1;t!==-1&&t<s&&--s}let c=o?e:yt(e,t.fromLeafId,a);if(i===`center`){let e=Y(c,r,e=>xt(e,n,s));return!W(e,r)&&!G(e,a)?X(J(Tt(e,n)),a):X(J(e),a)}return W(c,r)?X(St(c,r,i,n),a):J(H([n]))}function Tt(e,t){let n=K(e)[0];return n?Y(e,n.id,e=>xt(e,t)):H([t])}function Et(e,t,n){return J(Y(e,t,e=>e.tabs.some(e=>B(e)===n)?{...e,tabs:e.tabs.filter(e=>B(e)!==n),activeKey:e.activeKey===n?bt(e,n):e.activeKey}:e))}function Dt(e,t,n){let r=B(n);return J(Y(e,t,e=>{let t=e.previewKey===r?null:e.previewKey;return e.tabs.some(e=>V(e,n))?{...e,activeKey:r,previewKey:t}:{...e,tabs:[...e.tabs,n],activeKey:r,previewKey:t}}))}function Ot(e,t,n){let r=B(n);return J(Y(e,t,e=>e.tabs.some(e=>B(e)===r)?{...e,tabs:e.tabs.map(e=>B(e)===r?n:e),previewKey:e.previewKey===r?null:e.previewKey}:{...e,tabs:[...e.tabs,n]}))}function kt(e,t,n){let r=B(n);return Y(e,t,e=>({...e,tabs:e.tabs.map(e=>B(e)===r?n:e)}))}function At(e,t,n){let r=C(t),i=e=>e.kind===`split`?{...e,children:e.children.map(i)}:{...e,tabs:e.tabs.map(e=>e.type===`editor`&&C(e.tab)===r?{...e,tab:{...e.tab,compile_mode:n}}:e)};return i(e)}function jt(e,t){return e.type!==`editor`||t.type!==`editor`||e.tab.view!==`preview`||t.tab.view!==void 0||ae(t.tab.path)===null?t:{...t,tab:{...t.tab,view:`preview`}}}function Mt(e,t,n){let r=B(n);return J(Y(e,t,e=>{if(e.tabs.some(e=>V(e,n)))return{...e,activeKey:r};let t=e.previewKey?e.tabs.findIndex(t=>B(t)===e.previewKey):-1,i=t>=0?e.tabs[t]:void 0,a=i!==void 0&&!ft(i)&&!pt(i),o=a?jt(i,n):n,s=a?e.tabs.map((e,n)=>n===t?o:e):[...e.tabs,o];return{...e,tabs:s,activeKey:r,previewKey:r}}))}function X(e,t){let n=e=>e.kind===`leaf`?e.previewKey===t?{...e,previewKey:null}:e:{...e,children:e.children.map(n)};return n(e)}function Nt(e,t,n,r){return Y(e,t,e=>{let t=e.tabs.findIndex(e=>e.type===`editor`&&B(e)===n),i=t>=0?e.tabs[t]:void 0;if(i===void 0||i.type!==`editor`)return e;let a={...i,tab:{...i.tab,view:r}},o=B(a);if(o===n)return{...e,tabs:e.tabs.map((e,n)=>n===t?a:e)};let s=e.tabs.some((e,n)=>n!==t&&B(e)===o),c=s?e.tabs.filter((e,n)=>n!==t):e.tabs.map((e,n)=>n===t?a:e);return{...e,tabs:c,activeKey:e.activeKey===n?o:e.activeKey,previewKey:e.previewKey===n?s?null:o:e.previewKey??null}})}function Pt(e,t){let n=w(e);return n!==`commit`&&n!==`untitled`&&e.session===t.session&&e.path===t.path&&e.root===t.root}function Ft(e,t,n){if(n===t.path)return e;let r=!1,i=e=>{if(e.kind===`split`){let t=e.children.map(i);return t.some((t,n)=>t!==e.children[n])?{...e,children:t}:e}let a=new Map,o=!1,s=e.tabs.map(e=>{if(e.type!==`editor`||!Pt(e.tab,t))return e;let r={...e,tab:{...e.tab,path:n}};return a.set(B(e),B(r)),o=!0,r});if(!o)return e;r=!0;let c=e.activeKey,l=e.previewKey??null;return{...e,tabs:s,activeKey:c===null?null:a.get(c)??c,previewKey:l===null?null:a.get(l)??l}},a=i(e);return r?a:e}function It(e){if(e.type!==`editor`)return null;let t=e.tab,n=w(t);return n!==`file`&&n!==`external`||t.view===`linked`||t.view===`locked`||ae(t.path)===null?null:t}function Lt(e,t){let n=It(t);if(!n)return e;let r=!1,i=e=>{if(e.kind===`split`)return{...e,children:e.children.map(i)};let t=!1,a=e.tabs.map(e=>{if(e.type!==`editor`||!pt(e))return e;let r=e.tab;return r.session===n.session&&r.path===n.path&&(r.root??``)===(n.root??``)&&w(r)===w(n)?e:(t=!0,{type:`editor`,tab:{session:n.session,path:n.path,...n.kind===void 0?{}:{kind:n.kind},...n.root===void 0?{}:{root:n.root},view:r.view}})});return t?(r=!0,{...e,tabs:a}):e},a=i(e);return r?a:e}function Rt(e,t){return e.session===t.session&&e.path===t.path&&(e.root??``)===(t.root??``)&&w(e)===w(t)}function zt(e,t,n){let r=K(e).flatMap(e=>e.tabs.flatMap(n=>n.type!==`editor`||n.tab.view===`linked`||n.tab.view===`locked`||!Rt(n.tab,t)?[]:[{leafId:e.id,ref:n}]));return r.find(({leafId:e})=>e===n)??r.find(({ref:e})=>(e.tab.view??`source`)===`source`)??r[0]??null}function Bt(e,t,n){return Y(e,t,e=>e.tabs.some(e=>B(e)===n)?{...e,activeKey:n}:e)}function Vt(e,t,n){function r(e){return e.kind===`leaf`?e:e.id===t&&n.length===e.children.length?{...e,children:e.children.map(r),sizes:[...n]}:{...e,children:e.children.map(r)}}return r(e)}function Ht(e){let t=e.type===`terminal`?e.session:e.tab.session;return t===`00000000-0000-0000-0000-000000000000`?null:t}function Ut(e){return t=>{let n=Ht(t);return n===null||e.has(n)}}function Z(e,t){let n=e=>e.kind===`leaf`?{...e,tabs:e.tabs.filter(t)}:{...e,children:e.children.map(n)};return J(n(e))}function Wt(e){let t=new Set,n=[];for(let r of e){let e=J(Z(r,e=>!t.has(B(e)))),i=q(e);if(i.length!==0){for(let e of i)t.add(B(e));n.push(e)}}return n.length===0?H([]):_t(n.length===1?n[0]:J(U(`row`,n)))}function Gt(e){let t=e.editor_tabs.map(e=>({type:`editor`,tab:e})),n=e.session_tabs.map(e=>({type:`terminal`,session:e})),r=e.active_editor_tab?B({type:`editor`,tab:e.active_editor_tab}):null,i=e.active_session?`term:${e.active_session}`:null;if(t.length===0&&n.length===0)return H([]);if(t.length===0)return H(n,i);if(n.length===0)return H(t,r);let a=e.layout,o=typeof a.editor==`number`?a.editor:40,s=typeof a.session==`number`?a.session:60;return J(U(`col`,[H(t,r),H(n,i)],[o,s]))}function Kt(e){return JSON.stringify(qt(e))}function qt(e){return e===null?null:e.kind===`leaf`?e.tabs.length===0?null:{t:e.tabs.map(B)}:{d:e.direction,s:e.sizes.map(e=>Math.round(e*10)/10),c:e.children.map(qt)}}var Q=new Set,$=!1,Jt=null;function Yt(){for(let e of Q)e()}function Xt(e){return Q.add(e),()=>Q.delete(e)}function Zt(e){$!==e&&($=e,Yt())}function Qt(){Zt(!$)}function $t(){return(0,T.useSyncExternalStore)(Xt,()=>$)}function en(e){Jt=e,Yt()}function tn(){return(0,T.useSyncExternalStore)(Xt,()=>Jt)}var nn={layout_tree:null,active_session:null,layout_ref:null};function rn(e){return e.type===`terminal`?e.session:e.tab.session}function an(e,t){let n=new Set;for(let[r,i]of Object.entries(e))if(!(r===t||!i.layout_tree))for(let e of q(i.layout_tree))e.type===`terminal`&&n.add(e.session);return[...n]}function on(e,t){let n=e.project_layouts[t];return{...e,layout_tree:n?.layout_tree??null,active_session:n?.active_session??null,layout_ref:n?.layout_ref??null,session_tabs:[],editor_tabs:[],active_editor_tab:null}}function sn(e,t,n){return n?{loaded:e.loaded,snapshot:on(e.snapshot,t),current:()=>on(e.current(),t),update(n){let r={},i={...n};if(`layout_tree`in n&&(r.layout_tree=n.layout_tree??null,delete i.layout_tree),`active_session`in n&&(r.active_session=n.active_session??null,delete i.active_session),`layout_ref`in n&&(r.layout_ref=n.layout_ref??null,delete i.layout_ref),Object.keys(r).length>0){let n=e.current().project_layouts;i.project_layouts={...n,[t]:{...n[t]??nn,...r}}}Object.keys(i).length>0&&e.update(i)}}:e}function cn(e,t,n,r){let i=e.layout_tree??Gt(e),a={};for(let o of t)a[o]={layout_tree:gt(Z(i,e=>{let i=rn(e);return i===`00000000-0000-0000-0000-000000000000`?o===(r??t[0]):n.get(i)===o})),active_session:e.active_session!==null&&n.get(e.active_session)===o?e.active_session:null,layout_ref:null};return{layout_mode:`project`,project_layouts:a}}function ln(e,t,n={}){return{...e,...t,...n}}function un(e,t,n){let r=t.layout_tree?Z(t.layout_tree,e=>{let t=rn(e);return t===`00000000-0000-0000-0000-000000000000`||n.alive.has(t)}):null,i=t.active_session!==null&&n.alive.has(t.active_session)?t.active_session:null;if(t.scope===`profile`)return{projectBased:!1,patch:{layout_mode:`profile`,layout_tree:r,active_session:i,layout_ref:t.id}};let a=t.project_id??n.currentProject??n.projectIds[0]??``,o={layout_tree:r,active_session:i,layout_ref:t.id};if((e.layout_mode??`profile`)===`project`)return{projectBased:!0,patch:{project_layouts:{...e.project_layouts,[a]:o}}};let s=cn(e,n.projectIds,n.sessionProject,a);return{projectBased:!0,patch:{...s,project_layouts:ln(s.project_layouts??{},e.project_layouts,{[a]:o})}}}function dn(e,t){let n=e.project_layouts,r=[...t.filter(e=>e in n),...Object.keys(n).filter(e=>!t.includes(e))].map(e=>n[e]);return{layout_mode:`profile`,project_layouts:{},layout_tree:Wt(r.map(e=>e.layout_tree).filter(e=>e!==null)),active_session:r.map(e=>e.active_session).find(e=>e!==null)??null,layout_ref:null}}var fn=2e3,pn=a.parse({});function mn(e){return`puddle.ws.${e}`}function hn(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:a.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function gn(){let e=s(),[t,r]=(0,T.useState)(!1),[a,o]=(0,T.useState)(pn),c=(0,T.useRef)(a);c.current=a;let l=(0,T.useRef)(null),u=(0,T.useMemo)(()=>oe((e,t)=>{n(e,t).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},fn),[]);return(0,T.useEffect)(()=>{if(e===null){l.current=null;return}let t=mn(e);l.current=t;let n=!1;r(!1),o(pn);let a;try{a=hn(sessionStorage.getItem(t)),a.kind===`corrupt`&&sessionStorage.removeItem(t)}catch(e){console.warn(`ui-state read failed: ${e.message}`),a={kind:`absent`}}return a.kind===`present`?(o(a.snapshot),r(!0)):i(e).then(e=>{n||(e&&o(e.ui_state),r(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),n||r(!0)}),()=>{n=!0,u.flush()}},[e,u]),{loaded:t,snapshot:a,current:()=>c.current,update(t){if(e===null)return;let n={...c.current,...t};c.current=n,o(n);let r=l.current??mn(e);u(e,n);try{sessionStorage.setItem(r,JSON.stringify(n))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}export{Ke as $,H as A,B,Ct as C,Bt as D,q as E,Vt as F,dt as G,ut as H,Lt as I,Ze as J,lt as K,At as L,X as M,Z as N,G as O,Ft as P,qe as Q,Nt as R,_t as S,W as T,st as U,kt as V,ct as W,Ye as X,Qe as Y,Je as Z,Dt as _,ln as a,Ve as at,Gt as b,cn as c,Zt as d,Ge as et,Qt as f,Ot as g,Kt as h,un as i,ze as it,Mt as j,It as k,dn as l,$t as m,gn as n,We as nt,an as o,Re as ot,tn as p,rt as q,mn as r,He as rt,sn as s,Be as st,hn as t,Ue as tt,en as u,K as v,wt as w,Et as x,Ut as y,zt as z};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-C9A1vLE-.js";var t=e(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),n=e(`regex`,[[`path`,{d:`M17 3v10`,key:`15fgeh`}],[`path`,{d:`m12.67 5.5 8.66 5`,key:`1gpheq`}],[`path`,{d:`m12.67 10.5 8.66-5`,key:`1dkfa6`}],[`path`,{d:`M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z`,key:`swwfx4`}]]),r=e(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]);export{n,t as r,r as t};