@mindstudio-ai/browser-agent 0.1.49 → 0.1.50

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 (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -74,7 +74,7 @@ ${h}
74
74
  white-space: nowrap;
75
75
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
76
76
  ">${co}</div>
77
- `;function so(e,t,n){return e+(t-e)*n}function mo(){window.location.search.includes("mode=iframe")&&po()}function po(){if(document.getElementById(io))return;let e=E().cursor,t=E().zoom.mobilePreview,n=document.createElement("div");n.id=io,n.innerHTML=t?fo:uo,n.style.cssText=["position: fixed","top: -100px","left: -100px","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let r=document.createElement("div");r.id=Rs,r.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${Fe}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(r),document.documentElement.appendChild(n),e.el=n,e.rippleEl=r}function Ds(){E().cursor.trackingFrame===null&&go()}function ho(){let e=E().cursor;e.trackingFrame!==null&&(cancelAnimationFrame(e.trackingFrame),e.trackingFrame=null),e.targetElement=null}function go(){let e=E().cursor;if(e.el){if(e.targetElement&&e.targetElement.isConnected){let t=e.targetElement.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i=window.innerWidth,o=window.innerHeight,a=Math.max(gt,Math.min(n,i-gt)),s=Math.max(gt,Math.min(r,o-gt));if(e.x=so(e.x,a,ao),e.y=so(e.y,s,ao),e.el.style.transition="none",e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,Math.abs(e.x-a)<lo&&Math.abs(e.y-s)<lo&&(e.x=a,e.y=s,e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,e.settledResolve)){let c=e.settledResolve;e.settledResolve=null,c()}}else if(e.targetElement&&!e.targetElement.isConnected){if(e.settledResolve){let t=e.settledResolve;e.settledResolve=null,t()}e.targetElement=null,e.trackingFrame=null;return}else if(!e.targetElement){e.trackingFrame=null;return}e.trackingFrame=requestAnimationFrame(go)}}async function wt(e){let t=E().cursor;if(t.el){if(t.hideTimer&&(clearTimeout(t.hideTimer),t.hideTimer=null),t.settledResolve){let n=t.settledResolve;t.settledResolve=null,n()}if(t.targetElement=e,!t.hasPosition){let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,o=Math.max(window.innerWidth,100),a=Math.max(window.innerHeight,100);Math.random()<.5?(t.x=o+20,t.y=i+(Math.random()-.5)*100):(t.x=r+(Math.random()-.5)*100,t.y=a+20),t.el.style.transition="none",t.el.style.left=`${t.x}px`,t.el.style.top=`${t.y}px`,t.el.style.opacity="0",t.el.offsetWidth,t.hasPosition=!0}return t.visibilityState==="fading-out"?be("visible"):wo(t.visibilityState)||(be("fading-in"),await H(yt),t.visibilityState==="fading-in"&&(t.visibilityState="visible")),Ds(),new Promise(n=>{t.settledResolve=n})}}async function yo(){let e=E().cursor;e.el&&(e.el.style.transform="scale(0.85) translateY(1px)",e.rippleEl&&(e.rippleEl.style.transition="none",e.rippleEl.style.left=`${e.x}px`,e.rippleEl.style.top=`${e.y}px`,e.rippleEl.style.width="0",e.rippleEl.style.height="0",e.rippleEl.style.opacity="0.35",e.rippleEl.offsetWidth,e.rippleEl.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",e.rippleEl.style.width="40px",e.rippleEl.style.height="40px",e.rippleEl.style.opacity="0"),await H(Ps),e.el&&(e.el.style.transform="scale(1) translateY(0)"),await H(100))}function wo(e){return e==="visible"||e==="fading-in"||e==="fading-out"||e==="force-visible"}function be(e){let t=E().cursor;if(t.visibilityState=e,!!t.el)switch(e){case"hidden":case"force-hidden":case"snapshot-hidden":t.el.style.transition="none",t.el.style.opacity="0",t.rippleEl&&(t.rippleEl.style.opacity="0");break;case"fading-in":t.el.style.transition=`opacity ${yt}ms ease`,t.el.offsetWidth,t.el.style.opacity="1";break;case"visible":case"force-visible":t.el.style.opacity="1";break;case"fading-out":t.el.style.transition=`opacity ${yt}ms ease`,t.el.style.opacity="0";break}}function ze(){let e=E().cursor;e.hideTimer&&(clearTimeout(e.hideTimer),e.hideTimer=null)}function Xe(e){E().cursor.executing=e,e?no():ro()}function cn(){ze()}function bt(){let e=E().cursor;e.el&&e.visibilityState!=="force-visible"&&(e.targetElement=null,ze(),e.hideTimer=setTimeout(()=>{e.visibilityState!=="force-visible"&&(be("fading-out"),e.hideTimer=setTimeout(()=>{e.visibilityState==="fading-out"&&(be("hidden"),ho()),e.hideTimer=null},yt))},Fs))}function bo(){let e=E().cursor;e.visibilityState!=="snapshot-hidden"&&(ze(),e.preSnapshotState=e.visibilityState,be("snapshot-hidden"))}function vo(){let e=E().cursor,t=e.preSnapshotState;e.preSnapshotState=null,!(!e.el||!t||!wo(t))&&be(t==="fading-in"?"fading-in":"visible")}function un(e){let t=E().cursor;t.el&&(t.el.innerHTML=e?fo:uo)}function vt(e){let t=E().cursor;t.executing||(e==="visible"&&!t.el&&po(),t.el&&(e==="visible"?(ze(),t.hasPosition?be("force-visible"):t.visibilityState="force-visible"):e==="hidden"?(ze(),be("force-hidden"),ho()):bt()))}var Os=750,Hs=400,Me=2,Eo=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor","#__mindstudio-camera","#__mindstudio-flash","#__mindstudio-touch-circle"],Bs="#DD2590",Ws=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
77
+ `;function so(e,t,n){return e+(t-e)*n}function mo(){window.location.search.includes("mode=iframe")&&po()}function po(){if(document.getElementById(io))return;let e=E().cursor,t=E().zoom.mobilePreview,n=document.createElement("div");n.id=io,n.innerHTML=t?fo:uo,n.style.cssText=["position: fixed","top: -100px","left: -100px","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let r=document.createElement("div");r.id=Rs,r.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${Fe}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(r),document.documentElement.appendChild(n),e.el=n,e.rippleEl=r}function Ds(){E().cursor.trackingFrame===null&&go()}function ho(){let e=E().cursor;e.trackingFrame!==null&&(cancelAnimationFrame(e.trackingFrame),e.trackingFrame=null),e.targetElement=null}function go(){let e=E().cursor;if(e.el){if(e.targetElement&&e.targetElement.isConnected){let t=e.targetElement.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i=window.innerWidth,o=window.innerHeight,a=Math.max(gt,Math.min(n,i-gt)),s=Math.max(gt,Math.min(r,o-gt));if(e.x=so(e.x,a,ao),e.y=so(e.y,s,ao),e.el.style.transition="none",e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,Math.abs(e.x-a)<lo&&Math.abs(e.y-s)<lo&&(e.x=a,e.y=s,e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,e.settledResolve)){let c=e.settledResolve;e.settledResolve=null,c()}}else if(e.targetElement&&!e.targetElement.isConnected){if(e.settledResolve){let t=e.settledResolve;e.settledResolve=null,t()}e.targetElement=null,e.trackingFrame=null;return}else if(!e.targetElement){e.trackingFrame=null;return}e.trackingFrame=requestAnimationFrame(go)}}async function wt(e){let t=E().cursor;if(!t.el)return;if(t.hideTimer&&(clearTimeout(t.hideTimer),t.hideTimer=null),t.settledResolve){let r=t.settledResolve;t.settledResolve=null,r()}t.targetElement=e;let n=!1;if(!t.hasPosition){let r=e.getBoundingClientRect(),i=r.left+r.width/2,o=r.top+r.height/2,a=Math.max(window.innerWidth,100),s=Math.max(window.innerHeight,100);Math.random()<.5?(t.x=a+20,t.y=o+(Math.random()-.5)*100):(t.x=i+(Math.random()-.5)*100,t.y=s+20),t.el.style.transition="none",t.el.style.left=`${t.x}px`,t.el.style.top=`${t.y}px`,t.el.style.opacity="0",t.el.offsetWidth,t.hasPosition=!0,n=!0}return t.visibilityState==="fading-out"?be("visible"):(n||!wo(t.visibilityState))&&(be("fading-in"),await H(yt),t.visibilityState==="fading-in"&&(t.visibilityState="visible")),Ds(),new Promise(r=>{t.settledResolve=r})}async function yo(){let e=E().cursor;e.el&&(e.el.style.transform="scale(0.85) translateY(1px)",e.rippleEl&&(e.rippleEl.style.transition="none",e.rippleEl.style.left=`${e.x}px`,e.rippleEl.style.top=`${e.y}px`,e.rippleEl.style.width="0",e.rippleEl.style.height="0",e.rippleEl.style.opacity="0.35",e.rippleEl.offsetWidth,e.rippleEl.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",e.rippleEl.style.width="40px",e.rippleEl.style.height="40px",e.rippleEl.style.opacity="0"),await H(Ps),e.el&&(e.el.style.transform="scale(1) translateY(0)"),await H(100))}function wo(e){return e==="visible"||e==="fading-in"||e==="fading-out"||e==="force-visible"}function be(e){let t=E().cursor;if(t.visibilityState=e,!!t.el)switch(e){case"hidden":case"force-hidden":case"snapshot-hidden":t.el.style.transition="none",t.el.style.opacity="0",t.rippleEl&&(t.rippleEl.style.opacity="0");break;case"fading-in":t.el.style.transition=`opacity ${yt}ms ease`,t.el.offsetWidth,t.el.style.opacity="1";break;case"visible":case"force-visible":t.el.style.opacity="1";break;case"fading-out":t.el.style.transition=`opacity ${yt}ms ease`,t.el.style.opacity="0";break}}function ze(){let e=E().cursor;e.hideTimer&&(clearTimeout(e.hideTimer),e.hideTimer=null)}function Xe(e){E().cursor.executing=e,e?no():ro()}function cn(){ze()}function bt(){let e=E().cursor;e.el&&e.visibilityState!=="force-visible"&&(e.targetElement=null,ze(),e.hideTimer=setTimeout(()=>{e.visibilityState!=="force-visible"&&(be("fading-out"),e.hideTimer=setTimeout(()=>{e.visibilityState==="fading-out"&&(be("hidden"),ho()),e.hideTimer=null},yt))},Fs))}function bo(){let e=E().cursor;e.visibilityState!=="snapshot-hidden"&&(ze(),e.preSnapshotState=e.visibilityState,be("snapshot-hidden"))}function vo(){let e=E().cursor,t=e.preSnapshotState;e.preSnapshotState=null,!(!e.el||!t||!wo(t))&&be(t==="fading-in"?"fading-in":"visible")}function un(e){let t=E().cursor;t.el&&(t.el.innerHTML=e?fo:uo)}function vt(e){let t=E().cursor;t.executing||(e==="visible"&&!t.el&&po(),t.el&&(e==="visible"?(ze(),t.hasPosition?be("force-visible"):t.visibilityState="force-visible"):e==="hidden"?(ze(),be("force-hidden"),ho()):bt()))}var Os=750,Hs=400,Me=2,Eo=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor","#__mindstudio-camera","#__mindstudio-flash","#__mindstudio-touch-circle"],Bs="#DD2590",Ws=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
78
78
  <g filter="url(#filter0_d_2_302)">
79
79
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 21C4.57 21 3 19.43 3 17.5V10.5C3 8.57 4.57 7 6.5 7H7.5C7.966 7 8.387 6.49 8.605 6.053C9.239 4.786 10.028 4 12 4H16C17.972 4 18.761 4.786 19.395 6.053C19.613 6.49 20.034 7 20.5 7H21.5C23.43 7 25 8.57 25 10.5V17.5C25 19.43 23.43 21 21.5 21H6.5Z" fill="white"/>
80
80
  <path fill-rule="evenodd" clip-rule="evenodd" d="M14 18C11.238 18 9 15.762 9 13C9 10.238 11.238 8 14 8C16.762 8 19 10.238 19 13C19 15.762 16.762 18 14 18ZM21.5 8H20.5C19.5 8 18.816 7.132 18.5 6.5C18 5.5 17.5 5 16 5H14H12C10.5 5 10 5.5 9.5 6.5C9.184 7.132 8.5 8 7.5 8H6.5C5.119 8 4 9.119 4 10.5V17.5C4 18.881 5.119 20 6.5 20H21.5C22.881 20 24 18.881 24 17.5V10.5C24 9.119 22.881 8 21.5 8Z" fill="black"/>
@@ -228,4 +228,4 @@ ${h}
228
228
  border-radius: 12px;
229
229
  pointer-events: none;
230
230
  z-index: 2;
231
- `,t.overlay.appendChild(t.dragPreview)),t.dragPreview.style.left=`${Math.min(t.startX,e.clientX)}px`,t.dragPreview.style.top=`${Math.min(t.startY,e.clientY)}px`,t.dragPreview.style.width=`${Math.abs(n)}px`,t.dragPreview.style.height=`${Math.abs(r)}px`)}function zo(e){let t=E().noteLayer;if(t.overlay)try{t.overlay.releasePointerCapture(e.pointerId)}catch{}if(t.movingNote){t.movingNote=null;return}if(t.consumedByDeactivation){t.consumedByDeactivation=!1,De();return}if(!t.pointerDown||!t.overlay){De();return}if(t.didDrag){t.dragPreview&&(t.dragPreview.remove(),t.dragPreview=null);let n=Math.min(t.startX,e.clientX),r=Math.min(t.startY,e.clientY),i=Math.abs(e.clientX-t.startX),o=Math.abs(e.clientY-t.startY);if(i>10&&o>10){let a=Oo(n,r,i,o);t.overlay.appendChild(a.element),t.notes.push(a),Ct(a),t.currentNote=a}}else{let n=Do(e.clientX,e.clientY);t.overlay.appendChild(n.element),t.notes.push(n),Ct(n),t.currentNote=n}De()}function Xo(){let e=E().noteLayer;e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null),e.movingNote=null,De()}function Go(e){let t=E().noteLayer;if(t.currentNote){if(e.key==="Enter"&&!e.shiftKey&&t.currentNote.state==="editing"){Ie(t.currentNote)||ke(t.currentNote),t.currentNote=null,e.preventDefault();return}if(e.key==="Escape"){t.currentNote.state==="editing"?(Ie(t.currentNote)||ke(t.currentNote),t.currentNote=null):t.currentNote.state==="selected"&&(Ie(t.currentNote),t.currentNote=null),e.preventDefault();return}if(t.currentNote.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){ke(t.currentNote),t.currentNote=null,e.preventDefault();return}t.currentNote.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&t.currentNote.bubble.textContent?.trim()===""&&(ke(t.currentNote),t.currentNote=null,e.preventDefault())}}function Bo(e,t){let n=E().noteLayer;n.movingNote=e,n.moveOffsetX=t.clientX-e.x,n.moveOffsetY=t.clientY-e.y}function Ko(e){let t=E().noteLayer;for(let n of t.notes)if(n.element.contains(e))return n;return null}function ke(e){let t=E().noteLayer;e.element.remove(),t.notes=t.notes.filter(n=>n.id!==e.id),t.currentNote===e&&(t.currentNote=null)}function De(){let e=E().noteLayer;e.pointerDown=!1,e.startX=0,e.startY=0,e.didDrag=!1,e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null)}function Jo(){let e=E().notesMode;e.active||(e.active=!0,Wo())}function Zo(){let e=E().notesMode;e.active&&(e.active=!1,Uo())}async function Qo(){let{image:e}=await Ge({viewportOnly:!0});return e}var yn="mindstudio-browser-agent";function ei(){let e=E(),t=new URLSearchParams(window.location.search);e.zoom.pipMode=t.get("display-mode")==="pip",e.zoom.mobilePreview=t.get("preview")==="mobile";try{let n=sessionStorage.getItem("__ms_pip");n==="1"?e.zoom.pipMode=!0:n==="0"&&(e.zoom.pipMode=!1);let r=sessionStorage.getItem("__ms_mobile");r==="1"?e.zoom.mobilePreview=!0:r==="0"&&(e.zoom.mobilePreview=!1)}catch{}e.messages.handler||(e.messages.handler=async n=>{if(n.source===window)return;let r=n.data;if(!(!r||typeof r.command!="string")&&r.channel===yn)switch(r.command){case"notes-enter":Jo();break;case"notes-exit":Zo();break;case"notes-cursor-hide":qo();break;case"notes-screenshot":{try{let i=await Qo();window.parent.postMessage({channel:yn,command:"screenshot-result",image:i},"*")}catch(i){window.parent.postMessage({channel:yn,command:"screenshot-result",error:i instanceof Error?i.message:"Screenshot failed"},"*")}break}case"cursor-show":vt("visible");break;case"cursor-hide":vt("hidden");break;case"cursor-auto":vt(null);break;case"navigate":typeof r.url=="string"&&(window.history.pushState(null,"",r.url),window.dispatchEvent(new PopStateEvent("popstate")));break;case"display-mode-pip":e.zoom.pipMode=!0;try{sessionStorage.setItem("__ms_pip","1")}catch{}break;case"display-mode-full":e.zoom.pipMode=!1;try{sessionStorage.setItem("__ms_pip","0")}catch{}break;case"preview-mode-mobile":e.zoom.mobilePreview=!0;try{sessionStorage.setItem("__ms_mobile","1")}catch{}ln(),un(!0);break;case"preview-mode-desktop":e.zoom.mobilePreview=!1;try{sessionStorage.setItem("__ms_mobile","0")}catch{}to(),un(!1);break}},window.addEventListener("message",e.messages.handler))}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__=!0,Cn(),Ln(),Tn(),Nn(),Rn(),_n(),No(),ei(),mo(),eo(),Vr(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return gi(gc);})();
231
+ `,t.overlay.appendChild(t.dragPreview)),t.dragPreview.style.left=`${Math.min(t.startX,e.clientX)}px`,t.dragPreview.style.top=`${Math.min(t.startY,e.clientY)}px`,t.dragPreview.style.width=`${Math.abs(n)}px`,t.dragPreview.style.height=`${Math.abs(r)}px`)}function zo(e){let t=E().noteLayer;if(t.overlay)try{t.overlay.releasePointerCapture(e.pointerId)}catch{}if(t.movingNote){t.movingNote=null;return}if(t.consumedByDeactivation){t.consumedByDeactivation=!1,De();return}if(!t.pointerDown||!t.overlay){De();return}if(t.didDrag){t.dragPreview&&(t.dragPreview.remove(),t.dragPreview=null);let n=Math.min(t.startX,e.clientX),r=Math.min(t.startY,e.clientY),i=Math.abs(e.clientX-t.startX),o=Math.abs(e.clientY-t.startY);if(i>10&&o>10){let a=Oo(n,r,i,o);t.overlay.appendChild(a.element),t.notes.push(a),Ct(a),t.currentNote=a}}else{let n=Do(e.clientX,e.clientY);t.overlay.appendChild(n.element),t.notes.push(n),Ct(n),t.currentNote=n}De()}function Xo(){let e=E().noteLayer;e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null),e.movingNote=null,De()}function Go(e){let t=E().noteLayer;if(t.currentNote){if(e.key==="Enter"&&!e.shiftKey&&t.currentNote.state==="editing"){Ie(t.currentNote)||ke(t.currentNote),t.currentNote=null,e.preventDefault();return}if(e.key==="Escape"){t.currentNote.state==="editing"?(Ie(t.currentNote)||ke(t.currentNote),t.currentNote=null):t.currentNote.state==="selected"&&(Ie(t.currentNote),t.currentNote=null),e.preventDefault();return}if(t.currentNote.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){ke(t.currentNote),t.currentNote=null,e.preventDefault();return}t.currentNote.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&t.currentNote.bubble.textContent?.trim()===""&&(ke(t.currentNote),t.currentNote=null,e.preventDefault())}}function Bo(e,t){let n=E().noteLayer;n.movingNote=e,n.moveOffsetX=t.clientX-e.x,n.moveOffsetY=t.clientY-e.y}function Ko(e){let t=E().noteLayer;for(let n of t.notes)if(n.element.contains(e))return n;return null}function ke(e){let t=E().noteLayer;e.element.remove(),t.notes=t.notes.filter(n=>n.id!==e.id),t.currentNote===e&&(t.currentNote=null)}function De(){let e=E().noteLayer;e.pointerDown=!1,e.startX=0,e.startY=0,e.didDrag=!1,e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null)}function Jo(){let e=E().notesMode;e.active||(e.active=!0,Wo())}function Zo(){let e=E().notesMode;e.active&&(e.active=!1,Uo())}async function Qo(){let{image:e}=await Ge({viewportOnly:!0});return e}var yn="mindstudio-browser-agent";function ei(){let e=E(),t=new URLSearchParams(window.location.search);e.zoom.pipMode=t.get("display-mode")==="pip",e.zoom.mobilePreview=t.get("preview")==="mobile"||window.innerWidth<768;try{let n=sessionStorage.getItem("__ms_pip");n==="1"?e.zoom.pipMode=!0:n==="0"&&(e.zoom.pipMode=!1);let r=sessionStorage.getItem("__ms_mobile");r==="1"?e.zoom.mobilePreview=!0:r==="0"&&(e.zoom.mobilePreview=!1)}catch{}e.messages.handler||(e.messages.handler=async n=>{if(n.source===window)return;let r=n.data;if(!(!r||typeof r.command!="string")&&r.channel===yn)switch(r.command){case"notes-enter":Jo();break;case"notes-exit":Zo();break;case"notes-cursor-hide":qo();break;case"notes-screenshot":{try{let i=await Qo();window.parent.postMessage({channel:yn,command:"screenshot-result",image:i},"*")}catch(i){window.parent.postMessage({channel:yn,command:"screenshot-result",error:i instanceof Error?i.message:"Screenshot failed"},"*")}break}case"cursor-show":vt("visible");break;case"cursor-hide":vt("hidden");break;case"cursor-auto":vt(null);break;case"navigate":typeof r.url=="string"&&(window.history.pushState(null,"",r.url),window.dispatchEvent(new PopStateEvent("popstate")));break;case"display-mode-pip":e.zoom.pipMode=!0;try{sessionStorage.setItem("__ms_pip","1")}catch{}break;case"display-mode-full":e.zoom.pipMode=!1;try{sessionStorage.setItem("__ms_pip","0")}catch{}break;case"preview-mode-mobile":e.zoom.mobilePreview=!0;try{sessionStorage.setItem("__ms_mobile","1")}catch{}ln(),un(!0);break;case"preview-mode-desktop":e.zoom.mobilePreview=!1;try{sessionStorage.setItem("__ms_mobile","0")}catch{}to(),un(!1);break}},window.addEventListener("message",e.messages.handler))}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__=!0,Cn(),Ln(),Tn(),Nn(),Rn(),_n(),No(),ei(),mo(),eo(),Vr(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return gi(gc);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/browser-agent",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "Browser-side agent for MindStudio dev previews — captures logs, provides DOM snapshots, and enables remote interaction.",
5
5
  "main": "dist/index.js",
6
6
  "files": [