@reason-machines/cli-linux-x64 0.2.504 → 0.2.505
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/THIRD_PARTY_NOTICES.txt +7 -8
- package/bin/reason +2 -2
- package/bin/runtime/srt/sandbox-runtime.mjs +52 -52
- package/bin/vm-hands/api-credentials-23k36ayh.js +2 -0
- package/bin/vm-hands/api-jd29p2kc.js +2 -0
- package/bin/vm-hands/ask-relay-zpp0rkhg.js +4 -0
- package/bin/vm-hands/connect-cli-xyxgcg6z.js +2 -0
- package/bin/vm-hands/credentials-byna24dv.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-p2agcsk0.js +2 -0
- package/bin/vm-hands/desktop-account-z16mmkxg.js +2 -0
- package/bin/vm-hands/device-workspace-y0tk3ne8.js +2 -0
- package/bin/vm-hands/hands-worker-source-0qa16xzj.js +2 -0
- package/bin/vm-hands/index-h6xkz48h.js +12818 -0
- package/bin/vm-hands/install-receipt-nnragt7p.js +2 -0
- package/bin/vm-hands/local-automation-xbpca0f3.js +2 -0
- package/bin/vm-hands/local-capabilities-30m8pzpv.js +2 -0
- package/bin/vm-hands/local-desktop-users-gxfywsan.js +2 -0
- package/bin/vm-hands/local-display-mac-n236gkpe.js +2 -0
- package/bin/vm-hands/local-display-session-ddafdm8k.js +2 -0
- package/bin/vm-hands/local-display-video-gha54xwa.js +2 -0
- package/bin/vm-hands/local-managed-process-0zwxyqxd.js +2 -0
- package/bin/vm-hands/local-pty-session-w1yrmjm0.js +2 -0
- package/bin/vm-hands/managed-runtime-8y90twae.js +2 -0
- package/bin/vm-hands/network-contract-v0fkg94d.js +2 -0
- package/bin/vm-hands/network-sign-in-3dkdkh3a.js +34 -0
- package/bin/vm-hands/package-z2dk6xva.js +2 -0
- package/bin/vm-hands/permissions-ga1ax8wd.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-vzgxd159.js +2 -0
- package/bin/vm-hands/serve-service-42nqanvr.js +2 -0
- package/bin/vm-hands/status-m0g7k47a.js +96 -0
- package/bin/vm-hands/version-ye6800p2.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-00y3kn86.js +7 -0
- package/bin/vm-hands/vm-hands-entry-lite-0572m6cr.js +344 -0
- package/bin/vm-hands/vm-hands-entry-lite-07q2xvk1.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-0a4cy8gw.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-1nj03gbj.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-26xb026c.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-33h8294z.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-3882raa5.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-3rg3znp8.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-4swa18qz.js +10 -0
- package/bin/vm-hands/vm-hands-entry-lite-56v9haps.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-6x5pj2y0.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-fcvf8md1.js → vm-hands-entry-lite-8p8hz0j1.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-8twscwtw.js +112 -0
- package/bin/vm-hands/vm-hands-entry-lite-8xe0wzp9.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-ah2ep922.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-b0p8f295.js +52 -0
- package/bin/vm-hands/{vm-hands-entry-lite-77j164ps.js → vm-hands-entry-lite-b7wy89y0.js} +54 -54
- package/bin/vm-hands/vm-hands-entry-lite-c5gt0086.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-wrvz9jxy.js → vm-hands-entry-lite-c8bf82tx.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-dgmap6z4.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-dhqmbqsh.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-e1xjfj57.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-e4hwb89r.js +66 -0
- package/bin/vm-hands/vm-hands-entry-lite-g6r5xrk0.js +105 -0
- package/bin/vm-hands/vm-hands-entry-lite-ghhpgt3v.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-h5smacqn.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-jd31as70.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-k9n1pk42.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-kqbats5n.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-p9fwt68c.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-pkk555dx.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-pmw3ycgc.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-q9g11dbj.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-r374pchj.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-r665z809.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-rck5h8fr.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-rj8yq6gp.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-c11fg8gx.js → vm-hands-entry-lite-s8ty42st.js} +9 -5
- package/bin/vm-hands/vm-hands-entry-lite-s8zfzv0k.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-tafgty5k.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-tbdcmq09.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-td309c1y.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-v0bp1v66.js +128 -0
- package/bin/vm-hands/vm-hands-entry-lite-v0k8b768.js +452 -0
- package/bin/vm-hands/vm-hands-entry-lite-v4r1fggm.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-vqr3zrqr.js +539 -0
- package/bin/vm-hands/vm-hands-entry-lite-wbfmc0xn.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-x3pbyg92.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-rfz60hb3.js → vm-hands-entry-lite-xd2dn3n8.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-yqn8h1p0.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-zj3hb5jk.js +127 -0
- package/bin/vm-hands/vm-hands-entry-lite-zz8tr0bm.js +12 -0
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -3
- package/bin/vm-hands/vm-hands-executor-6tncheya.js +12 -0
- package/bin/vm-hands/vm-hands-op-runner-s1ghsym7.js +2 -0
- package/bin/vm-hands/vm-hands-runtime-k6egwk2t.js +4 -0
- package/bin/vm-hands/worker-preview-readiness-wh0yg1dz.js +2 -0
- package/bin/vm-hands/worker-sandbox-s054x4zw.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-gnefpvc1.js +0 -2
- package/bin/vm-hands/api-mjzanhf1.js +0 -2
- package/bin/vm-hands/connect-cli-dy7mdehx.js +0 -2
- package/bin/vm-hands/credentials-drj5ktpt.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-j1x988g0.js +0 -2
- package/bin/vm-hands/desktop-account-4525j7h3.js +0 -2
- package/bin/vm-hands/device-workspace-pt07525s.js +0 -2
- package/bin/vm-hands/fsevents-8zxmv89w.js +0 -2
- package/bin/vm-hands/hands-worker-source-atg5dc7b.js +0 -2
- package/bin/vm-hands/index-ttmxy9nd.js +0 -12818
- package/bin/vm-hands/install-receipt-6v65enmf.js +0 -2
- package/bin/vm-hands/local-automation-wfa3dpbs.js +0 -2
- package/bin/vm-hands/local-capabilities-3v7x217d.js +0 -2
- package/bin/vm-hands/local-desktop-users-ar6xpadb.js +0 -2
- package/bin/vm-hands/local-display-mac-fnp3317m.js +0 -2
- package/bin/vm-hands/local-display-session-2064d8k8.js +0 -2
- package/bin/vm-hands/local-display-video-1hxqy3xj.js +0 -2
- package/bin/vm-hands/local-managed-process-trmeeyh2.js +0 -2
- package/bin/vm-hands/local-pty-session-5yh2a63r.js +0 -2
- package/bin/vm-hands/managed-runtime-hhk63f61.js +0 -2
- package/bin/vm-hands/network-contract-rzw769gw.js +0 -2
- package/bin/vm-hands/package-r7sgmw4t.js +0 -2
- package/bin/vm-hands/permissions-xwyhbnjc.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-8fgk2s53.js +0 -2
- package/bin/vm-hands/serve-service-aye42qtb.js +0 -2
- package/bin/vm-hands/status-qtm9gb55.js +0 -10
- package/bin/vm-hands/version-gnb213c3.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-0y9n06b6.js +0 -14
- package/bin/vm-hands/vm-hands-entry-lite-38g65s5x.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-3sjkzhf6.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-545m8hm0.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-57v7y0km.js +0 -105
- package/bin/vm-hands/vm-hands-entry-lite-5gevvgec.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-5tbntcyq.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-61y11rrd.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-6x1an7es.js +0 -7
- package/bin/vm-hands/vm-hands-entry-lite-7777m86y.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-87vmbt38.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-8e5djf5y.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-8wcyveeh.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-e1z3y9rs.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-eabever7.js +0 -112
- package/bin/vm-hands/vm-hands-entry-lite-ewr54tpc.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ex69qn9q.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-f62fvme8.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-f69t48dj.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-gvjffc5t.js +0 -65
- package/bin/vm-hands/vm-hands-entry-lite-hmaazqdr.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-kq7hrjch.js +0 -128
- package/bin/vm-hands/vm-hands-entry-lite-mcjca0ez.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-mk5ayds8.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-mqzr55mw.js +0 -126
- package/bin/vm-hands/vm-hands-entry-lite-ncbzy69k.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-np07qyeq.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-nqdstx24.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-psywfz8m.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-pydgnx8a.js +0 -539
- package/bin/vm-hands/vm-hands-entry-lite-qpdpzg8g.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-qt71vz32.js +0 -52
- package/bin/vm-hands/vm-hands-entry-lite-qxsqx6hz.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-qy9xg6em.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-rmabryke.js +0 -452
- package/bin/vm-hands/vm-hands-entry-lite-rzr2ncf5.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-sss0m3yn.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-swrymqj9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-tebh7dcm.js +0 -6
- package/bin/vm-hands/vm-hands-entry-lite-txd50spx.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-wg0cykk2.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-x39tmj7j.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-xdjrdkh2.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-yretc2th.js +0 -3
- package/bin/vm-hands/vm-hands-executor-8c542krk.js +0 -12
- package/bin/vm-hands/vm-hands-op-runner-88e10ptt.js +0 -2
- package/bin/vm-hands/vm-hands-runtime-njh3th64.js +0 -4
- package/bin/vm-hands/worker-preview-readiness-7xtgxsar.js +0 -2
- package/bin/vm-hands/worker-sandbox-s9pyac8p.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Oj as v}from"./vm-hands-entry-lite-wbfmc0xn.js";import{fk as g,gk as h,hk as a}from"./vm-hands-entry-lite-3rg3znp8.js";import{mk as V}from"./vm-hands-entry-lite-56v9haps.js";import{Tk as r,_k as o}from"./vm-hands-entry-lite-e1xjfj57.js";import{dl as U}from"./vm-hands-entry-lite-e4hwb89r.js";import{createHmac as mQ,createPublicKey as CQ,randomBytes as LQ,randomUUID as t,verify as EQ}from"crypto";import{chmodSync as _,existsSync as e,mkdirSync as IQ,readFileSync as gQ,realpathSync as hQ,renameSync as vQ,statSync as yQ,unlinkSync as uQ,writeFileSync as pQ}from"fs";import{basename as cQ,dirname as F,isAbsolute as QQ,join as A,resolve as lQ}from"path";var WZ=[Object.freeze({family:"ara",channel:"stable",applicationId:"so.ara.desktop"}),Object.freeze({family:"ara",channel:"staging",applicationId:"so.ara.desktop.staging"}),Object.freeze({family:"reason",channel:"stable",applicationId:"com.reasonmachines.desktop"}),Object.freeze({family:"reason",channel:"staging",applicationId:"com.reasonmachines.desktop.staging"})];var zQ="REASON_DESKTOP_RUNTIME",UQ="REASON_DESKTOP_RUNTIME_CHANNEL",JQ="REASON_DESKTOP_RUNTIME_INSTANCE_ID",MQ="REASON_DESKTOP_RUNTIME_WORKSPACE_SCOPE",zZ={[zQ]:"ARA_DESKTOP_RUNTIME",[UQ]:"ARA_DESKTOP_RUNTIME_CHANNEL",[JQ]:"ARA_DESKTOP_RUNTIME_INSTANCE_ID",[MQ]:"ARA_DESKTOP_RUNTIME_WORKSPACE_SCOPE"};function m(Q){if(Q===void 0)return;if(!/^[a-f0-9]{64}$/.test(Q))throw Error("Invalid desktop workspace scope.");return Q}import{chmodSync as N,existsSync as z,mkdirSync as O,readFileSync as C,realpathSync as xQ,renameSync as wQ,unlinkSync as R,writeFileSync as f}from"fs";import{createPrivateKey as KQ,createPublicKey as VQ,generateKeyPairSync as AQ,randomUUID as NQ,sign as OQ}from"crypto";import{createRequire as RQ}from"module";import{homedir as fQ,platform as y}from"os";import{dirname as kQ,join as J}from"path";var L=1,BQ=16384,M=65536,_Q=128,TQ=128,u=65536;class q extends Error{code;nativeStatus;constructor(Q,Z){super(`Reason Device proof boundary failed (${Q}).${Z===void 0?"":` Native status: ${Z}.`}`);this.code=Q;this.nativeStatus=Z;this.name="LocalCredentialBoundaryError"}}function p(Q){if(Q.code==="proof_key_read_failed"&&Q.nativeStatus===-25300)return"proof_key_missing";switch(Q.nativeStatus){case-25308:return"keychain_interaction_required";case-25293:return"keychain_access_denied";case-25291:return"keychain_unavailable";default:return Q.code}}var k=null;function c(){if(!k)try{k=RQ(import.meta.url)("bun:ffi")}catch{throw new q("native_boundary_unavailable")}return k}function FQ(Q){if(typeof Q!=="string")return null;try{let Z=new URL(Q);if(Z.protocol!=="https:"&&Z.hostname!=="127.0.0.1"&&Z.hostname!=="localhost"&&Z.hostname!=="[::1]"&&Z.hostname!=="::1")return null;return Z.origin}catch{return null}}function PQ(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new q("invalid_credential_record");let Z=Q,$=FQ(Z.apiOrigin);if(Z.version!==L||!$||typeof Z.orgId!=="string"||Z.orgId.length<1||Z.orgId.length>160||typeof Z.deviceId!=="string"||Z.deviceId.length<1||Z.deviceId.length>160||typeof Z.credential!=="string"||!/^(?:reason|ara)_dev_/.test(Z.credential)||Z.credential.length>4096)throw new q("invalid_credential_record");return{version:L,apiOrigin:$,orgId:Z.orgId,deviceId:Z.deviceId,credential:Z.credential}}function DQ(Q=process.execPath){let Z=Q;try{Z=xQ(Q)}catch{}return v(kQ(Z))}function j(Q){return c().ptr(Q)}function bQ(Q){if(!z(Q))throw new q("native_boundary_unavailable");let{dlopen:Z,FFIType:$}=c();try{return Z(Q,{ara_device_configure_scope:{args:[$.ptr,$.u64],returns:$.i32},ara_device_key_load_public:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_create_fresh_public:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_sign:{args:[$.ptr,$.u64,$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_is_non_extractable:{args:[$.ptr],returns:$.i32},ara_device_key_delete:{args:[$.ptr],returns:$.i32},ara_device_binding_read:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_binding_create:{args:[$.ptr,$.u64],returns:$.i32},ara_device_binding_update:{args:[$.ptr,$.u64],returns:$.i32},ara_device_binding_delete:{args:[$.ptr],returns:$.i32},ara_device_keychain_read:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_keychain_delete:{args:[$.ptr],returns:$.i32}})}catch(W){if(W instanceof q)throw W;throw new q("native_boundary_unavailable")}}function E(Q){return Buffer.from(Q).toString("base64url")}function x(Q){if(typeof Q!=="string"||!/^[A-Za-z0-9_-]{87}$/.test(Q))return!1;try{let Z=Buffer.from(Q,"base64url");return Z.byteLength===65&&Z[0]===4}catch{return!1}}function l(Q){if(Q.byteLength<8||Q.byteLength>72||Q[0]!==48)return!1;let Z=Q[1];return Z!==void 0&&Z<128&&Z+2===Q.byteLength}class d{libraryPath;runtimePlatform;workspaceScope;library=null;constructor(Q=DQ(),Z=y(),$){this.libraryPath=Q;this.runtimePlatform=Z;this.workspaceScope=$;m($)}symbols(){if(this.runtimePlatform!=="darwin")throw new q("unsupported_platform");this.library??=bQ(this.libraryPath);let Q=new TextEncoder().encode(this.workspaceScope??""),Z=this.library.symbols.ara_device_configure_scope(j(Q.length?Q:new Uint8Array(1)),BigInt(Q.length));if(Z!==0)throw new q("native_boundary_unavailable",Z);return this.library.symbols}publicKey(Q){let Z=new Uint8Array(_Q),$=new BigUint64Array(1),W=Q==="load"?this.symbols().ara_device_key_load_public(j(Z),BigInt(Z.byteLength),j($)):this.symbols().ara_device_key_create_fresh_public(j(Z),BigInt(Z.byteLength),j($));if(W!==0)throw new q(Q==="load"?"proof_key_read_failed":"proof_key_generation_failed",W);let X=Number($[0]);if(!Number.isSafeInteger(X)||X!==65)throw new q("invalid_public_key");let Y=E(Z.subarray(0,X));if(!x(Y))throw new q("invalid_public_key");return Y}loadPublicKey(){return this.publicKey("load")}createFreshPublicKey(){return this.publicKey("create_fresh")}sign(Q){if(Q.byteLength<1||Q.byteLength>u)throw new q("proof_sign_failed");let Z=new Uint8Array(TQ),$=new BigUint64Array(1),W=this.symbols().ara_device_key_sign(j(Q),BigInt(Q.byteLength),j(Z),BigInt(Z.byteLength),j($));if(W!==0)throw new q("proof_sign_failed",W);let X=Number($[0]);if(!Number.isSafeInteger(X)||X<1||X>Z.byteLength)throw new q("invalid_signature");let Y=Z.subarray(0,X);if(!l(Y))throw new q("invalid_signature");return E(Y)}privateKeyIsNonExtractable(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_key_is_non_extractable(j(Q));if(Z!==0||Q[0]!==1)throw new q("proof_key_read_failed",Z);return!0}deleteKey(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_key_delete(j(Q));if(Z!==0)throw new q("proof_key_delete_failed",Z);return Q[0]===1}loadBinding(){let Q=new Uint8Array(M),Z=new BigUint64Array(1),$=this.symbols().ara_device_binding_read(j(Q),BigInt(Q.byteLength),j(Z));if($===1)return null;if($!==0)throw new q("binding_read_failed",$);let W=Number(Z[0]);if(!Number.isSafeInteger(W)||W<1||W>Q.byteLength)throw new q("invalid_binding");return Q.slice(0,W)}createBinding(Q){if(Q.byteLength<1||Q.byteLength>M)throw new q("invalid_binding");let Z=this.symbols().ara_device_binding_create(j(Q),BigInt(Q.byteLength));if(Z!==0)throw new q("binding_create_failed",Z)}updateBinding(Q){if(Q.byteLength<1||Q.byteLength>M)throw new q("invalid_binding");let Z=this.symbols().ara_device_binding_update(j(Q),BigInt(Q.byteLength));if(Z!==0)throw new q("binding_update_failed",Z)}deleteBinding(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_binding_delete(j(Q));if(Z!==0)throw new q("binding_delete_failed",Z);return Q[0]===1}loadLegacyCredential(){let Q=new Uint8Array(BQ),Z=new BigUint64Array(1),$=this.symbols().ara_device_keychain_read(j(Q),BigInt(Q.byteLength),j(Z));if($===1)return null;if($!==0)throw new q("legacy_credential_read_failed",$);let W=Number(Z[0]);if(!Number.isSafeInteger(W)||W<1||W>Q.byteLength)throw new q("invalid_credential_record");try{let X=new TextDecoder("utf-8",{fatal:!0}).decode(Q.subarray(0,W));return PQ(JSON.parse(X))}catch(X){if(X instanceof q)throw X;throw new q("invalid_credential_record")}}deleteLegacyCredential(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_keychain_delete(j(Q));if(Z!==0)throw new q("legacy_credential_delete_failed",Z);return Q[0]===1}}function I(Q){let Z=Q.export({format:"jwk"});if(Z.crv!=="P-256"||typeof Z.x!=="string"||typeof Z.y!=="string")throw new q("invalid_public_key");let $=Buffer.from(Z.x,"base64url"),W=Buffer.from(Z.y,"base64url");if($.byteLength!==32||W.byteLength!==32)throw new q("invalid_public_key");let X=Buffer.concat([Buffer.of(4),$,W]).toString("base64url");if(!x(X))throw new q("invalid_public_key");return X}function SQ(){let Q=process.env.XDG_CONFIG_HOME?.trim()||J(fQ(),".config");h(Q);let Z=J(Q,"ara");return g(Z)?Z:J(Q,"reason")}class i{directory;constructor(Q=SQ()){this.directory=Q}keyPath(){return J(this.directory,"local-device.key")}bindingPath(){return J(this.directory,"local-device.binding")}loadPrivateKeyObject(){let Q=this.keyPath();if(!z(Q))throw new q("proof_key_read_failed");try{let Z=C(Q,"utf8");return KQ({key:Z,format:"pem"})}catch{throw new q("proof_key_read_failed")}}loadPublicKey(){let Q=this.loadPrivateKeyObject(),Z=VQ(Q);return I(Z)}createFreshPublicKey(){O(this.directory,{recursive:!0,mode:448});let{privateKey:Q,publicKey:Z}=AQ("ec",{namedCurve:"P-256"}),$=Q.export({type:"pkcs8",format:"pem"}),W=this.keyPath();return f(W,$,{mode:384}),N(W,384),I(Z)}sign(Q){if(Q.byteLength<1||Q.byteLength>u)throw new q("proof_sign_failed");let Z=this.loadPrivateKeyObject(),$;try{$=OQ("sha256",Q,Z)}catch{throw new q("proof_sign_failed")}if(!l($))throw new q("invalid_signature");return $.toString("base64url")}privateKeyIsNonExtractable(){return!1}deleteKey(){let Q=this.keyPath();if(!z(Q))return!1;return R(Q),!0}loadBinding(){let Q=this.bindingPath();if(!z(Q))return null;try{return new Uint8Array(C(Q))}catch{return null}}createBinding(Q){if(Q.byteLength<1||Q.byteLength>M)throw new q("invalid_binding");O(this.directory,{recursive:!0,mode:448});let Z=this.bindingPath();if(z(Z))throw new q("binding_create_failed");f(Z,Q,{mode:384}),N(Z,384)}updateBinding(Q){if(Q.byteLength<1||Q.byteLength>M)throw new q("invalid_binding");O(this.directory,{recursive:!0,mode:448});let Z=this.bindingPath();if(!z(Z))throw new q("binding_update_failed");let $=`${Z}.${NQ()}`;try{f($,Q,{mode:384,flag:"wx"}),N($,384),wQ($,Z)}finally{if(z($))R($)}}deleteBinding(){let Q=this.bindingPath();if(!z(Q))return!1;return R(Q),!0}loadLegacyCredential(){return null}deleteLegacyCredential(){return!1}}function B(){return y()==="darwin"?new d:new i}var w=U.string().min(1).max(160).regex(/^[A-Za-z0-9._:-]+$/),s=U.object({id:w,kind:U.literal("permission_denied"),operation:U.enum(["bash","read","write","edit"]),provenance:U.enum(["sandbox_policy","os_permission_unknown"]),occurredAt:U.string().datetime(),expiresAt:U.string().datetime(),sessionId:w,deviceId:w,organizationId:w}).strict();var P=4;var K="macos-keychain-p256-v1",ZQ=1,dQ=`ARA-DEVICE-BINDING-V1
|
|
3
|
+
`;function iQ(Q){return Q===void 0||typeof Q==="number"&&Number.isInteger(Q)&&Q>=1&&Q<=4}function $Q(Q,Z=Date.now()){let $=s.safeParse(Q);if(!$.success)return!1;let W=$.data,X=typeof W.occurredAt==="string"?Date.parse(W.occurredAt):NaN,Y=typeof W.expiresAt==="string"?Date.parse(W.expiresAt):NaN;return W.kind==="permission_denied"&&["bash","read","write","edit"].includes(W.operation)&&["sandbox_policy","os_permission_unknown"].includes(W.provenance)&&Number.isFinite(X)&&X<=Z&&Y>Z&&Y>X&&Y-X<=600000}function LZ(Q,Z,$=Date.now()){if(!Q||!Z||Q.state!=="connected"||Q.deviceId!==Z.deviceId)return null;let W=Date.parse(Q.lastHeartbeatAt??""),X=Q.permissionRecovery;if(!($-W>=0&&$-W<30000)||!$Q(X,$)||X.deviceId!==Z.deviceId||X.organizationId!==Z.orgId)return null;try{process.kill(Q.pid,0)}catch{return null}return X}function WQ(Q={},Z=V()){let $=r({env:{...process.env,...Q}}),W=Q.XDG_CONFIG_HOME?.trim()||A(Z,".config");return a(W,...$==="staging"?["staging"]:[])}function D(Q={},Z=V()){return A(WQ(Q,Z),"local-device.json")}function qQ(Q={},Z=V()){return A(WQ(Q,Z),"local-daemon.json")}function b(Q,Z){IQ(F(Q),{recursive:!0,mode:448}),_(F(Q),448);let $=`${Q}.${process.pid}.${t()}.tmp`;try{pQ($,`${JSON.stringify(Z,null,2)}
|
|
4
|
+
`,{mode:384,flag:"wx"}),_($,384),vQ($,Q),_(Q,384)}finally{if(e($))uQ($)}return Q}function S(Q){if(!e(Q))return null;try{return JSON.parse(gQ(Q,"utf8"))}catch{return null}}function T(Q,Z,$){try{Q.onCredentialLifecycle?.({event:Z,...$?{reasonCode:$}:{}})}catch{}}function sQ(Q){if(!Array.isArray(Q))return null;let Z=[];for(let $ of Q){if(!$||typeof $!=="object")return null;let W=$;if(typeof W.id!=="string"||typeof W.label!=="string"||typeof W.path!=="string"||typeof W.pathFingerprint!=="string"||!W.permissions||typeof W.permissions.read!=="boolean"||typeof W.permissions.write!=="boolean"||typeof W.permissions.execute!=="boolean"||typeof W.permissions.discover_environment!=="boolean"||typeof W.permissions.expose_mcp!=="boolean")return null;Z.push({id:W.id,label:W.label,path:W.path,pathFingerprint:W.pathFingerprint,permissions:W.permissions})}return Z}function XQ(Q,Z,$=[]){let W=Object.keys(Q);return Z.every((X)=>Object.hasOwn(Q,X))&&W.every((X)=>Z.includes(X)||$.includes(X))}function nQ(Q){if(typeof Q!=="string")return null;try{let Z=new URL(Q);if(Z.protocol!=="https:"&&Z.hostname!=="127.0.0.1"&&Z.hostname!=="localhost")return null;return Z.origin}catch{return null}}function YQ(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let Z=Q,$=sQ(Z.roots),W=nQ(Z.apiOrigin);if(!W||typeof Z.orgId!=="string"||typeof Z.deviceId!=="string"||typeof Z.displayName!=="string"||typeof Z.registeredAt!=="string"||!iQ(Z.handsSlots)||Z.worker!==void 0&&(!Z.worker||!/^[a-f0-9]{64}$/.test(Z.worker.configDigest)||!["persistent","ephemeral"].includes(Z.worker.lifetime)||!Number.isFinite(Date.parse(Z.worker.expiresAt)))||!$)return null;return{apiOrigin:W,orgId:Z.orgId,deviceId:Z.deviceId,displayName:Z.displayName,registeredAt:Z.registeredAt,...Z.handsSlots!==void 0?{handsSlots:Z.handsSlots}:{},...Z.worker!==void 0?{worker:Z.worker}:{},roots:$}}function rQ(Q){return{...Q,credentialStorage:K}}function oQ(Q){return{version:P,apiOrigin:Q.apiOrigin,orgId:Q.orgId,deviceId:Q.deviceId,devicePublicKey:Q.devicePublicKey,displayName:Q.displayName,registeredAt:Q.registeredAt,...Q.handsSlots!==void 0?{handsSlots:Q.handsSlots}:{},...Q.worker!==void 0?{worker:Q.worker}:{},roots:Q.roots.map((Z)=>({id:Z.id,label:Z.label,path:Z.path,pathFingerprint:Z.pathFingerprint,permissions:{read:Z.permissions.read,write:Z.permissions.write,execute:Z.permissions.execute,discover_environment:Z.permissions.discover_environment,expose_mcp:Z.permissions.expose_mcp}})),credentialStorage:K}}function jQ(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let Z=Q;if(!XQ(Z,["version","apiOrigin","orgId","deviceId","devicePublicKey","displayName","registeredAt","roots","credentialStorage"],["handsSlots","worker"]))return null;let $=YQ(Z);if(!$||Z.version!==P||Z.credentialStorage!==K||!x(Z.devicePublicKey))return null;return{version:P,...$,devicePublicKey:Z.devicePublicKey,credentialStorage:K}}function GQ(Q){return new TextEncoder().encode(`${dQ}${JSON.stringify(oQ(Q))}`)}function aQ(Q){let Z=Buffer.from(Q,"base64url");return CQ({format:"jwk",key:{kty:"EC",crv:"P-256",x:Z.subarray(1,33).toString("base64url"),y:Z.subarray(33,65).toString("base64url")}})}function tQ(Q,Z){let $={version:ZQ,state:Q,signature:Z.sign(GQ(Q))};return new TextEncoder().encode(JSON.stringify($))}function HQ(Q){let Z;try{Z=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(Q))}catch{throw new q("invalid_binding")}if(!Z||typeof Z!=="object"||Array.isArray(Z))throw new q("invalid_binding");let $=Z;if(!XQ($,["version","state","signature"])||$.version!==ZQ||typeof $.signature!=="string"||!/^[A-Za-z0-9_-]{10,128}$/.test($.signature))throw new q("invalid_binding");let W=jQ($.state);if(!W)throw new q("invalid_binding");let X=!1;try{X=EQ("sha256",GQ(W),aQ(W.devicePublicKey),Buffer.from($.signature,"base64url"))}catch{X=!1}if(!X)throw new q("invalid_binding");return W}function eQ(Q){let{credentialStorage:Z,...$}=Q;return $}function QZ(Q){return Q instanceof q?p(Q):"credential_boundary_failed"}function EZ(Q=D(),Z={}){let $=S(Q),W=Z.proofStore??Z.credentialStore??B(),X=W.loadBinding();if(!X){if($&&typeof $==="object"&&!Array.isArray($)&&ZZ($))return null;if($!==null)throw new q("invalid_binding");return null}let Y=HQ(X),G=W.loadPublicKey();if(W.privateKeyIsNonExtractable(),G!==Y.devicePublicKey)throw new q("invalid_public_key");let H=jQ($);if(Z.repair!==!1&&(!H||JSON.stringify(H)!==JSON.stringify(Y)))b(Q,Y);return eQ(Y)}function ZZ(Q){let Z=Q,$=YQ(Q);if(!$)return null;if(Z.version===2){if(typeof Z.deviceCredential!=="string"||!/^(?:reason|ara)_dev_/.test(Z.deviceCredential)||Z.deviceCredential.length>4096)return null;return{state:$,credentialSource:"plaintext-v2"}}if(Z.version!==3||Z.credentialStorage!=="macos-keychain-v1"||"deviceCredential"in Z)return null;return{state:$,credentialSource:"keychain-v3"}}function IZ(Q,Z=D(),$={}){let W=$.proofStore??$.credentialStore??B();T($,"credential.store_started");try{if(!x(Q.devicePublicKey)||W.loadPublicKey()!==Q.devicePublicKey)throw new q("invalid_public_key");W.privateKeyIsNonExtractable();let X=rQ(Q),Y=W.loadBinding();if(Y){let H=HQ(Y);if(H.devicePublicKey!==Q.devicePublicKey||H.orgId!==Q.orgId||H.deviceId!==Q.deviceId||H.apiOrigin!==Q.apiOrigin&&!o(H.apiOrigin,Q.apiOrigin))throw new q("invalid_binding")}let G=tQ(X,W);if(Y)W.updateBinding(G);else W.createBinding(G);return b(Z,X),T($,"credential.store_completed"),Z}catch(X){throw T($,"credential.store_failed",QZ(X)),X}}function gZ(Q=qQ()){let Z=S(Q);if(!Z||typeof Z!=="object")return null;let $=Z;if($.version!==1||typeof $.pid!=="number"||!Number.isInteger($.pid)||!["starting","connected","stopped","error"].includes($.state??"")||typeof $.startedAt!=="string"||$.lastHeartbeatAt!==void 0&&typeof $.lastHeartbeatAt!=="string"||$.lastUsedAt!==void 0&&typeof $.lastUsedAt!=="string"||$.organizationId!==void 0&&typeof $.organizationId!=="string"||$.organizationName!==void 0&&typeof $.organizationName!=="string"||$.organizationSlug!==void 0&&typeof $.organizationSlug!=="string"||$.error!==void 0&&typeof $.error!=="string"||$.reconnectingSince!==void 0&&typeof $.reconnectingSince!=="string"||$.workspace!==void 0&&typeof $.workspace!=="string")return null;if($.permissionRecovery!==void 0&&!$Q($.permissionRecovery))delete $.permissionRecovery;return $}function hZ(Q,Z=qQ()){return b(Z,Q)}var n=1;function $Z(Q=D()){return A(F(Q),"local-device.proxy.json")}function vZ(Q=$Z()){let Z=S(Q);if(!Z||typeof Z!=="object"||Array.isArray(Z))return null;let $=Z;if($.version!==n||typeof $.url!=="string"||$.url.length===0||$.caFile!==void 0&&(typeof $.caFile!=="string"||!QQ($.caFile)))return null;return{version:n,url:$.url,...$.caFile?{caFile:$.caFile}:{}}}function yZ(Q,Z={read:!0,write:!1,execute:!1,discover_environment:!1,expose_mcp:!1},$=LQ(32)){let W=new Set,X=[];for(let Y of Q){let G=hQ(QQ(Y)?Y:lQ(Y));if(!yQ(G).isDirectory())throw Error(`Local execution root is not a directory: ${Y}`);if(W.has(G))continue;W.add(G),X.push({id:t(),label:cQ(G)||G,path:G,pathFingerprint:mQ("sha256",$).update(G).digest("hex"),permissions:{...Z}})}if(X.length===0)throw Error("At least one explicit local execution root is required.");return X}
|
|
5
|
+
export{q as ei,DQ as fi,x as gi,l as hi,d as ii,i as ji,$Q as ki,LZ as li,D as mi,qQ as ni,EZ as oi,IZ as pi,gZ as qi,hZ as ri,n as si,vZ as ti,yZ as ui};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$g as y8,Xg as p8,Yg as P8,Zg as X8,_g as Q8,ah as S8,ch as s,fh as w}from"./vm-hands-entry-lite-zj3hb5jk.js";import{Ih as e,Lh as d,Mh as o}from"./vm-hands-entry-lite-8twscwtw.js";import{ci as b8}from"./vm-hands-entry-lite-rj8yq6gp.js";import{ti as x8}from"./vm-hands-entry-lite-td309c1y.js";import{mk as g}from"./vm-hands-entry-lite-56v9haps.js";import{el as q8}from"./vm-hands-entry-lite-r665z809.js";import{ll as N}from"./vm-hands-entry-lite-v4r1fggm.js";import{execFile as J8,spawn as T8}from"child_process";import{randomBytes as u8}from"crypto";import{chmodSync as V8,existsSync as N8,lstatSync as s8,mkdirSync as K8,readFileSync as a8,rmSync as r8,writeFileSync as K}from"fs";import{connect as g8}from"net";import{join as J}from"path";var R=32,f=76;var $="./desktop-wallpaper-0pjhgyfk.jpg";var H="./dock-browser-afp005mt.png";var l="./dock-files-rywdm96b.png";var k="./dock-terminal-s41cj1jp.png";var v=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
|
|
3
|
+
# The native Blaxel image ships no feh, hsetroot or compositor, but it does ship
|
|
4
|
+
# python3-gi and libX11. tint2 reads _XROOTPMAP_ID to draw its transparent panel.
|
|
5
|
+
# Usage: DISPLAY=:99 python3 set-root-wallpaper.py IMAGE
|
|
6
|
+
import ctypes, sys
|
|
7
|
+
import gi
|
|
8
|
+
gi.require_version("GdkPixbuf", "2.0")
|
|
9
|
+
from gi.repository import GdkPixbuf
|
|
10
|
+
x = ctypes.cdll.LoadLibrary("libX11.so.6")
|
|
11
|
+
x.XOpenDisplay.restype = ctypes.c_void_p
|
|
12
|
+
x.XOpenDisplay.argtypes = [ctypes.c_char_p]
|
|
13
|
+
d = x.XOpenDisplay(None)
|
|
14
|
+
if not d: sys.exit("no display")
|
|
15
|
+
for name, res, args in [
|
|
16
|
+
("XDefaultScreen", ctypes.c_int, [ctypes.c_void_p]),
|
|
17
|
+
("XRootWindow", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_int]),
|
|
18
|
+
("XDisplayWidth", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
19
|
+
("XDisplayHeight", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
20
|
+
("XDefaultDepth", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
21
|
+
("XDefaultVisual", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_int]),
|
|
22
|
+
("XDefaultGC", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_int]),
|
|
23
|
+
("XCreatePixmap", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_uint, ctypes.c_uint, ctypes.c_uint]),
|
|
24
|
+
("XCreateImage", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint, ctypes.c_int, ctypes.c_int, ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint, ctypes.c_int, ctypes.c_int]),
|
|
25
|
+
("XPutImage", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_uint, ctypes.c_uint]),
|
|
26
|
+
("XInternAtom", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int]),
|
|
27
|
+
("XChangeProperty", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_int, ctypes.c_int, ctypes.c_void_p, ctypes.c_int]),
|
|
28
|
+
("XSetWindowBackgroundPixmap", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong]),
|
|
29
|
+
("XClearWindow", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong]),
|
|
30
|
+
("XSetCloseDownMode", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
31
|
+
("XCloseDisplay", ctypes.c_int, [ctypes.c_void_p]),
|
|
32
|
+
]:
|
|
33
|
+
f = getattr(x, name); f.restype = res; f.argtypes = args
|
|
34
|
+
s = x.XDefaultScreen(d); root = x.XRootWindow(d, s)
|
|
35
|
+
w, h = x.XDisplayWidth(d, s), x.XDisplayHeight(d, s)
|
|
36
|
+
if x.XDefaultDepth(d, s) != 24: sys.exit("unsupported depth")
|
|
37
|
+
# Scale to cover the screen, then crop the centre.
|
|
38
|
+
src = GdkPixbuf.Pixbuf.new_from_file(sys.argv[1])
|
|
39
|
+
k = max(w / src.get_width(), h / src.get_height())
|
|
40
|
+
sw, sh = max(w, round(src.get_width() * k)), max(h, round(src.get_height() * k))
|
|
41
|
+
pb = src.scale_simple(sw, sh, GdkPixbuf.InterpType.BILINEAR).new_subpixbuf((sw - w) // 2, (sh - h) // 2, w, h).copy()
|
|
42
|
+
if pb.get_has_alpha(): pb = pb.composite_color_simple(w, h, GdkPixbuf.InterpType.NEAREST, 255, 1, 0, 0)
|
|
43
|
+
rgb, stride = pb.get_pixels(), pb.get_rowstride()
|
|
44
|
+
bgrx = bytearray(w * h * 4)
|
|
45
|
+
for y in range(h):
|
|
46
|
+
row = rgb[y * stride:y * stride + w * 3]; o = y * w * 4
|
|
47
|
+
bgrx[o:o + w * 4:4] = row[2::3]; bgrx[o + 1:o + w * 4:4] = row[1::3]; bgrx[o + 2:o + w * 4:4] = row[0::3]
|
|
48
|
+
buf = ctypes.create_string_buffer(bytes(bgrx), len(bgrx))
|
|
49
|
+
pix = x.XCreatePixmap(d, root, w, h, 24)
|
|
50
|
+
img = x.XCreateImage(d, x.XDefaultVisual(d, s), 24, 2, 0, buf, w, h, 32, 0) # ZPixmap
|
|
51
|
+
x.XPutImage(d, pix, x.XDefaultGC(d, s), img, 0, 0, 0, 0, w, h)
|
|
52
|
+
ref = ctypes.c_ulong(pix)
|
|
53
|
+
for atom in (b"_XROOTPMAP_ID", b"ESETROOT_PMAP_ID"):
|
|
54
|
+
x.XChangeProperty(d, root, x.XInternAtom(d, atom, 0), 20, 32, 0, ctypes.byref(ref), 1) # XA_PIXMAP, PropModeReplace
|
|
55
|
+
x.XSetWindowBackgroundPixmap(d, root, pix)
|
|
56
|
+
x.XClearWindow(d, root)
|
|
57
|
+
x.XSetCloseDownMode(d, 1) # RetainPermanent: the pixmap outlives this process
|
|
58
|
+
x.XCloseDisplay(d)
|
|
59
|
+
`;function E8(x){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
60
|
+
<openbox_config xmlns="http://openbox.org/3.4/rc">
|
|
61
|
+
<theme><keepBorder>no</keepBorder></theme>
|
|
62
|
+
<applications>
|
|
63
|
+
<!-- Debian Chromium is "Chromium"; Chrome for Testing is "Chromium-browser". -->
|
|
64
|
+
<application class="Chromium*">
|
|
65
|
+
<decor>no</decor>
|
|
66
|
+
<position force="yes"><x>${R}</x><y>${R}</y></position>
|
|
67
|
+
<size><width>${x.width-R*2}</width><height>${x.height-R-f}</height></size>
|
|
68
|
+
</application>
|
|
69
|
+
</applications>
|
|
70
|
+
</openbox_config>`}var h8=`# Remote sandbox dock \u2014 launcher icons only, centred, no panel fill
|
|
71
|
+
panel_items = L
|
|
72
|
+
panel_size = 100% 46
|
|
73
|
+
panel_margin = 0 10
|
|
74
|
+
panel_padding = 0 0 10
|
|
75
|
+
panel_position = bottom center horizontal
|
|
76
|
+
panel_shrink = 1
|
|
77
|
+
panel_background_id = 0
|
|
78
|
+
panel_layer = top
|
|
79
|
+
mouse_effects = 1
|
|
80
|
+
mouse_hover_icon_asb = 100 0 12
|
|
81
|
+
mouse_pressed_icon_asb = 100 0 -12
|
|
82
|
+
|
|
83
|
+
launcher_icon_size = 46
|
|
84
|
+
launcher_padding = 0 0 10
|
|
85
|
+
launcher_background_id = 0
|
|
86
|
+
launcher_tooltip = 1
|
|
87
|
+
|
|
88
|
+
launcher_item_app = /tmp/ara-chromium.desktop
|
|
89
|
+
launcher_item_app = /tmp/ara-terminal.desktop
|
|
90
|
+
launcher_item_app = /tmp/ara-files.desktop
|
|
91
|
+
`,M8=`corner-radius = 12;
|
|
92
|
+
rounded-corners-exclude = [
|
|
93
|
+
"class_g = 'tint2'",
|
|
94
|
+
"window_type = 'dock'",
|
|
95
|
+
"window_type = 'desktop'"
|
|
96
|
+
];
|
|
97
|
+
backend = "xrender";
|
|
98
|
+
shadow = false;
|
|
99
|
+
fading = false;
|
|
100
|
+
vsync = false;
|
|
101
|
+
inactive-opacity = 1.0;
|
|
102
|
+
active-opacity = 1.0;
|
|
103
|
+
`,w8="/tmp/ara-dock-browser.png",F8=`[Desktop Entry]
|
|
104
|
+
Name=Chrome
|
|
105
|
+
Exec=chromium --no-sandbox %U
|
|
106
|
+
Icon=${w8}
|
|
107
|
+
Type=Application
|
|
108
|
+
Categories=Network;WebBrowser;
|
|
109
|
+
`,G8=`[Desktop Entry]
|
|
110
|
+
Name=Terminal
|
|
111
|
+
Exec=bash -c "DISPLAY=:99 xterm -fa DejaVuSansMono -fs 11 -bg black -fg white"
|
|
112
|
+
Icon=/tmp/ara-dock-terminal.png
|
|
113
|
+
Type=Application
|
|
114
|
+
Categories=System;TerminalEmulator;
|
|
115
|
+
`,c8=`[Desktop Entry]
|
|
116
|
+
Name=Files
|
|
117
|
+
Exec=bash -c "DISPLAY=:99 pcmanfm --no-desktop"
|
|
118
|
+
Icon=/tmp/ara-dock-files.png
|
|
119
|
+
Type=Application
|
|
120
|
+
Categories=System;FileManager;
|
|
121
|
+
`;var n={"wallpaper.jpg":$,"dock-browser.png":H,"dock-terminal.png":k,"dock-files.png":l},Z8=v,O8='set_wallpaper() { if command -v feh >/dev/null 2>&1; then feh --bg-fill "$1"; else python3 "$2" "$1"; fi; }';function i(x){let q=(Q)=>Q.replaceAll("DISPLAY=:99",`DISPLAY=${x.display}`).replaceAll("/tmp/ara-",`${x.root}/ara-`),P=new Set(x.absent??[]),p=h8.split(`
|
|
122
|
+
`).filter((Q)=>!(P.has("terminal")&&Q.endsWith("/ara-terminal.desktop"))&&!(P.has("files")&&Q.endsWith("/ara-files.desktop"))).join(`
|
|
123
|
+
`),b={"openbox/rc.xml":E8(x.screen),"tint2/tint2rc":q(p),"picom/picom.conf":M8,...P.has("terminal")?{}:{"ara-terminal.desktop":q(G8)},...P.has("files")?{}:{"ara-files.desktop":q(c8)},"ara-chromium.desktop":q(F8).replace("chromium --no-sandbox %U",x.browserExec),"ara-set-root-wallpaper.py":Z8},X=[...E.slice(0,3),O8,'[ ! -f "$ROOT/ara-wallpaper.jpg" ] || set_wallpaper "$ROOT/ara-wallpaper.jpg" "$ROOT/ara-set-root-wallpaper.py" || true',...E.slice(3)];return{files:b,start:X}}var E=['ticks() { line=$(cat "/proc/$1/stat" 2>/dev/null) || return 1; rest=${line##*) }; case $rest in Z*|X*) return 1;; esac; printf "%s" "$rest" | cut -d " " -f20; }','alive() { [ -f "$ROOT/$1.pid" ] || return 1; read -r pid start <"$ROOT/$1.pid"; current=$(ticks "$pid") || return 1; [ "$current" = "$start" ] && kill -0 "$pid" 2>/dev/null; }','launch() { name=$1; shift; "$@" 9>&- >"$ROOT/$name.log" 2>&1 & pid=$!; start=$(ticks "$pid"); printf "%s %s\\n" "$pid" "$start" >"$ROOT/$name.pid"; }','if [ -f "$ROOT/tint2/tint2rc" ] && ! alive tint2 && command -v tint2 >/dev/null 2>&1; then launch tint2 tint2 -c "$ROOT/tint2/tint2rc"; fi','if [ -f "$ROOT/picom/picom.conf" ] && ! alive picom && command -v picom >/dev/null 2>&1; then launch picom picom --config "$ROOT/picom/picom.conf"; fi'];var Y8=43200000,D=":99",z8=60000,_=15000,u={width:1280,height:800},$8=/^[A-Za-z0-9._:-]{1,160}$/;function H8(x){return Boolean(x)&&typeof x==="object"&&!Array.isArray(x)}var l8=["video","viewer","viewer_same_network","viewer_network"];function k8(x,q=Date.now()){let P=["relay_url","session_id","expires_at"];if(!H8(x)||P.some((y)=>!(y in x))||Object.keys(x).some((y)=>!P.includes(y)&&!l8.includes(y)))throw new N("invalid_display_request","Reason desktop request is malformed.");let p="video"in x?d(x.video):void 0,b="viewer"in x?e(x.viewer):null;if(p===null)throw new N("invalid_display_request","Reason desktop video request is invalid.");let X=null;try{X=typeof x.relay_url==="string"?new URL(x.relay_url):null}catch{}if(!X||X.protocol!=="wss:"&&X.protocol!=="ws:"||X.username||X.password)throw new N("invalid_display_request","Reason desktop relay URL is invalid.");if(typeof x.session_id!=="string"||!$8.test(x.session_id))throw new N("invalid_display_request","Reason desktop session identity is invalid.");let Q=typeof x.expires_at==="string"?Date.parse(x.expires_at):Number.NaN;if(!Number.isFinite(Q)||Q<=q)throw new N("invalid_display_request","Reason desktop session has already expired.");return{relay_url:x.relay_url,session_id:x.session_id,expires_at:new Date(Math.min(Q,q+Y8)).toISOString(),...p?{video:p}:{},...b?{viewer:b}:{},...p&&x.viewer_same_network===!0?{viewer_same_network:!0}:{}}}function I(x=process.platform){return(x==="linux"||x==="darwin"||x==="win32")&&w()?.features.display===!0}async function sx(){if(process.platform==="win32")return I()&&await s();if(process.platform!=="darwin")return I();return await s()}function h(x){K8(x,{recursive:!0,mode:448});let q=s8(x);if(!q.isDirectory()||q.isSymbolicLink()||process.getuid&&q.uid!==process.getuid())throw new N("display_unavailable","Reason desktop state directory is not private.");V8(x,448)}function v8(x,q){let P=(b)=>{let X=Buffer.alloc(2);return X.writeUInt16BE(b.length),Buffer.concat([X,b])},p=Buffer.from([255,255]);return Buffer.concat([p,P(Buffer.alloc(0)),P(Buffer.from(x)),P(Buffer.from("MIT-MAGIC-COOKIE-1")),P(q)])}function B(x,q,P=2000){return new Promise((p)=>{let b=g8(x),X="",Q=(y)=>{b.destroy(),p(y)};b.setTimeout(P,()=>Q(!1)),b.once("error",()=>Q(!1)),b.once("close",()=>Q(!1)),b.once("connect",()=>{if(!q)Q(!0)}),b.on("data",(y)=>{if(X+=y.toString("latin1"),X.length>=4)Q(X.startsWith("RFB "))})})}async function a(x,q){let P=Date.now()+q;while(Date.now()<P){if(await x())return!0;await new Promise((p)=>setTimeout(p,100))}return!1}function M(x,q,P){return new Promise((p)=>{let b=T8(x,q,{detached:!0,stdio:"ignore",env:P});b.once("error",()=>p(-1)),b.once("exit",(X)=>p(X)),b.unref(),setTimeout(()=>p(null),_).unref()})}var V=null;function n8(x=g()){return V??=i8(x).finally(()=>{V=null}),V}async function i8(x){let q=w({home:x});if(!q?.xvfb||!q.x11vnc||!q.openbox)throw new N("display_unavailable","Run `reason desktop install` on this machine to enable its desktop.");q8({root:q.root,automation:q.automation,extensionDir:q.extensionDir});let P=J(q.root,"display");h(P);let p=await m8(x,P,q.x11vnc);if(p)return p;let b={display:D,xauthority:J(P,"Xauthority"),rfbSocket:J(P,"rfb.sock")},X=J(P,"pulse"),Q=(async()=>{try{h(X)}catch{return null}return await X8(X,q.pulseaudio)})();h(J(P,"home"));let y=A8(P,b,q.pulseaudio),W=async()=>({...b,sound:await Q});if(await B({path:b.rfbSocket},!0))return C8(J(P,"theme"),E,y),await W();if(!N8(b.xauthority))K(b.xauthority,v8(D.slice(1),u8(16)),{mode:384,flag:"wx"});let T=R8(J(P,"theme"),b.display,u),A={path:`/tmp/.X11-unix/X${D.slice(1)}`};if(!await B(A,!1)){let r=`${u.width}x${u.height}`;if(q.xvnc)r8(b.rfbSocket,{force:!0}),M(q.xvnc,[b.display,"-geometry",r,"-depth","24","-nolisten","tcp","-auth",b.xauthority,"-rfbport","-1","-rfbunixpath",b.rfbSocket,"-SecurityTypes","None","-UseBlacklist=0","-AlwaysShared","-desktop","Reason"],y);else M(q.xvfb,[b.display,"-screen","0",`${r}x24`,"-nolisten","tcp","-auth",b.xauthority],y);if(!await a(()=>B(A,!1),_)||q.xvnc&&!await a(()=>B({path:b.rfbSocket},!0),_))throw new N("display_unavailable","Reason could not start the virtual display.");M(q.openbox,["--config-file",T.openboxConfig],y)}if(await L8(T,y),!await U8(q.x11vnc,b,P,"x11vnc.log",y))throw new N("display_unavailable","Reason could not start the desktop server.");return await W()}function A8(x,q,P){let p={HOME:J(x,"home"),PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:q.display,XAUTHORITY:q.xauthority};if(P)p.PULSE_SERVER=P8(p8(J(x,"pulse")));return p}async function U8(x,q,P,p,b){if(await B({path:q.rfbSocket},!0))return!0;r8(q.rfbSocket,{force:!0});let X=await M(x,["-display",q.display,"-auth",q.xauthority,"-rfbport","0","-rfbportv6","-1","-unixsock",q.rfbSocket,"-nopw","-forever","-shared","-noxdamage","-sb","0","-rfbversion","3.7","-quiet","-bg","-o",J(P,p)],b);if(X!==null&&X!==0)return!1;return await a(()=>B({path:q.rfbSocket},!0),_)}async function I8(){let x=["DISPLAY","XAUTHORITY","WAYLAND_DISPLAY","XDG_SESSION_TYPE"],q=(P)=>Object.fromEntries(x.flatMap((p)=>P[p]?[[p,P[p]]]:[]));if(process.env.DISPLAY)return q(process.env);try{let P=await new Promise((p,b)=>J8("systemctl",["--user","show-environment"],{encoding:"utf8",timeout:2000},(X,Q)=>X?b(X):p(Q)));return q(Object.fromEntries(P.split(`
|
|
124
|
+
`).flatMap((p)=>{let b=p.indexOf("=");return b>0?[[p.slice(0,b),p.slice(b+1)]]:[]})))}catch{return{}}}var m=new Set;async function m8(x,q,P){let p=await I8(),b=/^:(\d+)(?:\.\d+)?$/.exec(p.DISPLAY??"")?.[1];if(!b||`:${b}`===D||p.WAYLAND_DISPLAY||p.XDG_SESSION_TYPE==="wayland")return null;let X={display:`:${b}`,xauthority:p.XAUTHORITY??J(x,".Xauthority"),rfbSocket:J(q,`rfb-${b}.sock`)},Q=`${X.display} ${X.xauthority}`;if(m.has(Q)||!await B({path:`/tmp/.X11-unix/X${b}`},!1))return null;let y={HOME:x,PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:X.display,XAUTHORITY:X.xauthority};if(await U8(P,X,q,`x11vnc-${b}.log`,y))return{...X,sound:null};return m.add(Q),process.stderr.write(`Reason worker: your screen ${X.display} could not be served; using the virtual desktop
|
|
125
|
+
`),null}function R8(x,q,P){let p=`chromium --no-first-run --no-default-browser-check${process.geteuid?.()===0?" --no-sandbox":""} %U`,b=[["terminal","xterm"],["files","pcmanfm"]].filter(([,Q])=>!N8(`/usr/bin/${Q}`)).map(([Q])=>Q),X=i({root:x,display:q,screen:P,browserExec:p,absent:b});for(let Q of["","openbox","tint2","picom"])h(J(x,Q));for(let[Q,y]of Object.entries(X.files))K(J(x,Q),y,{mode:384});for(let[Q,y]of Object.entries(n))K(J(x,`ara-${Q}`),a8(y),{mode:384});return{root:x,openboxConfig:J(x,"openbox","rc.xml"),start:X.start}}function L8(x,q){return C8(x.root,[...x.start,"openbox --reconfigure >/dev/null 2>&1 || true"],q)}function C8(x,q,P){let p=[`ROOT=${JSON.stringify(x)}`,...q].join(`
|
|
126
|
+
`);return new Promise((b)=>{let X=T8("/bin/sh",["-c",p],{stdio:"ignore",env:{...P,PATH:"/usr/bin:/bin"}}),Q=setTimeout(()=>{X.kill(),b()},_);X.once("error",()=>{clearTimeout(Q),b()}),X.once("exit",()=>{clearTimeout(Q),b()})})}var t8=2073600,e8=320;function d8(x,q){let P=Math.min(1,Math.sqrt(t8/(x.width*x.height))),p=(b,X)=>Math.min(Math.floor(X/8)*8,Math.max(e8,Math.round(b*P/8)*8));return{width:p(x.width,q.width),height:p(x.height,q.height)}}function B8(x,q,P){return new Promise((p)=>J8(x,q,{env:P,encoding:"utf8",timeout:5000},(b,X)=>p(b?null:X)))}function o8(x){let q=/current (\d+) x (\d+), maximum (\d+) x (\d+)/.exec(x),P=x.split(`
|
|
127
|
+
`),p=P.findIndex((X)=>/^\S+ connected/.test(X));if(!q||p<0)return null;let b=[];for(let X of P.slice(p+1)){let Q=/^\s+(\d+x\d+)\s/.exec(X);if(!Q)break;b.push(Q[1])}return{current:{width:Number(q[1]),height:Number(q[2])},maximum:{width:Number(q[3]),height:Number(q[4])},output:P[p].split(" ")[0],modes:b}}async function xx(x,q,P){if(x.display!==D)return null;let p={PATH:"/usr/bin:/bin",DISPLAY:x.display,XAUTHORITY:x.xauthority},b=(W)=>B8("xrandr",W,p),X=o8(await b(["--query"])??"");if(!X||X.maximum.width<=X.current.width&&X.maximum.height<=X.current.height)return null;let Q=d8(q,X.maximum);if(Q.width===X.current.width&&Q.height===X.current.height)return{size:Q,changed:!1};let y=`${Q.width}x${Q.height}`;if(!X.modes.includes(y)){if(await b(["--newmode",y,"60",...[Q.width,Q.width,Q.width,Q.width,Q.height,Q.height,Q.height,Q.height].map(String)]),await b(["--addmode",X.output,y])===null)return null}return P(),await b(["--output",X.output,"--mode",y])===null?null:{size:Q,changed:!0}}async function qx(x,q){let P=w({home:g()});if(!P)return;let p=J(P.root,"display"),b=A8(p,x,P.pulseaudio);await L8(R8(J(p,"theme"),x.display,q),b);let X=q.width-R*2,Q=q.height-R-f;await B8("xdotool",["search","--onlyvisible","--class","Chromium","windowsize","%@",String(X),String(Q),"windowmove","%@",String(R),String(R)],{...b,PATH:"/usr/bin:/bin"})}var t=Promise.resolve();function bx(x,q,P=()=>{}){let p=t.then(()=>xx(x,q,P));return t=p.then((b)=>b?.changed?qx(x,b.size):void 0).catch(()=>{}),p.then((b)=>b?.size??null,()=>null)}async function Kx(x,q={}){let P=q.now??Date.now,p=k8(x.payload,P());if(x.signal.throwIfAborted(),!p.video)throw new N("display_video_required","Reason desktops stream as video now; this request came without it.");let b=q.platform??process.platform;if(b!=="linux"&&b!=="darwin"&&b!=="win32")throw new N("display_video_unsupported","This machine does not serve desktop video.");let X=p.video,Q=(q.video?.desktop??(b==="darwin"?async()=>Q8:b==="win32"?async()=>y8:n8))();return await px(x.signal,p,q,P,(y)=>S8(y,{request:X,desktop:Q,...p.viewer?{viewer:p.viewer}:{},viewerSameNetwork:p.viewer_same_network===!0},{resizeDesktop:bx,...q.video}),(y)=>o({type:"error",code:y}))}function px(x,q,P,p,b,X){let Q=p();return new Promise((y,W)=>{let T=null,A=!1,r=!1,Y,F,j,G=!1,U=null,L=(S)=>{if(r)return;if(U)S=U.outcome;r=!0,clearTimeout(Y),clearTimeout(F),x.removeEventListener("abort",Z),j?.close();try{T?.close(1000,"display_session_over")}catch{}if("error"in S){W(S.error);return}y({reason:S.reason,...j?.summary(),duration_ms:Math.max(0,p()-Q)})},c=()=>L({error:new N("display_relay_unavailable","Reason could not reach the desktop relay.")}),Z=()=>{let S=x.reason;L({error:S instanceof N?S:new N("cancelled","Reason closed the desktop session.")})},z=()=>{if(!U||!T)return;let{outcome:S}=U,C=!("error"in S)?S.reason:S.error instanceof N?S.error.code:"display_unavailable";if(!U.told)try{T.send(X(C))}catch{}L(S)};if(j=b({get done(){return r||U!==null},get open(){return A&&!r&&U===null},get bufferedAmount(){return T?.bufferedAmount??0},send(S){if(r||U||!A||!T)return;try{T.send(S)}catch{L({reason:"relay_closed"})}},end:(S)=>{if(r||U)return;if(!("error"in S)&&G&&A){L(S);return}if(U={outcome:S,told:!("error"in S)&&A},G&&A)z()}}),r){j.close();return}if(x.aborted){Z();return}x.addEventListener("abort",Z,{once:!0}),Y=setTimeout(()=>L({reason:"session_expired"}),Math.max(1,Date.parse(q.expires_at)-p())),F=setTimeout(()=>L({reason:"viewer_absent"}),P.viewerWaitMs??z8);try{T=(P.connect??b8)(q.relay_url,(P.loadProxy??x8)()?.url)}catch{c();return}T.binaryType="arraybuffer",T.onopen=()=>{if(r||!T)return;A=!0,j?.opened()},T.onmessage=(S)=>{if(r)return;let C=S.data,O=C instanceof ArrayBuffer?new Uint8Array(C):ArrayBuffer.isView(C)?new Uint8Array(C.buffer,C.byteOffset,C.byteLength):null;if(!O||O.byteLength===0)return;if(clearTimeout(F),G=!0,U){z();return}j?.received(O)},T.onclose=()=>{if(r)return;if(!A){c();return}L({reason:"relay_closed"})},T.onerror=()=>{if(r||A)return;c()}})}
|
|
128
|
+
export{Y8 as Kg,D as Lg,k8 as Mg,I as Ng,sx as Og,h as Pg,n8 as Qg,bx as Rg,Kx as Sg};
|