@gbasin/agentboard-linux-arm64 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/agentboard
CHANGED
|
Binary file
|
|
@@ -219,7 +219,7 @@ void main() {
|
|
|
219
219
|
select-none touch-manipulation
|
|
220
220
|
text-secondary
|
|
221
221
|
${t?`opacity-50`:``}
|
|
222
|
-
`,onMouseDown:e=>e.preventDefault(),onTouchStart:N(j),onClick:P(j),disabled:t,children:vO})]}),l&&(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,q.jsxs)(`div`,{ref:b,className:`mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl`,children:[(0,q.jsx)(`h3`,{className:`text-base font-medium text-primary mb-1 text-balance`,children:`Paste`}),(0,q.jsx)(`p`,{className:`text-xs text-muted mb-3 text-pretty`,children:`Text or image (long-press → Paste)`}),h?(0,q.jsx)(`div`,{className:`w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary`,children:`Uploading image...`}):(0,q.jsx)(`input`,{ref:y,type:`text`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),O()):e.key===`Escape`&&(e.preventDefault(),k())},placeholder:`Paste here...`,className:`w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent`,style:{fontSize:`16px`}}),p&&(0,q.jsx)(`p`,{className:`mt-2 text-xs text-danger`,role:`alert`,children:p}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:k,className:`px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:O,disabled:h,className:`px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50`,children:`Send`})]})]})})]})}function EO({isOpen:e,onClose:t,sessions:n,hibernatingSessions:r=[],historySessions:i=[],selectedSessionId:a,selectedHibernatingSessionId:o=null,onSelect:s,onSelectHibernating:c,onRename:l,onResume:u,onHibernate:d,onMoveToHistory:f,onNewSession:p,loading:m,error:h}){let g=ud(),_=(0,x.useRef)(null),v=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),(0,x.useEffect)(()=>{e?(v.current=document.activeElement,_.current?.focus()):v.current&&=(v.current.focus(),null)},[e]),(0,x.useEffect)(()=>{if(!e)return;let n=_.current;if(!n)return;let r=0,i=0,a=e=>{let t=e.touches[0];r=t.clientX,i=t.clientY},o=e=>{let n=e.changedTouches[0],a=r-n.clientX,o=Math.abs(n.clientY-i);a>=50&&a>o*1.5&&(`vibrate`in navigator&&navigator.vibrate(10),t())};return n.addEventListener(`touchstart`,a,{passive:!0}),n.addEventListener(`touchend`,o,{passive:!0}),()=>{n.removeEventListener(`touchstart`,a),n.removeEventListener(`touchend`,o)}},[e,t]);let y=e=>{s(e),t()},b=e=>{c?.(e),t()},S=g?{transition:`none`}:void 0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`session-drawer-backdrop ${e?`open`:``}`,style:S,onClick:t,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{ref:_,className:`session-drawer ${e?`open`:``}`,style:S,role:`dialog`,"aria-modal":`true`,"aria-label":`Session list`,tabIndex:-1,children:[(0,q.jsx)(WT,{sessions:n,hibernatingSessions:r,historySessions:i,selectedSessionId:a,selectedHibernatingSessionId:o,onSelect:y,onSelectHibernating:b,onRename:l,onResume:u,onHibernate:d,onMoveToHistory:f,onNewSession:()=>{p()!==!1&&t()},loading:m,error:h}),(0,q.jsx)(`div`,{className:`shrink-0 border-t border-border px-2 pt-2`,style:{paddingBottom:`max(0.5rem, env(safe-area-inset-bottom, 0.5rem))`},children:(0,q.jsx)(`button`,{onClick:()=>{p()!==!1&&t()},className:`btn btn-primary w-full py-2 text-sm`,children:`New Session`})})]})]})}var DO={working:`Working`,waiting:`Waiting`,permission:`Needs Input`,unknown:`Unknown`},OO={working:`text-working`,waiting:`text-waiting`,permission:`text-approval`,unknown:`text-muted`},kO={working:`bg-green-500/35 text-white`,waiting:`bg-blue-500/35 text-white`,permission:`bg-amber-500/35 text-white`,unknown:`bg-gray-500/35 text-white`},AO={working:`bg-working text-white`,waiting:`bg-waiting text-white`,permission:`bg-approval text-white`,unknown:`bg-muted text-white`};function jO(){`vibrate`in navigator&&navigator.vibrate(10)}function MO({session:e,sessions:t,hibernatingSession:n=null,hibernatingSessions:r=[],historySessions:i=[],connectionStatus:a,connectionEpoch:o=0,sendMessage:s,subscribe:c,onClose:l,onSelectSession:u,onSelectHibernatingSession:d,onNewSession:f,onKillSession:p,onRenameSession:m,onResumeSession:h,onHibernateSession:g,onMoveToHistory:_,onOpenSettings:v,loading:y=!1,error:b=null}){let S=KD[GD(e=>e.theme)],C=G(e=>e.useWebGL),w=G(e=>e.fontSize),T=G(e=>e.lineHeight),E=G(e=>e.letterSpacing),D=R(G(e=>e.fontOption),G(e=>e.customFontFamily)),O=Ke(We(G(e=>e.shortcutModifier))),k=Ve(),A=VD(),[j,M]=(0,x.useState)(!1),[N,P]=(0,x.useState)(!1),[F,I]=(0,x.useState)(!1),[L,z]=(0,x.useState)(!1),[B,V]=(0,x.useState)(!1),[H,U]=(0,x.useState)(!1),[W,ee]=(0,x.useState)(``),K=(0,x.useRef)(!1),te=(0,x.useRef)(null),re=(0,x.useRef)(null),ie=(0,x.useRef)(null),ae=(0,x.useRef)(null),oe=e?.remote===!0,se=Wm(e=>e.remoteAllowControl),le=Wm(e=>e.remoteAllowAttach),ue=Wm(e=>e.preferWindowName),de=oe&&!le,pe=!oe||se&&e?.source===`managed`,he=n?n.displayName||Nm(n.projectPath)||n.sessionId.slice(0,8):``,ge=n?Nm(n.projectPath):``,_e=n?Mm(n.lastActivityAt):``,ve=!!e&&!!g&&e.source===`managed`&&!e.remote&&!!e.agentSessionId?.trim(),{containerRef:ye,terminalRef:be,inTmuxCopyModeRef:xe,appMouseRef:Ce,setTmuxCopyMode:Te,isSwitching:Ee,pendingClipboardOffer:De,copyPendingClipboardOffer:Oe,dismissPendingClipboardOffer:ke}=BD({sessionId:e?.id??null,tmuxTarget:e?.tmuxWindow??null,agentType:e?.agentType,allowAttach:!de,connectionStatus:a,connectionEpoch:o,sendMessage:s,subscribe:c,theme:S,fontSize:w,lineHeight:T,letterSpacing:E,fontFamily:D,useWebGL:C,onScrollChange:e=>{M(!e)}}),je=(0,x.useCallback)(()=>{!e||de||(s({type:`tmux-cancel-copy-mode`,sessionId:e.id}),Te(!1),be.current?.scrollToBottom())},[e,de,s,Te,be]),Me=(0,x.useCallback)(()=>{V(!0),jO()},[]),Ne=WD({enabled:A||k,isOpen:B,onOpen:Me});(0,x.useEffect)(()=>{!A&&!k&&B&&V(!1)},[B,A,k]),HD(re,L,(0,x.useCallback)(()=>z(!1),[])),(0,x.useEffect)(()=>{H&&ie.current&&(ie.current.focus(),ie.current.select())},[H]),(0,x.useEffect)(()=>{F&&ae.current&&ae.current.focus()},[F]),UD(F,(0,x.useCallback)(()=>I(!1),[]));let Fe=()=>{e&&(p(e.id,`terminal_confirm_modal`),I(!1))},Ie=()=>{!e||!ve||(g?.(e.agentSessionId.trim()),z(!1))},Le=()=>{e&&(ee(e.agentSessionName||e.name),U(!0),z(!1))},Re=()=>{if(!e)return;let t=W.trim(),n=e.agentSessionName||e.name;t&&t!==n&&m(e.id,t),U(!1)},ze=e=>{e.key===`Enter`?(e.preventDefault(),Re()):e.key===`Escape`&&(e.preventDefault(),U(!1))};(0,x.useEffect)(()=>{if(!k||!e){P(!1);return}let t=ye.current;if(!t)return;let n=e=>{let n=t.querySelector(`.xterm-accessibility-tree`);if(!n)return!1;let r=e.anchorNode,i=e.focusNode;return!!r&&n.contains(r)||!!i&&n.contains(i)},r=()=>{let e=t.querySelector(`.xterm-accessibility`),n=t.querySelector(`.xterm-accessibility-tree`);!e||!n||(e.style.setProperty(`opacity`,`0`),n.style.setProperty(`opacity`,`0`),e.style.setProperty(`-webkit-user-select`,`none`),e.style.setProperty(`user-select`,`none`),n.style.setProperty(`-webkit-user-select`,`none`),n.style.setProperty(`user-select`,`none`),e.offsetHeight,requestAnimationFrame(()=>{e.style.removeProperty(`opacity`),n.style.removeProperty(`opacity`),e.style.removeProperty(`-webkit-user-select`),e.style.removeProperty(`user-select`),n.style.removeProperty(`-webkit-user-select`),n.style.removeProperty(`user-select`)}))},i=()=>{K.current=!1;let e=window.getSelection();try{e?.removeAllRanges()}catch{}be.current?.clearSelection(),r(),P(!1)};te.current=i;let a=()=>{let e=window.getSelection();if(!e||e.rangeCount===0||e.isCollapsed){K.current?i():P(e=>e&&!1);return}let t=n(e);if(!t&&K.current){i();return}K.current=t;let r=t;P(e=>e===r?e:r)},o=()=>{let e=window.getSelection();!e||e.isCollapsed||n(e)&&setTimeout(i,0)},s=null,c=!1,l=e=>{if(e.touches.length===1){let t=e.touches[0];s={x:t.clientX,y:t.clientY},c=!1}},u=e=>{if(c||!s||e.touches.length!==1)return;let t=e.touches[0],n=Math.abs(t.clientX-s.x),r=Math.abs(t.clientY-s.y);(n>10||r>10)&&(c=!0)},d=e=>{let r=c;s=null,c=!1;let a=window.getSelection();if(!a||a.rangeCount===0||a.isCollapsed){P(!1);return}let o=t.querySelector(`.xterm-accessibility-tree`);if(!o)return;if(!n(a)){P(!1);return}if(r)return;let l=e.target,u=l?o.contains(l):!1,d=!1;if(u&&l)try{d=a.containsNode(l,!0)}catch{d=!1}(!u||!d)&&setTimeout(i,0)};return document.addEventListener(`selectionchange`,a),document.addEventListener(`copy`,o),document.addEventListener(`touchstart`,l,{passive:!0}),document.addEventListener(`touchmove`,u,{passive:!0}),document.addEventListener(`touchend`,d,{passive:!0}),()=>{document.removeEventListener(`selectionchange`,a),document.removeEventListener(`copy`,o),document.removeEventListener(`touchstart`,l),document.removeEventListener(`touchmove`,u),document.removeEventListener(`touchend`,d),te.current=null,K.current=!1}},[ye,k,e?.id]),(0,x.useEffect)(()=>{if(!k)return;let t=ye.current;if(!t)return;let n=()=>{let e=be.current,n=t.querySelector(`.xterm`);if(!e||!n)return;let r=n.querySelector(`.xterm-screen`),i=n.querySelector(`.xterm-accessibility`),a=n.querySelector(`.xterm-accessibility-tree`);if(!r||!i||!a)return;let o=n.getBoundingClientRect(),s=r.getBoundingClientRect(),c=s.left-o.left,l=s.top-o.top;Object.assign(i.style,{left:`${c}px`,top:`${l}px`,right:`auto`,bottom:`auto`,width:`${s.width}px`,height:`${s.height}px`});let u=s.width/e.cols,d=s.height/e.rows,f=document.createElement(`span`);f.textContent=`0`.repeat(200),f.style.cssText=`position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px`,a.appendChild(f);let p=f.getBoundingClientRect().width/200;f.remove();let m=Math.max(-2,Math.min(2,u-p));t.style.setProperty(`--xterm-font-size`,`${e.options.fontSize}px`),t.style.setProperty(`--xterm-cell-height`,`${d}px`),t.style.setProperty(`--xterm-a11y-letter-spacing`,`${m}px`)},r=performance.now();n();let i=Math.round(performance.now()-r);i>10&&Z(`switch_a11y_overlay`,{sessionId:e?.id,a11yMs:i});let a=window.requestAnimationFrame(n),o=window.setTimeout(n,100),s=()=>window.requestAnimationFrame(n);return window.visualViewport?.addEventListener(`resize`,s),window.addEventListener(`orientationchange`,s),()=>{window.cancelAnimationFrame(a),window.clearTimeout(o),window.visualViewport?.removeEventListener(`resize`,s),window.removeEventListener(`orientationchange`,s)}},[ye,w,k,e?.id,be]);let He=(0,x.useRef)(N);(0,x.useEffect)(()=>{He.current=N},[N]);let Ue=(0,x.useRef)(e?.id);(0,x.useEffect)(()=>{Ue.current=e?.id},[e?.id]);let Ge=(0,x.useRef)(s);(0,x.useEffect)(()=>{Ge.current=s},[s]);let qe=(0,x.useRef)(!1);(0,x.useEffect)(()=>{let t=ye.current;if(!t||!e?.id||!A&&!k)return;let n={x:0,y:0},r=0,i=!1,a=null,o=0,s=0,c=0,l=Math.round(w*T),u=null,d=null,f=!1,p=null,m=()=>{let e=window.getComputedStyle(t).getPropertyValue(`--xterm-cell-height`).trim(),n=Number.parseFloat(e);return!Number.isNaN(n)&&n>0?n:Math.round(w*T)},h=()=>t.querySelector(`.xterm-helper-textarea`),g=e=>{let n=be.current;if(!n)return null;let r=(t.querySelector(`.xterm`)?.querySelector(`.xterm-screen`))?.getBoundingClientRect();if(!r||r.width<=0||r.height<=0)return null;let i=r.width/n.cols,a=r.height/n.rows;return i<=0||a<=0?null:{col:Math.min(n.cols,Math.max(1,Math.floor((e.clientX-r.left)/i)+1)),row:Math.min(n.rows,Math.max(1,Math.floor((e.clientY-r.top)/a)+1))}},_=()=>{let e=h();e&&document.activeElement!==e&&(e.disabled=!0)},v=()=>{let e=h();e&&(e.disabled=!1)};_();let y=()=>{if(xe.current)return;let e=h();e&&(e.disabled=!1,e.focus())},b=()=>{u!==null&&(cancelAnimationFrame(u),u=null),s=0},x=()=>{d!==null&&(clearTimeout(d),d=null)},S=(e,t,n)=>{let r=Ue.current;return r?(Ge.current({type:`terminal-input`,sessionId:r,data:`\x1b[<${e};${t.col};${t.row}${n}`}),!0):!1},C=e=>{let t=Ue.current;if(!t||e===0)return!1;let n=be.current,r=n?.cols??80,i=n?.rows??24,a=Math.floor(r/2),o=Math.floor(i/2),s=e>0?65:64,c=Math.abs(e),l=e<0;for(let e=0;e<c;e++)Ge.current({type:`terminal-input`,sessionId:t,data:`\x1b[<${s};${a};${o}M`});return l&&!Ce.current&&Te(!0),l},E=e=>{let t=Ue.current,n=g(e);return!t||!n?!1:(Ge.current({type:`terminal-input`,sessionId:t,data:`\x1b[<0;${n.col};${n.row}M\x1b[<0;${n.col};${n.row}m`}),!0)},D=e=>{if(!k||!Ce.current)return!1;let t=g(e);return t?(f=!0,p=t,_(),jO(),S(0,t,`M`)):!1},O=e=>{let t=g(e);return t?p&&p.col===t.col&&p.row===t.row?!0:(p=t,S(32,t,`M`)):!1},j=e=>{let t=e?g(e):p;return f=!1,p=null,t?S(0,t,`m`):!1},M=()=>{x(),f=!1,p=null,a=null,s=0,c=0},N=()=>{if(!k)return!1;let e=window.getSelection();if(!e||e.isCollapsed)return!1;let n=t.querySelector(`.xterm-accessibility-tree`);if(!n)return!1;let r=e.anchorNode,i=e.focusNode;return!!r&&n.contains(r)||!!i&&n.contains(i)},P=()=>{!k||!K.current||N()||te.current?.()},F=e=>{if(b(),P(),Ne.current||B){M();return}if(He.current){M();return}if(e.touches.length===1){let t=e.touches[0];if(n={x:t.clientX,y:t.clientY},r=performance.now(),i=!1,a=t.clientY,o=r,s=0,c=0,l=m(),v(),k&&Ce.current){let e={clientX:t.clientX,clientY:t.clientY};d=setTimeout(()=>{d=null,!(i||Ne.current||B)&&(He.current||N()||D(e))},350)}}},I=e=>{if(e.touches.length!==1||a===null)return;if(P(),Ne.current||B){M();return}let t=performance.now(),r=e.touches[0],u=r.clientX,d=r.clientY;if(f){e.preventDefault(),e.stopPropagation(),O(r),a=d,o=t;return}if(He.current||N()){M();return}e.preventDefault(),e.stopPropagation();let p=Math.abs(u-n.x),m=Math.abs(d-n.y);!i&&(p>6||m>6)&&(i=!0,x(),_());let h=a-d,g=t-o;if(a=d,o=t,g>0){let e=h/g;s=s*.7+e*.3}c+=h;let v=Math.max(6,l*.6),y=Math.trunc(c/v);y!==0&&(C(y),c-=y*v)},L=e=>{let t=s,n=performance.now()-r;if(x(),f){j(e.changedTouches[0]),M(),e.preventDefault(),e.stopPropagation();return}if(M(),Ne.current||B)return;let a=N();if(He.current&&!a&&te.current?.(),He.current||a){xe.current&&(qe.current=!0);return}if(!i){if(k&&n>=350)return;if(Ce.current){let t=e.changedTouches[0];if(t&&E(t)){e.preventDefault(),e.stopPropagation();return}}if(xe.current){e.preventDefault(),e.stopPropagation(),qe.current=!0;return}y();return}if(Math.abs(t)>.12){let e=t,n=performance.now(),r=()=>{let t=performance.now(),i=t-n;n=t;let a=e*i;c+=a;let o=Math.max(6,l*.6),s=Math.trunc(c/o);s!==0&&(C(s),c-=s*o),e*=.95**(i/16.67),u=Math.abs(e)>.02?requestAnimationFrame(r):null};u=requestAnimationFrame(r)}},R=e=>{qe.current&&=(e.preventDefault(),e.stopPropagation(),!1)},z={passive:!0,capture:!0},V={passive:!1,capture:!0},H={passive:!1,capture:!0},U={capture:!0};return t.addEventListener(`touchstart`,F,z),t.addEventListener(`touchmove`,I,V),t.addEventListener(`touchend`,L,H),t.addEventListener(`mousedown`,R,U),()=>{t.removeEventListener(`touchstart`,F,z),t.removeEventListener(`touchmove`,I,V),t.removeEventListener(`touchend`,L,H),t.removeEventListener(`mousedown`,R,U),x();let e=h();e&&(e.disabled=!1)}},[e?.id,ye,be,k,A,B,w,T]);let Je=(0,x.useCallback)(t=>{!e||de||s({type:`terminal-input`,sessionId:e.id,data:t})},[e,de,s]),Ye=(0,x.useCallback)(()=>{let e=ye.current;if(!e)return;let t=e.querySelector(`.xterm-helper-textarea`);t&&(t.removeAttribute(`disabled`),t.focus())},[ye]),Xe=(0,x.useCallback)(()=>{if(!e||de)return;xe.current&&(s({type:`tmux-cancel-copy-mode`,sessionId:e.id}),Te(!1));let t=ye.current;if(!t)return;let n=t.querySelector(`.xterm-helper-textarea`);n&&(n.removeAttribute(`disabled`),n.focus())},[e,de,s,ye,xe,Te]),Ze=(0,x.useCallback)(()=>{if(typeof document>`u`)return!1;let e=ye.current;if(!e)return!1;let t=e.querySelector(`.xterm-helper-textarea`);if(t&&document.activeElement===t)return!0;let n=document.activeElement,r=typeof HTMLInputElement<`u`&&n instanceof HTMLInputElement,i=typeof HTMLTextAreaElement<`u`&&n instanceof HTMLTextAreaElement;return r||i||n&&n.isContentEditable?!1:!!document.documentElement?.classList?.contains(`keyboard-visible`)},[ye]);(0,x.useEffect)(()=>{if(!k)return;let e=ye.current;if(!e)return;let t=e.querySelector(`.xterm-accessibility`),n=e.querySelector(`.xterm-accessibility-tree`);if(!t||!n)return;let r=()=>{let r=e.querySelector(`.xterm-helper-textarea`);r&&document.activeElement===r&&!He.current?(t.style.pointerEvents=`none`,n.style.pointerEvents=`none`):(t.style.removeProperty(`pointer-events`),n.style.removeProperty(`pointer-events`))};return r(),document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,r),()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,r)}},[ye,k,N]),(0,x.useEffect)(()=>{let e=ye.current;e&&(e.inert=!!n)},[ye,n]);let Qe=(0,x.useMemo)(()=>{if(!ue||t.length===0)return!1;let e=t.map(e=>e.name.trim()).filter(Boolean);return e.length===t.length&&new Set(e).size===t.length},[ue,t]);return(0,q.jsxs)(`section`,{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${k?`ios-native-term-selection`:``}`,"data-testid":`terminal-panel`,children:[(0,q.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e||n?``:`md:hidden`}`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,q.jsx)(`button`,{onClick:()=>V(!0),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0`,"aria-label":`Open session menu`,children:(0,q.jsx)(Se,{width:16,height:16})}),e&&pe&&(0,q.jsx)(`button`,{onClick:()=>I(!0),className:`hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0`,title:`Kill session (${O}X)`,"aria-label":`Kill session`,children:(0,q.jsx)(Be,{width:16,height:16})}),ve&&(0,q.jsx)(`button`,{onClick:Ie,className:`hidden md:flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all shrink-0`,title:`Hibernate session`,"aria-label":`Hibernate session`,children:(0,q.jsx)(we,{width:16,height:16})}),e?(0,q.jsxs)(`div`,{className:`flex items-baseline gap-3 min-w-0`,children:[H?(0,q.jsx)(`input`,{ref:ie,type:`text`,value:W,onChange:e=>ee(e.target.value),onBlur:Re,onKeyDown:ze,className:`w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent`}):(0,q.jsx)(`span`,{className:`text-sm font-medium text-primary truncate`,children:e.agentSessionName||e.name}),(0,q.jsx)(`span`,{className:`text-xs shrink-0 ${OO[e.status]}`,children:DO[e.status]})]}):n?(0,q.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-primary truncate`,children:he}),(0,q.jsx)(`span`,{className:`rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-400`,children:`Hibernating`})]}):(0,q.jsx)(`span`,{className:`text-sm font-medium text-primary md:hidden`,children:`Sessions`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[a!==`connected`&&(0,q.jsx)(`span`,{className:`text-xs text-approval`,children:a}),(0,q.jsx)(`button`,{onClick:f,className:`flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden`,title:`New session (${O}N)`,"aria-label":`New session`,children:(0,q.jsx)(Ae,{width:16,height:16})}),e&&pe&&(0,q.jsx)(`button`,{onClick:()=>I(!0),className:`flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all`,title:`Kill session (${O}X)`,"aria-label":`Kill session`,children:(0,q.jsx)(Be,{width:16,height:16})}),ve&&(0,q.jsx)(`button`,{onClick:Ie,className:`flex md:hidden h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`Hibernate session`,"aria-label":`Hibernate session`,children:(0,q.jsx)(we,{width:16,height:16})}),n&&(0,q.jsx)(`button`,{onClick:()=>h(n.sessionId),className:`btn btn-primary h-7 px-2 text-xs md:hidden`,children:`Wake`}),e&&(0,q.jsxs)(`div`,{className:`relative md:hidden`,ref:re,children:[(0,q.jsx)(`button`,{onClick:()=>z(!L),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`More options`,"aria-label":`More options`,children:(0,q.jsx)(fe,{width:16,height:16})}),L&&(0,q.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1`,children:[pe&&(0,q.jsxs)(`button`,{onClick:Le,className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,children:[(0,q.jsx)(me,{width:14,height:14}),`Rename`]}),ve&&(0,q.jsxs)(`button`,{onClick:Ie,className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,children:[(0,q.jsx)(we,{width:14,height:14}),`Hibernate`]}),(0,q.jsxs)(`button`,{onClick:()=>{v(),z(!1)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,children:[(0,q.jsx)(Pe,{width:14,height:14}),`Settings`]})]})]})]})]}),e&&t.length>1&&(0,q.jsxs)(`div`,{className:`relative overflow-hidden bg-elevated border-b border-border md:hidden`,children:[(0,q.jsx)(`div`,{className:`absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none`}),(0,q.jsx)(`div`,{className:`flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory`,style:{WebkitOverflowScrolling:`touch`},children:t.map((t,n)=>{let r=t.id===e.id,i=Qe?t.name.trim():n+1;return(0,q.jsx)(`button`,{type:`button`,className:`
|
|
222
|
+
`,onMouseDown:e=>e.preventDefault(),onTouchStart:N(j),onClick:P(j),disabled:t,children:vO})]}),l&&(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,q.jsxs)(`div`,{ref:b,className:`mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl`,children:[(0,q.jsx)(`h3`,{className:`text-base font-medium text-primary mb-1 text-balance`,children:`Paste`}),(0,q.jsx)(`p`,{className:`text-xs text-muted mb-3 text-pretty`,children:`Text or image (long-press → Paste)`}),h?(0,q.jsx)(`div`,{className:`w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary`,children:`Uploading image...`}):(0,q.jsx)(`input`,{ref:y,type:`text`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),O()):e.key===`Escape`&&(e.preventDefault(),k())},placeholder:`Paste here...`,className:`w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent`,style:{fontSize:`16px`}}),p&&(0,q.jsx)(`p`,{className:`mt-2 text-xs text-danger`,role:`alert`,children:p}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:k,className:`px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:O,disabled:h,className:`px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50`,children:`Send`})]})]})})]})}function EO({isOpen:e,onClose:t,sessions:n,hibernatingSessions:r=[],historySessions:i=[],selectedSessionId:a,selectedHibernatingSessionId:o=null,onSelect:s,onSelectHibernating:c,onRename:l,onResume:u,onHibernate:d,onMoveToHistory:f,onNewSession:p,loading:m,error:h}){let g=ud(),_=(0,x.useRef)(null),v=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),(0,x.useEffect)(()=>{e?(v.current=document.activeElement,_.current?.focus()):v.current&&=(v.current.focus(),null)},[e]),(0,x.useEffect)(()=>{if(!e)return;let n=_.current;if(!n)return;let r=0,i=0,a=e=>{let t=e.touches[0];r=t.clientX,i=t.clientY},o=e=>{let n=e.changedTouches[0],a=r-n.clientX,o=Math.abs(n.clientY-i);a>=50&&a>o*1.5&&(`vibrate`in navigator&&navigator.vibrate(10),t())};return n.addEventListener(`touchstart`,a,{passive:!0}),n.addEventListener(`touchend`,o,{passive:!0}),()=>{n.removeEventListener(`touchstart`,a),n.removeEventListener(`touchend`,o)}},[e,t]);let y=e=>{s(e),t()},b=e=>{c?.(e),t()},S=g?{transition:`none`}:void 0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`session-drawer-backdrop ${e?`open`:``}`,style:S,onClick:t,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{ref:_,className:`session-drawer ${e?`open`:``}`,style:S,role:`dialog`,"aria-modal":`true`,"aria-label":`Session list`,tabIndex:-1,children:[(0,q.jsx)(WT,{sessions:n,hibernatingSessions:r,historySessions:i,selectedSessionId:a,selectedHibernatingSessionId:o,onSelect:y,onSelectHibernating:b,onRename:l,onResume:u,onHibernate:d,onMoveToHistory:f,onNewSession:()=>{p()!==!1&&t()},loading:m,error:h}),(0,q.jsx)(`div`,{className:`shrink-0 border-t border-border px-2 pt-2`,style:{paddingBottom:`max(0.5rem, env(safe-area-inset-bottom, 0.5rem))`},children:(0,q.jsx)(`button`,{onClick:()=>{p()!==!1&&t()},className:`btn btn-primary w-full py-2 text-sm`,children:`New Session`})})]})]})}var DO={working:`Working`,waiting:`Waiting`,permission:`Needs Input`,unknown:`Unknown`},OO={working:`text-working`,waiting:`text-waiting`,permission:`text-approval`,unknown:`text-muted`},kO={working:`bg-green-500/35 text-white`,waiting:`bg-blue-500/35 text-white`,permission:`bg-amber-500/35 text-white`,unknown:`bg-gray-500/35 text-white`},AO={working:`bg-working text-white`,waiting:`bg-waiting text-white`,permission:`bg-approval text-white`,unknown:`bg-muted text-white`};function jO(){`vibrate`in navigator&&navigator.vibrate(10)}function MO({session:e,sessions:t,hibernatingSession:n=null,hibernatingSessions:r=[],historySessions:i=[],connectionStatus:a,connectionEpoch:o=0,sendMessage:s,subscribe:c,onClose:l,onSelectSession:u,onSelectHibernatingSession:d,onNewSession:f,onKillSession:p,onRenameSession:m,onResumeSession:h,onHibernateSession:g,onMoveToHistory:_,onOpenSettings:v,loading:y=!1,error:b=null}){let S=KD[GD(e=>e.theme)],C=G(e=>e.useWebGL),w=G(e=>e.fontSize),T=G(e=>e.lineHeight),E=G(e=>e.letterSpacing),D=R(G(e=>e.fontOption),G(e=>e.customFontFamily)),O=Ke(We(G(e=>e.shortcutModifier))),k=Ve(),A=VD(),[j,M]=(0,x.useState)(!1),[N,P]=(0,x.useState)(!1),[F,I]=(0,x.useState)(!1),[L,z]=(0,x.useState)(!1),[B,V]=(0,x.useState)(!1),[H,U]=(0,x.useState)(!1),[W,ee]=(0,x.useState)(``),K=(0,x.useRef)(!1),te=(0,x.useRef)(null),re=(0,x.useRef)(null),ie=(0,x.useRef)(null),ae=(0,x.useRef)(null),oe=e?.remote===!0,se=Wm(e=>e.remoteAllowControl),le=Wm(e=>e.remoteAllowAttach),ue=Wm(e=>e.preferWindowName),de=oe&&!le,pe=!oe||se&&e?.source===`managed`,he=n?n.displayName||Nm(n.projectPath)||n.sessionId.slice(0,8):``,ge=n?Nm(n.projectPath):``,_e=n?Mm(n.lastActivityAt):``,ve=!!e&&!!g&&e.source===`managed`&&!e.remote&&!!e.agentSessionId?.trim(),{containerRef:ye,terminalRef:be,inTmuxCopyModeRef:xe,appMouseRef:Ce,setTmuxCopyMode:Te,isSwitching:Ee,pendingClipboardOffer:De,copyPendingClipboardOffer:Oe,dismissPendingClipboardOffer:ke}=BD({sessionId:e?.id??null,tmuxTarget:e?.tmuxWindow??null,agentType:e?.agentType,allowAttach:!de,connectionStatus:a,connectionEpoch:o,sendMessage:s,subscribe:c,theme:S,fontSize:w,lineHeight:T,letterSpacing:E,fontFamily:D,useWebGL:C,onScrollChange:e=>{M(!e)}}),je=(0,x.useCallback)(()=>{!e||de||(s({type:`tmux-cancel-copy-mode`,sessionId:e.id}),Te(!1),be.current?.scrollToBottom())},[e,de,s,Te,be]),Me=(0,x.useCallback)(()=>{V(!0),jO()},[]),Ne=WD({enabled:A||k,isOpen:B,onOpen:Me});(0,x.useEffect)(()=>{!A&&!k&&B&&V(!1)},[B,A,k]),HD(re,L,(0,x.useCallback)(()=>z(!1),[])),(0,x.useEffect)(()=>{H&&ie.current&&(ie.current.focus(),ie.current.select())},[H]),(0,x.useEffect)(()=>{F&&ae.current&&ae.current.focus()},[F]),UD(F,(0,x.useCallback)(()=>I(!1),[]));let Fe=()=>{e&&(p(e.id,`terminal_confirm_modal`),I(!1))},Ie=()=>{!e||!ve||(g?.(e.agentSessionId.trim()),z(!1))},Le=()=>{e&&(ee(e.agentSessionName||e.name),U(!0),z(!1))},Re=()=>{if(!e)return;let t=W.trim(),n=e.agentSessionName||e.name;t&&t!==n&&m(e.id,t),U(!1)},ze=e=>{e.key===`Enter`?(e.preventDefault(),Re()):e.key===`Escape`&&(e.preventDefault(),U(!1))};(0,x.useEffect)(()=>{if(!k||!e){P(!1);return}let t=ye.current;if(!t)return;let n=e=>{let n=t.querySelector(`.xterm-accessibility-tree`);if(!n)return!1;let r=e.anchorNode,i=e.focusNode;return!!r&&n.contains(r)||!!i&&n.contains(i)},r=()=>{let e=t.querySelector(`.xterm-accessibility`),n=t.querySelector(`.xterm-accessibility-tree`);!e||!n||(e.style.setProperty(`opacity`,`0`),n.style.setProperty(`opacity`,`0`),e.style.setProperty(`-webkit-user-select`,`none`),e.style.setProperty(`user-select`,`none`),n.style.setProperty(`-webkit-user-select`,`none`),n.style.setProperty(`user-select`,`none`),e.offsetHeight,requestAnimationFrame(()=>{e.style.removeProperty(`opacity`),n.style.removeProperty(`opacity`),e.style.removeProperty(`-webkit-user-select`),e.style.removeProperty(`user-select`),n.style.removeProperty(`-webkit-user-select`),n.style.removeProperty(`user-select`)}))},i=()=>{K.current=!1;let e=window.getSelection();try{e?.removeAllRanges()}catch{}be.current?.clearSelection(),r(),P(!1)};te.current=i;let a=()=>{let e=window.getSelection();if(!e||e.rangeCount===0||e.isCollapsed){K.current?i():P(e=>e&&!1);return}let t=n(e);if(!t&&K.current){i();return}K.current=t;let r=t;P(e=>e===r?e:r)},o=()=>{let e=window.getSelection();!e||e.isCollapsed||n(e)&&setTimeout(i,0)},s=null,c=!1,l=e=>{if(e.touches.length===1){let t=e.touches[0];s={x:t.clientX,y:t.clientY},c=!1}},u=e=>{if(c||!s||e.touches.length!==1)return;let t=e.touches[0],n=Math.abs(t.clientX-s.x),r=Math.abs(t.clientY-s.y);(n>10||r>10)&&(c=!0)},d=e=>{let r=c;s=null,c=!1;let a=window.getSelection();if(!a||a.rangeCount===0||a.isCollapsed){P(!1);return}let o=t.querySelector(`.xterm-accessibility-tree`);if(!o)return;if(!n(a)){P(!1);return}if(r)return;let l=e.target,u=l?o.contains(l):!1,d=!1;if(u&&l)try{d=a.containsNode(l,!0)}catch{d=!1}(!u||!d)&&setTimeout(i,0)};return document.addEventListener(`selectionchange`,a),document.addEventListener(`copy`,o),document.addEventListener(`touchstart`,l,{passive:!0}),document.addEventListener(`touchmove`,u,{passive:!0}),document.addEventListener(`touchend`,d,{passive:!0}),()=>{document.removeEventListener(`selectionchange`,a),document.removeEventListener(`copy`,o),document.removeEventListener(`touchstart`,l),document.removeEventListener(`touchmove`,u),document.removeEventListener(`touchend`,d),te.current=null,K.current=!1}},[ye,k,e?.id]),(0,x.useEffect)(()=>{if(!k)return;let t=ye.current;if(!t)return;let n=()=>{let e=be.current,n=t.querySelector(`.xterm`);if(!e||!n)return;let r=n.querySelector(`.xterm-screen`),i=n.querySelector(`.xterm-accessibility`),a=n.querySelector(`.xterm-accessibility-tree`);if(!r||!i||!a)return;let o=n.getBoundingClientRect(),s=r.getBoundingClientRect(),c=s.left-o.left,l=s.top-o.top;Object.assign(i.style,{left:`${c}px`,top:`${l}px`,right:`auto`,bottom:`auto`,width:`${s.width}px`,height:`${s.height}px`});let u=s.width/e.cols,d=s.height/e.rows,f=document.createElement(`span`);f.textContent=`0`.repeat(200),f.style.cssText=`position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px`,a.appendChild(f);let p=f.getBoundingClientRect().width/200;f.remove();let m=Math.max(-2,Math.min(2,u-p));t.style.setProperty(`--xterm-font-size`,`${e.options.fontSize}px`),t.style.setProperty(`--xterm-cell-height`,`${d}px`),t.style.setProperty(`--xterm-a11y-letter-spacing`,`${m}px`)},r=performance.now();n();let i=Math.round(performance.now()-r);i>10&&Z(`switch_a11y_overlay`,{sessionId:e?.id,a11yMs:i});let a=window.requestAnimationFrame(n),o=window.setTimeout(n,100),s=()=>window.requestAnimationFrame(n);return window.visualViewport?.addEventListener(`resize`,s),window.addEventListener(`orientationchange`,s),()=>{window.cancelAnimationFrame(a),window.clearTimeout(o),window.visualViewport?.removeEventListener(`resize`,s),window.removeEventListener(`orientationchange`,s)}},[ye,w,k,e?.id,be]);let He=(0,x.useRef)(N);(0,x.useEffect)(()=>{He.current=N},[N]);let Ue=(0,x.useRef)(e?.id);(0,x.useEffect)(()=>{Ue.current=e?.id},[e?.id]);let Ge=(0,x.useRef)(s);(0,x.useEffect)(()=>{Ge.current=s},[s]);let qe=(0,x.useRef)(!1);(0,x.useEffect)(()=>{let t=ye.current;if(!t||!e?.id||!A&&!k)return;let n={x:0,y:0},r=0,i=!1,a=null,o=0,s=0,c=0,l=Math.round(w*T),u=null,d=null,f=!1,p=null,m=()=>{let e=window.getComputedStyle(t).getPropertyValue(`--xterm-cell-height`).trim(),n=Number.parseFloat(e);return!Number.isNaN(n)&&n>0?n:Math.round(w*T)},h=()=>t.querySelector(`.xterm-helper-textarea`),g=e=>{let n=be.current;if(!n)return null;let r=(t.querySelector(`.xterm`)?.querySelector(`.xterm-screen`))?.getBoundingClientRect();if(!r||r.width<=0||r.height<=0)return null;let i=r.width/n.cols,a=r.height/n.rows;return i<=0||a<=0?null:{col:Math.min(n.cols,Math.max(1,Math.floor((e.clientX-r.left)/i)+1)),row:Math.min(n.rows,Math.max(1,Math.floor((e.clientY-r.top)/a)+1))}},_=()=>{let e=h();e&&document.activeElement!==e&&(e.disabled=!0)},v=()=>{let e=h();e&&(e.disabled=!1)};_();let y=()=>{if(xe.current)return;let e=h();e&&(e.disabled=!1,e.focus())},b=()=>{u!==null&&(cancelAnimationFrame(u),u=null),s=0},x=()=>{d!==null&&(clearTimeout(d),d=null)},S=(e,t,n)=>{let r=Ue.current;return r?(Ge.current({type:`terminal-input`,sessionId:r,data:`\x1b[<${e};${t.col};${t.row}${n}`}),!0):!1},C=e=>{let t=Ue.current;if(!t||e===0)return!1;let n=be.current,r=n?.cols??80,i=n?.rows??24,a=Math.floor(r/2),o=Math.floor(i/2),s=e>0?65:64,c=Math.abs(e),l=e<0;for(let e=0;e<c;e++)Ge.current({type:`terminal-input`,sessionId:t,data:`\x1b[<${s};${a};${o}M`});return l&&!Ce.current&&Te(!0),l},E=e=>{let t=Ue.current,n=g(e);return!t||!n?!1:(Ge.current({type:`terminal-input`,sessionId:t,data:`\x1b[<0;${n.col};${n.row}M\x1b[<0;${n.col};${n.row}m`}),!0)},D=e=>{if(!k||!Ce.current)return!1;let t=g(e);return t?(f=!0,p=t,_(),jO(),S(0,t,`M`)):!1},O=e=>{let t=g(e);return t?p&&p.col===t.col&&p.row===t.row?!0:(p=t,S(32,t,`M`)):!1},j=e=>{let t=e?g(e):p;return f=!1,p=null,t?S(0,t,`m`):!1},M=()=>{x(),f=!1,p=null,a=null,s=0,c=0},N=()=>{if(!k)return!1;let e=window.getSelection();if(!e||e.isCollapsed)return!1;let n=t.querySelector(`.xterm-accessibility-tree`);if(!n)return!1;let r=e.anchorNode,i=e.focusNode;return!!r&&n.contains(r)||!!i&&n.contains(i)},P=()=>{!k||!K.current||N()||te.current?.()},F=e=>{if(b(),P(),Ne.current||B){M();return}if(He.current){M();return}if(e.touches.length===1){let t=e.touches[0];if(n={x:t.clientX,y:t.clientY},r=performance.now(),i=!1,a=t.clientY,o=r,s=0,c=0,l=m(),v(),k&&Ce.current){let e={clientX:t.clientX,clientY:t.clientY};d=setTimeout(()=>{d=null,!(i||Ne.current||B)&&(He.current||N()||D(e))},350)}}},I=e=>{if(e.touches.length!==1||a===null)return;if(P(),Ne.current||B){M();return}let t=performance.now(),r=e.touches[0],u=r.clientX,d=r.clientY;if(f){e.preventDefault(),e.stopPropagation(),O(r),a=d,o=t;return}if(He.current||N()){M();return}e.preventDefault(),e.stopPropagation();let p=Math.abs(u-n.x),m=Math.abs(d-n.y);!i&&(p>6||m>6)&&(i=!0,x(),_());let h=a-d,g=t-o;if(a=d,o=t,g>0){let e=h/g;s=s*.7+e*.3}c+=h;let v=Math.max(6,l*.6),y=Math.trunc(c/v);y!==0&&(C(y),c-=y*v)},L=e=>{let t=s,n=performance.now()-r;if(x(),f){j(e.changedTouches[0]),M(),e.preventDefault(),e.stopPropagation();return}if(M(),Ne.current||B)return;let a=N();if(He.current&&!a&&te.current?.(),He.current||a){xe.current&&(qe.current=!0);return}if(!i){if(k&&n>=350)return;if(Ce.current){let t=e.changedTouches[0];if(t&&E(t)){y(),e.preventDefault(),e.stopPropagation();return}}if(xe.current){e.preventDefault(),e.stopPropagation(),qe.current=!0;return}y();return}if(Math.abs(t)>.12){let e=t,n=performance.now(),r=()=>{let t=performance.now(),i=t-n;n=t;let a=e*i;c+=a;let o=Math.max(6,l*.6),s=Math.trunc(c/o);s!==0&&(C(s),c-=s*o),e*=.95**(i/16.67),u=Math.abs(e)>.02?requestAnimationFrame(r):null};u=requestAnimationFrame(r)}},R=e=>{qe.current&&=(e.preventDefault(),e.stopPropagation(),!1)},z={passive:!0,capture:!0},V={passive:!1,capture:!0},H={passive:!1,capture:!0},U={capture:!0};return t.addEventListener(`touchstart`,F,z),t.addEventListener(`touchmove`,I,V),t.addEventListener(`touchend`,L,H),t.addEventListener(`mousedown`,R,U),()=>{t.removeEventListener(`touchstart`,F,z),t.removeEventListener(`touchmove`,I,V),t.removeEventListener(`touchend`,L,H),t.removeEventListener(`mousedown`,R,U),x();let e=h();e&&(e.disabled=!1)}},[e?.id,ye,be,k,A,B,w,T]);let Je=(0,x.useCallback)(t=>{!e||de||s({type:`terminal-input`,sessionId:e.id,data:t})},[e,de,s]),Ye=(0,x.useCallback)(()=>{let e=ye.current;if(!e)return;let t=e.querySelector(`.xterm-helper-textarea`);t&&(t.removeAttribute(`disabled`),t.focus())},[ye]),Xe=(0,x.useCallback)(()=>{if(!e||de)return;xe.current&&(s({type:`tmux-cancel-copy-mode`,sessionId:e.id}),Te(!1));let t=ye.current;if(!t)return;let n=t.querySelector(`.xterm-helper-textarea`);n&&(n.removeAttribute(`disabled`),n.focus())},[e,de,s,ye,xe,Te]),Ze=(0,x.useCallback)(()=>{if(typeof document>`u`)return!1;let e=ye.current;if(!e)return!1;let t=e.querySelector(`.xterm-helper-textarea`);if(t&&document.activeElement===t)return!0;let n=document.activeElement,r=typeof HTMLInputElement<`u`&&n instanceof HTMLInputElement,i=typeof HTMLTextAreaElement<`u`&&n instanceof HTMLTextAreaElement;return r||i||n&&n.isContentEditable?!1:!!document.documentElement?.classList?.contains(`keyboard-visible`)},[ye]);(0,x.useEffect)(()=>{if(!k)return;let e=ye.current;if(!e)return;let t=e.querySelector(`.xterm-accessibility`),n=e.querySelector(`.xterm-accessibility-tree`);if(!t||!n)return;let r=()=>{let r=e.querySelector(`.xterm-helper-textarea`);r&&document.activeElement===r&&!He.current?(t.style.pointerEvents=`none`,n.style.pointerEvents=`none`):(t.style.removeProperty(`pointer-events`),n.style.removeProperty(`pointer-events`))};return r(),document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,r),()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,r)}},[ye,k,N]),(0,x.useEffect)(()=>{let e=ye.current;e&&(e.inert=!!n)},[ye,n]);let Qe=(0,x.useMemo)(()=>{if(!ue||t.length===0)return!1;let e=t.map(e=>e.name.trim()).filter(Boolean);return e.length===t.length&&new Set(e).size===t.length},[ue,t]);return(0,q.jsxs)(`section`,{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${k?`ios-native-term-selection`:``}`,"data-testid":`terminal-panel`,children:[(0,q.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e||n?``:`md:hidden`}`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,q.jsx)(`button`,{onClick:()=>V(!0),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0`,"aria-label":`Open session menu`,children:(0,q.jsx)(Se,{width:16,height:16})}),e&&pe&&(0,q.jsx)(`button`,{onClick:()=>I(!0),className:`hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0`,title:`Kill session (${O}X)`,"aria-label":`Kill session`,children:(0,q.jsx)(Be,{width:16,height:16})}),ve&&(0,q.jsx)(`button`,{onClick:Ie,className:`hidden md:flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all shrink-0`,title:`Hibernate session`,"aria-label":`Hibernate session`,children:(0,q.jsx)(we,{width:16,height:16})}),e?(0,q.jsxs)(`div`,{className:`flex items-baseline gap-3 min-w-0`,children:[H?(0,q.jsx)(`input`,{ref:ie,type:`text`,value:W,onChange:e=>ee(e.target.value),onBlur:Re,onKeyDown:ze,className:`w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent`}):(0,q.jsx)(`span`,{className:`text-sm font-medium text-primary truncate`,children:e.agentSessionName||e.name}),(0,q.jsx)(`span`,{className:`text-xs shrink-0 ${OO[e.status]}`,children:DO[e.status]})]}):n?(0,q.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-primary truncate`,children:he}),(0,q.jsx)(`span`,{className:`rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-400`,children:`Hibernating`})]}):(0,q.jsx)(`span`,{className:`text-sm font-medium text-primary md:hidden`,children:`Sessions`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[a!==`connected`&&(0,q.jsx)(`span`,{className:`text-xs text-approval`,children:a}),(0,q.jsx)(`button`,{onClick:f,className:`flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden`,title:`New session (${O}N)`,"aria-label":`New session`,children:(0,q.jsx)(Ae,{width:16,height:16})}),e&&pe&&(0,q.jsx)(`button`,{onClick:()=>I(!0),className:`flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all`,title:`Kill session (${O}X)`,"aria-label":`Kill session`,children:(0,q.jsx)(Be,{width:16,height:16})}),ve&&(0,q.jsx)(`button`,{onClick:Ie,className:`flex md:hidden h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`Hibernate session`,"aria-label":`Hibernate session`,children:(0,q.jsx)(we,{width:16,height:16})}),n&&(0,q.jsx)(`button`,{onClick:()=>h(n.sessionId),className:`btn btn-primary h-7 px-2 text-xs md:hidden`,children:`Wake`}),e&&(0,q.jsxs)(`div`,{className:`relative md:hidden`,ref:re,children:[(0,q.jsx)(`button`,{onClick:()=>z(!L),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`More options`,"aria-label":`More options`,children:(0,q.jsx)(fe,{width:16,height:16})}),L&&(0,q.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1`,children:[pe&&(0,q.jsxs)(`button`,{onClick:Le,className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,children:[(0,q.jsx)(me,{width:14,height:14}),`Rename`]}),ve&&(0,q.jsxs)(`button`,{onClick:Ie,className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,children:[(0,q.jsx)(we,{width:14,height:14}),`Hibernate`]}),(0,q.jsxs)(`button`,{onClick:()=>{v(),z(!1)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,children:[(0,q.jsx)(Pe,{width:14,height:14}),`Settings`]})]})]})]})]}),e&&t.length>1&&(0,q.jsxs)(`div`,{className:`relative overflow-hidden bg-elevated border-b border-border md:hidden`,children:[(0,q.jsx)(`div`,{className:`absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none`}),(0,q.jsx)(`div`,{className:`flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory`,style:{WebkitOverflowScrolling:`touch`},children:t.map((t,n)=>{let r=t.id===e.id,i=Qe?t.name.trim():n+1;return(0,q.jsx)(`button`,{type:`button`,className:`
|
|
223
223
|
flex items-center justify-center shrink-0 snap-start
|
|
224
224
|
h-8 ${Qe?`min-w-[2rem] px-2.5 max-w-[8rem] truncate`:`w-8`}
|
|
225
225
|
text-sm font-extrabold rounded-lg
|
package/dist/client/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<title>Agentboard</title>
|
|
9
9
|
<link rel="apple-touch-icon" href="/icons/pwa-192x192.png" />
|
|
10
10
|
<meta name="theme-color" content="#0f172a" />
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-5KQCdBbP.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-aj6nV1MJ.css">
|
|
13
13
|
<link rel="manifest" href="/manifest.webmanifest"></head>
|
|
14
14
|
<body>
|
package/dist/client/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,n={};const i=(i,o)=>(i=new URL(i+".js",o).href,n[i]||new Promise(n=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=n,document.head.appendChild(e)}else e=i,importScripts(i),n()}).then(()=>{let e=n[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(o,s)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(n[r])return;let
|
|
1
|
+
if(!self.define){let e,n={};const i=(i,o)=>(i=new URL(i+".js",o).href,n[i]||new Promise(n=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=n,document.head.appendChild(e)}else e=i,importScripts(i),n()}).then(()=>{let e=n[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(o,s)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(n[r])return;let t={};const f=e=>i(e,r),d={module:{uri:r},exports:t,require:f};n[r]=Promise.all(o.map(e=>d[e]||f(e))).then(e=>(s(...e),t))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"91a1e641753e5fe06e233b128b694cc9"},{url:"favicon.svg",revision:"12048a608dedfc53518ddc59c07e41b6"},{url:"icons/pwa-512x512.png",revision:"eb82042b3e4ed505f3efe1b79622d998"},{url:"icons/pwa-192x192.png",revision:"affb57c15619ee7223d1adea372ad514"},{url:"fonts/jetbrains-mono-vietnamese-wght-normal.woff2",revision:"ddf99e6e35c6ee9f00a41d2567b0e77f"},{url:"fonts/jetbrains-mono-latin-wght-normal.woff2",revision:"b058178d7f309414f8f856b99fd80d9b"},{url:"fonts/jetbrains-mono-latin-ext-wght-normal.woff2",revision:"e36841ed93d5bfe6b1d487d18ad7e90b"},{url:"fonts/jetbrains-mono-greek-wght-normal.woff2",revision:"51671ed9eb64e29390d4791ab0023c8e"},{url:"fonts/jetbrains-mono-cyrillic-wght-normal.woff2",revision:"615bf869ebeb5998734d81fc8958116c"},{url:"fonts/jetbrains-mono-cyrillic-ext-wght-normal.woff2",revision:"742dd0628e0118d32dccf0437900670b"},{url:"assets/workbox-window.prod.es5-Bq4GJJid.js",revision:null},{url:"assets/index-aj6nV1MJ.css",revision:null},{url:"assets/index-5KQCdBbP.js",revision:null},{url:"icons/pwa-192x192.png",revision:"affb57c15619ee7223d1adea372ad514"},{url:"icons/pwa-512x512.png",revision:"eb82042b3e4ed505f3efe1b79622d998"},{url:"manifest.webmanifest",revision:"b6d4b3666a548fa0f0c6919d31ec2eee"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api(?:\/|$)/,/^\/ws(?:\/|$)/]}))});
|