@reason-machines/cli-linux-x64 0.2.421 → 0.2.424
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/api-credentials-skdwhmrz.js +2 -0
- package/bin/vm-hands/api-s23qevwq.js +2 -0
- package/bin/vm-hands/connect-cli-t0hbgm24.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-46deqrq5.js +2 -0
- package/bin/vm-hands/desktop-account-nb7g2ek5.js +2 -0
- package/bin/vm-hands/device-workspace-6av4wa2e.js +2 -0
- package/bin/vm-hands/{fsevents-p3d8kd0p.js → fsevents-5c1c8fc6.js} +1 -1
- package/bin/vm-hands/hands-worker-source-wjsjw77t.js +2 -0
- package/bin/vm-hands/{index-wrw65904.js → index-0dp6x9h4.js} +18 -18
- package/bin/vm-hands/install-receipt-4sjr0jhg.js +2 -0
- package/bin/vm-hands/local-automation-6tqggav3.js +2 -0
- package/bin/vm-hands/local-capabilities-2y88qy9j.js +2 -0
- package/bin/vm-hands/local-desktop-users-2azpqr2m.js +2 -0
- package/bin/vm-hands/local-display-mac-1ddx6s3j.js +2 -0
- package/bin/vm-hands/local-display-session-av1hsfp5.js +2 -0
- package/bin/vm-hands/local-display-video-bthyfqap.js +2 -0
- package/bin/vm-hands/local-managed-process-h78vz9za.js +2 -0
- package/bin/vm-hands/local-pty-session-7hps89vj.js +2 -0
- package/bin/vm-hands/managed-runtime-brqgwtr6.js +2 -0
- package/bin/vm-hands/network-contract-8fkzm0t0.js +2 -0
- package/bin/vm-hands/package-k6jdrvn6.js +2 -0
- package/bin/vm-hands/permissions-9jtsmk94.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-45dm5s53.js +2 -0
- package/bin/vm-hands/serve-service-ve6vc2wd.js +2 -0
- package/bin/vm-hands/status-b0d7e01z.js +10 -0
- package/bin/vm-hands/version-ghpq62s2.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-hbs3tpdg.js → vm-hands-entry-lite-07vak0wy.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-dsxpxqd3.js → vm-hands-entry-lite-0bh3f1ms.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-21qpxvt8.js → vm-hands-entry-lite-12rzrd95.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-pf5qtbj5.js → vm-hands-entry-lite-1f2cam25.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-gvh1qskx.js → vm-hands-entry-lite-2pvb1wqs.js} +12 -12
- package/bin/vm-hands/{vm-hands-entry-lite-np07qyeq.js → vm-hands-entry-lite-2yz6b0n3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-nzmkyezg.js → vm-hands-entry-lite-3adw9jw3.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-3d4h1cgm.js +539 -0
- package/bin/vm-hands/{vm-hands-entry-lite-g4zd2d5n.js → vm-hands-entry-lite-3pnjdh8m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5dtfehjv.js → vm-hands-entry-lite-3rwtqr28.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-tdgtpx8e.js → vm-hands-entry-lite-3vmhs921.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-beyyy1gz.js → vm-hands-entry-lite-499mywh7.js} +29 -29
- package/bin/vm-hands/{vm-hands-entry-lite-ec9jemny.js → vm-hands-entry-lite-4fwf7wgb.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-m1yxqqaz.js → vm-hands-entry-lite-5e847nnc.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-6y7wsj5e.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-6c67a3jc.js → vm-hands-entry-lite-8j7p91hr.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-djg69hf4.js → vm-hands-entry-lite-8v7t1q38.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hek6nw5m.js → vm-hands-entry-lite-99vdpqvp.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-8r31b0ps.js → vm-hands-entry-lite-9jgf223h.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-jev771b3.js → vm-hands-entry-lite-9sa1knn7.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-60pg3wxj.js → vm-hands-entry-lite-9z3v15d2.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-s5qkb1fk.js → vm-hands-entry-lite-a3w8m8nb.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-avc65bd7.js → vm-hands-entry-lite-ba3qq0bs.js} +4 -4
- package/bin/vm-hands/vm-hands-entry-lite-cm497v4t.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-2x8g6ktg.js → vm-hands-entry-lite-csn32c21.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-hk6trmwa.js → vm-hands-entry-lite-d9g1pzzx.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-s4bharcb.js → vm-hands-entry-lite-dh8f2h2d.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-rfz60hb3.js → vm-hands-entry-lite-em7mk9tn.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-weqw6ykz.js → vm-hands-entry-lite-ftk544sk.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-fbhqfzbq.js → vm-hands-entry-lite-g9z467dk.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-8wf6y7xy.js → vm-hands-entry-lite-ge0w0944.js} +10 -10
- package/bin/vm-hands/{vm-hands-entry-lite-aj139v8j.js → vm-hands-entry-lite-hw26gewc.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-jzz73e3f.js → vm-hands-entry-lite-jcf61cb4.js} +5 -5
- package/bin/vm-hands/vm-hands-entry-lite-mcjca0ez.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-s1nwwtcs.js → vm-hands-entry-lite-mpxyq14w.js} +18 -18
- package/bin/vm-hands/{vm-hands-entry-lite-50zbqwkv.js → vm-hands-entry-lite-n4x7reax.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-vpz54vwj.js → vm-hands-entry-lite-njs8k65s.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-dk79tnax.js → vm-hands-entry-lite-qyp2a4c3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-3krzmhkk.js → vm-hands-entry-lite-r7zs4ce2.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-bx5zy5bd.js → vm-hands-entry-lite-t3qf6qrj.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-wx4ax7wg.js → vm-hands-entry-lite-t5q30ne0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-c8ga19q0.js → vm-hands-entry-lite-tj1g1vn3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-4vks5phw.js → vm-hands-entry-lite-tqc2ezda.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-4wpqs406.js → vm-hands-entry-lite-vgedszdd.js} +9 -9
- package/bin/vm-hands/{vm-hands-entry-lite-ycnrtwdf.js → vm-hands-entry-lite-yx6t5b7k.js} +4 -4
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/vm-hands-executor-65vx1gt3.js +11 -0
- package/bin/vm-hands/vm-hands-op-runner-ya32haj0.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-6stbsbbw.js → vm-hands-runtime-ec9x2kez.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-kmwcrttt.js +2 -0
- package/bin/vm-hands/worker-sandbox-epre0fnv.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-18d75dfn.js +0 -2
- package/bin/vm-hands/api-credentials-3vhge1ap.js +0 -2
- package/bin/vm-hands/connect-cli-5r07fda9.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-17t4efc4.js +0 -2
- package/bin/vm-hands/desktop-account-6sjrxy69.js +0 -2
- package/bin/vm-hands/device-workspace-s50q53sz.js +0 -2
- package/bin/vm-hands/hands-worker-source-kddz4y15.js +0 -2
- package/bin/vm-hands/install-receipt-ysa70fvh.js +0 -2
- package/bin/vm-hands/local-automation-764g234v.js +0 -2
- package/bin/vm-hands/local-capabilities-mg6eae35.js +0 -2
- package/bin/vm-hands/local-desktop-users-cppjjr81.js +0 -2
- package/bin/vm-hands/local-display-mac-0qz3b627.js +0 -2
- package/bin/vm-hands/local-display-session-a59620te.js +0 -2
- package/bin/vm-hands/local-display-video-6zdpjv5n.js +0 -2
- package/bin/vm-hands/local-managed-process-s7j196kq.js +0 -2
- package/bin/vm-hands/local-pty-session-rpk05ap5.js +0 -2
- package/bin/vm-hands/managed-runtime-vg23x3np.js +0 -2
- package/bin/vm-hands/network-contract-trkxqc0w.js +0 -2
- package/bin/vm-hands/package-xqbhdf15.js +0 -2
- package/bin/vm-hands/permissions-zkrmth58.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-xn3ddz70.js +0 -2
- package/bin/vm-hands/serve-service-y2sa6493.js +0 -2
- package/bin/vm-hands/status-6qmcgcem.js +0 -10
- package/bin/vm-hands/version-42drg7mg.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-33hwmnd3.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-7fsj5nrx.js +0 -539
- package/bin/vm-hands/vm-hands-entry-lite-z76nfb19.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-zp6naptr.js +0 -3
- package/bin/vm-hands/vm-hands-executor-957e80sb.js +0 -11
- package/bin/vm-hands/vm-hands-op-runner-65erpgzp.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-w62n91kr.js +0 -2
- package/bin/vm-hands/worker-sandbox-2r5nseff.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as ie,spawn as E}from"child_process";var
|
|
2
|
+
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as ie,spawn as E}from"child_process";var yo="h264_ws_v1",wo="video",ht=["smooth","sharp","data_saver","balanced"];var bo="video_presets";var L=8388608,S=65536,vo="control",So="v1",X=200;function Wn(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t,n=(i)=>typeof i==="string"&&i.length>0&&i.length<=X;if(Object.keys(e).length!==2||!n(e.user_id)||!n(e.name))return null;return{user_id:e.user_id,name:e.name}}var Eo="windows",xo="v1",D=200,J=(t)=>typeof t==="string"&&ht.includes(t);function ko(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t;if(Object.keys(e).length!==2||e.format!=="h264_ws_v1"||!J(e.preset))return null;return{format:"h264_ws_v1",preset:e.preset}}var o={hello:1,frame:2,stats:3,pong:4,serverClipboard:5,error:6,audioHello:7,audio:8,control:9,windows:10,pointer:16,key:17,config:18,ping:19,clientClipboard:20,keyframeRequest:21,ack:22,audioEnable:23,resize:24};class l extends Error{constructor(t){super(t);this.name="DisplayVideoProtocolError"}}var Z=new TextEncoder,Q=new TextDecoder("utf-8",{fatal:!0});function p(t,e){if(e.byteLength+1>L)throw new l("message_too_large");let n=new Uint8Array(5+e.byteLength),i=new DataView(n.buffer);return i.setUint32(0,e.byteLength+1),i.setUint8(4,t),n.set(e,5),n}function w(t){let e=Z.encode(t);if(e.byteLength>S)throw new l("text_too_large");return e}function _(t,e){if(!Number.isInteger(t)||t<0||t>65535)throw new l(`invalid_${e}`);return t}function ee(t){if(!Number.isFinite(t))throw new l("invalid_window");return Math.max(-2147483648,Math.min(2147483647,Math.round(t)))}function Gt(t){switch(t.type){case"hello":{let e=w(t.codec),n=new Uint8Array(6+e.byteLength),i=new DataView(n.buffer);return i.setUint16(0,_(t.width,"width")),i.setUint16(2,_(t.height,"height")),i.setUint8(4,Math.max(1,Math.min(240,Math.round(t.fps)))),i.setUint8(5,ht.indexOf(t.preset)),n.set(e,6),p(o.hello,n)}case"frame":{let e=new Uint8Array(13+t.data.byteLength),n=new DataView(e.buffer);return n.setUint8(0,t.key?1:0),n.setUint32(1,t.seq>>>0),n.setBigUint64(5,BigInt(Math.max(0,Math.floor(t.captureMicros)))),e.set(t.data,13),p(o.frame,e)}case"stats":return p(o.stats,w(JSON.stringify(t.stats)));case"pong":case"ping":{let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t.token),p(t.type==="ping"?o.ping:o.pong,e)}case"serverClipboard":return p(o.serverClipboard,w(t.text));case"clientClipboard":return p(o.clientClipboard,w(t.text));case"error":return p(o.error,w(t.code));case"pointer":{let e=new Uint8Array(5),n=new DataView(e.buffer);return n.setUint16(0,_(t.x,"x")),n.setUint16(2,_(t.y,"y")),n.setUint8(4,t.buttons&255),p(o.pointer,e)}case"key":{let e=new Uint8Array(5),n=new DataView(e.buffer);return n.setUint8(0,t.down?1:0),n.setUint32(1,t.keysym>>>0),p(o.key,e)}case"config":return p(o.config,Uint8Array.of(ht.indexOf(t.preset)));case"keyframeRequest":return p(o.keyframeRequest,new Uint8Array(0));case"audioHello":{let e=w(t.codec),n=new Uint8Array(5+e.byteLength),i=new DataView(n.buffer);return i.setUint32(0,t.sampleRate>>>0),i.setUint8(4,t.channels&255),n.set(e,5),p(o.audioHello,n)}case"audio":{let e=new Uint8Array(8+t.data.byteLength);return new DataView(e.buffer).setBigUint64(0,BigInt(Math.max(0,Math.floor(t.captureMicros)))),e.set(t.data,8),p(o.audio,e)}case"control":return p(o.control,w(JSON.stringify(t.control)));case"windows":{let e=t.bounds.slice(0,D),n=new Uint8Array(e.length*16),i=new DataView(n.buffer);return e.forEach((s,a)=>{[s.x,s.y,s.width,s.height].forEach((c,d)=>i.setInt32(a*16+d*4,ee(c)))}),p(o.windows,n)}case"audioEnable":return p(o.audioEnable,Uint8Array.of(t.on?1:0));case"resize":{let e=new Uint8Array(4),n=new DataView(e.buffer);return n.setUint16(0,_(t.width,"width")),n.setUint16(2,_(t.height,"height")),p(o.resize,e)}case"ack":{let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t.seq>>>0),p(o.ack,e)}}}function M(t){let e=ht[t];if(!e)throw new l("invalid_preset");return e}function y(t,e){if(t.byteLength!==e)throw new l("invalid_length")}function x(t){if(t.byteLength>S)throw new l("text_too_large");try{return Q.decode(t)}catch{throw new l("invalid_text")}}function te(t){let e;try{e=JSON.parse(x(t))}catch{throw new l("invalid_stats")}let n=e;if(!n||typeof n!=="object"||["fps","kbps","dropped","restarts","queued_bytes"].some((s)=>typeof n[s]!=="number"||!Number.isFinite(n[s])))throw new l("invalid_stats");return{fps:n.fps,kbps:n.kbps,dropped:n.dropped,restarts:n.restarts,queued_bytes:n.queued_bytes}}function ne(t){let e;try{e=JSON.parse(x(t))}catch{throw new l("invalid_control")}let n=e;if(!n||typeof n!=="object"||typeof n.you!=="boolean"||typeof n.same_user!=="boolean")throw new l("invalid_control");let i=n.holder===null?null:Wn(n.holder);if(i===null&&n.holder!==null)throw new l("invalid_control");return{holder:i,you:n.you,same_user:n.same_user}}function re(t,e){let n=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(t){case o.hello:if(e.byteLength<6)throw new l("invalid_length");return{type:"hello",width:n.getUint16(0),height:n.getUint16(2),fps:n.getUint8(4),preset:M(n.getUint8(5)),codec:x(e.subarray(6))};case o.frame:if(e.byteLength<14)throw new l("invalid_length");if(n.getUint8(0)>1)throw new l("invalid_frame_flags");return{type:"frame",key:n.getUint8(0)===1,seq:n.getUint32(1),captureMicros:Number(n.getBigUint64(5)),data:e.subarray(13)};case o.stats:return{type:"stats",stats:te(e)};case o.ping:case o.pong:return y(e,8),{type:t===o.ping?"ping":"pong",token:n.getFloat64(0)};case o.serverClipboard:return{type:"serverClipboard",text:x(e)};case o.clientClipboard:return{type:"clientClipboard",text:x(e)};case o.error:return{type:"error",code:x(e)};case o.pointer:return y(e,5),{type:"pointer",x:n.getUint16(0),y:n.getUint16(2),buttons:n.getUint8(4)};case o.key:if(y(e,5),n.getUint8(0)>1)throw new l("invalid_key_flags");return{type:"key",down:n.getUint8(0)===1,keysym:n.getUint32(1)};case o.config:return y(e,1),{type:"config",preset:M(n.getUint8(0))};case o.keyframeRequest:return y(e,0),{type:"keyframeRequest"};case o.audioHello:if(e.byteLength<5)throw new l("invalid_length");return{type:"audioHello",sampleRate:n.getUint32(0),channels:n.getUint8(4),codec:x(e.subarray(5))};case o.audio:if(e.byteLength<9)throw new l("invalid_length");return{type:"audio",captureMicros:Number(n.getBigUint64(0)),data:e.subarray(8)};case o.audioEnable:if(y(e,1),n.getUint8(0)>1)throw new l("invalid_audio_flags");return{type:"audioEnable",on:n.getUint8(0)===1};case o.resize:return y(e,4),{type:"resize",width:n.getUint16(0),height:n.getUint16(2)};case o.control:return{type:"control",control:ne(e)};case o.windows:{if(e.byteLength%16!==0||e.byteLength>D*16)throw new l("invalid_length");let i=[];for(let s=0;s<e.byteLength;s+=16)i.push({x:n.getInt32(s),y:n.getInt32(s+4),width:n.getInt32(s+8),height:n.getInt32(s+12)});return{type:"windows",bounds:i}}case o.ack:return y(e,4),{type:"ack",seq:n.getUint32(0)};default:return null}}class Vn{buffer=new Uint8Array(0);push(t){let e=new Uint8Array(this.buffer.byteLength+t.byteLength);e.set(this.buffer),e.set(t,this.buffer.byteLength);let n=[],i=0;while(e.byteLength-i>=4){let s=new DataView(e.buffer,e.byteOffset+i,4).getUint32(0);if(s<1||s>L)throw new l("invalid_message_length");if(e.byteLength-i-4<s)break;let a=e[i+4],c=e.slice(i+5,i+4+s),d=re(a,c);if(d)n.push(d);i+=4+s}return this.buffer=e.slice(i),n}}var Y="/usr/bin/osascript",se=5000,oe=1048576,ae=String.raw`
|
|
3
3
|
ObjC.import("CoreGraphics");
|
|
4
4
|
ObjC.import("ApplicationServices");
|
|
5
5
|
ObjC.import("AppKit");
|
|
@@ -70,7 +70,7 @@ function run(argv) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
`;function q(t){let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!=="object")return null;let n=e,i=(c)=>typeof c==="number"&&Number.isFinite(c)?Math.min(65535,Math.round(c)):0;if(typeof n.screen!=="boolean"||typeof n.accessibility!=="boolean")return null;let s=i(n.width),a=i(n.height);return s>0&&a>0?{screen:n.screen,accessibility:n.accessibility,width:s,height:a}:null}function k(t,...e){let[n,...i]=[...t,Y,"-l","JavaScript","-e",ae,...e];return[n,i]}function H(t,...e){return new Promise((n)=>{ie(...k(t,...e),{env:{},timeout:se,killSignal:"SIGKILL",maxBuffer:65536,encoding:"utf8"},(i,s)=>n(i?null:q(s.split(`
|
|
73
|
-
`)[0]??"")))})}function
|
|
73
|
+
`)[0]??"")))})}function Xe(t=[]){return H(t,"probe")}function ft(t,e){return H(t,"request",...e?[e]:[])}var N=2,ce=8,ue=String.raw`
|
|
74
74
|
ObjC.import("CoreGraphics");
|
|
75
75
|
ObjC.import("Foundation");
|
|
76
76
|
ObjC.bindFunction("getppid", ["int", []]);
|
|
@@ -101,12 +101,12 @@ function run() {
|
|
|
101
101
|
$.NSThread.sleepForTimeInterval(wait);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`;function le(t){let e;try{e=JSON.parse(t)}catch{return null}if(!Array.isArray(e))return null;let n=[];for(let i of e.slice(0,D)){if(!Array.isArray(i)||i.length!==4||!i.every((u)=>typeof u==="number"&&Number.isFinite(u)))return null;let[s,a,c,d]=i.map(Math.round);if(c>0&&d>0)n.push({x:s,y:a,width:c,height:d})}return n}function
|
|
104
|
+
`;function le(t){let e;try{e=JSON.parse(t)}catch{return null}if(!Array.isArray(e))return null;let n=[];for(let i of e.slice(0,D)){if(!Array.isArray(i)||i.length!==4||!i.every((u)=>typeof u==="number"&&Number.isFinite(u)))return null;let[s,a,c,d]=i.map(Math.round);if(c>0&&d>0)n.push({x:s,y:a,width:c,height:d})}return n}function Gn(t){let e=Date.now(),n=0,i=!1,s=(u,b={})=>{try{process.stderr.write(`${JSON.stringify({event:"display.windows_helper",state:u,...b})}
|
|
105
105
|
`)}catch{}},a=(u,b={})=>{if(i)return;i=!0,s(u,{updates:n,duration_ms:Date.now()-e,...b})},c=E(Y,["-l","JavaScript","-e",ue],{env:{},stdio:["ignore","pipe","ignore"]});s("started");let d="";return c.stdout.on("data",(u)=>{if(i)return;d+=u.toString("utf8");for(let b=d.indexOf(`
|
|
106
106
|
`);b>=0;b=d.indexOf(`
|
|
107
|
-
`)){let m=le(d.slice(0,b));if(d=d.slice(b+1),m)n++,t(m)}if(d.length>65536)d=""}),c.once("error",(u)=>a("failed",{code:u.code??"spawn_failed"})),c.once("exit",(u,b)=>a("failed",{code:"exited",exit_code:u,signal:b})),{close(){a("stopped"),c.kill("SIGKILL")}}}var T=5,R=[{bit:1,button:0,down:1,up:2,drag:6},{bit:4,button:1,down:3,up:4,drag:7},{bit:2,button:2,down:25,up:26,drag:27}],de=[[8,1,0],[16,-1,0],[32,0,1],[64,0,-1]],P=50,fe=500,V=4,I=131072,W=262144,O=524288,F=1048576,B=new Map([[65505,[56,I]],[65506,[60,I]],[65507,[59,W]],[65508,[62,W]],[65511,[58,O]],[65512,[61,O]],[65513,[58,O]],[65514,[61,O]],[65027,[61,O]],[65515,[55,F]],[65516,[54,F]]]),pe=new Map([[65288,51],[65289,48],[65056,48],[65293,36],[65307,53],[65535,117],[65509,57],[65360,115],[65361,123],[65362,126],[65363,124],[65364,125],[65365,116],[65366,121],[65367,119],[65379,114],[65386,114],[65291,71],[65408,49],[65421,76],[65429,115],[65430,123],[65431,126],[65432,124],[65433,125],[65434,116],[65435,121],[65436,119],[65437,71],[65438,114],[65439,117],[65450,67],[65451,69],[65452,65],[65453,78],[65454,65],[65455,75],[65469,81],...[82,83,84,85,86,87,88,89,91,92].map((t,e)=>[65456+e,t]),...[122,120,99,118,96,97,98,100,101,109,103,111,105,107,113,106,64,79,80,90].map((t,e)=>[65470+e,t])]),G="asdfhgzxcv\x00bqweryt123465=97-80]ou[ip\x00lj'k;\\,/nm.\x00 `",j='~!@#$%^&*()_+{}|:"<>?',be="`1234567890-=[]\\;',./",v=new Map;for(let t=0;t<G.length;t++){let e=G[t];if(e==="\x00")continue;if(v.set(e.charCodeAt(0),[t,!1]),e>="a"&&e<="z")v.set(e.toUpperCase().charCodeAt(0),[t,!0])}for(let t=0;t<j.length;t++)v.set(j.charCodeAt(t),[v.get(be.charCodeAt(t))[0],!0]);class K{now;x=-1;y=-1;mask=0;clicks=0;lastDown=null;held=new Set;constructor(t=()=>performance.now()){this.now=t}flags(){let t=0;for(let e of this.held)t|=B.get(e)[1];return t}mouse(t,e){return`m ${t} ${this.x} ${this.y} ${e} ${t===T?0:this.clicks} ${this.flags()}`}pointer(t,e,n){let i=[];if(t!==this.x||e!==this.y){this.x=t,this.y=e;let s=R.find((a)=>this.mask&a.bit);i.push(s?this.mouse(s.drag,s.button):this.mouse(T,0))}for(let s of R){let a=(this.mask&s.bit)!==0,c=(n&s.bit)!==0;if(!a&&c){let d=this.now(),u=this.lastDown;this.clicks=u&&u.button===s.button&&d-u.at<=fe&&Math.abs(t-u.x)<=V&&Math.abs(e-u.y)<=V?this.clicks+1:1,this.lastDown={button:s.button,at:d,x:t,y:e},i.push(this.mouse(s.down,s.button))}else if(a&&!c)i.push(this.mouse(s.up,s.button))}for(let[s,a,c]of de)if(!(this.mask&s)&&n&s)i.push(`w ${a*P} ${c*P} ${this.flags()}`);return this.mask=n,i}key(t,e){let n=t?1:0,i=B.get(e);if(i){if(t)this.held.add(e);else this.held.delete(e);return[`k ${i[0]} ${n} ${this.flags()}`]}let s=pe.get(e);if(s!==void 0)return[`k ${s} ${n} ${this.flags()}`];let a=e<256?e:(e&4278190080)===16777216?e&16777215:0,c=v.get(a);if(c)return[`k ${c[0]} ${n} ${this.flags()|(c[1]?I:0)}`];if(a<160||a>65535||a>=55296&&a<57344)return[];return[`u ${n} ${a} ${this.flags()}`]}}function
|
|
107
|
+
`)){let m=le(d.slice(0,b));if(d=d.slice(b+1),m)n++,t(m)}if(d.length>65536)d=""}),c.once("error",(u)=>a("failed",{code:u.code??"spawn_failed"})),c.once("exit",(u,b)=>a("failed",{code:"exited",exit_code:u,signal:b})),{close(){a("stopped"),c.kill("SIGKILL")}}}var T=5,R=[{bit:1,button:0,down:1,up:2,drag:6},{bit:4,button:1,down:3,up:4,drag:7},{bit:2,button:2,down:25,up:26,drag:27}],de=[[8,1,0],[16,-1,0],[32,0,1],[64,0,-1]],P=50,fe=500,V=4,I=131072,W=262144,O=524288,F=1048576,B=new Map([[65505,[56,I]],[65506,[60,I]],[65507,[59,W]],[65508,[62,W]],[65511,[58,O]],[65512,[61,O]],[65513,[58,O]],[65514,[61,O]],[65027,[61,O]],[65515,[55,F]],[65516,[54,F]]]),pe=new Map([[65288,51],[65289,48],[65056,48],[65293,36],[65307,53],[65535,117],[65509,57],[65360,115],[65361,123],[65362,126],[65363,124],[65364,125],[65365,116],[65366,121],[65367,119],[65379,114],[65386,114],[65291,71],[65408,49],[65421,76],[65429,115],[65430,123],[65431,126],[65432,124],[65433,125],[65434,116],[65435,121],[65436,119],[65437,71],[65438,114],[65439,117],[65450,67],[65451,69],[65452,65],[65453,78],[65454,65],[65455,75],[65469,81],...[82,83,84,85,86,87,88,89,91,92].map((t,e)=>[65456+e,t]),...[122,120,99,118,96,97,98,100,101,109,103,111,105,107,113,106,64,79,80,90].map((t,e)=>[65470+e,t])]),G="asdfhgzxcv\x00bqweryt123465=97-80]ou[ip\x00lj'k;\\,/nm.\x00 `",j='~!@#$%^&*()_+{}|:"<>?',be="`1234567890-=[]\\;',./",v=new Map;for(let t=0;t<G.length;t++){let e=G[t];if(e==="\x00")continue;if(v.set(e.charCodeAt(0),[t,!1]),e>="a"&&e<="z")v.set(e.toUpperCase().charCodeAt(0),[t,!0])}for(let t=0;t<j.length;t++)v.set(j.charCodeAt(t),[v.get(be.charCodeAt(t))[0],!0]);class K{now;x=-1;y=-1;mask=0;clicks=0;lastDown=null;held=new Set;constructor(t=()=>performance.now()){this.now=t}flags(){let t=0;for(let e of this.held)t|=B.get(e)[1];return t}mouse(t,e){return`m ${t} ${this.x} ${this.y} ${e} ${t===T?0:this.clicks} ${this.flags()}`}pointer(t,e,n){let i=[];if(t!==this.x||e!==this.y){this.x=t,this.y=e;let s=R.find((a)=>this.mask&a.bit);i.push(s?this.mouse(s.drag,s.button):this.mouse(T,0))}for(let s of R){let a=(this.mask&s.bit)!==0,c=(n&s.bit)!==0;if(!a&&c){let d=this.now(),u=this.lastDown;this.clicks=u&&u.button===s.button&&d-u.at<=fe&&Math.abs(t-u.x)<=V&&Math.abs(e-u.y)<=V?this.clicks+1:1,this.lastDown={button:s.button,at:d,x:t,y:e},i.push(this.mouse(s.down,s.button))}else if(a&&!c)i.push(this.mouse(s.up,s.button))}for(let[s,a,c]of de)if(!(this.mask&s)&&n&s)i.push(`w ${a*P} ${c*P} ${this.flags()}`);return this.mask=n,i}key(t,e){let n=t?1:0,i=B.get(e);if(i){if(t)this.held.add(e);else this.held.delete(e);return[`k ${i[0]} ${n} ${this.flags()}`]}let s=pe.get(e);if(s!==void 0)return[`k ${s} ${n} ${this.flags()}`];let a=e<256?e:(e&4278190080)===16777216?e&16777215:0,c=v.get(a);if(c)return[`k ${c[0]} ${n} ${this.flags()|(c[1]?I:0)}`];if(a<160||a>65535||a>=55296&&a<57344)return[];return[`u ${n} ${a} ${this.flags()}`]}}function Kn(t,e=[]){let n=E(...k(e),{env:{},stdio:["pipe","pipe","ignore"]}),i=new K,s="",a=!1,c=null,d=()=>{n.kill("SIGKILL"),c?.kill("SIGKILL")},u=(f)=>{if(a)return;a=!0,d(),t.end(f)},b=(f)=>u({error:new r("display_unavailable",f)}),m=(f)=>{if(a||f.length===0)return;if(n.stdin.write(f.map((g)=>`${g}
|
|
108
108
|
`).join("")),n.stdin.writableLength>oe)u({reason:"input_backpressure"})},z=()=>{c=E(...k(e,"clipboard"),{env:{},stdio:["ignore","pipe","ignore"]});let f="";c.stdout?.on("data",(g)=>{if(a)return;f+=g.toString("ascii");for(let h=f.indexOf(`
|
|
109
109
|
`);h>=0;h=f.indexOf(`
|
|
110
110
|
`)){let U=f.slice(0,h);if(f=f.slice(h+1),!U.startsWith("c "))continue;let A=U.slice(2);if(A.length>Math.ceil(S/3)*4||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(A)){u({reason:"display_protocol"});return}let C=Buffer.from(A,"base64");if(C.byteLength<=S)t.clipboard(C.toString("utf8"));if(a)return}if(f.length>Math.ceil(S/3)*4+2)u({reason:"display_protocol"})}),c.once("error",()=>b("Reason could not watch this Mac's desktop clipboard.")),c.once("exit",()=>{if(!a)b("Reason could not watch this Mac's desktop clipboard.")})};return n.stdout.on("data",(f)=>{if(a||s===null)return;s+=f.toString("utf8");let g=s.indexOf(`
|
|
111
111
|
`);if(g<0){if(s.length>4096)u({reason:"display_protocol"});return}let h=q(s.slice(0,g));if(s=null,!h)u({reason:"display_protocol"});else if(!h.screen||!h.accessibility)b(e.length>0?"Reason's background worker needs Screen Recording and Accessibility on this Mac (its own Reason entry in System Settings > Privacy & Security, not the Reason app's): run `reason permissions allow` on this Mac.":"Allow Screen Recording and Accessibility for this Mac's Reason worker, then restart it.");else z(),t.ready({width:h.width,height:h.height})}),n.stdin.on("error",()=>{return}),n.once("error",()=>b("Reason could not start this Mac's desktop input.")),n.once("exit",()=>{if(s!==null)b("Reason could not start this Mac's desktop input.");else u({reason:"display_closed"})}),{pointer:(f,g,h)=>m(i.pointer(f,g,h)),key:(f,g)=>m(i.key(f,g)),clipboard:(f)=>m([`c ${Buffer.from(f,"utf8").toString("base64")}`]),close(){a=!0,d()}}}
|
|
112
|
-
export{bo,vo,
|
|
112
|
+
export{yo,wo,ht,bo,S,vo,So,Wn,Eo,xo,ko,Gt,Vn,Xe,ft,Gn,Kn};
|