@reason-machines/cli-linux-x64 0.2.560 → 0.2.563
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/reason +2 -2
- package/bin/vm-hands/agent-network-3stvmqsj.js +2 -0
- package/bin/vm-hands/api-9xm5e4g9.js +2 -0
- package/bin/vm-hands/api-credentials-3wwkpts2.js +2 -0
- package/bin/vm-hands/{ask-relay-2vf6fa2t.js → ask-relay-5f92e4c5.js} +2 -2
- package/bin/vm-hands/connect-cli-d3dp0r1t.js +2 -0
- package/bin/vm-hands/credentials-sk4sag42.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-3jscber1.js +2 -0
- package/bin/vm-hands/desktop-account-xma0330a.js +2 -0
- package/bin/vm-hands/desktop-components-p0zx6qxg.js +2 -0
- package/bin/vm-hands/desktop-delegate-tch2qzx0.js +2 -0
- package/bin/vm-hands/device-workspace-4bj43nxq.js +2 -0
- package/bin/vm-hands/{fsevents-vxv56sp5.js → fsevents-ezcg3e40.js} +1 -1
- package/bin/vm-hands/hands-worker-source-8pe7yv0m.js +2 -0
- package/bin/vm-hands/{index-03p9c17x.js → index-w92ys6ra.js} +16 -16
- package/bin/vm-hands/install-receipt-68xxg7hn.js +2 -0
- package/bin/vm-hands/local-automation-0a7enct8.js +2 -0
- package/bin/vm-hands/local-capabilities-d3ycjdyg.js +2 -0
- package/bin/vm-hands/local-desktop-users-jpf0resr.js +2 -0
- package/bin/vm-hands/local-display-mac-h5yz0ydd.js +2 -0
- package/bin/vm-hands/local-display-session-pc85z6mg.js +2 -0
- package/bin/vm-hands/local-display-video-40avbg94.js +2 -0
- package/bin/vm-hands/local-managed-process-ka331rcr.js +2 -0
- package/bin/vm-hands/local-pty-session-tqn2xmph.js +2 -0
- package/bin/vm-hands/managed-runtime-nwj7cn7c.js +2 -0
- package/bin/vm-hands/network-auto-update-tk104maa.js +3 -0
- package/bin/vm-hands/network-contract-nkwcf4r9.js +2 -0
- package/bin/vm-hands/{network-sign-in-8yvdx5rm.js → network-sign-in-t9ng36rs.js} +2 -2
- package/bin/vm-hands/package-9w0mmxb5.js +2 -0
- package/bin/vm-hands/permissions-ywh8x4dq.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-pck5har9.js +2 -0
- package/bin/vm-hands/serve-service-43kmwskj.js +2 -0
- package/bin/vm-hands/{status-fr7192eh.js → status-ec366bs8.js} +7 -7
- package/bin/vm-hands/version-6ys9zwbj.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-0as6nsks.js → vm-hands-entry-lite-0jy8mv4a.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-zawytz09.js → vm-hands-entry-lite-12ck5swp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-j10cw3d9.js → vm-hands-entry-lite-13nx02p7.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-vdv4nm5f.js → vm-hands-entry-lite-1b21avcs.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-qegwyvyz.js → vm-hands-entry-lite-1w39j6vz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-8w0ah5j9.js → vm-hands-entry-lite-1wxwsb3f.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-ms99mzp0.js → vm-hands-entry-lite-284z7ct8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-a7bf7xr7.js → vm-hands-entry-lite-2qfmabqn.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-q9s1e2y1.js → vm-hands-entry-lite-33at6g06.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-e3fn8ys2.js → vm-hands-entry-lite-3gc2bn5a.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hxfxs7r9.js → vm-hands-entry-lite-3q2ng4e9.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-41nn0vbf.js +150 -0
- package/bin/vm-hands/{vm-hands-entry-lite-0ex2twm5.js → vm-hands-entry-lite-43bv9hf0.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-f8p11q6h.js → vm-hands-entry-lite-61p78r72.js} +19 -19
- package/bin/vm-hands/{vm-hands-entry-lite-hs6sdn60.js → vm-hands-entry-lite-88dxn9b5.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-997y1m1r.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zh6ncdjn.js → vm-hands-entry-lite-a3gq377t.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-0wb1n769.js → vm-hands-entry-lite-b1vanmtv.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-q9djb28r.js → vm-hands-entry-lite-cc8hwgxc.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-chq0qx9f.js +12 -0
- package/bin/vm-hands/{vm-hands-entry-lite-84mc1f7h.js → vm-hands-entry-lite-cmmb9k3g.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-fhx46jny.js → vm-hands-entry-lite-d12hx1dk.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-4jgykvd3.js → vm-hands-entry-lite-d431ffz0.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ptycjmkc.js → vm-hands-entry-lite-fccn6s4j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-qf990rxw.js → vm-hands-entry-lite-fn2805g8.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-y4df9n3f.js → vm-hands-entry-lite-frg1b1rg.js} +105 -105
- package/bin/vm-hands/{vm-hands-entry-lite-71ebge0c.js → vm-hands-entry-lite-fxptf351.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-57ajjwmh.js → vm-hands-entry-lite-gxf2r5en.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-cspd38hc.js → vm-hands-entry-lite-j8s2vqpf.js} +42 -42
- package/bin/vm-hands/{vm-hands-entry-lite-fk2s50nc.js → vm-hands-entry-lite-jgwjt10t.js} +3 -5
- package/bin/vm-hands/{vm-hands-entry-lite-hjjbjpd7.js → vm-hands-entry-lite-jj7873n8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-f95mg81d.js → vm-hands-entry-lite-k4d5rhpw.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-9g52kxyj.js → vm-hands-entry-lite-kbnxk71q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-8pcs85ak.js → vm-hands-entry-lite-mn8rjpxq.js} +10 -10
- package/bin/vm-hands/{vm-hands-entry-lite-52qz0n30.js → vm-hands-entry-lite-ngry8nkq.js} +4 -4
- package/bin/vm-hands/vm-hands-entry-lite-pe374cn6.js +81 -0
- package/bin/vm-hands/{vm-hands-entry-lite-8xv6c0rm.js → vm-hands-entry-lite-pg7nnyc6.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-tcmye5ny.js → vm-hands-entry-lite-q62g6sx0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-v4hr9x9h.js → vm-hands-entry-lite-qjrgvdbj.js} +34 -34
- package/bin/vm-hands/{vm-hands-entry-lite-krpqqx12.js → vm-hands-entry-lite-rxydyqke.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-weqam12f.js → vm-hands-entry-lite-s93f3pbv.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-z0ht62s4.js → vm-hands-entry-lite-sh4mqy93.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-srtqjjqb.js +48 -0
- package/bin/vm-hands/{vm-hands-entry-lite-q3er9m6y.js → vm-hands-entry-lite-thstg177.js} +6 -6
- package/bin/vm-hands/vm-hands-entry-lite-vbqfmsd3.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-wnqqjsew.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-pxtycfdv.js → vm-hands-entry-lite-xfak34av.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-sy7dcccg.js → vm-hands-entry-lite-y0jtj8zz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-yvws5zpx.js → vm-hands-entry-lite-yg4dk99m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-2rgf8866.js → vm-hands-entry-lite-z65xva21.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-rhx6adbr.js → vm-hands-entry-lite-zj9esd2g.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-jpvmkce5.js → vm-hands-entry-lite-zp7chzcc.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-k5ytpgzz.js → vm-hands-entry-lite-zpvr7wc6.js} +19 -19
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/vm-hands-executor-2ngwj96m.js +12 -0
- package/bin/vm-hands/vm-hands-op-runner-te2ze1e7.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-gjjm5fzd.js → vm-hands-runtime-09ehkm3c.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-h96yr4wf.js +2 -0
- package/bin/vm-hands/worker-sandbox-6kkhvryn.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/agent-network-j5f603sy.js +0 -2
- package/bin/vm-hands/api-credentials-7rhpwe7n.js +0 -2
- package/bin/vm-hands/api-vkgf7wma.js +0 -2
- package/bin/vm-hands/connect-cli-06x1wfgv.js +0 -2
- package/bin/vm-hands/credentials-s7ps7y6s.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-3xnrp33e.js +0 -2
- package/bin/vm-hands/desktop-account-eg8thn79.js +0 -2
- package/bin/vm-hands/device-workspace-h5rsecq8.js +0 -2
- package/bin/vm-hands/hands-worker-source-vk664w8p.js +0 -2
- package/bin/vm-hands/install-receipt-j04hdw1k.js +0 -2
- package/bin/vm-hands/local-automation-8b1znx0p.js +0 -2
- package/bin/vm-hands/local-capabilities-m6pzcc94.js +0 -2
- package/bin/vm-hands/local-desktop-users-sq4trh07.js +0 -2
- package/bin/vm-hands/local-display-mac-yxcxvg2z.js +0 -2
- package/bin/vm-hands/local-display-session-zyd8s6n6.js +0 -2
- package/bin/vm-hands/local-display-video-rk680vwg.js +0 -2
- package/bin/vm-hands/local-managed-process-w26jhyfg.js +0 -2
- package/bin/vm-hands/local-pty-session-edd8ttf9.js +0 -2
- package/bin/vm-hands/managed-runtime-ykv5nyva.js +0 -2
- package/bin/vm-hands/network-auto-update-mrjz964a.js +0 -3
- package/bin/vm-hands/network-contract-8mxtma3w.js +0 -2
- package/bin/vm-hands/package-vwvzjtn0.js +0 -2
- package/bin/vm-hands/permissions-nmxr8238.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-1nkpw1v3.js +0 -2
- package/bin/vm-hands/serve-service-det934tz.js +0 -2
- package/bin/vm-hands/version-5d6gbmrd.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-ab1pq3xg.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-bnpdn6fw.js +0 -127
- package/bin/vm-hands/vm-hands-entry-lite-jhsa4av7.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-nn6zcvmp.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-tvnfm4xg.js +0 -150
- package/bin/vm-hands/vm-hands-executor-qny3mx8f.js +0 -12
- package/bin/vm-hands/vm-hands-op-runner-5q01rhkc.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-06tygyjs.js +0 -2
- package/bin/vm-hands/worker-sandbox-e1cpkzfz.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{xr,w}from"./vm-hands-entry-lite-33at6g06.js";import{De}from"./vm-hands-entry-lite-88dxn9b5.js";import{chmodSync as Y,existsSync as R,mkdirSync as X,readlinkSync as C,readFileSync as S,renameSync as Q,unlinkSync as Z,writeFileSync as nn}from"fs";import{homedir as u}from"os";import{basename as _,dirname as h,isAbsolute as p,join as o,normalize as b,relative as A,resolve as O}from"path";var c=3,N=1,P=2,D=1,x=1,T="Reason may read and write files and run commands in this signed-in OS account, subject to saved restrictions and operating system permissions.",ol="Reason may later execute on this computer inside a Reason sandbox, limited to folders explicitly attached by the user.",L=[ol,"Ara may later execute on this computer inside an Ara sandbox, limited to folders explicitly attached by the user."];function M(n){return typeof n==="string"&&L.includes(n)}var F=["future_device","updates_only","cli_only"];function f(n){return typeof n==="string"&&F.some((t)=>t===n)}function B(n=process.env,t=u()){return n.XDG_CONFIG_HOME?.trim()||o(t,".config")}function ot(n=process.env,t=u()){let r=w({env:n}),e=B(n,t);return o(e,De(e).state==="kept"?"ara":"reason",...r==="staging"?["staging"]:[],"installation.json")}function a(n){return typeof n==="string"&&n.trim().length>0}var U=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function V(n){return typeof n==="string"&&U.test(n)}function l(n){return a(n)&&p(n)&&b(n)===n}function y(n){if(!n||typeof n!=="object"||Array.isArray(n))return!1;let t=n;return l(t.path)&&(t.role==="launcher"&&(t.kind==="file"||t.kind==="symlink")||t.role==="worker_root"&&t.kind==="directory"||t.role==="alias"&&t.kind==="symlink"&&l(t.target))}function vc(n){return n==="staging"?["reason-staging","ara-staging"]:["reason","ara"]}var Pl=["reason","ara"];function as(n){let t=n.owned_paths.filter((e)=>e.role==="launcher").map((e)=>e.path),[r]=vc(n.channel);return t.find((e)=>_(e)===r)??t[0]??null}function g(n){let[t,r]=vc(n.channel==="staging"?"staging":"production"),e=[[t,r],[r,t]];return n.owned_paths?.every((i)=>i.role!=="alias"||n.installer==="shell"&&e.some(([s,v])=>i.path===o(n.install_dir,s)&&i.target===o(n.install_dir,v))&&n.owned_paths?.some((s)=>s.role==="launcher"&&s.path===i.target))??!1}function d(n,t){try{return O(h(n),C(n))===t}catch{return!1}}function $i(n){let t=_(n),r=t==="ara"?"reason":t==="ara-staging"?"reason-staging":null;if(!r)return n;let e=o(h(n),r);return d(e,n)||d(n,e)?e:n}function m(n,t){let r=A(n,t);return r.length>0&&!r.startsWith("..")&&!p(r)}function I(n){if(n===null)return!0;if(!n||typeof n!=="object"||Array.isArray(n))return!1;let t=n;return(t.kind==="shell_profile"||t.kind==="windows_user_path")&&a(t.location)&&a(t.value)&&(typeof t.added_by_installer==="boolean"||typeof t.added_by_ara==="boolean")&&(t.added_by_installer===void 0||typeof t.added_by_installer==="boolean")&&(t.added_by_ara===void 0||typeof t.added_by_ara==="boolean")}function E(n,t){if(t===null)return n==="cli_only";if(!t||typeof t!=="object"||Array.isArray(t))return!1;let r=t;if(r.version!==D||!a(r.recorded_at))return!1;if(n==="future_device")return r.decision==="authorized"&&M(r.scope);return r.scope===null&&r.decision===(n==="updates_only"?"ask":"disabled")}function K(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n;if(t.schema_version!==N||!xr.includes(t.channel)||t.install_method!=="curl"||t.installer!=="shell"&&t.installer!=="powershell"||!a(t.installed_at)||!a(t.version)||!a(t.target)||!l(t.install_dir)||!Array.isArray(t.owned_paths)||!t.owned_paths.every(y)||!t.owned_paths.every((r)=>m(t.install_dir,r.path))||!g(t)||!I(t.path_entry))return null;return{...t,schema_version:c,installation_id:null,background_mode:"cli_only",device_consent:null}}function z(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n;if(t.schema_version!==P||!k(t)||!f(t.background_mode)||!E(t.background_mode,t.device_consent))return null;return{...t,schema_version:c,installation_id:null}}function k(n){return xr.includes(n.channel)&&(n.install_method==="curl"&&(n.installer==="shell"||n.installer==="powershell")||n.install_method==="desktop"&&n.installer==="desktop"&&Array.isArray(n.owned_paths)&&n.owned_paths.length===0&&n.path_entry===null)&&a(n.installed_at)&&a(n.version)&&a(n.target)&&l(n.install_dir)&&Array.isArray(n.owned_paths)&&n.owned_paths.every(y)&&n.owned_paths.every((t)=>m(n.install_dir,t.path))&&g(n)&&I(n.path_entry)}function G(n){let t=K(n);if(t)return t;let r=z(n);if(r)return r;if(!n||typeof n!=="object"||Array.isArray(n))return null;let e=n;if(e.schema_version!==c||!V(e.installation_id)||!k(e)||!f(e.background_mode)||!E(e.background_mode,e.device_consent)||e.desktop_account_access!==void 0&&(e.desktop_account_access===null||typeof e.desktop_account_access!=="object"||Array.isArray(e.desktop_account_access)||e.desktop_account_access.version!==x||e.desktop_account_access.scope!==T||!a(e.desktop_account_access.recorded_at)||!Number.isFinite(Date.parse(e.desktop_account_access.recorded_at))))return null;return e}function We(n=ot()){if(!R(n))return null;try{return G(JSON.parse(S(n,"utf8")))}catch{return null}}export{ol,ot,vc,Pl,as,$i,We};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{G}from"./vm-hands-entry-lite-
|
|
2
|
+
import{G}from"./vm-hands-entry-lite-pg7nnyc6.js";import{randomUUID as k}from"crypto";import{closeSync as E,constants as c,fstatSync as S,lstatSync as f,mkdirSync as s,openSync as g,readFileSync as p,realpathSync as l,renameSync as v,unlinkSync as O,writeFileSync as F}from"fs";import{dirname as a,resolve as w}from"path";var _=65536;function u(r){try{return f(r),!0}catch(o){if(o instanceof Error&&"code"in o&&o.code==="ENOENT")return!1;throw o}}function b(r,o=!1){if(!u(r)){if(!o)throw Error("worker_state_missing");d(r),s(r,{mode:448})}let e=f(r);if(!e.isDirectory()||e.isSymbolicLink()||!G(e)||l(r)!==w(r))throw Error("worker_state_directory_not_private_or_canonical")}function d(r){let o=a(r);if(!u(o))d(o),s(o,{mode:448});if(l(o)!==w(o))throw Error("worker_parent_not_canonical")}function m(r,o=_){let e=g(r,c.O_RDONLY|c.O_NOFOLLOW);try{let n=S(e);if(!n.isFile()||n.nlink!==1||!G(n)||n.size>o)throw Error("worker_file_not_private");return p(e,"utf8")}finally{E(e)}}function y(r,o,e=_){let n=JSON.stringify(o);if(n===void 0)throw Error("worker_file_invalid");let t=n+`
|
|
3
3
|
`;if(Buffer.byteLength(t,"utf8")>e)throw Error("worker_file_too_large");if(b(a(r)),u(r))m(r,e);let i=`${r}.${k()}`;try{F(i,t,{mode:384,flag:"wx"}),v(i,r)}finally{if(u(i))O(i)}}
|
|
4
4
|
export{u,b,m,y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var e={REASON_API_KEY:"ARA_API_KEY",REASON_API_URL:"ARA_API_URL",REASON_CLI_CHANNEL:"ARA_CLI_CHANNEL",REASON_CLI_LAUNCHER_PATH:"ARA_CLI_LAUNCHER_PATH",REASON_MANAGED_RUNTIME_ROOT:"ARA_MANAGED_RUNTIME_ROOT",REASON_INSTALL_ALIAS_PATH:"ARA_INSTALL_ALIAS_PATH",REASON_INSTALL_DIR:"ARA_INSTALL_DIR",REASON_INSTALL_METHOD:"ARA_INSTALL_METHOD",REASON_INSTALL_PINNED_VERSION:"ARA_INSTALL_PINNED_VERSION",REASON_INSTALL_UPGRADE:"ARA_INSTALL_UPGRADE"},t=Object.values(e),E=new Set;function
|
|
3
|
-
export{
|
|
2
|
+
var e={REASON_API_KEY:"ARA_API_KEY",REASON_API_URL:"ARA_API_URL",REASON_CLI_CHANNEL:"ARA_CLI_CHANNEL",REASON_CLI_LAUNCHER_PATH:"ARA_CLI_LAUNCHER_PATH",REASON_MANAGED_RUNTIME_ROOT:"ARA_MANAGED_RUNTIME_ROOT",REASON_INSTALL_ALIAS_PATH:"ARA_INSTALL_ALIAS_PATH",REASON_INSTALL_DIR:"ARA_INSTALL_DIR",REASON_INSTALL_METHOD:"ARA_INSTALL_METHOD",REASON_INSTALL_PINNED_VERSION:"ARA_INSTALL_PINNED_VERSION",REASON_INSTALL_UPGRADE:"ARA_INSTALL_UPGRADE"},t=Object.values(e),E=new Set;function R(n,A){let N=n[A];if(N?.trim())return N;let _=n[e[A]];if(_?.trim())E.add(e[A]);return _}function Pn(n,A){return{[n]:A,[e[n]]:A}}
|
|
3
|
+
export{R,Pn};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`,{mode:384}),K(r,384),X(r,t),p=null}function D(e,t=k(),r=Date.now()){if(!I(e))throw Error(`No file or folder at ${e}.`);let n=A(e),i=v(t);if(i===n||i.startsWith(`${n}${w}`)||n.startsWith(`${i}${w}`))throw Error("Reason's own configuration folder cannot be allowed.");let o={path:n,kind:_(n).isDirectory()?"folder":"file",grantedAt:r},a=m(t).filter((l)=>l.path!==n);return O([...a,o],t),o}function j(e,t=k()){let r=I(e)?A(e):C(e),n=m(t),i=n.filter((o)=>o.path!==r);if(i.length===n.length)return!1;return O(i,t),!0}function
|
|
2
|
+
import{Pr,Rr}from"./vm-hands-entry-lite-13nx02p7.js";import{g}from"./vm-hands-entry-lite-1w39j6vz.js";import{Bc,st,Yt,Tr,Nn}from"./vm-hands-entry-lite-thstg177.js";import{L}from"./vm-hands-entry-lite-fccn6s4j.js";import{s,Et}from"./vm-hands-entry-lite-12ck5swp.js";import{spawnSync as se}from"child_process";import{dirname as S}from"path";import{spawn as U}from"child_process";import{accessSync as H,constants as J}from"fs";import{basename as q,join as B}from"path";var d=null;function R(e){if(d===e)d=null;if(e.exitCode===null&&e.signalCode===null)e.kill("SIGTERM")}var Bi=(e,t)=>{if(d)R(d);let r=B(e,Bc);try{H(r,J.X_OK)}catch{return()=>{}}let n;try{n=U(r,["--app",e,"--name",q(e,".app"),"--permission",t==="screen"?"screen_recording":"accessibility"],{detached:!0,stdio:"ignore"})}catch{return()=>{}}return n.on("error",()=>{if(d===n)d=null}),n.once("exit",()=>{if(d===n)d=null}),n.unref(),d=n,()=>R(n)};import{chmodSync as K,existsSync as I,mkdirSync as V,readFileSync as Y,realpathSync as A,renameSync as X,statSync as _,writeFileSync as z}from"fs";import{dirname as v,isAbsolute as Q,join as Z,resolve as C,sep as w}from"path";function k(e=s()){return Z(Et(e),"reason","protected-path-grants.json")}var p=null;function ee(e){let t=JSON.parse(e);if(!Array.isArray(t?.grants))return[];return t.grants.flatMap((r)=>{let n=r;return n&&typeof n.path==="string"&&Q(n.path)&&(n.kind==="file"||n.kind==="folder")&&typeof n.grantedAt==="number"?[{path:n.path,kind:n.kind,grantedAt:n.grantedAt}]:[]})}function m(e=k()){try{let{mtimeMs:t}=_(e);if(p&&p.file===e&&p.mtimeMs===t)return p.grants;let r=ee(Y(e,"utf8"));return p={file:e,mtimeMs:t,grants:r},r}catch{return[]}}function te(e,t){return e.kind==="file"?t===e.path:t===e.path||t.startsWith(`${e.path}${w}`)}function ne(e,t){let r=C(e);return m(t).some((n)=>te(n,r))}function xc(e,t){return L(e)&&!ne(e,t)}function O(e,t){V(v(t),{recursive:!0,mode:448});let r=`${t}.${process.pid}.tmp`;z(r,`${JSON.stringify({version:1,grants:e},null,2)}
|
|
3
|
+
`,{mode:384}),K(r,384),X(r,t),p=null}function D(e,t=k(),r=Date.now()){if(!I(e))throw Error(`No file or folder at ${e}.`);let n=A(e),i=v(t);if(i===n||i.startsWith(`${n}${w}`)||n.startsWith(`${i}${w}`))throw Error("Reason's own configuration folder cannot be allowed.");let o={path:n,kind:_(n).isDirectory()?"folder":"file",grantedAt:r},a=m(t).filter((l)=>l.path!==n);return O([...a,o],t),o}function j(e,t=k()){let r=I(e)?A(e):C(e),n=m(t),i=n.filter((o)=>o.path!==r);if(i.length===n.length)return!1;return O(i,t),!0}function Cc(e,t,r){let n=t?"file-read* file-write*":"file-read*";return m(r).filter((i)=>i.path===e||i.path.startsWith(`${e}${w}`)).map((i)=>`(allow ${n} (${i.kind==="file"?"literal":"subpath"} ${JSON.stringify(i.path)}))`)}var G=`Reason permissions
|
|
4
4
|
|
|
5
5
|
Usage:
|
|
6
6
|
reason permissions [--json]
|
|
@@ -20,9 +20,9 @@ this Mac may open. Only you can change this list; Sessions cannot.
|
|
|
20
20
|
allow asks for each missing one, or the one named. macOS cannot ask for Full
|
|
21
21
|
Disk Access: allow disk opens its pane, shows the file to add in Finder and
|
|
22
22
|
waits until the worker has it.
|
|
23
|
-
`,b="x-apple.systempreferences:com.apple.preference.security",re="curl -fsSL https://reasonmachines.com/install.sh | bash",ie=180000,oe=2000,M=["screen","accessibility","disk"],x={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${b}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${b}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${b}?Privacy_AllFiles`}};function F(e){return e.executable}function ae(e,t){if(e==="computer_use_identity_missing")return`Reason's background identity is not installed (${e}); reinstall Reason: ${re}`;if(e==="computer_use_identity_outdated")return`Reason's background identity is outdated (${Yt(t)??"unknown"}; this CLI is ${g}) (${e}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${e}); run the installed \`reason\``}function
|
|
23
|
+
`,b="x-apple.systempreferences:com.apple.preference.security",re="curl -fsSL https://reasonmachines.com/install.sh | bash",ie=180000,oe=2000,M=["screen","accessibility","disk"],x={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${b}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${b}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${b}?Privacy_AllFiles`}};function F(e){return e.executable}function ae(e,t){if(e==="computer_use_identity_missing")return`Reason's background identity is not installed (${e}); reinstall Reason: ${re}`;if(e==="computer_use_identity_outdated")return`Reason's background identity is outdated (${Yt(t)??"unknown"}; this CLI is ${g}) (${e}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${e}); run the installed \`reason\``}function sl(e=s()){let t=Tr(e);if(t.length>0)return{state:"ready",path:S(S(S(t[0]))),prefix:t};let r=Nn(t,e)??"computer_use_identity_unavailable";return{state:r,path:st(e),detail:ae(r,e)}}function E(){return{identity:()=>sl(),grants:(e)=>Pr(e),request:(e,t)=>Rr(e,t),worker:async()=>(await import("./status-ec366bs8.js")).connectionMacState(),open:(e)=>{se("/usr/bin/open",e,{stdio:"ignore",timeout:1e4})},tile:Bi,restartConnection:async()=>(await import("./connect-cli-d3dp0r1t.js")).restartConnection(),sleep:(e)=>new Promise((t)=>setTimeout(t,e)),now:()=>Date.now()}}function N(e,t,r){if(e.state!=="ready"||!t)return"unknown";return t[r]?"granted":"missing"}async function Ac(e){let t=e.identity(),r=t.state==="ready"?await e.grants(t.prefix):null,n=await e.worker(),i=n?F(n):null,o=!i||n?.full_disk_access==="unknown"?"unknown":n?.full_disk_access==="granted"?"granted":"missing",a=(l,u,c)=>{let{label:f,purpose:y,level:h}=x[l];return{id:l,label:f,purpose:y,level:h,state:u,holder:c}};return{identity:{state:t.state,path:t.path,detail:t.state==="ready"?null:t.detail},worker_detail:i?null:"Full Disk Access is read from this computer's running worker; `reason connect` starts it.",permissions:[a("screen",N(t,r,"screen"),t.path),a("accessibility",N(t,r,"accessibility"),t.path),a("disk",o,i)]}}function Rl(e){let t=e.identity.state==="ready"?null:e.identity.state,r=e.permissions.filter((o)=>o.state==="granted").length,n=[...t?[t]:[],...e.permissions.filter((o)=>o.state!=="granted"&&!(t&&o.id!=="disk")).map((o)=>`${o.label} ${o.state}`)],i=!t&&e.permissions.some((o)=>o.state==="missing");return`Permissions: ${r} of ${e.permissions.length}${n.length>0?` (${n.join(", ")})`:""}`+(i?" \u2014 reason permissions allow":n.length>0?" \u2014 reason permissions":"")}function ce(e){let t=[];if(e.identity.detail)t.push(e.identity.detail);t.push(`Reason: ${e.identity.path}`);let r=e.permissions.find((n)=>n.id==="disk");t.push(r?.holder?`Worker: ${r.holder}`:`Worker: ${e.worker_detail}`),t.push("");for(let n of e.permissions){let i=`${n.label}${n.level==="recommended"?" (recommended)":""}`;t.push(` ${n.id.padEnd(13)} ${n.state.padEnd(7)} ${i}: ${n.purpose}`)}if(e.permissions.some((n)=>n.state==="missing"))t.push("","Allow the missing ones: reason permissions allow");return`${t.join(`
|
|
24
24
|
`)}
|
|
25
|
-
`}async function T(e,t){let r=t.now()+ie;for(;;){if(await e())return!0;if(t.now()>=r)return!1;await t.sleep(oe)}}async function
|
|
25
|
+
`}async function T(e,t){let r=t.now()+ie;for(;;){if(await e())return!0;if(t.now()>=r)return!1;await t.sleep(oe)}}async function al(e,t){let r=t.host??E(),{io:n}=t,i=await Ac(r),o=i.permissions.filter((c)=>e.includes(c.id)&&c.state!=="granted");if(o.length===0)return n.stdout.write(`Reason permissions: ${e.map((c)=>x[c].label).join(", ")} already allowed.
|
|
26
26
|
`),0;let a=!1,l=!1,u=r.identity();for(let c of o){let{label:f,pane:y}=x[c.id];if(c.id!=="disk"){if(u.state!=="ready"){if(!a)n.stderr.write(`Reason permissions: ${u.detail}
|
|
27
27
|
`);a=!0;continue}let P=c.id;await r.request(u.prefix,P),r.open([y]);let W=r.tile(u.path,P);if(n.stdout.write(`Allow Reason in System Settings > Privacy & Security > ${f}.
|
|
28
28
|
`),!t.wait)continue;if(n.stdout.write(`Waiting for it (Ctrl-C to stop)\u2026
|
|
@@ -34,11 +34,11 @@ waits until the worker has it.
|
|
|
34
34
|
`),await T(async()=>(await r.worker())?.full_disk_access==="granted",r))n.stdout.write(`Full Disk Access: granted.
|
|
35
35
|
`);else n.stderr.write("Full Disk Access is not reported yet. If you allowed it, `reason connect` restarts the worker with it.\n"),a=!0}if(l)try{if(await r.restartConnection())n.stdout.write(`This computer's Reason connection restarted to use them.
|
|
36
36
|
`)}catch(c){n.stderr.write(`This computer's Reason connection uses them after it restarts (\`reason connect\`): ${c instanceof Error?c.message:String(c)}
|
|
37
|
-
`)}return a?1:0}function le(e){if(e.some((n)=>["--help","-h","help"].includes(n)))return{command:"help"};let[t,...r]=e;if(t==="protected"){let n=r.includes("--json"),[i="list",o,a]=r.filter((l)=>l!=="--json");if(i==="list"&&o===void 0)return{command:"protected",action:i,json:n};if((i==="allow"||i==="revoke")&&o&&a===void 0)return{command:"protected",action:i,path:o,json:n};return{error:"protected expects list, allow <path> or revoke <path>."}}if(t===void 0||t==="--json")return e.length<=1?{command:"list",json:t==="--json"}:{error:`Unknown option: ${e[1]}`};if(t!=="allow")return{error:`Unknown permissions command: ${t}`};if(r.length>1)return{error:`Unknown option: ${r[1]}`};if(r.length===0)return{command:"allow",ids:[...M]};if(!M.includes(r[0]))return{error:`allow expects ${M.join(", ")}.`};return{command:"allow",ids:[r[0]]}}async function
|
|
37
|
+
`)}return a?1:0}function le(e){if(e.some((n)=>["--help","-h","help"].includes(n)))return{command:"help"};let[t,...r]=e;if(t==="protected"){let n=r.includes("--json"),[i="list",o,a]=r.filter((l)=>l!=="--json");if(i==="list"&&o===void 0)return{command:"protected",action:i,json:n};if((i==="allow"||i==="revoke")&&o&&a===void 0)return{command:"protected",action:i,path:o,json:n};return{error:"protected expects list, allow <path> or revoke <path>."}}if(t===void 0||t==="--json")return e.length<=1?{command:"list",json:t==="--json"}:{error:`Unknown option: ${e[1]}`};if(t!=="allow")return{error:`Unknown permissions command: ${t}`};if(r.length>1)return{error:`Unknown option: ${r[1]}`};if(r.length===0)return{command:"allow",ids:[...M]};if(!M.includes(r[0]))return{error:`allow expects ${M.join(", ")}.`};return{command:"allow",ids:[r[0]]}}async function Tl(e,t={}){let r=t.io??{stdout:process.stdout,stderr:process.stderr},n=le(e);if("error"in n)return r.stderr.write(`${n.error}
|
|
38
38
|
|
|
39
39
|
${G}`),1;if(n.command==="help")return r.stdout.write(G),0;if(n.command==="protected")return de(n,r);let i=t.platform??process.platform;if(i!=="darwin")return r.stdout.write(n.command==="list"&&n.json?`${JSON.stringify({platform:i,applicable:!1})}
|
|
40
40
|
`:`Reason permissions: macOS privacy permissions do not apply on this computer.
|
|
41
|
-
`),0;let o=t.host??E();if(n.command==="allow")return
|
|
41
|
+
`),0;let o=t.host??E();if(n.command==="allow")return al(n.ids,{io:r,wait:!0,host:o});let a=await Ac(o);return r.stdout.write(n.json?`${JSON.stringify({platform:i,applicable:!0,...a},null,2)}
|
|
42
42
|
`:ce(a)),0}function de(e,t){try{if(e.action==="allow"){let n=D(e.path);return t.stdout.write(e.json?`${JSON.stringify({grant:n})}
|
|
43
43
|
`:`Sessions on this computer may now open ${n.path}.
|
|
44
44
|
`),0}if(e.action==="revoke"){let n=j(e.path);return t.stdout.write(e.json?`${JSON.stringify({revoked:n})}
|
|
@@ -49,4 +49,4 @@ ${G}`),1;if(n.command==="help")return r.stdout.write(G),0;if(n.command==="protec
|
|
|
49
49
|
`).join(""):`No protected paths are allowed on this computer.
|
|
50
50
|
`),0}catch(r){return t.stderr.write(`${r instanceof Error?r.message:String(r)}
|
|
51
51
|
`),1}}
|
|
52
|
-
export{
|
|
52
|
+
export{Bi,xc,Cc,sl,Ac,Rl,al,Tl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{te}from"./vm-hands-entry-lite-
|
|
2
|
+
import{te}from"./vm-hands-entry-lite-kbnxk71q.js";var pc=32;var hc="__ARA_PI_TOOL_CONFINED_SCRIPT_5f0c9e2a__",fc=262144;var F=2,Ei=33554432,ki=200000,jo=4000000,_r=240000;var Ho=2000;var xi=16384,qt=32768,_t=128,Uo=64,Wt=2097152,_n=1,He=16384,Vt=32768,zo=8388608,yt=1000,yn=2500,Ci=2000,wn=yn+Ci,R=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/,h=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Ai={text_only:4430,invalid_json:4431,invalid_cancel_request:4432,invalid_sdk_response:4433,claim_required:4434,invalid_claim:4435,executor_mismatch:4436,stale_generation:4437,fence_conflict:4438,frame_too_large:4439,result_too_large:4440,progress_too_large:4441,terminal_cleanup_started:4442,job_journal_unavailable:4443},V=new Map(Object.entries(Ai).map(([t,n])=>[n,t]));var N=["cancelled","command_failed","duplicate_request_id","duplicate_result_evicted","invalid_repl_response","invalid_request","process_group_cleanup_unconfirmed","repl_failed","result_too_large","repl_response_too_large","repl_transport_failed","request_ledger_full","request_journal_unavailable","request_outcome_uncertain","maintenance_held","request_not_found","resume_digest_mismatch","spawn_failed","stale_generation","timeout"],I=new Set(N),qo=16384,y=["maintenance_held","invalid_job_request","jobs_disabled","job_not_found","job_conflict","job_capacity","job_journal_unavailable","job_not_running","job_lease_expired","job_input_sequence","job_input_backpressure","stale_generation","pty_unsupported","job_mode_mismatch"];class r extends Error{code;constructor(t){super(t);this.name="HandsProtocolError",this.code=t}}function m(t){return new TextEncoder().encode(t).byteLength}function a(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function i(t,n){let e=new Set(n);return Object.keys(t).every((s)=>e.has(s))}function nt(t){return typeof t==="string"&&R.test(t)}function Ee(t){return Number.isSafeInteger(t)&&Number(t)>=1}function ce(t){return typeof t==="string"&&h.test(t)}function it(t){return typeof t==="string"&&t.startsWith("pty-")&&ce(t.slice(4))}function p(t){return[t.cols,t.rows].every((n)=>Number.isSafeInteger(n)&&Number(n)>=1&&Number(n)<=yt)}function _(t){if(typeof t!=="string"||t.length>Math.ceil(He/3)*4||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return-1;let n=t.endsWith("==")?2:t.endsWith("=")?1:0;if(n&&"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[t.length-n-1])&(n===2?15:3))return-1;let s=t.length/4*3-n;return s<=He?s:-1}function l(t){if(m(t)>Ei)throw new r("frame_too_large");try{return JSON.parse(t)}catch{throw new r("invalid_json")}}function Pi(t){let n=l(t);if(!a(n)||!i(n,["type","version","generation","id","jobId","action","input"])||n.type!=="job"||n.version!==F||!Ee(n.generation)||!nt(n.id)||!nt(n.jobId)||!a(n.input))throw new r("invalid_job_request");let e=n.input,s=Number.isSafeInteger(e.leaseExpiresAtMs)&&Number(e.leaseExpiresAtMs)>0,d=Number.isSafeInteger(e.sequence)&&Number(e.sequence)>=1;if(!(n.action==="start"?e.mode==="pty"?i(e,["mode","cols","rows","leaseExpiresAtMs"])&&it(n.jobId)&&p(e)&&s:i(e,["script","leaseExpiresAtMs"])&&typeof e.script==="string"&&e.script.length<=ki&&s:n.action==="inspect"?i(e,["after"])&&Number.isSafeInteger(e.after)&&Number(e.after)>=0:n.action==="input"?"dataBase64"in e?i(e,["sequence","dataBase64"])&&it(n.jobId)&&d&&_(e.dataBase64)>0:i(e,["sequence","data","eof"])&&d&&typeof e.data==="string"&&e.data.length<=xi&&typeof e.eof==="boolean":n.action==="resize"?i(e,["sequence","cols","rows"])&&it(n.jobId)&&d&&p(e):n.action==="renew"?i(e,["leaseExpiresAtMs"])&&s:n.action==="cancel"&&i(e,[])))throw new r("invalid_job_request");return n}function Ri(t){let n=l(t);if(!a(n)||!i(n,["type","version","generation","id","ok","job","error"])||n.type!=="job_result"||n.version!==F||!Ee(n.generation)||!nt(n.id))throw new r("invalid_job_result");if(n.ok===!1&&n.job===void 0&&typeof n.error==="string"&&y.some((o)=>o===n.error))return n;let e=n.job;if(n.ok!==!0||n.error!==void 0||!a(e)||!i(e,["jobId","state","startedAtMs","finishedAtMs","leaseExpiresAtMs","exitCode","inputSequence","output","firstCursor","nextCursor","truncated","process","environmentRevision","environmentSnapshotId","pty"])||!nt(e.jobId)||!["starting","running","exited","cancelled","expired","uncertain"].includes(String(e.state))||!Number.isSafeInteger(e.startedAtMs)||Number(e.startedAtMs)<1||!Number.isSafeInteger(e.leaseExpiresAtMs)||Number(e.leaseExpiresAtMs)<1||e.finishedAtMs!==null&&(!Number.isSafeInteger(e.finishedAtMs)||Number(e.finishedAtMs)<Number(e.startedAtMs))||e.exitCode!==null&&(!Number.isSafeInteger(e.exitCode)||Number(e.exitCode)<0||Number(e.exitCode)>255)||!Number.isSafeInteger(e.inputSequence)||Number(e.inputSequence)<0||!Number.isSafeInteger(e.firstCursor)||Number(e.firstCursor)<1||!Number.isSafeInteger(e.nextCursor)||Number(e.nextCursor)<Number(e.firstCursor)-1||typeof e.truncated!=="boolean"||!Array.isArray(e.output)||e.output.length>_t)throw new r("invalid_job_result");if(e.environmentRevision===void 0!==(e.environmentSnapshotId===void 0)||e.environmentRevision!==void 0&&(!Number.isSafeInteger(e.environmentRevision)||Number(e.environmentRevision)<1||!ce(e.environmentSnapshotId)))throw new r("invalid_job_result");let s=Number(e.firstCursor)-1,d=0;for(let o of e.output){if(!a(o)||!i(o,["cursor","stream","text"])||!Number.isSafeInteger(o.cursor)||Number(o.cursor)<=s||Number(o.cursor)>Number(e.nextCursor)||!["stdout","stderr"].includes(String(o.stream))||typeof o.text!=="string")throw new r("invalid_job_result");d+=o.text.length,s=Number(o.cursor)}if(d>qt)throw new r("invalid_job_result");let c=e.state==="starting"||e.state==="running";if(c&&(e.finishedAtMs!==null||e.exitCode!==null)||!c&&e.finishedAtMs===null||e.state==="uncertain"&&e.exitCode!==null||e.state==="exited"&&e.exitCode===null||e.state==="cancelled"&&e.exitCode!==130||e.state==="expired"&&e.exitCode!==124)throw new r("invalid_job_result");if(e.process!==void 0){let o=e.process;if(!a(o)||!i(o,["pid","processGroupId","executorLaunchId"])||!Number.isSafeInteger(o.pid)||Number(o.pid)<1||o.processGroupId!==o.pid||!ce(o.executorLaunchId)||!["starting","running"].includes(String(e.state)))throw new r("invalid_job_result")}if(e.pty!==void 0){let o=e.pty;if(!a(o)||!i(o,["version","cols","rows","output","cleanup"])||o.version!==_n||!it(e.jobId)||!p(o)||e.output.length!==0||!Array.isArray(o.output)||o.output.length>_t||(c?o.cleanup!=="pending":e.state==="uncertain"?o.cleanup!=="unconfirmed":o.cleanup!=="confirmed")||e.state==="running"&&(e.process===void 0||e.environmentRevision===void 0))throw new r("invalid_job_result");let g=Number(e.firstCursor)-1,b=0;for(let u of o.output){if(!a(u)||!i(u,["cursor","dataBase64"])||!Number.isSafeInteger(u.cursor)||Number(u.cursor)<=g||Number(u.cursor)>Number(e.nextCursor))throw new r("invalid_job_result");let f=_(u.dataBase64);if(f<=0||(b+=f)>Vt)throw new r("invalid_job_result");g=Number(u.cursor)}}return n}function Wo(t){if(m(t)>Wt)throw new r("frame_too_large");let n=l(t);if(!a(n)||!i(n,["version","sessionId","operationId","runId","deviceId","rootId","workspace","binding","targetRevision","rootGrantRevision","generation","fenceId","executorLaunchId","job"])||n.version!==_n||![n.sessionId,n.operationId,n.runId].every(nt)||![n.deviceId,n.rootId,n.fenceId,n.executorLaunchId].every(ce)||!Ee(n.generation)||!Number.isSafeInteger(n.rootGrantRevision)||Number(n.rootGrantRevision)<1||!["workspace_source","mcp_control"].includes(String(n.binding))||!Number.isSafeInteger(n.targetRevision)||Number(n.targetRevision)<0||n.binding==="workspace_source"&&n.targetRevision!==0||!a(n.workspace))throw new r("invalid_pty_receipt");if(!te(n.workspace))throw new r("invalid_pty_receipt");let e=Ri(JSON.stringify({type:"job_result",version:F,generation:n.generation,id:n.operationId,ok:!0,job:n.job}));if(!e.ok||!e.job.pty||e.job.pty.output.length!==0||e.job.process&&e.job.process.executorLaunchId!==n.executorLaunchId)throw new r("invalid_pty_receipt");return n}export{pc,hc,fc,F,Ei,ki,jo,_r,Ho,xi,qt,_t,Uo,Wt,_n,He,Vt,zo,yt,yn,Ci,wn,Ai,qo,nt,Ee,ce,it,Pi,Ri,Wo};
|