@reason-machines/cli-linux-arm64-musl 0.2.281 → 0.2.283
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/ara +1 -1
- package/bin/vm-hands/connect-cli-55e1yksk.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-92914wyp.js → custom-endpoint-device-7kd3qh6r.js} +1 -1
- package/bin/vm-hands/desktop-account-5kmddfvt.js +2 -0
- package/bin/vm-hands/{device-workspace-zk5xwd10.js → device-workspace-te28d7t5.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-da93x0qx.js → hands-worker-source-6ts5hhas.js} +1 -1
- package/bin/vm-hands/{index-w9nq2f0p.js → index-9aw1gjs5.js} +1 -1
- package/bin/vm-hands/local-automation-04rec2qb.js +2 -0
- package/bin/vm-hands/local-capabilities-2bd5ev5m.js +2 -0
- package/bin/vm-hands/local-desktop-users-nxyv3mk1.js +2 -0
- package/bin/vm-hands/local-display-mac-rp51a8w7.js +2 -0
- package/bin/vm-hands/local-display-session-zvj3ntsc.js +2 -0
- package/bin/vm-hands/{network-contract-41qanjhp.js → network-contract-wkc0ycet.js} +1 -1
- package/bin/vm-hands/package-56yg8k4a.js +2 -0
- package/bin/vm-hands/permissions-qnq69hfd.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-51gs8j7v.js → reason-hands-protocol-2gkb9qeb.js} +1 -1
- package/bin/vm-hands/{status-ycqjx7at.js → status-mbjv1h54.js} +2 -2
- package/bin/vm-hands/version-vs0sn7wr.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zjnq10yb.js → vm-hands-entry-lite-0etm5tzc.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-t678ape1.js → vm-hands-entry-lite-2yne3ped.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-fraghb8k.js → vm-hands-entry-lite-4fnbmmp6.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ptmqg51y.js → vm-hands-entry-lite-53jm8bj7.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-s2xydt0n.js → vm-hands-entry-lite-5vrdj7jm.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-rs7g2egs.js → vm-hands-entry-lite-7s23wnph.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-c2nrar90.js → vm-hands-entry-lite-8kqg77ym.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-n0v0srqp.js → vm-hands-entry-lite-9jdxjw46.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-bjhw87nc.js +343 -0
- package/bin/vm-hands/{vm-hands-entry-lite-bm9x8vng.js → vm-hands-entry-lite-d2wgjdc5.js} +24 -23
- package/bin/vm-hands/{vm-hands-entry-lite-65pbrs1x.js → vm-hands-entry-lite-h2xpqaxn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-bfwf82rw.js → vm-hands-entry-lite-k1wbh9dq.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-84aq8d12.js → vm-hands-entry-lite-kxbpf40y.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-sv6xwe0h.js → vm-hands-entry-lite-m5pmd2cz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-s5qn1k80.js → vm-hands-entry-lite-qbk0wxrz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-d2xzrjx2.js → vm-hands-entry-lite-rnykqcys.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-7gh1rbn7.js → vm-hands-entry-lite-ss2w3h3d.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-9pmag2qk.js → vm-hands-entry-lite-vvmq0mtv.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ffg7rf02.js → vm-hands-entry-lite-wffqkcjq.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-1hwdab4e.js → vm-hands-entry-lite-whcnpjdx.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-rwdevjb0.js → vm-hands-entry-lite-y3k1pyx7.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-anaydk9m.js → vm-hands-entry-lite-y9k070mt.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-bwt3y6wz.js → vm-hands-entry-lite-yf8h8gmh.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-gqncr2j0.js → vm-hands-entry-lite-yh7n4svm.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-k4c504n7.js → vm-hands-entry-lite-yvmzze06.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-samg5ahn.js → vm-hands-executor-h8hm44fp.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-v941qg9f.js → vm-hands-op-runner-e2p1qwmv.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-emtd6z5q.js → vm-hands-runtime-pdvbqbpj.js} +3 -3
- package/bin/vm-hands/worker-sandbox-4c9302zr.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/connect-cli-sfr2y6mq.js +0 -2
- package/bin/vm-hands/desktop-account-vsrtgkk9.js +0 -2
- package/bin/vm-hands/local-automation-99wn9bh2.js +0 -2
- package/bin/vm-hands/local-capabilities-7thv11wy.js +0 -2
- package/bin/vm-hands/local-desktop-users-3j79jbyp.js +0 -2
- package/bin/vm-hands/local-display-mac-j1v3mcgx.js +0 -2
- package/bin/vm-hands/local-display-session-mrf9pm28.js +0 -2
- package/bin/vm-hands/package-rx9y4bwe.js +0 -2
- package/bin/vm-hands/permissions-p9p6z62j.js +0 -2
- package/bin/vm-hands/version-xjrgafqj.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-c0whrdtr.js +0 -343
- package/bin/vm-hands/worker-sandbox-nnce49w0.js +0 -2
package/bin/ara
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m}from"./vm-hands-entry-lite-bjhw87nc.js";import"./vm-hands-entry-lite-yvmzze06.js";import"./vm-hands-entry-lite-y3k1pyx7.js";import"./vm-hands-entry-lite-2yne3ped.js";import"./vm-hands-entry-lite-8kqg77ym.js";import"./vm-hands-entry-lite-h2xpqaxn.js";import"./vm-hands-entry-lite-qvrnx0vk.js";import"./vm-hands-entry-lite-n07kxrd1.js";import"./vm-hands-entry-lite-whcnpjdx.js";import"./vm-hands-entry-lite-d2wgjdc5.js";import"./vm-hands-entry-lite-yh7n4svm.js";import"./vm-hands-entry-lite-m5pmd2cz.js";import"./vm-hands-entry-lite-7s23wnph.js";import"./vm-hands-entry-lite-k1wbh9dq.js";import"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-rnykqcys.js";import"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-qbk0wxrz.js";import"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-0etm5tzc.js";import"./vm-hands-entry-lite-9jdxjw46.js";import"./vm-hands-entry-lite-y9k070mt.js";import"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{g as runDisconnectCli,f as runConnectCli,m as restartConnectionWhenIdle,l as restartConnection,h as logoutConnection,k as connectionUsesUserChrome,i as connectionReport,j as connectionForBrowserExtension,c as connectionDirectory,d as computerDisconnected,e as addConnectionFolder,b as DISCONNECT_HELP,a as CONNECT_HELP};
|
package/bin/vm-hands/{custom-endpoint-device-92914wyp.js → custom-endpoint-device-7kd3qh6r.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$b as b,_b as a,ac as c,bc as d,cc as e,dc as f,ec as g,fc as h,gc as i,hc as j,ic as k,jc as l,kc as m}from"./vm-hands-entry-lite-
|
|
2
|
+
import{$b as b,_b as a,ac as c,bc as d,cc as e,dc as f,ec as g,fc as h,gc as i,hc as j,ic as k,jc as l,kc as m}from"./vm-hands-entry-lite-whcnpjdx.js";import"./vm-hands-entry-lite-m5pmd2cz.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{h as customEndpointRequestMatchesConfig,i as CustomEndpointDeviceRequestSchema,l as CustomEndpointDeviceReceiptSchema,j as CustomEndpointDeviceHeadersSchema,m as CustomEndpointDeviceCredentialSchema,k as CustomEndpointDeviceChunkSchema,f as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,g as CUSTOM_ENDPOINT_DEVICE_SAFE_HEADERS,c as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,d as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,e as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,b as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,a as CUSTOM_ENDPOINT_DEVICE_CAPABILITY};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ug as a,Vg as b,Wg as c,Xg as d,Yg as e}from"./vm-hands-entry-lite-qbk0wxrz.js";import"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{b as passwdAccount,e as desktopHome,d as desktopAccount,c as configureDesktopAccount,a as DESKTOP_USER_ENV};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ch as a,dh as b,eh as c,fh as d,gh as e,hh as f,ih as g,jh as h,kh as i,lh as j,mh as k,nh as l,oh as m,ph as n,qh as o,rh as p,sh as q,th as r,uh as s,vh as t}from"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{j as parseDeviceWorkspace,g as isSessionWorktreePath,h as isDeviceWorkspacePath,i as deviceWorkspaceRootRelative,s as computeWorkerWorkspace,r as cloudSessionRootLayout,t as cloudSessionLayoutOfRoot,q as cloudSessionLayout,m as SIDECHAT_WORKSPACE_ID,f as SESSION_WORKTREE_ID,e as SESSION_WORKTREES,c as SESSION_WORKSPACE_LAYOUT,a as REASON_WORKSPACE_BASE,d as HANDS_WORKSPACE_LAYOUT_KEY,b as HANDS_WORKSPACE_BASE_KEY,p as CLOUD_SESSION_ROOT_SHELL_PATTERNS,o as CLOUD_SESSION_ROOT,l as CLOUD_SESSION_CONTROL_BASE,n as CLOUD_REPOSITORY_WORKSPACE_ID,k as CLOUD_PAYLOAD_HOME};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ab as a,Bb as b,Cb as c,Db as d,Eb as e,Fb as f,Gb as g,Hb as h,Ib as i}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ab as a,Bb as b,Cb as c,Db as d,Eb as e,Fb as f,Gb as g,Hb as h,Ib as i}from"./vm-hands-entry-lite-8kqg77ym.js";import"./vm-hands-entry-lite-n07kxrd1.js";import"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{e as selectCloudChildPath,a as REASON_HANDS_WORKER_VERSION,h as REASON_HANDS_WORKER_SOURCE,b as REASON_HANDS_WORKER_ENTRYPOINT,i as REASON_HANDS_WORKER_ARTIFACT_SHA256,f as REASON_HANDS_MAC_PTY_MEMBER_SOURCE,g as REASON_HANDS_LINUX_PTY_PROBE_SOURCE,d as REASON_HANDS_CLOUD_CHILD_PATH_MACOS,c as REASON_HANDS_CLOUD_CHILD_PATH_LINUX};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{x as fJ0}from"./vm-hands-entry-lite-
|
|
2
|
+
import{x as fJ0}from"./vm-hands-entry-lite-yf8h8gmh.js";import{Jh as WV0,Kh as X$,Mh as X0}from"./vm-hands-entry-lite-ss2w3h3d.js";var f0=X$((UU0,Q_)=>{var __dirname="/Users/runner/work/monorepo/monorepo/production/node_modules/.bun/playwright-core@1.60.0/node_modules/playwright-core/lib",ln=Object.create,H5=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,sT=Object.getOwnPropertyNames,dn=Object.getPrototypeOf,cn=Object.prototype.hasOwnProperty,e=(Q,Y)=>function(){return Y||(0,Q[sT(Q)[0]])((Y={exports:{}}).exports,Y),Y.exports},eQ=(Q,Y)=>{for(var X in Y)H5(Q,X,{get:Y[X],enumerable:!0})},eT=(Q,Y,X,J)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(let G of sT(Y))if(!cn.call(Q,G)&&G!==X)H5(Q,G,{get:()=>Y[G],enumerable:!(J=mn(Y,G))||J.enumerable})}return Q},j1=(Q,Y,X)=>(X=Q!=null?ln(dn(Q)):{},eT(Y||!Q||!Q.__esModule?H5(X,"default",{value:Q,enumerable:!0}):X,Q)),pn=(Q)=>eT(H5({},"__esModule",{value:!0}),Q),nn=e({"node_modules/colors/lib/styles.js"(Q,Y){var X={};Y.exports=X;var J={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(J).forEach(function(G){var Z=J[G],$=X[G]=[];$.open="\x1B["+Z[0]+"m",$.close="\x1B["+Z[1]+"m"})}}),an=e({"node_modules/colors/lib/system/has-flag.js"(Q,Y){Y.exports=function(X,J){J=J||process.argv;var G=J.indexOf("--"),Z=/^-{1,2}/.test(X)?"":"--",$=J.indexOf(Z+X);return $!==-1&&(G===-1?!0:$<G)}}}),on=e({"node_modules/colors/lib/system/supports-colors.js"(Q,Y){var X=X0("os"),J=an(),G=process.env,Z=void 0;if(J("no-color")||J("no-colors")||J("color=false"))Z=!1;else if(J("color")||J("colors")||J("color=true")||J("color=always"))Z=!0;if("FORCE_COLOR"in G)Z=G.FORCE_COLOR.length===0||parseInt(G.FORCE_COLOR,10)!==0;function $(H){if(H===0)return!1;return{level:H,hasBasic:!0,has256:H>=2,has16m:H>=3}}function W(H){if(Z===!1)return 0;if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2;if(H&&!H.isTTY&&Z!==!0)return 0;var B=Z?1:0;if(process.platform==="win32"){var V=X.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(V[0])>=10&&Number(V[2])>=10586)return Number(V[2])>=14931?3:2;return 1}if("CI"in G){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(M){return M in G})||G.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in G){var U=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(G.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM))return 1;if("COLORTERM"in G)return 1;if(G.TERM==="dumb")return B;return B}function K(H){var B=W(H);return $(B)}Y.exports={supportsColor:K,stdout:K(process.stdout),stderr:K(process.stderr)}}}),rn=e({"node_modules/colors/lib/custom/trap.js"(Q,Y){Y.exports=function(J,G){var Z="";J=J||"Run the trap, drop the bass",J=J.split("");var $={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return J.forEach(function(W){W=W.toLowerCase();var K=$[W]||[" "],H=Math.floor(Math.random()*K.length);if(typeof $[W]<"u")Z+=$[W][H];else Z+=W}),Z}}}),tn=e({"node_modules/colors/lib/custom/zalgo.js"(Q,Y){Y.exports=function(J,G){J=J||" he is here ";var Z={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},$=[].concat(Z.up,Z.down,Z.mid);function W(B){var V=Math.floor(Math.random()*B);return V}function K(B){var V=!1;return $.filter(function(U){V=U===B}),V}function H(B,V){var U="",M,L;V=V||{},V.up=typeof V.up<"u"?V.up:!0,V.mid=typeof V.mid<"u"?V.mid:!0,V.down=typeof V.down<"u"?V.down:!0,V.size=typeof V.size<"u"?V.size:"maxi",B=B.split("");for(L in B){if(K(L))continue;switch(U=U+B[L],M={up:0,down:0,mid:0},V.size){case"mini":M.up=W(8),M.mid=W(2),M.down=W(8);break;case"maxi":M.up=W(16)+3,M.mid=W(4)+1,M.down=W(64)+3;break;default:M.up=W(8)+1,M.mid=W(6)/2,M.down=W(8)+1;break}var F=["up","mid","down"];for(var z in F){var N=F[z];for(var A=0;A<=M[N];A++)if(V[N])U=U+Z[N][W(Z[N].length)]}}return U}return H(J,G)}}}),sn=e({"node_modules/colors/lib/maps/america.js"(Q,Y){Y.exports=function(X){return function(J,G,Z){if(J===" ")return J;switch(G%3){case 0:return X.red(J);case 1:return X.white(J);case 2:return X.blue(J)}}}}}),en=e({"node_modules/colors/lib/maps/zebra.js"(Q,Y){Y.exports=function(X){return function(J,G,Z){return G%2===0?J:X.inverse(J)}}}}),Qi=e({"node_modules/colors/lib/maps/rainbow.js"(Q,Y){Y.exports=function(X){var J=["red","yellow","green","blue","magenta"];return function(G,Z,$){if(G===" ")return G;else return X[J[Z++%J.length]](G)}}}}),Yi=e({"node_modules/colors/lib/maps/random.js"(Q,Y){Y.exports=function(X){var J=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(G,Z,$){return G===" "?G:X[J[Math.round(Math.random()*(J.length-2))]](G)}}}}),Xi=e({"node_modules/colors/lib/colors.js"(Q,Y){var X={};Y.exports=X,X.themes={};var J=X0("util"),G=X.styles=nn(),Z=Object.defineProperties,$=new RegExp(/[\r\n]+/g);if(X.supportsColor=on().supportsColor,typeof X.enabled>"u")X.enabled=X.supportsColor()!==!1;X.enable=function(){X.enabled=!0},X.disable=function(){X.enabled=!1},X.stripColors=X.strip=function(N){return(""+N).replace(/\x1B\[\d+m/g,"")};var W=X.stylize=function(A,R){if(!X.enabled)return A+"";var q=G[R];if(!q&&R in X)return X[R](A);return q.open+A+q.close},K=/[|\\{}()[\]^$+*?.]/g,H=function(N){if(typeof N!=="string")throw TypeError("Expected a string");return N.replace(K,"\\$&")};function B(N){var A=function R(){return M.apply(R,arguments)};return A._styles=N,A.__proto__=U,A}var V=function(){var N={};return G.grey=G.gray,Object.keys(G).forEach(function(A){G[A].closeRe=new RegExp(H(G[A].close),"g"),N[A]={get:function(){return B(this._styles.concat(A))}}}),N}(),U=Z(function(){},V);function M(){var N=Array.prototype.slice.call(arguments),A=N.map(function(O){if(O!=null&&O.constructor===String)return O;else return J.inspect(O)}).join(" ");if(!X.enabled||!A)return A;var R=A.indexOf(`
|
|
3
3
|
`)!=-1,q=this._styles,D=q.length;while(D--){var E=G[q[D]];if(A=E.open+A.replace(E.closeRe,E.open)+E.close,R)A=A.replace($,function(O){return E.close+O+E.open})}return A}X.setTheme=function(N){if(typeof N==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var A in N)(function(R){X[R]=function(q){if(typeof N[R]==="object"){var D=q;for(var E in N[R])D=X[N[R][E]](D);return D}return X[N[R]](q)}})(A)};function L(){var N={};return Object.keys(V).forEach(function(A){N[A]={get:function(){return B([A])}}}),N}var F=function(A,R){var q=R.split("");return q=q.map(A),q.join("")};X.trap=rn(),X.zalgo=tn(),X.maps={},X.maps.america=sn()(X),X.maps.zebra=en()(X),X.maps.rainbow=Qi()(X),X.maps.random=Yi()(X);for(z in X.maps)(function(N){X[N]=function(A){return F(X.maps[N],A)}})(z);var z;Z(X,L())}}),Ji=e({"node_modules/colors/safe.js"(Q,Y){var X=Xi();Y.exports=X}}),Gi=e({"node_modules/ms/index.js"(Q,Y){var X=1000,J=X*60,G=J*60,Z=G*24,$=Z*7,W=Z*365.25;Y.exports=function(U,M){M=M||{};var L=typeof U;if(L==="string"&&U.length>0)return K(U);else if(L==="number"&&isFinite(U))return M.long?B(U):H(U);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(U))};function K(U){if(U=String(U),U.length>100)return;var M=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(U);if(!M)return;var L=parseFloat(M[1]),F=(M[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return L*W;case"weeks":case"week":case"w":return L*$;case"days":case"day":case"d":return L*Z;case"hours":case"hour":case"hrs":case"hr":case"h":return L*G;case"minutes":case"minute":case"mins":case"min":case"m":return L*J;case"seconds":case"second":case"secs":case"sec":case"s":return L*X;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return L;default:return}}function H(U){var M=Math.abs(U);if(M>=Z)return Math.round(U/Z)+"d";if(M>=G)return Math.round(U/G)+"h";if(M>=J)return Math.round(U/J)+"m";if(M>=X)return Math.round(U/X)+"s";return U+"ms"}function B(U){var M=Math.abs(U);if(M>=Z)return V(U,M,Z,"day");if(M>=G)return V(U,M,G,"hour");if(M>=J)return V(U,M,J,"minute");if(M>=X)return V(U,M,X,"second");return U+" ms"}function V(U,M,L,F){var z=M>=L*1.5;return Math.round(U/L)+" "+F+(z?"s":"")}}}),Qj=e({"node_modules/debug/src/common.js"(Q,Y){function X(J){Z.debug=Z,Z.default=Z,Z.coerce=V,Z.disable=H,Z.enable=W,Z.enabled=B,Z.humanize=Gi(),Z.destroy=U,Object.keys(J).forEach((M)=>{Z[M]=J[M]}),Z.names=[],Z.skips=[],Z.formatters={};function G(M){let L=0;for(let F=0;F<M.length;F++)L=(L<<5)-L+M.charCodeAt(F),L|=0;return Z.colors[Math.abs(L)%Z.colors.length]}Z.selectColor=G;function Z(M){let L,F=null,z,N;function A(...R){if(!A.enabled)return;let q=A,D=Number(new Date),E=D-(L||D);if(q.diff=E,q.prev=L,q.curr=D,L=D,R[0]=Z.coerce(R[0]),typeof R[0]!=="string")R.unshift("%O");let O=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(I,P)=>{if(I==="%%")return"%";O++;let C=Z.formatters[P];if(typeof C==="function"){let b=R[O];I=C.call(q,b),R.splice(O,1),O--}return I}),Z.formatArgs.call(q,R),(q.log||Z.log).apply(q,R)}if(A.namespace=M,A.useColors=Z.useColors(),A.color=Z.selectColor(M),A.extend=$,A.destroy=Z.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(F!==null)return F;if(z!==Z.namespaces)z=Z.namespaces,N=Z.enabled(M);return N},set:(R)=>{F=R}}),typeof Z.init==="function")Z.init(A);return A}function $(M,L){let F=Z(this.namespace+(typeof L>"u"?":":L)+M);return F.log=this.log,F}function W(M){Z.save(M),Z.namespaces=M,Z.names=[],Z.skips=[];let L=(typeof M==="string"?M:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let F of L)if(F[0]==="-")Z.skips.push(F.slice(1));else Z.names.push(F)}function K(M,L){let F=0,z=0,N=-1,A=0;while(F<M.length)if(z<L.length&&(L[z]===M[F]||L[z]==="*"))if(L[z]==="*")N=z,A=F,z++;else F++,z++;else if(N!==-1)z=N+1,A++,F=A;else return!1;while(z<L.length&&L[z]==="*")z++;return z===L.length}function H(){let M=[...Z.names,...Z.skips.map((L)=>"-"+L)].join(",");return Z.enable(""),M}function B(M){for(let L of Z.skips)if(K(M,L))return!1;for(let L of Z.names)if(K(M,L))return!0;return!1}function V(M){if(M instanceof Error)return M.stack||M.message;return M}function U(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return Z.enable(Z.load()),Z}Y.exports=X}}),Zi=e({"node_modules/debug/src/browser.js"(Q,Y){Q.formatArgs=J,Q.save=G,Q.load=Z,Q.useColors=X,Q.storage=$(),Q.destroy=(()=>{let K=!1;return()=>{if(!K)K=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})(),Q.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function X(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let K;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(K=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(K[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function J(K){if(K[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+K[0]+(this.useColors?"%c ":" ")+"+"+Y.exports.humanize(this.diff),!this.useColors)return;let H="color: "+this.color;K.splice(1,0,H,"color: inherit");let B=0,V=0;K[0].replace(/%[a-zA-Z%]/g,(U)=>{if(U==="%%")return;if(B++,U==="%c")V=B}),K.splice(V,0,H)}Q.log=console.debug||console.log||(()=>{});function G(K){try{if(K)Q.storage.setItem("debug",K);else Q.storage.removeItem("debug")}catch(H){}}function Z(){let K;try{K=Q.storage.getItem("debug")||Q.storage.getItem("DEBUG")}catch(H){}if(!K&&typeof process<"u"&&"env"in process)K=process.env.DEBUG;return K}function $(){try{return localStorage}catch(K){}}Y.exports=Qj()(Q);var{formatters:W}=Y.exports;W.j=function(K){try{return JSON.stringify(K)}catch(H){return"[UnexpectedJSONParseError]: "+H.message}}}}),$i=e({"node_modules/has-flag/index.js"(Q,Y){Y.exports=(X,J=process.argv)=>{let G=X.startsWith("-")?"":X.length===1?"-":"--",Z=J.indexOf(G+X),$=J.indexOf("--");return Z!==-1&&($===-1||Z<$)}}}),Wi=e({"node_modules/supports-color/index.js"(Q,Y){var X=X0("os"),J=X0("tty"),G=$i(),{env:Z}=process,$;if(G("no-color")||G("no-colors")||G("color=false")||G("color=never"))$=0;else if(G("color")||G("colors")||G("color=true")||G("color=always"))$=1;function W(){if("FORCE_COLOR"in Z){if(Z.FORCE_COLOR==="true")return 1;if(Z.FORCE_COLOR==="false")return 0;return Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}}function K(V){if(V===0)return!1;return{level:V,hasBasic:!0,has256:V>=2,has16m:V>=3}}function H(V,{streamIsTTY:U,sniffFlags:M=!0}={}){let L=W();if(L!==void 0)$=L;let F=M?$:L;if(F===0)return 0;if(M){if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2}if(V&&!U&&F===void 0)return 0;let z=F||0;if(Z.TERM==="dumb")return z;if(process.platform==="win32"){let N=X.release().split(".");if(Number(N[0])>=10&&Number(N[2])>=10586)return Number(N[2])>=14931?3:2;return 1}if("CI"in Z){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((N)=>(N in Z))||Z.CI_NAME==="codeship")return 1;return z}if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Z){let N=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return N>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Z.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM))return 1;if("COLORTERM"in Z)return 1;return z}function B(V,U={}){let M=H(V,{streamIsTTY:V&&V.isTTY,...U});return K(M)}Y.exports={supportsColor:B,stdout:B({isTTY:J.isatty(1)}),stderr:B({isTTY:J.isatty(2)})}}}),Ki=e({"node_modules/debug/src/node.js"(Q,Y){var X=X0("tty"),J=X0("util");Q.init=B,Q.log=W,Q.formatArgs=Z,Q.save=K,Q.load=H,Q.useColors=G,Q.destroy=J.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),Q.colors=[6,2,3,4,5,1];try{let U=Wi();if(U&&(U.stderr||U).level>=2)Q.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(U){}Q.inspectOpts=Object.keys(process.env).filter((U)=>{return/^debug_/i.test(U)}).reduce((U,M)=>{let L=M.substring(6).toLowerCase().replace(/_([a-z])/g,(z,N)=>{return N.toUpperCase()}),F=process.env[M];if(/^(yes|on|true|enabled)$/i.test(F))F=!0;else if(/^(no|off|false|disabled)$/i.test(F))F=!1;else if(F==="null")F=null;else F=Number(F);return U[L]=F,U},{});function G(){return"colors"in Q.inspectOpts?Boolean(Q.inspectOpts.colors):X.isatty(process.stderr.fd)}function Z(U){let{namespace:M,useColors:L}=this;if(L){let F=this.color,z="\x1B[3"+(F<8?F:"8;5;"+F),N=` ${z};1m${M} \x1B[0m`;U[0]=N+U[0].split(`
|
|
4
4
|
`).join(`
|
|
5
5
|
`+N),U.push(z+"m+"+Y.exports.humanize(this.diff)+"\x1B[0m")}else U[0]=$()+M+" "+U[0]}function $(){if(Q.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function W(...U){return process.stderr.write(J.formatWithOptions(Q.inspectOpts,...U)+`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Cc as a,Dc as b,Ec as c,Fc as d,Gc as e,Hc as f,Ic as g,Jc as h,Kc as i,Lc as j,Mc as k,Nc as l}from"./vm-hands-entry-lite-d2wgjdc5.js";import"./vm-hands-entry-lite-yh7n4svm.js";import"./vm-hands-entry-lite-m5pmd2cz.js";import"./vm-hands-entry-lite-7s23wnph.js";import"./vm-hands-entry-lite-k1wbh9dq.js";import"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-rnykqcys.js";import"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-qbk0wxrz.js";import"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-0etm5tzc.js";import"./vm-hands-entry-lite-9jdxjw46.js";import"./vm-hands-entry-lite-y9k070mt.js";import"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{d as runRelayed,e as runMacComputerUse,l as runLocalAutomation,k as runAutomationCallLocally,b as parseAutomationPayload,g as localUserChromeProfiles,h as localUserChromeInstance,f as localUserChromeHost,j as localBrowserProfile,c as localAutomationAvailable,i as ensureLocalBrowser,a as AUTOMATION_CHUNK_BYTES};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as o,P as c,Q as d,R as e,S as f,T as g,U as h,V as i,W as j,X as k,Y as l,Z as m,_ as n,aa as p,ba as q,ca as r,da as s,ea as t,fa as u}from"./vm-hands-entry-lite-y3k1pyx7.js";import"./vm-hands-entry-lite-2yne3ped.js";import"./vm-hands-entry-lite-8kqg77ym.js";import"./vm-hands-entry-lite-h2xpqaxn.js";import"./vm-hands-entry-lite-qvrnx0vk.js";import{Zb as b}from"./vm-hands-entry-lite-n07kxrd1.js";import"./vm-hands-entry-lite-whcnpjdx.js";import"./vm-hands-entry-lite-d2wgjdc5.js";import"./vm-hands-entry-lite-yh7n4svm.js";import"./vm-hands-entry-lite-m5pmd2cz.js";import"./vm-hands-entry-lite-7s23wnph.js";import"./vm-hands-entry-lite-k1wbh9dq.js";import"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-rnykqcys.js";import"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-qbk0wxrz.js";import"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-0etm5tzc.js";import"./vm-hands-entry-lite-9jdxjw46.js";import"./vm-hands-entry-lite-y9k070mt.js";import{Ih as a}from"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{g as spawnCaptured,f as sandboxProfile,e as safeEnvironment,k as runTransferCapability,i as runFileCapability,t as rebindLocalHandsControl,j as localGithubPreviewServerLaunch,b as isProtectedLocalPath,u as executeLocalOperation,m as enrolledWorkspaceRootFingerprint,q as enrolledRootPaths,p as enrolledHomeContainedRootFingerprints,n as enrolledAccountRootPath,o as enrolledAccountRootFingerprint,s as deliverLocalHandsEnvironment,h as defaultLocalCommandRunner,d as confinedExecutionShell,r as capabilityInventoryForRoots,c as SHORT_REQUEST_CAPABILITIES,a as LocalCapabilityError,l as LOCAL_CAPABILITY_REGISTRY};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bh as a,Ch as b,Dh as c,Eh as d,Fh as e,Gh as f,Hh as g}from"./vm-hands-entry-lite-y9k070mt.js";import"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{f as trackDesktopRun,c as releaseLocalDesktop,a as noteLocalDesktopUse,g as holdLocalDesktop,b as forgetLocalDesktopUse,e as DESKTOP_WAIT_MS,d as DESKTOP_IDLE_MS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ng as a,Og as b,Pg as c,Qg as d,Rg as e,Sg as f,Tg as g}from"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{c as requestMacScreenAccess,d as parseMacWindowBounds,a as parseMacScreenStatus,e as openMacWindowBounds,g as openMacInput,b as macScreenStatus,f as MacInputTranslator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ae as h,te as a,ue as b,ve as c,we as d,xe as e,ye as f,ze as g}from"./vm-hands-entry-lite-7s23wnph.js";import"./vm-hands-entry-lite-k1wbh9dq.js";import"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-rnykqcys.js";import"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-qbk0wxrz.js";import"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-0etm5tzc.js";import"./vm-hands-entry-lite-9jdxjw46.js";import"./vm-hands-entry-lite-y9k070mt.js";import"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{h as runLocalDisplayStream,f as privateDirectory,c as parseDisplayStreamPayload,e as localDisplayReady,d as localDisplayAvailable,g as ensureLinuxDesktop,a as LOCAL_DISPLAY_MAX_SESSION_MS,b as LINUX_WORKER_DISPLAY};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$c as
|
|
2
|
+
import{$c as f,$d as fa,Ad as G,Bd as H,Cd as I,Dd as J,Ed as K,Fd as L,Gd as M,Hd as N,Id as O,Jd as P,Kd as Q,Ld as R,Md as S,Nd as T,Od as U,Pd as V,Qd as W,Rd as X,Sd as Y,Td as Z,Ud as _,Vd as $,Wc as a,Wd as aa,Xc as b,Xd as ba,Yc as c,Yd as ca,Zc as d,Zd as da,_c as e,_d as ea,ad as g,bd as h,cd as i,dd as j,ed as k,fd as l,gd as m,hd as n,id as o,jd as p,kd as q,ld as r,md as s,nd as t,od as u,pd as v,qd as w,rd as x,sd as y,td as z,ud as A,vd as B,wd as C,xd as D,yd as E,zd as F}from"./vm-hands-entry-lite-yh7n4svm.js";import"./vm-hands-entry-lite-m5pmd2cz.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{Y as parseLocalRuntimeRootsSyncResponse,U as parseLocalRuntimeRegistrationResponse,T as parseLocalRuntimeProofChallenge,ca as parseLocalRuntimeOperationHeartbeatResponse,da as parseLocalRuntimeOperationEventsResponse,ea as parseLocalRuntimeOperationEnvironmentResponse,fa as parseLocalRuntimeOperationCompletionResponse,ba as parseLocalRuntimeOperationClaim,$ as parseLocalRuntimeLocalSubscriptionResponse,aa as parseLocalRuntimeLifecycleResponse,Z as parseLocalRuntimeIdentityResponse,W as parseLocalRuntimeHeartbeatResponse,X as parseLocalRuntimeFirstHeartbeat,S as parseLocalRuntimeErrorEnvelope,V as parseLocalRuntimeEnrollmentResponse,_ as parseLocalRuntimeDisconnectResponse,j as localRuntimeSessionRoutable,R as buildLocalRuntimeDeviceProofBytes,I as WORKER_PREVIEW_CARRIED_JOBS,e as RELAY_HOST_ALIAS_VERSION,d as RELAY_HOST_ALIAS_HEADER,N as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,k as LOCAL_RUNTIME_SESSION_VM_HANDS_REGISTER,h as LOCAL_RUNTIME_SESSION_PRE_AUTH_MAX_BYTES,g as LOCAL_RUNTIME_SESSION_PATH,m as LOCAL_RUNTIME_SESSION_CLOSE,l as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,i as LOCAL_RUNTIME_SESSION_AUTH_DEADLINE_MS,b as LOCAL_RUNTIME_ROUTE_PREFIX,f as LOCAL_RUNTIME_ROUTES,a as LOCAL_RUNTIME_PROTOCOL_VERSION,O as LOCAL_RUNTIME_LIFECYCLE_EVENTS,Q as LOCAL_RUNTIME_LEGACY_DEVICE_PROOF_TAG,P as LOCAL_RUNTIME_DEVICE_PROOF_TAG,c as LOCAL_OPERATION_MAX_BYTES,K as JOBS_START_WAIT_KEY,J as JOBS_START_WAIT,H as HANDS_SESSION_GROUP_KEY,G as HANDS_SESSION_GROUP,s as HANDS_REBIND_KEY,t as HANDS_REBIND_CONTROL,r as HANDS_REBIND,D as HANDS_MODEL_JOBS_EGRESS_KEY,C as HANDS_MODEL_JOBS_EGRESS,z as HANDS_LARGE_ENVIRONMENT_KEY,y as HANDS_LARGE_ENVIRONMENT,F as HANDS_JOBS_USER_KEY,E as HANDS_JOBS_USER,x as HANDS_HEADLESS_BROWSER_KEY,w as HANDS_HEADLESS_BROWSER,o as HANDS_ENVIRONMENT_DELIVER_CONTROL,n as HANDS_ENVIRONMENT_DELIVERY,q as HANDS_ENVIRONMENT_AT_CLAIM_KEY,p as HANDS_ENVIRONMENT_AT_CLAIM,B as HANDS_CONFINEMENT_KEY,A as HANDS_CONFINEMENT,v as HANDS_CLOUD_ACCESS_KEY,u as HANDS_CLOUD_ACCESS,L as AUTOMATION_USER_CHROME,M as AUTOMATION_CLOUD_SESSIONS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qg as a,rg as b,sg as c,tg as d,ug as e,vg as f,wg as g,xg as h,yg as i,zg as j}from"./vm-hands-entry-lite-rnykqcys.js";import"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-0etm5tzc.js";import"./vm-hands-entry-lite-9jdxjw46.js";import"./vm-hands-entry-lite-wffqkcjq.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{j as runPermissionsCli,d as reasonIdentity,e as readMacPermissions,f as permissionsSummary,i as parsePermissionsArgs,c as fullDiskAccessTarget,g as formatMacPermissions,h as allowMacPermissions,a as PERMISSIONS_HELP,b as MAC_PERMISSION_IDS};
|
package/bin/vm-hands/{reason-hands-protocol-51gs8j7v.js → reason-hands-protocol-2gkb9qeb.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$f as
|
|
2
|
+
import{$f as S,Af as r,Bf as s,Cf as t,Df as u,Ef as v,Ff as w,Gf as x,Hf as y,If as z,Jf as A,Kf as B,Lf as C,Mf as D,Nf as E,Of as F,Pf as G,Qf as H,Rf as I,Sf as J,Tf as K,Uf as L,Vf as M,Wf as N,Xf as O,Yf as P,Zf as Q,_f as R,ag as T,bg as U,cg as V,dg as W,eg as X,fg as Y,jf as a,kf as b,lf as c,mf as d,nf as e,of as f,pf as g,qf as h,rf as i,sf as j,tf as k,uf as l,vf as m,wf as n,xf as o,yf as p,zf as q}from"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-kxbpf40y.js";import"./vm-hands-entry-lite-ss2w3h3d.js";export{w as reasonHandsCloseReason,X as parseReasonHandsSdkResponse,W as parseReasonHandsSdkRequest,I as parseReasonHandsResult,H as parseReasonHandsRequest,O as parseReasonHandsPtyReceipt,J as parseReasonHandsProgress,N as parseReasonHandsJobResult,M as parseReasonHandsJobRequest,L as parseReasonHandsClaimAck,K as parseReasonHandsClaim,P as parseReasonHandsCancelRequest,Q as parseReasonHandsCancelAck,E as isReasonHandsUuid,C as isReasonHandsRequestId,F as isReasonHandsPtyJobId,D as isReasonHandsGeneration,G as isReasonHandsArtifactSha256,Y as encodeReasonHandsSdkResponse,S as encodeReasonHandsResult,R as encodeReasonHandsRequest,T as encodeReasonHandsProgress,V as encodeReasonHandsClaimAck,U as encodeReasonHandsClaim,z as REASON_HANDS_SDK_MAX_QUERY_CHARS,y as REASON_HANDS_SDK_MAX_NAME_CHARS,n as REASON_HANDS_PTY_PROTOCOL_VERSION,q as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,p as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,o as REASON_HANDS_PTY_MAX_INPUT_BYTES,r as REASON_HANDS_PTY_MAX_DIMENSION,s as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,u as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,t as REASON_HANDS_PTY_ANCHOR_EXIT_MS,a as REASON_HANDS_PROTOCOL_VERSION,f as REASON_HANDS_OUTPUT_TRUNCATED_MARKER,d as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,e as REASON_HANDS_MAX_OUTPUT_CHARS,c as REASON_HANDS_MAX_INPUT_CHARS,b as REASON_HANDS_MAX_FRAME_BYTES,g as REASON_HANDS_MAX_ERROR_CHARS,h as REASON_HANDS_JOB_PROTOCOL_VERSION,l as REASON_HANDS_JOB_MAX_RECORDS,k as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,j as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,i as REASON_HANDS_JOB_MAX_INPUT_CHARS,A as REASON_HANDS_JOB_ERRORS,m as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,x as REASON_HANDS_ERROR_CODES,v as REASON_HANDS_CLOSE_CODES,B as HandsProtocolError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as Wq,b as Bq,c as bq,d as Fq,e as Dq,f as kq,i as Kq,j as Vq,o as Hq}from"./vm-hands-entry-lite-
|
|
2
|
+
import{a as Wq,b as Bq,c as bq,d as Fq,e as Dq,f as kq,i as Kq,j as Vq,o as Hq}from"./vm-hands-entry-lite-bjhw87nc.js";import"./vm-hands-entry-lite-yvmzze06.js";import"./vm-hands-entry-lite-y3k1pyx7.js";import"./vm-hands-entry-lite-2yne3ped.js";import"./vm-hands-entry-lite-8kqg77ym.js";import"./vm-hands-entry-lite-h2xpqaxn.js";import"./vm-hands-entry-lite-qvrnx0vk.js";import"./vm-hands-entry-lite-n07kxrd1.js";import"./vm-hands-entry-lite-whcnpjdx.js";import{lc as jq}from"./vm-hands-entry-lite-d2wgjdc5.js";import"./vm-hands-entry-lite-yh7n4svm.js";import{ae as G}from"./vm-hands-entry-lite-m5pmd2cz.js";import"./vm-hands-entry-lite-7s23wnph.js";import{Ee as H,Fe as u,Ge as s,bf as Qq}from"./vm-hands-entry-lite-k1wbh9dq.js";import"./vm-hands-entry-lite-53jm8bj7.js";import"./vm-hands-entry-lite-rnykqcys.js";import"./vm-hands-entry-lite-5vrdj7jm.js";import"./vm-hands-entry-lite-qbk0wxrz.js";import{Zg as l}from"./vm-hands-entry-lite-vvmq0mtv.js";import"./vm-hands-entry-lite-kxbpf40y.js";import{wh as R}from"./vm-hands-entry-lite-0etm5tzc.js";import"./vm-hands-entry-lite-9jdxjw46.js";import"./vm-hands-entry-lite-y9k070mt.js";import"./vm-hands-entry-lite-wffqkcjq.js";import{Mh as $q}from"./vm-hands-entry-lite-ss2w3h3d.js";import{createHash as tq,randomBytes as sq}from"crypto";import{readFileSync as eq,realpathSync as Aq,renameSync as aq,unlinkSync as nq,writeFileSync as q3}from"fs";import{dirname as x3,join as zq}from"path";import{spawnSync as Mq}from"child_process";import{accessSync as _q,constants as wq,existsSync as L,mkdirSync as Lq,readFileSync as fq,renameSync as Sq,writeFileSync as hq}from"fs";import{homedir as Cq}from"os";import{delimiter as gq,dirname as mq,join as T}from"path";import{existsSync as Tq,readFileSync as Uq}from"fs";import{join as vq}from"path";var Eq=`---
|
|
3
3
|
name: reason
|
|
4
4
|
description: Integrate software with Reason's public REST API using a scoped API key. Use for API clients, CI, service integrations, or cloud coding-session automation.
|
|
5
5
|
---
|
|
@@ -79,7 +79,7 @@ This computer
|
|
|
79
79
|
`),b.version)x.stdout.write(`Version: ${b.version}${b.version===R?"":` (${R} is installed; \`reason connect\` restarts it on that)`}
|
|
80
80
|
`);if(x.stdout.write(`Folder: ${b.folder}
|
|
81
81
|
`),x.stdout.write(`Sessions: ${b.sessions_running===null?"":`${b.sessions_running} running, `}${b.sessions_max===1?"one at a time":`up to ${b.sessions_max} at once`}
|
|
82
|
-
`),A){let Z=A,V=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Rq,readMacPermissions:Nq,reasonIdentity:Iq}=await import("./permissions-
|
|
82
|
+
`),A){let Z=A,V=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Rq,readMacPermissions:Nq,reasonIdentity:Iq}=await import("./permissions-qnq69hfd.js"),{macScreenStatus:Oq}=await import("./local-display-mac-rp51a8w7.js");return Rq(await Nq({identity:()=>Iq(),grants:Oq,worker:async()=>Z}))}))().catch(()=>null);if(V)x.stdout.write(`${V}
|
|
83
83
|
`);x.stdout.write(`Keep awake: ${A.keep_awake.enabled?"on":"off"}${A.keep_awake.holding?" (holding)":""}
|
|
84
84
|
`)}if(b.service)x.stdout.write(`Logs: ${b.service.logs}
|
|
85
85
|
`);for(let Z of b.workspaces??[]){let V=Z.state==="removed"?"removed from that workspace":Z.blocked?"offline (this computer is outside that workspace's allowed networks)":Z.device_id?Gq[Z.state]:"connecting";x.stdout.write(`Also in workspace ${Z.name??Z.organization_id}${Z.account?" (another Reason account's)":""}: ${V}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{O as
|
|
2
|
+
import{Ah as $}from"./vm-hands-entry-lite-9jdxjw46.js";var O=$.version,Z=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function S(B,D){if(!Z.test(B)||!Z.test(D))throw Error("cannot compare invalid CLI versions");let J=(q)=>{let y=q.indexOf("-");return y===-1?[q,void 0]:[q.slice(0,y),q.slice(y+1)]},[j,F]=J(B),[w,G]=J(D),K=j.split(".").map(BigInt),M=w.split(".").map(BigInt);for(let q=0;q<3;q+=1){if(K[q]===M[q])continue;return K[q]<M[q]?-1:1}if(F===void 0||G===void 0){if(F===G)return 0;return F===void 0?1:-1}let Q=F.split("."),U=G.split("."),A=Math.max(Q.length,U.length);for(let q=0;q<A;q+=1){let y=Q[q],z=U[q];if(y===void 0||z===void 0){if(y===z)return 0;return y===void 0?-1:1}if(y===z)continue;let H=/^\d+$/.test(y),W=/^\d+$/.test(z);if(H&&W){let X=BigInt(y),Y=BigInt(z);if(X===Y)continue;return X<Y?-1:1}if(H!==W)return H?-1:1;return y<z?-1:1}return 0}function k(B,D){return D?`cli ${B} \xB7 agent ${D}`:`cli ${B}`}
|
|
3
|
+
export{O as wh,Z as xh,S as yh,k as zh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ab as W9,Bb as u0,Ib as z0,wb as WQ,xb as Z8,yb as u9,zb as q0}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ab as W9,Bb as u0,Ib as z0,wb as WQ,xb as Z8,yb as u9,zb as q0}from"./vm-hands-entry-lite-8kqg77ym.js";import{Qb as PQ,Rb as IQ,Sb as rZ,Tb as tZ,Ub as G8}from"./vm-hands-entry-lite-qvrnx0vk.js";import{Zb as R0}from"./vm-hands-entry-lite-n07kxrd1.js";import{Bd as N0,Oc as a$,Rc as o$,ud as R9,vd as n0,wd as H8,xd as w0}from"./vm-hands-entry-lite-yh7n4svm.js";import{ae as I}from"./vm-hands-entry-lite-m5pmd2cz.js";import{Ke as kQ,Le as f8,Ze as wQ,df as s9,ef as w8}from"./vm-hands-entry-lite-k1wbh9dq.js";import{Af as x8,Df as c9,Lf as A8,Mf as P0,Nf as j0,Of as d9,Vf as R8,Wf as $Q,Xf as l$,gf as WZ,jf as F9,sf as r$,tf as t$,vf as e$,xf as v9,yf as p$,zf as u$}from"./vm-hands-entry-lite-53jm8bj7.js";import{Xg as aZ}from"./vm-hands-entry-lite-qbk0wxrz.js";import{Zg as U8,_g as p9,bh as iZ}from"./vm-hands-entry-lite-vvmq0mtv.js";import{ch as F8,dh as l0,eh as W8,fh as s0,gh as K9,hh as Q8,ih as r8,jh as p0,kh as v0,lh as d$,vh as F$}from"./vm-hands-entry-lite-kxbpf40y.js";import{Ah as JZ}from"./vm-hands-entry-lite-9jdxjw46.js";import{Gh as oZ}from"./vm-hands-entry-lite-y9k070mt.js";import{Ih as C}from"./vm-hands-entry-lite-wffqkcjq.js";import{Jh as L1,Mh as ZZ}from"./vm-hands-entry-lite-ss2w3h3d.js";var v={chunk:32768,upload:1048576,total:536870912,streams:16,queued:512,buffered:262144,relayBuffered:8388608,requestMs:30000,lifetimeMs:600000,authorizationMs:2000};function g9($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function g0($,Q,Z=Number.MAX_SAFE_INTEGER){return typeof $==="number"&&Number.isSafeInteger($)&&$>=Q&&$<=Z}function I$($){return typeof $==="string"&&/^[a-zA-Z0-9_-]{1,160}$/.test($)}function _0($){if(!g9($)||Object.keys($).length!==12||![$.organizationId,$.userId,$.runId,$.deviceId,$.rootId,$.jobId,$.fenceId].every(I$)||!g0($.attachmentRevision,0)||!g0($.grantRevision,1)||!g0($.generation,1)||!g0($.port,1024,65535)||!g0($.expiresAtMs,1))throw Error("preview_binding_invalid");return Object.freeze({...$})}function y0($,Q){return Object.keys($).every((Z)=>$[Z]===Q[Z])}function M9($){if($.length>4096||!$.startsWith("/")||$.startsWith("//")||/[\\\x00-\x20\x7f#]/.test($))throw Error("preview_path_invalid");let Q=decodeURIComponent($);if(Q.startsWith("//")||/[\\\x00-\x1f\x7f]/.test(Q))throw Error("preview_path_invalid");return $}function P$($){return Array.isArray($)&&$.length<=64&&$.every((Q)=>Array.isArray(Q)&&Q.length===2&&typeof Q[0]==="string"&&/^[a-zA-Z0-9-]{1,80}$/.test(Q[0])&&typeof Q[1]==="string"&&Q[1].length<=4096&&!/[\x00-\x1f\x7f]/.test(Q[1]))}function N9($,Q=v.chunk){if($.length>Math.ceil(Q/3)*4||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test($))throw Error("preview_data_invalid");let Z=Buffer.from($,"base64");if(Z.length>Q)throw Error("preview_data_too_large");return Z}function R$($){if(Array.isArray($))return Buffer.concat($);if(typeof $==="string")return Buffer.from($,"utf8");if($ instanceof ArrayBuffer)return Buffer.from($);return $}function E$($){if(Buffer.byteLength($)>v.upload*1.4+300000)throw Error("preview_frame_too_large");let Q=JSON.parse($);if(!g9(Q))throw Error("preview_frame_invalid");if(Q.type==="hello"){let Z=_0(Q.binding);return g0(Q.messages,v.chunk,v.upload)?{type:"hello",binding:Z,messages:Q.messages}:{type:"hello",binding:Z}}if(Q.type==="refused"&&typeof Q.reason==="string"&&/^[a-z_]{1,32}$/.test(Q.reason))return{type:"refused",binding:_0(Q.binding),reason:Q.reason};if(!I$(Q.id))throw Error("preview_frame_invalid");if(Q.type==="end"||Q.type==="cancel"||Q.type==="credit")return{type:Q.type,id:Q.id};if(Q.type==="ws"&&typeof Q.protocol==="string"&&/^[a-zA-Z0-9._-]{0,100}$/.test(Q.protocol))return{type:"ws",id:Q.id,protocol:Q.protocol};if(Q.type==="data"&&typeof Q.data==="string"&&typeof Q.binary==="boolean")return N9(Q.data,v.upload),{type:"data",id:Q.id,data:Q.data,binary:Q.binary};if(Q.type==="head"&&g0(Q.status,200,599)&&P$(Q.headers))return{type:"head",id:Q.id,status:Q.status,headers:Q.headers};if(Q.type==="request"&&typeof Q.method==="string"&&/^(GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS)$/.test(Q.method)&&typeof Q.path==="string"&&P$(Q.headers)&&typeof Q.body==="string"&&typeof Q.upgrade==="boolean")return N9(Q.body,v.upload),{type:"request",id:Q.id,method:Q.method,path:M9(Q.path),headers:Q.headers,body:Q.body,upgrade:Q.upgrade};throw Error("preview_frame_invalid")}function T8($){let Q=[...$],Z=new Set(Q.filter(([J])=>J.toLowerCase()==="connection").flatMap(([,J])=>J.toLowerCase().split(",").map((G)=>G.trim()))),X=new Set(["authorization","proxy-authorization","cookie","set-cookie","host","origin","referer","connection","upgrade","keep-alive","transfer-encoding","te","trailer","content-length","forwarded","alt-svc","service-worker-allowed","clear-site-data","refresh"]);return Q.filter(([J])=>!X.has(J.toLowerCase())&&!Z.has(J.toLowerCase())&&!/^(x-forwarded-|x-ara-|sec-websocket-|access-control-)/i.test(J))}async function O8($){let Q;try{return await Promise.race([Promise.resolve().then($).then((Z)=>Z===!0||(Z===!1?!1:void 0),()=>{return}),new Promise((Z)=>{Q=setTimeout(()=>Z(void 0),v.authorizationMs)})])}finally{clearTimeout(Q)}}async function j9($){return await O8($)===!0}function y9($,Q){let Z=new URL($);if(Z.username||Z.password||Z.search||Z.hash||!(Z.protocol==="wss:"||Z.protocol==="ws:"&&["127.0.0.1","[::1]"].includes(Z.hostname))||!new RegExp(`^/${Q}/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]{32,}$`).test(Z.pathname))throw Error("preview_relay_invalid");return Z.href}function S$($){if(!g9($)||Object.keys($).length!==2||typeof $.deviceRelayUrl!=="string")throw Error("preview_open_invalid");return{binding:_0($.binding),deviceRelayUrl:y9($.deviceRelayUrl,"device")}}function w$($){if(!g9($)||Object.keys($).length!==1||!("binding"in $))throw Error("preview_close_invalid");return{binding:_0($.binding)}}import{request as B4}from"http";import{WebSocket as C9}from"ws";import{randomBytes as F4,timingSafeEqual as W4}from"crypto";import{createServer as U4}from"net";var b$="x-preview-connection";async function k$($,Q){if(Q.aborted)throw Error("preview_closed");let Z=F4(32).toString("base64url"),X=new Set,J=!1,G=U4((Y)=>{if(J||Q.aborted||X.size>=v.streams*2)return Y.destroy();X.add(Y);let H=new AbortController;Y.once("close",()=>{X.delete(Y),H.abort()}),Y.on("error",()=>Y.destroy()),Y.setTimeout(2000,()=>Y.destroy());let W=Buffer.alloc(0),F=(L)=>{W=Buffer.concat([W,L]);let B=W.indexOf(`\r
|
|
3
3
|
\r
|
|
4
4
|
`);if(B<0){if(W.length>16384)Y.destroy();return}if(Y.pause(),Y.off("data",F),B>16384||W.length>v.upload+16384)return Y.destroy();K(W,B).catch(()=>Y.destroy())};Y.on("data",F);async function K(L,B){let U=L.subarray(0,B).toString("latin1").split(`\r
|
|
5
5
|
`),M=/^(GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS) (\S+) HTTP\/1\.1$/.exec(U.shift()??"");if(!M)throw Error("preview_request_invalid");M9(M[2]);let _=!1,q=0,D=[];for(let T of U){let k=/^([a-zA-Z0-9-]+):[ \t]*([^\x00-\x08\x0a-\x1f\x7f]*)$/.exec(T);if(!k)throw Error("preview_header_invalid");if(k[1].toLowerCase()===b$){q++;let g=Buffer.from(k[2].trim());_=g.length===Z.length&&W4(g,Buffer.from(Z))}else if(k[1].toLowerCase()!=="host")D.push(T)}if(!_||q!==1||J||H.signal.aborted)throw Error("preview_connection_denied");let x=await $.connect(H.signal);if(J||H.signal.aborted)throw x.destroy(),Error("preview_closed");X.add(x),x.on("error",()=>Y.destroy()),x.once("close",()=>{X.delete(x),Y.destroy()}),Y.once("close",()=>x.destroy()),Y.setTimeout(0);let b=[`${M[1]} ${M[2]} HTTP/1.1`,`Host: 127.0.0.1:${x.remotePort}`,...D,"",""].join(`\r
|
|
@@ -303,7 +303,7 @@ async (input) => {
|
|
|
303
303
|
if (!bridge || typeof bridge.evaluate !== "function") throw new Error("Reason Hands browser bridge is not installed");
|
|
304
304
|
return await bridge.evaluate(typeof input === "string" ? input : input && input.code);
|
|
305
305
|
}
|
|
306
|
-
`.trim();import{Buffer as Q9}from"buffer";import{randomUUID as a3}from"crypto";class lQ extends Error{code;constructor($){super($==="hands_repl_private_profile_attribute_denied"?"Private browser attribute read denied.":$);this.code=$;this.name="HandsReplBrowserDispatcherError"}}var sQ=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","prototype"]),dQ=/^hands_[A-Za-z0-9_-]{8,128}$/,o3=2048,nQ=32,iQ=1e4,r3=new Set(["href","src","alt","title","role","aria-label","aria-expanded","aria-checked","aria-selected","aria-disabled","placeholder","type","name","data-testid"]);function t3($){let Q=$.split("+"),Z=(Q.pop()??"").replace(/^Key/,"").toLowerCase();if(Z==="f12")return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&["l","n","t","j","i","p","s","w","u","o","r","tab","pageup","pagedown"].includes(Z))return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&Q.includes("Shift")&&Z==="c")return!0;return Q.includes("Alt")&&["d","arrowleft","arrowright","home"].includes(Z)}var e3=($)=>{let Q=$.closest("a[href],area[href]");return{password:$.tagName==="INPUT"&&$.type==="password",executableLink:Boolean(Q&&!/^(https?:|about:blank)/i.test(Q.href))}},aQ={browser:{close:{returns:"void"},contexts:{returns:"context[]"},isConnected:{returns:"json"},version:{returns:"json"}},context:{addCookies:{returns:"void"},addInitScript:{returns:"void"},browser:{returns:"browser"},clearCookies:{returns:"void"},clearPermissions:{returns:"void"},close:{returns:"void"},cookies:{returns:"json"},grantPermissions:{returns:"void"},newPage:{returns:"page"},pages:{returns:"page[]"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setGeolocation:{returns:"void"},setHTTPCredentials:{returns:"void"},setOffline:{returns:"void"},setViewportSize:{returns:"void"},storageState:{returns:"json"},viewportSize:{returns:"json",special:"contextViewportSize"}},page:{addInitScript:{returns:"void"},addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},bringToFront:{returns:"void"},close:{returns:"void"},content:{returns:"json"},context:{returns:"context"},emulateMedia:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},frame:{returns:"frame"},frameLocator:{returns:"frameLocator"},frames:{returns:"frame[]"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goBack:{returns:"void"},goForward:{returns:"void"},goto:{returns:"void"},isClosed:{returns:"json"},locator:{returns:"locator"},mainFrame:{returns:"frame"},opener:{returns:"page"},pdf:{returns:"bytes"},reload:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setContent:{returns:"void"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setInputFiles:{returns:"void"},setViewportSize:{returns:"void"},title:{returns:"json"},url:{returns:"json"},viewportSize:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},locator:{all:{returns:"locator[]"},allInnerTexts:{returns:"json"},allTextContents:{returns:"json"},and:{returns:"locator"},ariaSnapshot:{returns:"json"},blur:{returns:"void"},boundingBox:{returns:"json"},check:{returns:"void"},clear:{returns:"void"},click:{returns:"void"},contentFrame:{returns:"frameLocator"},count:{returns:"json"},dblclick:{returns:"void"},dragTo:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},evaluateAll:{returns:"json",requiresStringSource:!0},fill:{returns:"void"},filter:{returns:"locator"},first:{returns:"locator",special:"property"},focus:{returns:"void"},getAttribute:{returns:"json"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},hover:{returns:"void"},innerHTML:{returns:"json"},innerText:{returns:"json"},inputValue:{returns:"json"},isChecked:{returns:"json"},isEditable:{returns:"json"},isEnabled:{returns:"json"},isHidden:{returns:"json"},isVisible:{returns:"json"},last:{returns:"locator",special:"property"},locator:{returns:"locator"},nth:{returns:"locator"},or:{returns:"locator"},page:{returns:"page"},press:{returns:"void"},pressSequentially:{returns:"void"},scrollIntoViewIfNeeded:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setInputFiles:{returns:"void"},tap:{returns:"void"},textContent:{returns:"json"},type:{returns:"void"},uncheck:{returns:"void"},waitFor:{returns:"void"}},frame:{addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},childFrames:{returns:"frame[]"},content:{returns:"json"},evaluate:{returns:"json",requiresStringSource:!0},frameLocator:{returns:"frameLocator"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goto:{returns:"void"},isDetached:{returns:"json"},locator:{returns:"locator"},name:{returns:"json"},page:{returns:"page"},parentFrame:{returns:"frame"},setContent:{returns:"void"},title:{returns:"json"},url:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},frameLocator:{getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},locator:{returns:"locator"},owner:{returns:"locator"}}};function R($){throw new lQ($)}function G0($){if(!$||typeof $!=="object"||Array.isArray($))return!1;let Q=Object.getPrototypeOf($);return Q===Object.prototype||Q===null}function Z9($,Q=0,Z={nodes:0}){if(Q>nQ||++Z.nodes>iQ)R("hands_repl_json_too_complex");if($===null||typeof $==="boolean"||typeof $==="string")return;if(typeof $==="number"){if(!Number.isFinite($))R("hands_repl_invalid_json");return}if(Array.isArray($)){for(let X of $)Z9(X,Q+1,Z);return}if(!G0($))R("hands_repl_invalid_json");for(let[X,J]of Object.entries($)){if(sQ.has(X))R("hands_repl_invalid_json");Z9(J,Q+1,Z)}}function m8($){return typeof $==="string"&&Object.hasOwn(aQ,$)}function $1($){if(!$.endsWith("[]"))return null;let Q=$.slice(0,-2);return m8(Q)?Q:null}function pQ($){return G0($)&&Object.keys($).length===2&&$.$handsRepl==="bytes"&&typeof $.base64==="string"}function Q1($){return G0($)&&Object.keys($).length===1&&$.$handsRepl==="undefined"}function uQ($){return G0($)&&Object.keys($).length===2&&$.$handsRepl==="routeFulfill"&&"options"in $}function E0($){return!!$&&typeof $==="object"}function a9(){return Object.freeze({$handsRepl:"undefined"})}function Z1($){if(!Q9.isBuffer($)&&!($ instanceof Uint8Array))R("hands_repl_expected_bytes");return Object.freeze({$handsRepl:"bytes",base64:Q9.from($).toString("base64")})}function oQ($){if(!E0($.browser)||!E0($.context)||!E0($.page))R("hands_repl_invalid_roots");if(typeof $.a11y!=="function"||typeof $.view!=="function")R("hands_repl_invalid_callbacks");let Q=$.maxHandles??o3;if(!Number.isInteger(Q)||Q<3||Q>1e5)R("hands_repl_invalid_handle_limit");let Z=new Map,X=new WeakMap,J=$.createOpaqueId??a3,G=(K,L)=>{if(!E0(L))R("hands_repl_expected_target");let B=X.get(L)?.get(K);if(B)return B;if(Z.size>=Q)R("hands_repl_handle_limit");let U="";for(let q=0;q<16;q+=1){let D=`hands_${J()}`;if(dQ.test(D)&&!Z.has(D)){U=D;break}}if(!U)R("hands_repl_invalid_opaque_id");let M=Object.freeze({$handsRepl:"handle",id:U,kind:K});Z.set(U,{kind:K,target:L});let _=X.get(L);if(!_)_=new Map,X.set(L,_);return _.set(K,M),M},z=Object.freeze({browser:G("browser",$.browser),context:G("context",$.context),page:G("page",$.page)}),V=(K)=>{if(!G0(K)||Object.keys(K).length!==3||K.$handsRepl!=="handle"||typeof K.id!=="string"||!dQ.test(K.id)||!m8(K.kind))R("hands_repl_invalid_handle");let L=Z.get(K.id);if(!L||L.kind!==K.kind)R("hands_repl_unknown_handle");return L},Y=(K,L=0,B=new Set)=>{if(L>nQ)R("hands_repl_json_too_complex");if(K===void 0)return a9();if(K===null||typeof K==="boolean"||typeof K==="string")return K;if(typeof K==="number"){if(!Number.isFinite(K))R("hands_repl_non_json_result");return K}if(Array.isArray(K)){if(B.has(K))R("hands_repl_cyclic_result");B.add(K);try{return K.map((U)=>Y(U,L+1,B))}finally{B.delete(K)}}if(!G0(K))R("hands_repl_non_json_result");if(B.has(K))R("hands_repl_cyclic_result");B.add(K);try{let U=Object.create(null);for(let M of Object.keys(K)){let _=Object.getOwnPropertyDescriptor(K,M);if(!_||!("value"in _))continue;U[M]=Y(_.value,L+1,B)}return U}finally{B.delete(K)}},H=(K,L)=>{if(L==="void")return a9();if(L==="json")return Y(K);if(L==="bytes")return Z1(K);let B=$1(L);if(B){if(!Array.isArray(K))R("hands_repl_expected_target_list");if(B==="context"&&K.some((U)=>U!==$.context))R("hands_repl_foreign_context");return K.map((U)=>G(B,U))}if(K===null||K===void 0)return a9();if(!m8(L))R("hands_repl_invalid_return_kind");if(L==="context"&&K!==$.context)R("hands_repl_foreign_context");return G(L,K)},W=(K)=>{if(G0(K)&&K.$handsRepl==="handle")return V(K).target;if(pQ(K))return Q9.from(K.base64,"base64");if(Q1(K))return;if(uQ(K))R("hands_repl_route_fulfill_only");if(Array.isArray(K))return K.map(W);if(!G0(K))return K;let L=Object.create(null);for(let[B,U]of Object.entries(K))L[B]=W(U);return L};return Object.freeze({roots:z,dispatch:async(K)=>{if(!G0(K)||typeof K.type!=="string")R("hands_repl_invalid_request");if(K.type==="a11y"){let T=K.target===void 0?Z.get(z.page.id):V(K.target);if(!T||T.kind!=="page"&&T.kind!=="locator")R("hands_repl_invalid_a11y_target");return Y(await $.a11y(T.target))}if(K.type==="view"){if(Z9(K.source),K.options!==void 0)Z9(K.options);let T=pQ(K.source)?Q9.from(K.source.base64,"base64"):K.source;if($.privateProfile&&!Q9.isBuffer(T))R("hands_repl_profile_requires_image_bytes");return Y(await $.view(T,K.options))}if(K.type!=="call")R("hands_repl_invalid_request");if(typeof K.method!=="string"||K.method.length===0||K.method.length>128)R("hands_repl_invalid_method");if(sQ.has(K.method))R("hands_repl_forbidden_method");let L=V(K.target),B=K.args??[];if(!Array.isArray(B))R("hands_repl_invalid_arguments");if(Z9(B),L.kind==="page"&&K.method==="captureScreenshot"){if(B.length!==0)R("hands_repl_invalid_arguments");if(!$.screenshotExport)R("hands_repl_screenshot_export_unavailable");return Y(await $.screenshotExport(L.target))}if(L.kind==="context"&&["startRecording","stopRecording"].includes(K.method)){if(!$.recording||L.target!==$.context)R("hands_repl_recording_unavailable");if(B.length>(K.method==="startRecording"?1:0))R("hands_repl_invalid_arguments");return Y(K.method==="startRecording"?await $.recording.start(B[0]):await $.recording.stop())}if($.privateProfile){let T=K.method;if(["evaluate","evaluateAll","waitForFunction","addInitScript","addScriptTag","addStyleTag","setContent","setInputFiles","route","content","cookies","storageState","addCookies","clearCookies","setExtraHTTPHeaders","setHTTPCredentials","grantPermissions","clearPermissions","innerHTML","textContent","allTextContents"].includes(T)||L.kind==="browser"&&T==="close"||L.kind==="context"&&T==="close")R("hands_repl_private_profile_method_denied");if(L.kind==="browser"&&T==="contexts")return H([$.context],"context[]");if((T==="screenshot"||T==="pdf")&&G0(B[0])&&(("path"in B[0])||("style"in B[0])))R("hands_repl_private_profile_path_denied");if(T==="goto"){if(typeof B[0]!=="string")R("hands_repl_private_profile_url_denied");try{let k=new URL(B[0]);if(!["http:","https:"].includes(k.protocol)&&B[0]!=="about:blank")R("hands_repl_private_profile_url_denied")}catch{R("hands_repl_private_profile_url_denied")}}if(T==="getAttribute"&&(typeof B[0]!=="string"||!r3.has(B[0].toLowerCase())))R("hands_repl_private_profile_attribute_denied");if(L.kind==="locator"&&["innerText","allInnerTexts","getAttribute"].includes(T)){let k=[L.target];if(T==="allInnerTexts"){let g=Reflect.get(L.target,"all");if(typeof g!=="function")R("hands_repl_private_profile_probe_unavailable");let O=await Reflect.apply(g,L.target,[]);if(!Array.isArray(O)||O.length>iQ||!O.every(E0))R("hands_repl_private_profile_probe_unavailable");k=O}for(let g of k){let O=Reflect.get(g,"isVisible");if(typeof O!=="function"||!await Reflect.apply(O,g,[]))R("hands_repl_private_profile_hidden_value_denied")}}if(T==="press"&&typeof B[0]==="string"&&t3(B[0]))R("hands_repl_private_profile_browser_shortcut_denied");if(L.kind==="locator"&&["inputValue","click","dblclick","tap","press"].includes(T)){let k=Reflect.get(L.target,"evaluate");if(typeof k!=="function")R("hands_repl_private_profile_probe_unavailable");let g=await Reflect.apply(k,L.target,[e3]);if(!G0(g)||typeof g.password!=="boolean"||typeof g.executableLink!=="boolean")R("hands_repl_private_profile_probe_unavailable");if(T==="inputValue"&&g.password)R("hands_repl_private_profile_password_denied");if(T!=="inputValue"&&g.executableLink)R("hands_repl_private_profile_url_denied");if(T==="inputValue"){let O=Reflect.get(L.target,"isVisible");if(typeof O!=="function"||!await Reflect.apply(O,L.target,[]))R("hands_repl_private_profile_hidden_value_denied")}}}let U=aQ[L.kind][K.method];if(!U)R("hands_repl_method_not_allowed");if(U.requiresStringSource&&typeof B[0]!=="string")R("hands_repl_string_source_required");if(L.kind==="browser"&&K.method==="contexts")return[z.context];if(["addInitScript","addScriptTag","addStyleTag","screenshot","pdf","storageState"].includes(K.method)&&B.some((T)=>G0(T)&&("path"in T)))R("hands_repl_file_path_not_allowed");if(K.method==="goto"&&typeof B[0]==="string"){let T;try{T=new URL(B[0]).protocol}catch{R("hands_repl_invalid_url")}if(!["http:","https:","data:","about:","blob:"].includes(T))R("hands_repl_file_path_not_allowed")}if(U.special==="contextViewportSize"){let T=Reflect.get(L.target,"pages");if(typeof T!=="function")R("hands_repl_method_unavailable");let k=await Reflect.apply(T,L.target,[]),g=Array.isArray(k)?k[0]:void 0,O=E0(g)?Reflect.get(g,"viewportSize"):void 0;if(typeof O!=="function")return a9();return H(await Reflect.apply(O,g,[]),U.returns)}if(U.special==="property"){let T=Reflect.get(L.target,K.method);return H(typeof T==="function"?Reflect.apply(T,L.target,[]):T,U.returns)}let M=Reflect.get(L.target,K.method);if(typeof M!=="function")R("hands_repl_method_unavailable");if(U.special==="route"){let T=B[1];if(!uQ(T))R("hands_repl_invalid_route_handler");Z9(T.options);let k=W(T.options),g=async(j)=>{if(!E0(j))R("hands_repl_invalid_route");let A=Reflect.get(j,"fulfill");if(typeof A!=="function")R("hands_repl_invalid_route");await Reflect.apply(A,j,[k])},O=[W(B[0]??null),g],N=await Reflect.apply(M,L.target,O);return H(N,U.returns)}let _=B.map(W);if(K.method==="setInputFiles"){let T=L.kind==="locator"?0:1,k=async(O)=>{if(typeof O!=="string"){if(!G0(O)||typeof O.name!=="string"||typeof O.mimeType!=="string"||!Q9.isBuffer(O.buffer))R("hands_repl_invalid_file_input");return O}if(!$.readWorkspaceFile)R("hands_repl_workspace_required");return $.readWorkspaceFile(O)},g=_[T];_[T]=Array.isArray(g)?await Promise.all(g.map(k)):await k(g)}if(K.method==="goto")await $.beforeNavigation?.();let q=$.actionRecorder?.(),D=await Reflect.apply(M,L.target,_),b={click:"Click browser element",tap:"Click browser element",dblclick:"Double click browser element",fill:"Type text",type:"Type text",pressSequentially:"Type text",clear:"Clear browser field",press:"Press key",scrollIntoViewIfNeeded:"Scroll browser element into view",dragTo:"Drag on computer",selectOption:"Select browser option",check:"Check browser control",uncheck:"Uncheck browser control",hover:"Hover browser element",focus:"Focus browser element",goto:"Open browser page",reload:"Reload browser page",goBack:"Go back in browser",goForward:"Go forward in browser",screenshot:"Take browser screenshot"}[K.method];if(b){let T=Reflect.get(L.target,"page"),k=L.kind==="page"?L.target:typeof T==="function"?Reflect.apply(T,L.target,[]):void 0;q?.(b,E0(k)?k:void 0)}return H(D,U.returns)}})}import{isIP as QZ}from"net";import{Resolver as X1}from"dns/promises";import{isIP as r9}from"net";var J1=[["0.0.0.0",8],["10.0.0.0",8],["100.64.0.0",10],["127.0.0.0",8],["169.254.0.0",16],["172.16.0.0",12],["192.0.0.0",24],["192.0.2.0",24],["192.168.0.0",16],["198.18.0.0",15],["198.51.100.0",24],["203.0.113.0",24],["224.0.0.0",4],["240.0.0.0",4]];function g8($){if(r9($)!==4)return null;let Q=$.split(".");if(Q.length!==4)return null;let Z=0;for(let X of Q){let J=Number(X);if(!Number.isInteger(J)||J<0||J>255)return null;Z=Z*256+J}return Z>>>0}function Y1($,Q,Z){let X=g8(Q);if(X===null)return!1;let J=Z===0?0:4294967295<<32-Z>>>0;return($&J)>>>0===(X&J)>>>0}function rQ($){let Q=g8($);if(Q===null)return!0;return J1.some(([Z,X])=>Y1(Q,Z,X))}function G1($){if(r9($)!==6)return null;let Q=$.toLowerCase(),Z=Q.indexOf("%");if(Z>=0)Q=Q.slice(0,Z);let X=[],J=Q.lastIndexOf(":"),G=J>=0?Q.slice(J+1):"";if(G.includes(".")){let K=g8(G);if(K===null)return null;X=[K>>>16&65535,K&65535],Q=Q.slice(0,J+1)+"0:0"}let z=Q.split("::");if(z.length>2)return null;let V=(K)=>{if(K==="")return[];let L=[];for(let B of K.split(":")){if(B===""||B.length>4||!/^[0-9a-f]+$/.test(B))return null;L.push(Number.parseInt(B,16))}return L},Y=V(z[0]??"");if(Y===null)return null;if(z.length===1){let K=Y;if(K.length!==8)return null;return X.length>0?K.slice(0,6).concat(X):K}let H=V(z[1]??"");if(H===null)return null;let W=8-Y.length-H.length;if(W<0)return null;let F=Y.concat(Array(W).fill(0),H);if(F.length!==8)return null;return X.length>0?F.slice(0,6).concat(X):F}function z1($,Q){return`${$>>8&255}.${$&255}.${Q>>8&255}.${Q&255}`}function K1($){let Q=G1($);if(Q===null)return!0;let[Z,X,J]=Q;if((Z&57344)!==8192)return!0;if(Z===8193&&(X&65024)===0)return!0;if(Z===8193&&X===3512)return!0;if(Z===16383&&(X&61440)===0)return!0;if(Z===8194)return rQ(z1(X,J));return!1}function tQ($){return $.replace(/^\[|\]$/g,"")}function o9($){let Q=tQ($.trim()),Z=r9(Q);if(Z===4)return rQ(Q);if(Z===6)return K1(Q);return!0}function eQ($){if($ instanceof Error&&$.name==="TimeoutError")return"dns_timeout";switch(typeof $==="object"&&$!==null&&"code"in $?$.code:void 0){case"ENOTFOUND":return"dns_not_found";case"ENODATA":return"dns_empty";case"EAI_AGAIN":case"ESERVFAIL":case"ECONNREFUSED":return"dns_temporary";case"ETIMEOUT":case"ETIMEDOUT":return"dns_timeout";default:return"dns_failed"}}var $Z=5000;function V1($){return async(Q,Z)=>{if(Z?.aborted)throw Error("aborted");let X=new X1({timeout:$Z,tries:1});if($)X.setServers($);let J=()=>X.cancel();Z?.addEventListener("abort",J,{once:!0});try{let[G,z]=await Promise.allSettled([X.resolve4(Q),X.resolve6(Q)]),V=[...G.status==="fulfilled"?G.value:[],...z.status==="fulfilled"?z.value:[]];if(V.length>0)return V;let Y=[G,z].flatMap((W)=>W.status==="rejected"?[W.reason]:[]);throw Y.find((W)=>["dns_temporary","dns_timeout"].includes(eQ(W)))??Y[0]??Object.assign(Error("DNS returned no addresses"),{code:"ENODATA"})}finally{Z?.removeEventListener("abort",J)}}}var H1=V1();async function F1($,Q,Z,X){if(X?.aborted)throw Error("aborted");let J=new AbortController,G,z,V=Q($,J.signal);V.catch(()=>{});try{return await Promise.race([V,new Promise((Y,H)=>{if(G=setTimeout(()=>H(new DOMException("DNS lookup timed out","TimeoutError")),Z),X)z=()=>H(Error("aborted")),X.addEventListener("abort",z,{once:!0})})])}finally{if(G!==void 0)clearTimeout(G);if(X&&z)X.removeEventListener("abort",z);J.abort()}}async function p5($,Q=H1,Z){let X=tQ($);if(r9(X))return o9(X)?{ok:!1,reason:"non_public_ip"}:{ok:!0,addresses:[X]};let J;try{J=await F1(X,Q,$Z,Z)}catch(G){return{ok:!1,reason:Z?.aborted?Z.reason instanceof Error&&Z.reason.name==="TimeoutError"?"dns_timeout":"aborted":eQ(G)}}if(J.length===0)return{ok:!1,reason:"dns_empty"};if(J.some(o9))return{ok:!1,reason:"non_public_ip"};return{ok:!0,addresses:J}}var W1=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$/;function y8($){return $.length<=253&&W1.test($.toLowerCase())}function U1($,Q){let Z=$.trim().toLowerCase();if(!y8(Z))return!1;if(Z.startsWith("*.")){let X=Z.slice(2);return Q===X||Q.endsWith(`.${X}`)}return Z===Q}function B1($){let Q=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec($);if(!Q)return null;let Z=Q.slice(1).map(Number);return Z.some((X)=>X>255)?null:Z}function h8($,Q=[]){let Z=(X)=>{if(X=X.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,""),!X.includes(":"))return X;try{X=new URL(`http://[${X}]/`).hostname.slice(1,-1)}catch{return X}let J=/^::ffff:([\da-f]+):([\da-f]+)$/.exec(X);if(!J)return X;let G=parseInt(J[1],16),z=parseInt(J[2],16);return`${G>>8}.${G&255}.${z>>8}.${z&255}`};return Q.some((X)=>Z(X)===Z($))}function c0($){$=$.toLowerCase().replace(/^\[|\]$/g,"");let Q=B1($);if(Q){let[G,z,V]=Q;if(G===127)return"loopback";return G===0||G===10||G>=224||G===100&&z>=64&&z<=127||G===169&&z===254||G===172&&z>=16&&z<=31||G===192&&(z===168||z===0&&(V===0||V===2)||z===88&&V===99)||G===198&&(z===18||z===19||z===51&&V===100)||G===203&&z===0&&V===113?"private":"public"}if(!$.includes(":"))return"hostname";try{$=new URL(`http://[${$}]/`).hostname.slice(1,-1)}catch{return"private"}if($==="::1")return"loopback";let Z=/^::ffff:([\da-f]+):([\da-f]+)$/.exec($);if(Z){let G=parseInt(Z[1],16),z=parseInt(Z[2],16);return c0(`${G>>8}.${G&255}.${z>>8}.${z&255}`)==="public"?"public":"private"}let[X,J=0]=$.split(":").map((G)=>parseInt(G||"0",16));return X<8192||X>16383||X===8194||X===8193&&(J<512||J===3512)||X===16383&&J<4096?"private":"public"}function A9($,Q){let Z;try{Z=new URL($)}catch{return{allowed:!1,url:$,host:null,reason:"invalid_url"}}if(["about:","data:","blob:"].includes(Z.protocol))return{allowed:!0,url:$,host:null,reason:"local_document"};if(!["http:","https:","ws:","wss:"].includes(Z.protocol))return{allowed:!1,url:$,host:Z.hostname||null,reason:"unsupported_protocol"};let X=Z.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(Q.mode==="off")return{allowed:!0,url:$,host:X,reason:"policy_off"};let J=(V)=>({allowed:!1,url:$,host:X,reason:V});if(Z.username||Z.password)return J("invalid_url");if(Q.mode==="public_web"){let V=c0(X)!=="public"&&c0(X)!=="hostname"||X==="localhost"||/\.(?:localhost|local|internal|arpa)$/.test(X)||!X.includes(".")&&!QZ(X)||Boolean(QZ(X)&&o9(X));return{allowed:!V,url:$,host:X,reason:V?"private_network":"public_web"}}let G=Number(Z.port||(["https:","wss:"].includes(Z.protocol)?443:80));if(Q.deniedPorts?.includes(G)||h8(X,Q.deniedHosts))return J("destination_not_allowed");let z=c0(X);if(z==="private"||["local","internal","arpa"].some((V)=>X===V||X.endsWith(`.${V}`)))return J("private_network");if(z==="loopback"||X==="localhost"||X.endsWith(".localhost"))return Q.allowedLoopbackPorts?.includes(G)?{allowed:!0,url:$,host:X,reason:"loopback"}:J("destination_not_allowed");if(Q.allowedDomains.some((V)=>U1(V,X)))return{allowed:!0,url:$,host:X,reason:"allowed_domain"};return{allowed:!1,url:$,host:X,reason:"destination_not_allowed"}}import XZ from"child_process";import{accessSync as N1,constants as M1,readFileSync as j1,statSync as C1}from"fs";import{createRequire as q1}from"module";import{isAbsolute as v8,join as T1}from"path";var c8=Object.freeze({schemaVersion:1,driver:"playwright-core",driverVersion:JZ.dependencies["playwright-core"],browser:"chromium"}),YZ=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Chromium.app/Contents/MacOS/Chromium"],d8=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable"];function x9($){try{return N1($,M1.X_OK),v8($)&&C1($).isFile()}catch{return!1}}function p8($,Q=process.platform){let Z=Q==="darwin"?YZ:Q==="linux"?d8:null;return Z?($??Z).find(x9)??null:null}function O1(){if(!process.versions.bun)return;let $=Symbol.for("ara.headless-browser.bun-pipe-owners");if(Object.hasOwn(globalThis,$))return;let Q=[];XZ.spawn=new Proxy(XZ.spawn,{apply(Z,X,J){let G=Reflect.apply(Z,X,J),z=J[1],V=J[2]?.stdio;if(Array.isArray(z)&&z.includes("--remote-debugging-pipe")&&Array.isArray(V)&&V[3]==="pipe"&&V[4]==="pipe")Q.push(G);return G}}),Object.defineProperty(globalThis,$,{value:Q})}async function t9($){if(O1(),$!==void 0){if(!v8($))throw Error("hands_browser_driver_path_must_be_absolute");let X=T1($,"package.json"),J=JSON.parse(j1(X,"utf8"));if(J.name!==c8.driver)throw Error("hands_browser_wrong_driver");let G=q1(X)($),z=G.default?.chromium??G.chromium;if(!z)throw Error("hands_browser_missing_chromium");return{version:J.version,chromium:z}}let[Q,Z]=await Promise.all([import("./index-w9nq2f0p.js"),import("./package-rx9y4bwe.js").then((m)=>L1(m.default,1))]);return{version:Z.default.version,chromium:Q.chromium}}var D1=($,Q=c8.driverVersion)=>({status:"unavailable",reason:$,expectedDriverVersion:Q}),_1=($)=>$.loadDriver?.()??t9($.driverModuleDirectory);async function X9($={}){return GZ($,c8.driverVersion)}async function u8($,Q={}){if($.driverVersion!=="1.61.1"||!v8($.driverModuleDirectory))throw Error("hands_browser_invalid_managed_compatibility");return GZ({...Q,driverModuleDirectory:$.driverModuleDirectory,allowSystemBrowser:!0},$.driverVersion)}async function GZ($,Q){let Z=(Y)=>D1(Y,Q),X=$.platform??process.platform;if(X!=="linux"&&X!=="darwin")return Z("unsupported_platform");let J;try{J=await _1($)}catch{return Z("driver_missing")}if(J.version!==Q)return Z("driver_version_mismatch");let G=(Y,H)=>({status:"resolved",executablePath:Y,source:H,driverVersion:J.version});if($.executablePath!==void 0)return x9($.executablePath)?G($.executablePath,"configured"):Z("executable_missing");let z=J.chromium.executablePath();if(x9(z))return G(z,"managed");let V=$.allowSystemBrowser===!0?p8($.systemCandidates,X):null;return V?G(V,"system"):Z("executable_missing")}var g1=["/usr/local/bin/chromium",...d8];function y1($,Q=UZ()){return p8($??(Q==="linux"?g1:void 0),Q)}async function h1(){try{return(await t9()).chromium}catch{return w1(import.meta.url)("playwright-core").chromium}}var v1=1048576,c1=105000,d1=20000,VZ=5000,p1=2000,u1=1000,l1=30000,HZ=81920,s1={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};async function n1($,Q){let Z=new URL($.url()),X={...await $.allHeaders(),host:Z.host};for(let J of Object.keys(X))if(/^(?:proxy-|connection$|upgrade$|transfer-encoding$|content-length$)/i.test(J))delete X[J];return new Promise((J,G)=>{let V=(Z.protocol==="https:"?k1:b1)(Z,{method:$.method(),headers:X,agent:!1,lookup:(H,W,F)=>{let K=d0.isIP(Q);if(W.all)F(null,[{address:Q,family:K}]);else F(null,Q,K)}},(H)=>{let W=[],F=0;H.on("data",(K)=>{if(F+=K.length,F>33554432)V.destroy(Error("hands_browser_response_too_large"));else W.push(K)}),H.on("error",G),H.on("end",()=>{let K={};for(let[L,B]of Object.entries(H.headers))if(B!==void 0&&!["transfer-encoding","connection","content-length"].includes(L))K[L]=Array.isArray(B)?B.join(`
|
|
306
|
+
`.trim();import{Buffer as Q9}from"buffer";import{randomUUID as a3}from"crypto";class lQ extends Error{code;constructor($){super($==="hands_repl_private_profile_attribute_denied"?"Private browser attribute read denied.":$);this.code=$;this.name="HandsReplBrowserDispatcherError"}}var sQ=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","prototype"]),dQ=/^hands_[A-Za-z0-9_-]{8,128}$/,o3=2048,nQ=32,iQ=1e4,r3=new Set(["href","src","alt","title","role","aria-label","aria-expanded","aria-checked","aria-selected","aria-disabled","placeholder","type","name","data-testid"]);function t3($){let Q=$.split("+"),Z=(Q.pop()??"").replace(/^Key/,"").toLowerCase();if(Z==="f12")return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&["l","n","t","j","i","p","s","w","u","o","r","tab","pageup","pagedown"].includes(Z))return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&Q.includes("Shift")&&Z==="c")return!0;return Q.includes("Alt")&&["d","arrowleft","arrowright","home"].includes(Z)}var e3=($)=>{let Q=$.closest("a[href],area[href]");return{password:$.tagName==="INPUT"&&$.type==="password",executableLink:Boolean(Q&&!/^(https?:|about:blank)/i.test(Q.href))}},aQ={browser:{close:{returns:"void"},contexts:{returns:"context[]"},isConnected:{returns:"json"},version:{returns:"json"}},context:{addCookies:{returns:"void"},addInitScript:{returns:"void"},browser:{returns:"browser"},clearCookies:{returns:"void"},clearPermissions:{returns:"void"},close:{returns:"void"},cookies:{returns:"json"},grantPermissions:{returns:"void"},newPage:{returns:"page"},pages:{returns:"page[]"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setGeolocation:{returns:"void"},setHTTPCredentials:{returns:"void"},setOffline:{returns:"void"},setViewportSize:{returns:"void"},storageState:{returns:"json"},viewportSize:{returns:"json",special:"contextViewportSize"}},page:{addInitScript:{returns:"void"},addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},bringToFront:{returns:"void"},close:{returns:"void"},content:{returns:"json"},context:{returns:"context"},emulateMedia:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},frame:{returns:"frame"},frameLocator:{returns:"frameLocator"},frames:{returns:"frame[]"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goBack:{returns:"void"},goForward:{returns:"void"},goto:{returns:"void"},isClosed:{returns:"json"},locator:{returns:"locator"},mainFrame:{returns:"frame"},opener:{returns:"page"},pdf:{returns:"bytes"},reload:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setContent:{returns:"void"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setInputFiles:{returns:"void"},setViewportSize:{returns:"void"},title:{returns:"json"},url:{returns:"json"},viewportSize:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},locator:{all:{returns:"locator[]"},allInnerTexts:{returns:"json"},allTextContents:{returns:"json"},and:{returns:"locator"},ariaSnapshot:{returns:"json"},blur:{returns:"void"},boundingBox:{returns:"json"},check:{returns:"void"},clear:{returns:"void"},click:{returns:"void"},contentFrame:{returns:"frameLocator"},count:{returns:"json"},dblclick:{returns:"void"},dragTo:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},evaluateAll:{returns:"json",requiresStringSource:!0},fill:{returns:"void"},filter:{returns:"locator"},first:{returns:"locator",special:"property"},focus:{returns:"void"},getAttribute:{returns:"json"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},hover:{returns:"void"},innerHTML:{returns:"json"},innerText:{returns:"json"},inputValue:{returns:"json"},isChecked:{returns:"json"},isEditable:{returns:"json"},isEnabled:{returns:"json"},isHidden:{returns:"json"},isVisible:{returns:"json"},last:{returns:"locator",special:"property"},locator:{returns:"locator"},nth:{returns:"locator"},or:{returns:"locator"},page:{returns:"page"},press:{returns:"void"},pressSequentially:{returns:"void"},scrollIntoViewIfNeeded:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setInputFiles:{returns:"void"},tap:{returns:"void"},textContent:{returns:"json"},type:{returns:"void"},uncheck:{returns:"void"},waitFor:{returns:"void"}},frame:{addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},childFrames:{returns:"frame[]"},content:{returns:"json"},evaluate:{returns:"json",requiresStringSource:!0},frameLocator:{returns:"frameLocator"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goto:{returns:"void"},isDetached:{returns:"json"},locator:{returns:"locator"},name:{returns:"json"},page:{returns:"page"},parentFrame:{returns:"frame"},setContent:{returns:"void"},title:{returns:"json"},url:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},frameLocator:{getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},locator:{returns:"locator"},owner:{returns:"locator"}}};function R($){throw new lQ($)}function G0($){if(!$||typeof $!=="object"||Array.isArray($))return!1;let Q=Object.getPrototypeOf($);return Q===Object.prototype||Q===null}function Z9($,Q=0,Z={nodes:0}){if(Q>nQ||++Z.nodes>iQ)R("hands_repl_json_too_complex");if($===null||typeof $==="boolean"||typeof $==="string")return;if(typeof $==="number"){if(!Number.isFinite($))R("hands_repl_invalid_json");return}if(Array.isArray($)){for(let X of $)Z9(X,Q+1,Z);return}if(!G0($))R("hands_repl_invalid_json");for(let[X,J]of Object.entries($)){if(sQ.has(X))R("hands_repl_invalid_json");Z9(J,Q+1,Z)}}function m8($){return typeof $==="string"&&Object.hasOwn(aQ,$)}function $1($){if(!$.endsWith("[]"))return null;let Q=$.slice(0,-2);return m8(Q)?Q:null}function pQ($){return G0($)&&Object.keys($).length===2&&$.$handsRepl==="bytes"&&typeof $.base64==="string"}function Q1($){return G0($)&&Object.keys($).length===1&&$.$handsRepl==="undefined"}function uQ($){return G0($)&&Object.keys($).length===2&&$.$handsRepl==="routeFulfill"&&"options"in $}function E0($){return!!$&&typeof $==="object"}function a9(){return Object.freeze({$handsRepl:"undefined"})}function Z1($){if(!Q9.isBuffer($)&&!($ instanceof Uint8Array))R("hands_repl_expected_bytes");return Object.freeze({$handsRepl:"bytes",base64:Q9.from($).toString("base64")})}function oQ($){if(!E0($.browser)||!E0($.context)||!E0($.page))R("hands_repl_invalid_roots");if(typeof $.a11y!=="function"||typeof $.view!=="function")R("hands_repl_invalid_callbacks");let Q=$.maxHandles??o3;if(!Number.isInteger(Q)||Q<3||Q>1e5)R("hands_repl_invalid_handle_limit");let Z=new Map,X=new WeakMap,J=$.createOpaqueId??a3,G=(K,L)=>{if(!E0(L))R("hands_repl_expected_target");let B=X.get(L)?.get(K);if(B)return B;if(Z.size>=Q)R("hands_repl_handle_limit");let U="";for(let q=0;q<16;q+=1){let D=`hands_${J()}`;if(dQ.test(D)&&!Z.has(D)){U=D;break}}if(!U)R("hands_repl_invalid_opaque_id");let M=Object.freeze({$handsRepl:"handle",id:U,kind:K});Z.set(U,{kind:K,target:L});let _=X.get(L);if(!_)_=new Map,X.set(L,_);return _.set(K,M),M},z=Object.freeze({browser:G("browser",$.browser),context:G("context",$.context),page:G("page",$.page)}),V=(K)=>{if(!G0(K)||Object.keys(K).length!==3||K.$handsRepl!=="handle"||typeof K.id!=="string"||!dQ.test(K.id)||!m8(K.kind))R("hands_repl_invalid_handle");let L=Z.get(K.id);if(!L||L.kind!==K.kind)R("hands_repl_unknown_handle");return L},Y=(K,L=0,B=new Set)=>{if(L>nQ)R("hands_repl_json_too_complex");if(K===void 0)return a9();if(K===null||typeof K==="boolean"||typeof K==="string")return K;if(typeof K==="number"){if(!Number.isFinite(K))R("hands_repl_non_json_result");return K}if(Array.isArray(K)){if(B.has(K))R("hands_repl_cyclic_result");B.add(K);try{return K.map((U)=>Y(U,L+1,B))}finally{B.delete(K)}}if(!G0(K))R("hands_repl_non_json_result");if(B.has(K))R("hands_repl_cyclic_result");B.add(K);try{let U=Object.create(null);for(let M of Object.keys(K)){let _=Object.getOwnPropertyDescriptor(K,M);if(!_||!("value"in _))continue;U[M]=Y(_.value,L+1,B)}return U}finally{B.delete(K)}},H=(K,L)=>{if(L==="void")return a9();if(L==="json")return Y(K);if(L==="bytes")return Z1(K);let B=$1(L);if(B){if(!Array.isArray(K))R("hands_repl_expected_target_list");if(B==="context"&&K.some((U)=>U!==$.context))R("hands_repl_foreign_context");return K.map((U)=>G(B,U))}if(K===null||K===void 0)return a9();if(!m8(L))R("hands_repl_invalid_return_kind");if(L==="context"&&K!==$.context)R("hands_repl_foreign_context");return G(L,K)},W=(K)=>{if(G0(K)&&K.$handsRepl==="handle")return V(K).target;if(pQ(K))return Q9.from(K.base64,"base64");if(Q1(K))return;if(uQ(K))R("hands_repl_route_fulfill_only");if(Array.isArray(K))return K.map(W);if(!G0(K))return K;let L=Object.create(null);for(let[B,U]of Object.entries(K))L[B]=W(U);return L};return Object.freeze({roots:z,dispatch:async(K)=>{if(!G0(K)||typeof K.type!=="string")R("hands_repl_invalid_request");if(K.type==="a11y"){let T=K.target===void 0?Z.get(z.page.id):V(K.target);if(!T||T.kind!=="page"&&T.kind!=="locator")R("hands_repl_invalid_a11y_target");return Y(await $.a11y(T.target))}if(K.type==="view"){if(Z9(K.source),K.options!==void 0)Z9(K.options);let T=pQ(K.source)?Q9.from(K.source.base64,"base64"):K.source;if($.privateProfile&&!Q9.isBuffer(T))R("hands_repl_profile_requires_image_bytes");return Y(await $.view(T,K.options))}if(K.type!=="call")R("hands_repl_invalid_request");if(typeof K.method!=="string"||K.method.length===0||K.method.length>128)R("hands_repl_invalid_method");if(sQ.has(K.method))R("hands_repl_forbidden_method");let L=V(K.target),B=K.args??[];if(!Array.isArray(B))R("hands_repl_invalid_arguments");if(Z9(B),L.kind==="page"&&K.method==="captureScreenshot"){if(B.length!==0)R("hands_repl_invalid_arguments");if(!$.screenshotExport)R("hands_repl_screenshot_export_unavailable");return Y(await $.screenshotExport(L.target))}if(L.kind==="context"&&["startRecording","stopRecording"].includes(K.method)){if(!$.recording||L.target!==$.context)R("hands_repl_recording_unavailable");if(B.length>(K.method==="startRecording"?1:0))R("hands_repl_invalid_arguments");return Y(K.method==="startRecording"?await $.recording.start(B[0]):await $.recording.stop())}if($.privateProfile){let T=K.method;if(["evaluate","evaluateAll","waitForFunction","addInitScript","addScriptTag","addStyleTag","setContent","setInputFiles","route","content","cookies","storageState","addCookies","clearCookies","setExtraHTTPHeaders","setHTTPCredentials","grantPermissions","clearPermissions","innerHTML","textContent","allTextContents"].includes(T)||L.kind==="browser"&&T==="close"||L.kind==="context"&&T==="close")R("hands_repl_private_profile_method_denied");if(L.kind==="browser"&&T==="contexts")return H([$.context],"context[]");if((T==="screenshot"||T==="pdf")&&G0(B[0])&&(("path"in B[0])||("style"in B[0])))R("hands_repl_private_profile_path_denied");if(T==="goto"){if(typeof B[0]!=="string")R("hands_repl_private_profile_url_denied");try{let k=new URL(B[0]);if(!["http:","https:"].includes(k.protocol)&&B[0]!=="about:blank")R("hands_repl_private_profile_url_denied")}catch{R("hands_repl_private_profile_url_denied")}}if(T==="getAttribute"&&(typeof B[0]!=="string"||!r3.has(B[0].toLowerCase())))R("hands_repl_private_profile_attribute_denied");if(L.kind==="locator"&&["innerText","allInnerTexts","getAttribute"].includes(T)){let k=[L.target];if(T==="allInnerTexts"){let g=Reflect.get(L.target,"all");if(typeof g!=="function")R("hands_repl_private_profile_probe_unavailable");let O=await Reflect.apply(g,L.target,[]);if(!Array.isArray(O)||O.length>iQ||!O.every(E0))R("hands_repl_private_profile_probe_unavailable");k=O}for(let g of k){let O=Reflect.get(g,"isVisible");if(typeof O!=="function"||!await Reflect.apply(O,g,[]))R("hands_repl_private_profile_hidden_value_denied")}}if(T==="press"&&typeof B[0]==="string"&&t3(B[0]))R("hands_repl_private_profile_browser_shortcut_denied");if(L.kind==="locator"&&["inputValue","click","dblclick","tap","press"].includes(T)){let k=Reflect.get(L.target,"evaluate");if(typeof k!=="function")R("hands_repl_private_profile_probe_unavailable");let g=await Reflect.apply(k,L.target,[e3]);if(!G0(g)||typeof g.password!=="boolean"||typeof g.executableLink!=="boolean")R("hands_repl_private_profile_probe_unavailable");if(T==="inputValue"&&g.password)R("hands_repl_private_profile_password_denied");if(T!=="inputValue"&&g.executableLink)R("hands_repl_private_profile_url_denied");if(T==="inputValue"){let O=Reflect.get(L.target,"isVisible");if(typeof O!=="function"||!await Reflect.apply(O,L.target,[]))R("hands_repl_private_profile_hidden_value_denied")}}}let U=aQ[L.kind][K.method];if(!U)R("hands_repl_method_not_allowed");if(U.requiresStringSource&&typeof B[0]!=="string")R("hands_repl_string_source_required");if(L.kind==="browser"&&K.method==="contexts")return[z.context];if(["addInitScript","addScriptTag","addStyleTag","screenshot","pdf","storageState"].includes(K.method)&&B.some((T)=>G0(T)&&("path"in T)))R("hands_repl_file_path_not_allowed");if(K.method==="goto"&&typeof B[0]==="string"){let T;try{T=new URL(B[0]).protocol}catch{R("hands_repl_invalid_url")}if(!["http:","https:","data:","about:","blob:"].includes(T))R("hands_repl_file_path_not_allowed")}if(U.special==="contextViewportSize"){let T=Reflect.get(L.target,"pages");if(typeof T!=="function")R("hands_repl_method_unavailable");let k=await Reflect.apply(T,L.target,[]),g=Array.isArray(k)?k[0]:void 0,O=E0(g)?Reflect.get(g,"viewportSize"):void 0;if(typeof O!=="function")return a9();return H(await Reflect.apply(O,g,[]),U.returns)}if(U.special==="property"){let T=Reflect.get(L.target,K.method);return H(typeof T==="function"?Reflect.apply(T,L.target,[]):T,U.returns)}let M=Reflect.get(L.target,K.method);if(typeof M!=="function")R("hands_repl_method_unavailable");if(U.special==="route"){let T=B[1];if(!uQ(T))R("hands_repl_invalid_route_handler");Z9(T.options);let k=W(T.options),g=async(j)=>{if(!E0(j))R("hands_repl_invalid_route");let A=Reflect.get(j,"fulfill");if(typeof A!=="function")R("hands_repl_invalid_route");await Reflect.apply(A,j,[k])},O=[W(B[0]??null),g],N=await Reflect.apply(M,L.target,O);return H(N,U.returns)}let _=B.map(W);if(K.method==="setInputFiles"){let T=L.kind==="locator"?0:1,k=async(O)=>{if(typeof O!=="string"){if(!G0(O)||typeof O.name!=="string"||typeof O.mimeType!=="string"||!Q9.isBuffer(O.buffer))R("hands_repl_invalid_file_input");return O}if(!$.readWorkspaceFile)R("hands_repl_workspace_required");return $.readWorkspaceFile(O)},g=_[T];_[T]=Array.isArray(g)?await Promise.all(g.map(k)):await k(g)}if(K.method==="goto")await $.beforeNavigation?.();let q=$.actionRecorder?.(),D=await Reflect.apply(M,L.target,_),b={click:"Click browser element",tap:"Click browser element",dblclick:"Double click browser element",fill:"Type text",type:"Type text",pressSequentially:"Type text",clear:"Clear browser field",press:"Press key",scrollIntoViewIfNeeded:"Scroll browser element into view",dragTo:"Drag on computer",selectOption:"Select browser option",check:"Check browser control",uncheck:"Uncheck browser control",hover:"Hover browser element",focus:"Focus browser element",goto:"Open browser page",reload:"Reload browser page",goBack:"Go back in browser",goForward:"Go forward in browser",screenshot:"Take browser screenshot"}[K.method];if(b){let T=Reflect.get(L.target,"page"),k=L.kind==="page"?L.target:typeof T==="function"?Reflect.apply(T,L.target,[]):void 0;q?.(b,E0(k)?k:void 0)}return H(D,U.returns)}})}import{isIP as QZ}from"net";import{Resolver as X1}from"dns/promises";import{isIP as r9}from"net";var J1=[["0.0.0.0",8],["10.0.0.0",8],["100.64.0.0",10],["127.0.0.0",8],["169.254.0.0",16],["172.16.0.0",12],["192.0.0.0",24],["192.0.2.0",24],["192.168.0.0",16],["198.18.0.0",15],["198.51.100.0",24],["203.0.113.0",24],["224.0.0.0",4],["240.0.0.0",4]];function g8($){if(r9($)!==4)return null;let Q=$.split(".");if(Q.length!==4)return null;let Z=0;for(let X of Q){let J=Number(X);if(!Number.isInteger(J)||J<0||J>255)return null;Z=Z*256+J}return Z>>>0}function Y1($,Q,Z){let X=g8(Q);if(X===null)return!1;let J=Z===0?0:4294967295<<32-Z>>>0;return($&J)>>>0===(X&J)>>>0}function rQ($){let Q=g8($);if(Q===null)return!0;return J1.some(([Z,X])=>Y1(Q,Z,X))}function G1($){if(r9($)!==6)return null;let Q=$.toLowerCase(),Z=Q.indexOf("%");if(Z>=0)Q=Q.slice(0,Z);let X=[],J=Q.lastIndexOf(":"),G=J>=0?Q.slice(J+1):"";if(G.includes(".")){let K=g8(G);if(K===null)return null;X=[K>>>16&65535,K&65535],Q=Q.slice(0,J+1)+"0:0"}let z=Q.split("::");if(z.length>2)return null;let V=(K)=>{if(K==="")return[];let L=[];for(let B of K.split(":")){if(B===""||B.length>4||!/^[0-9a-f]+$/.test(B))return null;L.push(Number.parseInt(B,16))}return L},Y=V(z[0]??"");if(Y===null)return null;if(z.length===1){let K=Y;if(K.length!==8)return null;return X.length>0?K.slice(0,6).concat(X):K}let H=V(z[1]??"");if(H===null)return null;let W=8-Y.length-H.length;if(W<0)return null;let F=Y.concat(Array(W).fill(0),H);if(F.length!==8)return null;return X.length>0?F.slice(0,6).concat(X):F}function z1($,Q){return`${$>>8&255}.${$&255}.${Q>>8&255}.${Q&255}`}function K1($){let Q=G1($);if(Q===null)return!0;let[Z,X,J]=Q;if((Z&57344)!==8192)return!0;if(Z===8193&&(X&65024)===0)return!0;if(Z===8193&&X===3512)return!0;if(Z===16383&&(X&61440)===0)return!0;if(Z===8194)return rQ(z1(X,J));return!1}function tQ($){return $.replace(/^\[|\]$/g,"")}function o9($){let Q=tQ($.trim()),Z=r9(Q);if(Z===4)return rQ(Q);if(Z===6)return K1(Q);return!0}function eQ($){if($ instanceof Error&&$.name==="TimeoutError")return"dns_timeout";switch(typeof $==="object"&&$!==null&&"code"in $?$.code:void 0){case"ENOTFOUND":return"dns_not_found";case"ENODATA":return"dns_empty";case"EAI_AGAIN":case"ESERVFAIL":case"ECONNREFUSED":return"dns_temporary";case"ETIMEOUT":case"ETIMEDOUT":return"dns_timeout";default:return"dns_failed"}}var $Z=5000;function V1($){return async(Q,Z)=>{if(Z?.aborted)throw Error("aborted");let X=new X1({timeout:$Z,tries:1});if($)X.setServers($);let J=()=>X.cancel();Z?.addEventListener("abort",J,{once:!0});try{let[G,z]=await Promise.allSettled([X.resolve4(Q),X.resolve6(Q)]),V=[...G.status==="fulfilled"?G.value:[],...z.status==="fulfilled"?z.value:[]];if(V.length>0)return V;let Y=[G,z].flatMap((W)=>W.status==="rejected"?[W.reason]:[]);throw Y.find((W)=>["dns_temporary","dns_timeout"].includes(eQ(W)))??Y[0]??Object.assign(Error("DNS returned no addresses"),{code:"ENODATA"})}finally{Z?.removeEventListener("abort",J)}}}var H1=V1();async function F1($,Q,Z,X){if(X?.aborted)throw Error("aborted");let J=new AbortController,G,z,V=Q($,J.signal);V.catch(()=>{});try{return await Promise.race([V,new Promise((Y,H)=>{if(G=setTimeout(()=>H(new DOMException("DNS lookup timed out","TimeoutError")),Z),X)z=()=>H(Error("aborted")),X.addEventListener("abort",z,{once:!0})})])}finally{if(G!==void 0)clearTimeout(G);if(X&&z)X.removeEventListener("abort",z);J.abort()}}async function p5($,Q=H1,Z){let X=tQ($);if(r9(X))return o9(X)?{ok:!1,reason:"non_public_ip"}:{ok:!0,addresses:[X]};let J;try{J=await F1(X,Q,$Z,Z)}catch(G){return{ok:!1,reason:Z?.aborted?Z.reason instanceof Error&&Z.reason.name==="TimeoutError"?"dns_timeout":"aborted":eQ(G)}}if(J.length===0)return{ok:!1,reason:"dns_empty"};if(J.some(o9))return{ok:!1,reason:"non_public_ip"};return{ok:!0,addresses:J}}var W1=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$/;function y8($){return $.length<=253&&W1.test($.toLowerCase())}function U1($,Q){let Z=$.trim().toLowerCase();if(!y8(Z))return!1;if(Z.startsWith("*.")){let X=Z.slice(2);return Q===X||Q.endsWith(`.${X}`)}return Z===Q}function B1($){let Q=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec($);if(!Q)return null;let Z=Q.slice(1).map(Number);return Z.some((X)=>X>255)?null:Z}function h8($,Q=[]){let Z=(X)=>{if(X=X.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,""),!X.includes(":"))return X;try{X=new URL(`http://[${X}]/`).hostname.slice(1,-1)}catch{return X}let J=/^::ffff:([\da-f]+):([\da-f]+)$/.exec(X);if(!J)return X;let G=parseInt(J[1],16),z=parseInt(J[2],16);return`${G>>8}.${G&255}.${z>>8}.${z&255}`};return Q.some((X)=>Z(X)===Z($))}function c0($){$=$.toLowerCase().replace(/^\[|\]$/g,"");let Q=B1($);if(Q){let[G,z,V]=Q;if(G===127)return"loopback";return G===0||G===10||G>=224||G===100&&z>=64&&z<=127||G===169&&z===254||G===172&&z>=16&&z<=31||G===192&&(z===168||z===0&&(V===0||V===2)||z===88&&V===99)||G===198&&(z===18||z===19||z===51&&V===100)||G===203&&z===0&&V===113?"private":"public"}if(!$.includes(":"))return"hostname";try{$=new URL(`http://[${$}]/`).hostname.slice(1,-1)}catch{return"private"}if($==="::1")return"loopback";let Z=/^::ffff:([\da-f]+):([\da-f]+)$/.exec($);if(Z){let G=parseInt(Z[1],16),z=parseInt(Z[2],16);return c0(`${G>>8}.${G&255}.${z>>8}.${z&255}`)==="public"?"public":"private"}let[X,J=0]=$.split(":").map((G)=>parseInt(G||"0",16));return X<8192||X>16383||X===8194||X===8193&&(J<512||J===3512)||X===16383&&J<4096?"private":"public"}function A9($,Q){let Z;try{Z=new URL($)}catch{return{allowed:!1,url:$,host:null,reason:"invalid_url"}}if(["about:","data:","blob:"].includes(Z.protocol))return{allowed:!0,url:$,host:null,reason:"local_document"};if(!["http:","https:","ws:","wss:"].includes(Z.protocol))return{allowed:!1,url:$,host:Z.hostname||null,reason:"unsupported_protocol"};let X=Z.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(Q.mode==="off")return{allowed:!0,url:$,host:X,reason:"policy_off"};let J=(V)=>({allowed:!1,url:$,host:X,reason:V});if(Z.username||Z.password)return J("invalid_url");if(Q.mode==="public_web"){let V=c0(X)!=="public"&&c0(X)!=="hostname"||X==="localhost"||/\.(?:localhost|local|internal|arpa)$/.test(X)||!X.includes(".")&&!QZ(X)||Boolean(QZ(X)&&o9(X));return{allowed:!V,url:$,host:X,reason:V?"private_network":"public_web"}}let G=Number(Z.port||(["https:","wss:"].includes(Z.protocol)?443:80));if(Q.deniedPorts?.includes(G)||h8(X,Q.deniedHosts))return J("destination_not_allowed");let z=c0(X);if(z==="private"||["local","internal","arpa"].some((V)=>X===V||X.endsWith(`.${V}`)))return J("private_network");if(z==="loopback"||X==="localhost"||X.endsWith(".localhost"))return Q.allowedLoopbackPorts?.includes(G)?{allowed:!0,url:$,host:X,reason:"loopback"}:J("destination_not_allowed");if(Q.allowedDomains.some((V)=>U1(V,X)))return{allowed:!0,url:$,host:X,reason:"allowed_domain"};return{allowed:!1,url:$,host:X,reason:"destination_not_allowed"}}import XZ from"child_process";import{accessSync as N1,constants as M1,readFileSync as j1,statSync as C1}from"fs";import{createRequire as q1}from"module";import{isAbsolute as v8,join as T1}from"path";var c8=Object.freeze({schemaVersion:1,driver:"playwright-core",driverVersion:JZ.dependencies["playwright-core"],browser:"chromium"}),YZ=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Chromium.app/Contents/MacOS/Chromium"],d8=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable"];function x9($){try{return N1($,M1.X_OK),v8($)&&C1($).isFile()}catch{return!1}}function p8($,Q=process.platform){let Z=Q==="darwin"?YZ:Q==="linux"?d8:null;return Z?($??Z).find(x9)??null:null}function O1(){if(!process.versions.bun)return;let $=Symbol.for("ara.headless-browser.bun-pipe-owners");if(Object.hasOwn(globalThis,$))return;let Q=[];XZ.spawn=new Proxy(XZ.spawn,{apply(Z,X,J){let G=Reflect.apply(Z,X,J),z=J[1],V=J[2]?.stdio;if(Array.isArray(z)&&z.includes("--remote-debugging-pipe")&&Array.isArray(V)&&V[3]==="pipe"&&V[4]==="pipe")Q.push(G);return G}}),Object.defineProperty(globalThis,$,{value:Q})}async function t9($){if(O1(),$!==void 0){if(!v8($))throw Error("hands_browser_driver_path_must_be_absolute");let X=T1($,"package.json"),J=JSON.parse(j1(X,"utf8"));if(J.name!==c8.driver)throw Error("hands_browser_wrong_driver");let G=q1(X)($),z=G.default?.chromium??G.chromium;if(!z)throw Error("hands_browser_missing_chromium");return{version:J.version,chromium:z}}let[Q,Z]=await Promise.all([import("./index-9aw1gjs5.js"),import("./package-56yg8k4a.js").then((m)=>L1(m.default,1))]);return{version:Z.default.version,chromium:Q.chromium}}var D1=($,Q=c8.driverVersion)=>({status:"unavailable",reason:$,expectedDriverVersion:Q}),_1=($)=>$.loadDriver?.()??t9($.driverModuleDirectory);async function X9($={}){return GZ($,c8.driverVersion)}async function u8($,Q={}){if($.driverVersion!=="1.61.1"||!v8($.driverModuleDirectory))throw Error("hands_browser_invalid_managed_compatibility");return GZ({...Q,driverModuleDirectory:$.driverModuleDirectory,allowSystemBrowser:!0},$.driverVersion)}async function GZ($,Q){let Z=(Y)=>D1(Y,Q),X=$.platform??process.platform;if(X!=="linux"&&X!=="darwin")return Z("unsupported_platform");let J;try{J=await _1($)}catch{return Z("driver_missing")}if(J.version!==Q)return Z("driver_version_mismatch");let G=(Y,H)=>({status:"resolved",executablePath:Y,source:H,driverVersion:J.version});if($.executablePath!==void 0)return x9($.executablePath)?G($.executablePath,"configured"):Z("executable_missing");let z=J.chromium.executablePath();if(x9(z))return G(z,"managed");let V=$.allowSystemBrowser===!0?p8($.systemCandidates,X):null;return V?G(V,"system"):Z("executable_missing")}var g1=["/usr/local/bin/chromium",...d8];function y1($,Q=UZ()){return p8($??(Q==="linux"?g1:void 0),Q)}async function h1(){try{return(await t9()).chromium}catch{return w1(import.meta.url)("playwright-core").chromium}}var v1=1048576,c1=105000,d1=20000,VZ=5000,p1=2000,u1=1000,l1=30000,HZ=81920,s1={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};async function n1($,Q){let Z=new URL($.url()),X={...await $.allHeaders(),host:Z.host};for(let J of Object.keys(X))if(/^(?:proxy-|connection$|upgrade$|transfer-encoding$|content-length$)/i.test(J))delete X[J];return new Promise((J,G)=>{let V=(Z.protocol==="https:"?k1:b1)(Z,{method:$.method(),headers:X,agent:!1,lookup:(H,W,F)=>{let K=d0.isIP(Q);if(W.all)F(null,[{address:Q,family:K}]);else F(null,Q,K)}},(H)=>{let W=[],F=0;H.on("data",(K)=>{if(F+=K.length,F>33554432)V.destroy(Error("hands_browser_response_too_large"));else W.push(K)}),H.on("error",G),H.on("end",()=>{let K={};for(let[L,B]of Object.entries(H.headers))if(B!==void 0&&!["transfer-encoding","connection","content-length"].includes(L))K[L]=Array.isArray(B)?B.join(`
|
|
307
307
|
`):B;J({status:H.statusCode??502,headers:K,body:Buffer.concat(W)})})}),Y=setTimeout(()=>V.destroy(Error("hands_browser_fetch_timeout")),l1);V.once("close",()=>clearTimeout(Y)),V.on("error",G),V.end($.postDataBuffer()??void 0)})}async function i1($,Q,Z=()=>{},X={lookup:(J)=>S1(J,{all:!0}),fetch:n1}){let J=new WeakSet,G=new WeakMap,z=(V)=>{let Y=G.get(V);if(Y)return Y;let H=(async()=>{if(!$.newCDPSession)return;let W=await $.newCDPSession(V),F=new Map;W.on("Network.loadingFinished",({requestId:K})=>F.delete(K)),W.on("Network.loadingFailed",({requestId:K})=>F.delete(K)),W.on("Fetch.requestPaused",async(K)=>{let L=K.networkId??K.requestId,B=K.redirectedRequestId?(F.get(L)??0)+1:0;F.set(L,B);let U=A9(K.request.url,Q),M=Q.mode==="enforce"&&Boolean(K.redirectedRequestId)&&U.host!==null&&!d0.isIP(U.host),_=!U.allowed?U:M?{...U,allowed:!1,reason:"destination_not_allowed"}:B>20?{...U,allowed:!1,reason:"redirect_not_supported"}:null;try{if(_)Z(_),await W.send("Fetch.failRequest",{requestId:K.requestId,errorReason:"BlockedByClient"});else await W.send("Fetch.continueRequest",{requestId:K.requestId})}catch{await W.send("Fetch.failRequest",{requestId:K.requestId,errorReason:"Failed"}).catch(()=>{})}}),await W.send("Network.enable"),await W.send("Fetch.enable",{patterns:[{urlPattern:"*",requestStage:"Request"}]}),J.add(V)})();return G.set(V,H),H};return await $.route("**/*",async(V)=>{let Y=V.request().url(),H=A9(Y,Q);if(H.allowed&&Q.mode==="public_web"){await V.continue();return}let W=V.request();if(H.allowed&&H.host&&d0.isIP(H.host)&&W.isNavigationRequest?.()){let F=W.frame();if(J.has(F.page())&&F===F.page().mainFrame()){await V.continue();return}}if(H.allowed&&(Q.mode==="off"||H.reason==="local_document")){await V.continue();return}if(H.allowed&&H.host)try{let F=H.host,K=c0(F),L,B=await(async()=>{if(K!=="hostname")return[{address:F,family:d0.isIP(F)}];if(H.reason==="loopback")return[{address:"127.0.0.1",family:4}];try{return await Promise.race([X.lookup(F),new Promise((U,M)=>{L=setTimeout(()=>M(Error("hands_browser_dns_timeout")),5000)})])}finally{if(L)clearTimeout(L)}})();if(!B.length||B.some(({address:U})=>{let M=c0(U);return!d0.isIP(U)||Q.mode==="enforce"&&h8(U,Q.deniedHosts)||(H.reason==="loopback"?M!=="loopback":M!=="public")}))H={...H,allowed:!1,reason:"private_network"};else{let U=await X.fetch(V.request(),B[0].address);if(U.status>=300&&U.status<400){let M=U.headers.location??Y;try{M=new URL(M,Y).href}catch{}let _=A9(M,Q);H=_.allowed?{..._,allowed:!1,reason:"redirect_not_supported"}:_}else{await V.fulfill(U);return}}}catch{await V.abort("failed");return}Z(H),await V.abort("blockedbyclient")}),await $.routeWebSocket("**/*",async(V)=>{let Y=A9(V.url(),Q);if(Q.mode==="enforce"&&Y.allowed&&(!Y.host||!d0.isIP(Y.host)))Y={...Y,allowed:!1,reason:"destination_not_allowed"};if(Y.allowed){V.connectToServer();return}Z(Y),await V.close({code:1008,reason:"Reason egress policy denied"})}),Q.mode==="off"?void 0:{preparePage:z}}async function BZ($,Q=UZ(),Z){if(Z){let J=await u8(Z,{platform:Q,systemCandidates:$});return J.status==="resolved"?J.executablePath:null}if($!==void 0){let J=y1($,Q);if(J)return J}let X=await X9({platform:Q,systemCandidates:$,allowSystemBrowser:!0});return X.status==="resolved"?X.executablePath:null}function FZ($,Q){if(!$)throw Error("hands_repl_workspace_required");let Z=s8($),X=J9($),J=n8(X,J9(X,Q)),z=J!==".."&&!J.startsWith(`..${i8}`)&&!KZ(J)?J9(Z,J):J9(Z,Q);if(R0(J9(X,Q))||R0(z))throw Error("hands_repl_protected_path");let V=(B)=>{let U=n8(Z,B);return U!==""&&U!==".."&&!U.startsWith(`..${i8}`)&&!KZ(U)},Y=s8(z);if(R0(Y))throw Error("hands_repl_protected_path");if(!V(z)||!V(Y))throw Error("hands_repl_file_outside_workspace");let H=n8(Z,z).split(i8),W=[Z,...H.map((B,U)=>J9(Z,...H.slice(0,U+1)))],F=W.map((B)=>zZ(B));if(F.some((B)=>B.isSymbolicLink()))throw Error("hands_repl_file_symlink");let K=F[F.length-1];if(!K.isFile()||K.nlink!==1||K.size>16777216)throw Error("hands_repl_file_not_regular_or_too_large");let L=I1(z,l8.O_RDONLY|l8.O_NOFOLLOW|l8.O_NONBLOCK);try{let B=P1(L);if(B.dev!==K.dev||B.ino!==K.ino||!B.isFile())throw Error("hands_repl_file_changed");for(let q=0;q<W.length;q++){let D=zZ(W[q]);if(D.dev!==F[q].dev||D.ino!==F[q].ino||D.isSymbolicLink())throw Error("hands_repl_file_changed")}if(!V(s8(z)))throw Error("hands_repl_file_outside_workspace");let U=Buffer.alloc(16777217),M=0;while(M<U.length){let q=R1(L,U,M,U.length-M,null);if(!q)break;M+=q}if(M===U.length)throw Error("hands_repl_file_too_large");let _=U.subarray(0,M);return{name:f1(z),mimeType:s1[m1(z).toLowerCase()]??"application/octet-stream",buffer:_}}finally{x1(L)}}function Y9($,Q){$.end(`${JSON.stringify(Q)}
|
|
308
308
|
`)}function e9($){try{E1($)}catch{}}async function LZ($){if($.managedBrowser&&$.driverModuleDirectory!==void 0)throw Error("hands_browser_ambiguous_driver_configuration");let Q=$.launch||$.targetContext?null:$.managedBrowser?await u8($.managedBrowser,{executablePath:$.browserExecutablePath}):await X9({executablePath:$.browserExecutablePath,driverModuleDirectory:$.driverModuleDirectory});if(Q?.status==="unavailable")throw Error(`hands_browser_${Q.reason}`);let Z=Q?.status==="resolved"?Q.executablePath:$.browserExecutablePath;if(!Z||!x9(Z))throw Error("hands_browser_unavailable");let X=$.launch??(async(N)=>($.targetContext?await h1():(await t9($.managedBrowser?.driverModuleDirectory??$.driverModuleDirectory)).chromium).launch(N)),J=[],G={},z=null,V=null,Y=null,H=null,W=!1,F=null,K=new Map,L=new WeakMap,B=null,U=()=>{if(W)throw Error("hands_repl_stopped");if(H)throw H},M=(N)=>{let j=L.get(N);if(j)return j;let A=Promise.resolve().then(()=>N.close()).then(()=>{K.delete(N)});return L.set(N,A),A},_=async()=>{let N=[...K.entries()].reverse(),j=B??=performance.now()+u1,A=Promise.allSettled(N.filter(([,P])=>P==="context").map(([P])=>M(P))),m;try{await Promise.race([A,new Promise((P)=>{m=setTimeout(P,Math.max(0,j-performance.now()))})])}finally{if(m)clearTimeout(m)}let w=await Promise.allSettled(N.map(([P])=>M(P))),E=[];for(let[P,f]of w.entries()){if(f.status!=="rejected")continue;let d=f.reason instanceof Error&&["Error","TimeoutError","ProtocolError"].includes(f.reason.name)?f.reason.name:"unknown";E.push(Error(`hands_repl_close_failed: ${N[P][1]}: ${d}`))}if(E.length)throw AggregateError(E,"hands_repl_stop_unconfirmed")},q=(N,j)=>{if(K.set(N,j),W||H)M(N).catch(()=>{return}),U();return N},D=async()=>{let N=await X({executablePath:Z,headless:!0,chromiumSandbox:$.managedBrowser===void 0,args:["--disable-background-networking","--disable-quic","--disable-dev-shm-usage","--disable-gpu","--disable-software-rasterizer","--dns-prefetch-disable","--force-webrtc-ip-handling-policy=disable_non_proxied_udp","--no-pings"]}),j=null;try{q(N,"browser"),j=$.targetContext??q(await N.newContext({viewport:{width:1440,height:900},screen:{width:1440,height:900},serviceWorkers:"block",acceptDownloads:!1}),"context");let A=await i1(j,$.networkPolicy??{mode:"off"},$.onEgressDenied);if(U(),A){let S=j.newPage.bind(j);j.newPage=async()=>{let h=await S();return await A.preparePage(h),h}}let w=j.pages()[0]??await j.newPage();await A?.preparePage(w),U();let E=async(S=w)=>{let h=S;if(typeof h.ariaSnapshot==="function")return h.ariaSnapshot({timeout:1e4});return w.locator("body").innerText({timeout:1e4})},P=async(S,h={})=>{let c=h&&typeof h==="object"&&!Array.isArray(h)?h:{},a,H0="image/png";if(Buffer.isBuffer(S)||S instanceof Uint8Array)a=Buffer.from(S);else if(typeof S==="string"&&(S.startsWith("data:")||/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(S)))a=Buffer.from(S.replace(/^data:[^,]*,/,""),"base64");else if(typeof S==="string"){let k0=FZ($.workspaceRoot,S);a=k0.buffer,H0=k0.mimeType}else throw Error("view() needs a Buffer, a base64 string, or a path to an image file");if(a.length===0)throw Error("view(): the image is empty");let B8=String(c.label??"").replace(/[\r\n>]+/g," ").trim().slice(0,120),D0=Number(c.maxWidth)||1024,i0=Number(c.quality)||72,w9=$.targetContext?await N.newPage():await j.newPage();try{let k0=`data:${H0};base64,${a.toString("base64")}`;for(let r=0;r<5;r+=1){let B0=await w9.evaluate(async(F0)=>{let L0=new Image;L0.src=F0.url,await L0.decode();let f0=Math.min(1,F0.maxWidth/L0.naturalWidth),Y0=document.createElement("canvas");Y0.width=Math.max(1,Math.round(L0.naturalWidth*f0)),Y0.height=Math.max(1,Math.round(L0.naturalHeight*f0));let X0=Y0.getContext("2d");if(!X0)throw Error("view(): canvas unavailable");return X0.fillStyle="#ffffff",X0.fillRect(0,0,Y0.width,Y0.height),X0.drawImage(L0,0,0,Y0.width,Y0.height),{data:Y0.toDataURL("image/jpeg",F0.q/100).split(",")[1]??"",width:Y0.width,height:Y0.height,sourceWidth:L0.naturalWidth,sourceHeight:L0.naturalHeight}},{url:k0,maxWidth:D0,q:i0}),a0=Buffer.from(B0.data,"base64");if(a0.length<=HZ){let F0=B8||"image";return`<<<ARA_VIEW_IMAGE ${B0.data} image/jpeg ${F0}>>>
|
|
309
309
|
Viewing ${F0} (${B0.sourceWidth}x${B0.sourceHeight} source, sent at ${B0.width}x${B0.height}, ${Math.round(a0.length/1024)}KB).`}if(D0>640)D0=Math.round(D0*0.75);else i0=Math.max(30,i0-15)}throw Error(`view(): could not reduce the image under ${Math.round(HZ/1024)}KB`)}finally{await w9.close().catch(()=>{return})}},f=oQ({browser:$.targetContext?.browser()??N,context:j,page:w,a11y:E,view:P,readWorkspaceFile:(S)=>FZ($.workspaceRoot,S),privateProfile:$.privateProfile,beforeNavigation:$.beforeNavigation,recording:$.recording,screenshotExport:$.screenshotExport,actionRecorder:()=>{let S=J,h=G;return(c,a)=>{if(S.length<WZ)S.push(c);if(a)h.page=a}}}),d=async(S)=>{U();let h=q(await N.newContext({serviceWorkers:"block",acceptDownloads:!1}),"context");try{await h.route("**/*",(a)=>a.abort()),U(),await h.routeWebSocket("**/*",(a)=>a.close({code:1008,reason:"Reason evaluator network denied"})),U(),await h.exposeBinding("__araHandsRpc",async(a,H0)=>$.onBrowserOperation?$.onBrowserOperation(S,()=>f.dispatch(H0)):f.dispatch(H0)),U();let c=await h.newPage();return U(),await c.goto("data:text/html,<title>Reason Hands evaluator</title>"),U(),await c.evaluate(`(${vQ})(${JSON.stringify(f.roots)})`),{context:h,page:c,runId:S}}catch(c){throw await M(h).catch(()=>{return}),c}},u=await d(),l={browser:N,context:j,page:w,evaluator:u,async captureProgressFrame(S){return P(await S.screenshot({type:"jpeg",quality:65,timeout:2000}),{label:"Screen after browser action"})},async resetEvaluator(S){await M(l.evaluator.context),l.evaluator=await d(S)}};return U(),l}catch(A){throw await _().catch(()=>{return}),A}},x=async()=>{if(U(),z)return z;if(!Y){V=D();let N;Y=Promise.race([V,new Promise((j,A)=>{N=setTimeout(()=>A(Error("hands_browser_unavailable: startup timed out")),d1)})]).then((j)=>{return U(),z=j,j}).catch(async()=>{H=Error("hands_browser_unavailable: startup failed or timed out");let j;try{await Promise.race([_(),new Promise((A,m)=>{j=setTimeout(()=>m(Error("hands_repl_stop_timeout")),VZ)})])}catch{H=Error("hands_browser_unavailable: startup cleanup unconfirmed")}finally{if(j)clearTimeout(j)}throw H}).finally(()=>{if(N)clearTimeout(N)})}return Y},b=async(N,j,A=!1)=>{let m=await x(),w=G;if($.onBrowserOperation&&m.evaluator.runId!==j)await m.resetEvaluator(j);let P=(async()=>{let u=await m.evaluator.page.evaluate(`(${cQ})(${JSON.stringify({code:N})})`);if(typeof u!=="string")throw Error("hands_repl_invalid_evaluator_output");let l=w.page;if(A&&l&&!u.includes("<<<ARA_VIEW_IMAGE")){let S=()=>m.captureProgressFrame(l);try{let h=await($.onBrowserOperation?$.onBrowserOperation(j,S):S());return w.automaticProgressImage=!0,`${u}
|