@reason-machines/cli-linux-arm64-musl 0.2.357 → 0.2.359
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/api-credentials-axffq0pk.js +2 -0
- package/bin/vm-hands/api-texm6ayv.js +2 -0
- package/bin/vm-hands/ask-relay-fkb3bj30.js +8 -0
- package/bin/vm-hands/connect-cli-ev4xex04.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-j3e3zjd5.js → custom-endpoint-device-bsanzqj2.js} +1 -1
- package/bin/vm-hands/desktop-account-jxfva4m1.js +2 -0
- package/bin/vm-hands/{device-workspace-7yg5x68n.js → device-workspace-fhbpenda.js} +1 -1
- package/bin/vm-hands/hands-worker-source-ze6q6h8b.js +2 -0
- package/bin/vm-hands/{index-swa20ch8.js → index-tv4kcb2a.js} +1 -1
- package/bin/vm-hands/install-receipt-3s9amwp3.js +2 -0
- package/bin/vm-hands/local-automation-f8f33qpp.js +2 -0
- package/bin/vm-hands/local-capabilities-ya6yzxh5.js +2 -0
- package/bin/vm-hands/local-desktop-users-3th2aaac.js +2 -0
- package/bin/vm-hands/local-display-mac-neweyjpa.js +2 -0
- package/bin/vm-hands/local-display-session-v00nv1fm.js +2 -0
- package/bin/vm-hands/local-pty-session-2crsy5td.js +2 -0
- package/bin/vm-hands/managed-runtime-mg7kmckn.js +2 -0
- package/bin/vm-hands/{network-contract-rm9x646s.js → network-contract-gq8x3ehk.js} +1 -1
- package/bin/vm-hands/package-s3eg9zrd.js +2 -0
- package/bin/vm-hands/permissions-3kjdp3ge.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-3z7bas06.js → reason-hands-protocol-67d4b6fm.js} +1 -1
- package/bin/vm-hands/serve-service-nqshfese.js +2 -0
- package/bin/vm-hands/{status-vfh269zs.js → status-f146chye.js} +2 -2
- package/bin/vm-hands/version-ss25ccvh.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-qk2t0xs7.js → vm-hands-entry-lite-07er2w8q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5b29hq7h.js → vm-hands-entry-lite-1j9r1fca.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-22we2jrv.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-xhjbc3e4.js → vm-hands-entry-lite-3ew5ftk0.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-463aheya.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-5kgvss4p.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-5xtkyx25.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-jfwz0br7.js → vm-hands-entry-lite-9z6k7898.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-bybpy28m.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-c0m2jewa.js +11 -0
- package/bin/vm-hands/{vm-hands-entry-lite-t7wda1y5.js → vm-hands-entry-lite-c7krpmd8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-dys7am1h.js → vm-hands-entry-lite-d2hbz0r4.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-nvhzj5b0.js → vm-hands-entry-lite-f4gvypnx.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-wpx6sg6d.js → vm-hands-entry-lite-gxjxx1r2.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-gzxxsjmr.js +62 -0
- package/bin/vm-hands/{vm-hands-entry-lite-nd1k2jz9.js → vm-hands-entry-lite-h2xemq1f.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-c9wp99nr.js → vm-hands-entry-lite-ha1ej910.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-nbtpm59m.js → vm-hands-entry-lite-j05685sg.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-6f5eypjm.js → vm-hands-entry-lite-jn95s3j4.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-kt4831mq.js +340 -0
- package/bin/vm-hands/{vm-hands-entry-lite-k17ntg9v.js → vm-hands-entry-lite-kv0qat0x.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-kxdw4myj.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-r5nskvf8.js → vm-hands-entry-lite-n867d88m.js} +9 -68
- package/bin/vm-hands/{vm-hands-entry-lite-swz6ea7y.js → vm-hands-entry-lite-p8662x7z.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-pf1gagky.js +37 -0
- package/bin/vm-hands/{vm-hands-entry-lite-953ekkrb.js → vm-hands-entry-lite-qbnz4h30.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-2w440hvn.js → vm-hands-entry-lite-qhgfnhjt.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-trcg4jv7.js → vm-hands-entry-lite-qm18wqgz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-beannz0s.js → vm-hands-entry-lite-r5y08n0q.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-r6pap1kh.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-s98hjhz3.js +5 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zrvaqawr.js → vm-hands-entry-lite-sx2gpbap.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-qf01e5f1.js → vm-hands-entry-lite-szfy3kx7.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-95k4g3jj.js → vm-hands-entry-lite-taw01cp4.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-d93n1cz7.js → vm-hands-entry-lite-tg2bkah3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-mybm2kyz.js → vm-hands-entry-lite-v08mjs3f.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-84d59wrf.js → vm-hands-entry-lite-w88zkzhr.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-wej1p1ry.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-gcn3rmz6.js → vm-hands-entry-lite-wry37am5.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-x4j4058x.js +9 -0
- package/bin/vm-hands/{vm-hands-entry-lite-tj1y61bg.js → vm-hands-entry-lite-ygx9kj92.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-4ee0fqc5.js → vm-hands-executor-5nqmf61x.js} +1 -1
- package/bin/vm-hands/vm-hands-op-runner-zedtdcmk.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-42azzb1d.js → vm-hands-runtime-hnpk8xmf.js} +3 -3
- package/bin/vm-hands/worker-sandbox-vmp22sk6.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-emdf5nm5.js +0 -2
- package/bin/vm-hands/api-js29ghm5.js +0 -2
- package/bin/vm-hands/ask-relay-3x4np5cy.js +0 -8
- package/bin/vm-hands/connect-cli-12z734eh.js +0 -2
- package/bin/vm-hands/desktop-account-gcysz0m3.js +0 -2
- package/bin/vm-hands/hands-worker-source-hbp5n31r.js +0 -2
- package/bin/vm-hands/local-automation-rvwmkxjb.js +0 -2
- package/bin/vm-hands/local-capabilities-v0bd3pg1.js +0 -2
- package/bin/vm-hands/local-desktop-users-pccz3sz9.js +0 -2
- package/bin/vm-hands/local-display-mac-gj72gkfb.js +0 -2
- package/bin/vm-hands/local-display-session-m55mqd0t.js +0 -2
- package/bin/vm-hands/local-pty-session-zen80k1k.js +0 -2
- package/bin/vm-hands/package-1e3w44ve.js +0 -2
- package/bin/vm-hands/permissions-hvhfr5k0.js +0 -2
- package/bin/vm-hands/version-07vvwhvf.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-33ttamma.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-6qfax5p2.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-d9k3dzaq.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-dyy62gt3.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-f6vhpgam.js +0 -343
- package/bin/vm-hands/vm-hands-entry-lite-njne26yc.js +0 -43
- package/bin/vm-hands/vm-hands-entry-lite-tdgbgcer.js +0 -3
- package/bin/vm-hands/vm-hands-op-runner-s5nh8mpx.js +0 -2
- package/bin/vm-hands/worker-sandbox-yw24sxyp.js +0 -2
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{sf as A}from"./vm-hands-entry-lite-swz6ea7y.js";import{Lf as wz,Mf as Nz}from"./vm-hands-entry-lite-c9wp99nr.js";import{Kh as N}from"./vm-hands-entry-lite-5b29hq7h.js";import{wi as Fz}from"./vm-hands-entry-lite-nd1k2jz9.js";import{spawnSync as iz}from"child_process";import{dirname as g}from"path";import{spawn as cz}from"child_process";import{accessSync as lz,constants as sz}from"fs";import{basename as nz,join as pz}from"path";import{randomUUID as p}from"crypto";import{spawnSync as M}from"child_process";import{chmodSync as Hz,cpSync as Rz,existsSync as U,lstatSync as O,mkdirSync as i,readdirSync as Cz,readFileSync as E,readlinkSync as Lz,realpathSync as T,renameSync as R,rmdirSync as Mz,rmSync as P,symlinkSync as c,writeFileSync as Oz}from"fs";import{dirname as C,join as D,relative as Uz,resolve as Tz}from"path";var a="so.ara.cli",_z="5LJFSBRY2F";var o="ReasonBackgroundIdentity",r="Contents/Helpers/ReasonPermissionTile";var x="AraBackgroundIdentity",Az="Reason",Iz=`anchor apple generic and identifier "${a}" and certificate leaf[subject.OU] = "${_z}"`;class L extends Error{code;constructor(z,J){super(J);this.code=z;this.name="MacOSBackgroundIdentityError"}}var k="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";function v(z=N()){return D(z,"Library","Application Support","Reason","Background","Reason.app")}function _(z=N()){return D(z,"Library","Application Support","Ara","Background","Ara.app")}function kz(z){try{return O(z).isFile()}catch{return!1}}function y(z){return[o,x].map((J)=>D(z,"Contents","MacOS",J)).find(kz)??null}function w(z){try{if(!O(z).isDirectory())return!1;let J=E(D(z,"Contents","Info.plist"),"utf8");return J.includes(`<string>${a}</string>`)&&(J.includes(`<string>${Az}</string>`)||J.includes("<string>Ara</string>"))&&y(z)!==null}catch{return!1}}function I(z=N()){let J=v(z);if(!w(J))return null;try{let Z=E(D(J,"Contents","Info.plist"),"utf8");return/<key>CFBundleVersion<\/key>\s*<string>(\d+\.\d+\.\d+)<\/string>/.exec(Z)?.[1]??null}catch{return null}}function Sz(z,J=N()){let Z=I(J);return Z===null||$z(S(Z.split(".")),S(z.split(/[.-]/).slice(0,3)))}var fz=1e4;function t(z,J){return M(z,[...J],{stdio:"ignore",timeout:fz}).status??1}var e=new Set;function zz(z){if(process.env.REASON_TEST_REFUSE_REAL_IDENTITY!=="1")return;let J=(Z)=>{try{return T(Z)}catch{return Tz(Z)}};if(z!==void 0&&J(z)!==J(N()))return;throw Error("A test tried to change this computer's real Reason background identity; pass a temporary home. Refused by scripts/test-env.ts.")}var Jz=/\/(?:runtime|CLI)\/versions\/(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$|\/\.ara(?:-staging)?-worker-(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$/,Zz=new Set(["ara","ara.exe","reason","reason.exe"]);function S(z){return z.map((J)=>Number(J))}function $z(z,J){for(let Z=0;Z<3;Z+=1)if(z[Z]!==J[Z])return z[Z]<J[Z];return!1}var Ez=[0,2,161];function xz(z){if(z===null)return!0;let J=Ez,Z=null;try{Z=T(process.execPath)}catch{}return z.some(($)=>{let j=Jz.exec($);if(j){let Q=j[1]===void 0?j.slice(4,7):j.slice(1,4);return $z(S(Q),J)}let q=$.slice($.lastIndexOf("/")+1);return Zz.has(q)&&$!==Z&&$!==process.execPath})}function yz(){let z=M("/bin/ps",["-xo","pid=,comm="],{encoding:"utf8",timeout:5000});if(z.status!==0)return null;let J=[];for(let Z of z.stdout.split(`
|
|
3
|
-
`)){let $=/^\s*(\d+)\s+(\S.*)$/.exec(Z);if(!$||Number($[1])===process.pid)continue;let j=$[2].trimEnd(),q=j.slice(j.lastIndexOf("/")+1);if(!Jz.test(j)&&Zz.has(q)){let V=M("/usr/sbin/lsof",["-a","-p",$[1],"-d","txt","-Fn"],{encoding:"utf8",timeout:5000}).stdout?.split(`
|
|
4
|
-
`).find((X)=>X.startsWith("n/"));if(V)j=V.slice(1)}J.push(j)}return J}function bz(z){if(zz(z.home),!w(z.sourceApp))throw new L("identity_invalid","The packaged Reason background identity is missing or invalid.");let J=z.command??t,Z=v(z.home),$=C(Z);i($,{recursive:!0,mode:448}),Hz($,448);let j=T(z.sourceApp),q=null;try{q=T(Z)}catch{}if(j!==q){let Q=`${process.pid}.${p()}`,V=D($,`.Reason.app.${Q}.tmp`),X=D($,`.Reason.app.${Q}.old`),W=!1;try{if(Rz(j,V,{recursive:!0,errorOnExist:!0,preserveTimestamps:!0}),!w(V))throw new L("identity_invalid","The copied Reason background identity is invalid.");let Y=z.releaseSigned?["--test-requirement",`=${Iz}`]:[];if(J("/usr/bin/codesign",["--verify","--strict",...Y,V])!==0)throw new L("identity_invalid_signature","The installed Reason background identity has an invalid signature.");let B=!1;for(let F=0;F<4;F+=1){let G=!1;try{R(Z,X),G=!0,W=!0}catch(K){if(K.code!=="ENOENT")throw K}if(F===0)z.beforePublish?.();try{R(V,Z),B=!0}catch(K){let m=K.code;if(!["EEXIST","ENOTEMPTY"].includes(m??""))throw K;if(G)P(X,{recursive:!0,force:!0}),W=!1;if(F===3)throw K;continue}if(G)P(X,{recursive:!0,force:!0}),W=!1;break}if(!B)throw Error("Could not publish Reason's background identity.")}catch(Y){if(W&&!U(Z)&&U(X))R(X,Z);throw Y}finally{P(V,{recursive:!0,force:!0}),P(X,{recursive:!0,force:!0})}}return Wz(Z,z,{verified:j!==q}),Z}function jz(z){return D(C(z),".Reason.app.registered")}function qz(z){try{let J=O(z);return J.isDirectory()?`${J.ino}:${J.birthtimeMs}`:null}catch{return null}}function f(z){let J=qz(z);try{return J!==null&&E(jz(z),"utf8")===J}catch{return!1}}function Qz(z){if(w(z))return"bundle";try{if(O(D(z,"Contents","Info.plist"),{throwIfNoEntry:!1}))return null;return O(D(z,"Contents","MacOS",x)).isSymbolicLink()?"retired":null}catch{return null}}function Wz(z,J,Z={}){let $=J.command??t;if(!Z.verified&&$("/usr/bin/codesign",["--verify","--strict",z])!==0)throw new L("identity_invalid_signature","The installed Reason background identity has an invalid signature.");if($(k,["-f",z])!==0)throw new L("identity_register_failed","Could not register Reason's macOS background identity.");let j=qz(z);try{if(j)Oz(jz(z),j,{mode:384})}catch{}try{gz(z,J.home,$,J.runningExecutables??yz)}catch(q){let Q=q.code??"unknown";process.stderr.write(`Reason background identity: legacy_identity_retire_failed (${Q})
|
|
5
|
-
`)}}function gz(z,J,Z,$){let j=y(z);if(!j)return;let q=_(J),Q=C(q),V=(K)=>D(K,"Contents","MacOS",x),X=Uz(C(V(q)),j),W=`${process.pid}.${p()}`,Y=Qz(q);if(Y===null)return;let B=Y==="bundle";if(B)Z(k,["-u",q]);let F=D(Q,`.Ara.app.${W}.old`);if(!e.has(q)&&!xz($())){if(!B)Z(k,["-u",q]);try{R(q,F)}catch(K){if(K.code==="ENOENT")return;throw K}P(F,{recursive:!0,force:!0}),uz(Q);return}if(!B){if(Lz(V(q))===X)return;let K=`${V(q)}.${W}`;c(X,K);try{R(K,V(q))}finally{P(K,{force:!0})}return}let G=D(Q,`.Ara.app.${W}.shim`);i(C(V(G)),{recursive:!0}),c(X,V(G));try{try{R(q,F)}catch(K){if(K.code==="ENOENT")return;throw K}try{R(G,q)}catch(K){if(U(q))return;throw R(F,q),K}}finally{P(G,{recursive:!0,force:!0}),P(F,{recursive:!0,force:!0})}}function uz(z){try{if(Cz(z).some((Z)=>Z!==".DS_Store"))return;P(D(z,".DS_Store"),{force:!0}),Mz(z)}catch{}}var l=new Map;function hz(z=N()){let J=l.get(z);if(J)return J;if(process.platform!=="darwin")return[];let Z=s(z);if(Z===null&&U(C(v(z))))Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,100),Z=s(z);if(Z===null)return[];return l.set(z,Z),Z}function s(z){let J=v(z),Z=_(z);if(!w(J)||!f(J))try{dz({home:z,skipWhenSettled:!0})}catch{}let $=w(J)&&(f(J)||!w(Z))?J:w(Z)?Z:null,j=$?y($):null;if(!j)return null;if($===Z)e.add(Z);let q=M(j,["--can-spawn"],{env:{},timeout:2000,encoding:"utf8"});return q.status===0&&q.stdout===`spawn
|
|
6
|
-
`?[j,"--spawn"]:[]}var n=new Map;function b(z=N()){let J=hz(z),Z=J[0];if(!Z)return[];let $=n.get(Z);if($===void 0){let j=M(Z,["--can-spawn-computer-use"],{env:{},timeout:2000,encoding:"utf8"});$=j.status===0&&j.stdout===`spawn
|
|
7
|
-
`,n.set(Z,$)}return $?J:[]}function Kz(z=b(),J=N()){if(z.length>0)return null;if(I(J)===null)return"computer_use_identity_missing";return Sz(A,J)?"computer_use_identity_outdated":"computer_use_identity_unavailable"}function dz(z={}){zz(z.home);let J=v(z.home);if(z.skipWhenSettled&&w(J)&&f(J)&&Qz(_(z.home))===null)return!0;if(!w(J)){let Z=_(z.home);if(!w(Z))return!1;try{return bz({...z,sourceApp:Z}),!0}catch($){if(!w(J))throw $}}return Wz(J,z),!0}var mz="REASON_WORKER_IDENTITY_APP";function VJ(z,J=process.env,Z=N()){let $=J[mz];return $&&$===v(Z)?$:z}function XJ(z,J){if(process.platform!=="darwin")return null;let Z=v(z),$=D(Z,"Contents","MacOS",o),j=M($,["--can-run-worker",J],{env:{},timeout:2000,encoding:"utf8"});return j.status===0&&j.stdout===`run-worker
|
|
8
|
-
`?{app:Z,executable:$}:null}var H=null;function Vz(z){if(H===z)H=null;if(z.exitCode===null&&z.signalCode===null)z.kill("SIGTERM")}var Xz=(z,J)=>{if(H)Vz(H);let Z=pz(z,r);try{lz(Z,sz.X_OK)}catch{return()=>{}}let $;try{$=cz(Z,["--app",z,"--name",nz(z,".app"),"--permission",J==="screen"?"screen_recording":"accessibility"],{detached:!0,stdio:"ignore"})}catch{return()=>{}}return $.on("error",()=>{if(H===$)H=null}),$.once("exit",()=>{if(H===$)H=null}),$.unref(),H=$,()=>Vz($)};var Dz=`Reason permissions
|
|
9
|
-
|
|
10
|
-
Usage:
|
|
11
|
-
reason permissions [--json]
|
|
12
|
-
reason permissions allow [screen|accessibility|disk]
|
|
13
|
-
|
|
14
|
-
The macOS privacy permissions of this computer's Reason worker:
|
|
15
|
-
screen Screen & System Audio Recording: desktop video, computer-use screenshots
|
|
16
|
-
accessibility Accessibility: computer-use clicks and typing, desktop input
|
|
17
|
-
disk Full Disk Access (recommended): Sessions in Desktop, Documents,
|
|
18
|
-
Downloads, iCloud Drive and Mail
|
|
19
|
-
|
|
20
|
-
allow asks for each missing one, or the one named. macOS cannot ask for Full
|
|
21
|
-
Disk Access: allow disk opens its pane, shows the file to add in Finder and
|
|
22
|
-
waits until the worker has it.
|
|
23
|
-
`,u="x-apple.systempreferences:com.apple.preference.security",az="curl -fsSL https://reasonmachines.com/install.sh | bash",oz=180000,rz=2000,h=["screen","accessibility","disk"],d={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${u}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${u}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${u}?Privacy_AllFiles`}};function Bz(z){return z.executable}function tz(z,J){if(z==="computer_use_identity_missing")return`Reason's background identity is not installed (${z}); reinstall Reason: ${az}`;if(z==="computer_use_identity_outdated")return`Reason's background identity is outdated (${I(J)??"unknown"}; this CLI is ${A}) (${z}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${z}); run the installed \`reason\``}function ez(z=N()){let J=b(z);if(J.length>0)return{state:"ready",path:g(g(g(J[0]))),prefix:J};let Z=Kz(J,z)??"computer_use_identity_unavailable";return{state:Z,path:v(z),detail:tz(Z,z)}}function Pz(){return{identity:()=>ez(),grants:(z)=>wz(z),request:(z,J)=>Nz(z,J),worker:async()=>(await import("./status-vfh269zs.js")).connectionMacState(),open:(z)=>{iz("/usr/bin/open",z,{stdio:"ignore",timeout:1e4})},tile:Xz,restartConnection:async()=>(await import("./connect-cli-12z734eh.js")).restartConnection(),sleep:(z)=>new Promise((J)=>setTimeout(J,z)),now:()=>Date.now()}}function Yz(z,J,Z){if(z.state!=="ready"||!J)return"unknown";return J[Z]?"granted":"missing"}async function vz(z){let J=z.identity(),Z=J.state==="ready"?await z.grants(J.prefix):null,$=await z.worker(),j=$?Bz($):null,q=!j||$?.full_disk_access==="unknown"?"unknown":$?.full_disk_access==="granted"?"granted":"missing",Q=(V,X,W)=>{let{label:Y,purpose:B,level:F}=d[V];return{id:V,label:Y,purpose:B,level:F,state:X,holder:W}};return{identity:{state:J.state,path:J.path,detail:J.state==="ready"?null:J.detail},worker_detail:j?null:"Full Disk Access is read from this computer's running worker; `reason connect` starts it.",permissions:[Q("screen",Yz(J,Z,"screen"),J.path),Q("accessibility",Yz(J,Z,"accessibility"),J.path),Q("disk",q,j)]}}function MJ(z){let J=z.identity.state==="ready"?null:z.identity.state,Z=z.permissions.filter((q)=>q.state==="granted").length,$=[...J?[J]:[],...z.permissions.filter((q)=>q.state!=="granted"&&!(J&&q.id!=="disk")).map((q)=>`${q.label} ${q.state}`)],j=!J&&z.permissions.some((q)=>q.state==="missing");return`Permissions: ${Z} of ${z.permissions.length}${$.length>0?` (${$.join(", ")})`:""}`+(j?" \u2014 reason permissions allow":$.length>0?" \u2014 reason permissions":"")}function zJ(z){let J=[];if(z.identity.detail)J.push(z.identity.detail);J.push(`Reason: ${z.identity.path}`);let Z=z.permissions.find(($)=>$.id==="disk");J.push(Z?.holder?`Worker: ${Z.holder}`:`Worker: ${z.worker_detail}`),J.push("");for(let $ of z.permissions){let j=`${$.label}${$.level==="recommended"?" (recommended)":""}`;J.push(` ${$.id.padEnd(13)} ${$.state.padEnd(7)} ${j}: ${$.purpose}`)}if(z.permissions.some(($)=>$.state==="missing"))J.push("","Allow the missing ones: reason permissions allow");return`${J.join(`
|
|
24
|
-
`)}
|
|
25
|
-
`}async function Gz(z,J){let Z=J.now()+oz;for(;;){if(await z())return!0;if(J.now()>=Z)return!1;await J.sleep(rz)}}async function JJ(z,J){let Z=J.host??Pz(),{io:$}=J,j=await vz(Z),q=j.permissions.filter((W)=>z.includes(W.id)&&W.state!=="granted");if(q.length===0)return $.stdout.write(`Reason permissions: ${z.map((W)=>d[W].label).join(", ")} already allowed.
|
|
26
|
-
`),0;let Q=!1,V=!1,X=Z.identity();for(let W of q){let{label:Y,pane:B}=d[W.id];if(W.id!=="disk"){if(X.state!=="ready"){if(!Q)$.stderr.write(`Reason permissions: ${X.detail}
|
|
27
|
-
`);Q=!0;continue}let G=W.id;await Z.request(X.prefix,G),Z.open([B]);let K=Z.tile(X.path,G);if($.stdout.write(`Allow Reason in System Settings > Privacy & Security > ${Y}.
|
|
28
|
-
`),!J.wait)continue;if($.stdout.write(`Waiting for it (Ctrl-C to stop)\u2026
|
|
29
|
-
`),await Gz(async()=>(await Z.grants(X.prefix))?.[G]===!0,Z).finally(K))$.stdout.write(`${Y}: granted.
|
|
30
|
-
`),V=!0;else $.stderr.write(`${Y} is not allowed yet; turn on Reason there, then run \`reason permissions\`.
|
|
31
|
-
`),Q=!0;continue}let F=Bz(await Z.worker()??{executable:null});if(!F){$.stderr.write(`Reason permissions: ${j.worker_detail} Then run \`reason permissions allow disk\`.
|
|
32
|
-
`),Q=!0;continue}if(Z.open([B]),Z.open(["-R",F]),$.stdout.write(`Full Disk Access: click + and choose ${F} (shown in Finder), or drag it into the list.
|
|
33
|
-
`),!J.wait)continue;if($.stdout.write(`Waiting for the worker to report it (Ctrl-C to stop)\u2026
|
|
34
|
-
`),await Gz(async()=>(await Z.worker())?.full_disk_access==="granted",Z))$.stdout.write(`Full Disk Access: granted.
|
|
35
|
-
`);else $.stderr.write("Full Disk Access is not reported yet. If you allowed it, `reason connect` restarts the worker with it.\n"),Q=!0}if(V)try{if(await Z.restartConnection())$.stdout.write(`This computer's Reason connection restarted to use them.
|
|
36
|
-
`)}catch(W){$.stderr.write(`This computer's Reason connection uses them after it restarts (\`reason connect\`): ${W instanceof Error?W.message:String(W)}
|
|
37
|
-
`)}return Q?1:0}function ZJ(z){if(z.some(($)=>["--help","-h","help"].includes($)))return{command:"help"};let[J,...Z]=z;if(J===void 0||J==="--json")return z.length<=1?{command:"list",json:J==="--json"}:{error:`Unknown option: ${z[1]}`};if(J!=="allow")return{error:`Unknown permissions command: ${J}`};if(Z.length>1)return{error:`Unknown option: ${Z[1]}`};if(Z.length===0)return{command:"allow",ids:[...h]};if(!h.includes(Z[0]))return{error:`allow expects ${h.join(", ")}.`};return{command:"allow",ids:[Z[0]]}}async function OJ(z,J={}){let Z=J.io??{stdout:process.stdout,stderr:process.stderr},$=ZJ(z);if("error"in $)return Z.stderr.write(`${$.error}
|
|
38
|
-
|
|
39
|
-
${Dz}`),1;if($.command==="help")return Z.stdout.write(Dz),0;let j=J.platform??process.platform;if(j!=="darwin")return Z.stdout.write($.command==="list"&&$.json?`${JSON.stringify({platform:j,applicable:!1})}
|
|
40
|
-
`:`Reason permissions: macOS privacy permissions do not apply on this computer.
|
|
41
|
-
`),0;let q=J.host??Pz();if($.command==="allow")return JJ($.ids,{io:Z,wait:!0,host:q});let Q=await vz(q);return Z.stdout.write($.json?`${JSON.stringify({platform:j,applicable:!0,...Q},null,2)}
|
|
42
|
-
`:zJ(Q)),0}
|
|
43
|
-
export{a as _e,k as $e,hz as af,b as bf,Kz as cf,dz as df,mz as ef,VJ as ff,XJ as gf,Xz as hf,Dz as if,h as jf,Bz as kf,ez as lf,vz as mf,MJ as nf,zJ as of,JJ as pf,ZJ as qf,OJ as rf};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{u as a}from"./vm-hands-entry-lite-tdgbgcer.js";import"./vm-hands-entry-lite-dyy62gt3.js";import"./vm-hands-entry-lite-wpx6sg6d.js";import"./vm-hands-entry-lite-nvhzj5b0.js";import"./vm-hands-entry-lite-tj1y61bg.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{a as configureWorkerSandbox};
|