@reason-machines/cli-linux-x64 0.2.419 → 0.2.421
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 +8 -7
- package/bin/reason +2 -2
- package/bin/runtime/srt/sandbox-runtime.mjs +52 -52
- package/bin/vm-hands/api-18d75dfn.js +2 -0
- package/bin/vm-hands/api-credentials-3vhge1ap.js +2 -0
- package/bin/vm-hands/connect-cli-5r07fda9.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-17t4efc4.js +2 -0
- package/bin/vm-hands/desktop-account-6sjrxy69.js +2 -0
- package/bin/vm-hands/device-workspace-s50q53sz.js +2 -0
- package/bin/vm-hands/fsevents-p3d8kd0p.js +2 -0
- package/bin/vm-hands/hands-worker-source-kddz4y15.js +2 -0
- package/bin/vm-hands/index-wrw65904.js +12818 -0
- package/bin/vm-hands/install-receipt-ysa70fvh.js +2 -0
- package/bin/vm-hands/local-automation-764g234v.js +2 -0
- package/bin/vm-hands/local-capabilities-mg6eae35.js +2 -0
- package/bin/vm-hands/local-desktop-users-cppjjr81.js +2 -0
- package/bin/vm-hands/local-display-mac-0qz3b627.js +2 -0
- package/bin/vm-hands/local-display-session-a59620te.js +2 -0
- package/bin/vm-hands/local-display-video-6zdpjv5n.js +2 -0
- package/bin/vm-hands/local-managed-process-s7j196kq.js +2 -0
- package/bin/vm-hands/local-pty-session-rpk05ap5.js +2 -0
- package/bin/vm-hands/managed-runtime-vg23x3np.js +2 -0
- package/bin/vm-hands/network-contract-trkxqc0w.js +2 -0
- package/bin/vm-hands/package-xqbhdf15.js +2 -0
- package/bin/vm-hands/permissions-zkrmth58.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-xn3ddz70.js +2 -0
- package/bin/vm-hands/serve-service-y2sa6493.js +2 -0
- package/bin/vm-hands/status-6qmcgcem.js +10 -0
- package/bin/vm-hands/version-42drg7mg.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-agsp101y.js → vm-hands-entry-lite-21qpxvt8.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-2x8g6ktg.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-33hwmnd3.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-3krzmhkk.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-4vks5phw.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-4wpqs406.js +126 -0
- package/bin/vm-hands/vm-hands-entry-lite-50zbqwkv.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-5dtfehjv.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-60pg3wxj.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-6c67a3jc.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-7fsj5nrx.js +539 -0
- package/bin/vm-hands/vm-hands-entry-lite-8r31b0ps.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-8wf6y7xy.js +105 -0
- package/bin/vm-hands/vm-hands-entry-lite-aj139v8j.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-avc65bd7.js +65 -0
- package/bin/vm-hands/{vm-hands-entry-lite-vsa7t6m9.js → vm-hands-entry-lite-beyyy1gz.js} +54 -54
- package/bin/vm-hands/vm-hands-entry-lite-bx5zy5bd.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-c8ga19q0.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-djg69hf4.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-dk79tnax.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-dsxpxqd3.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-ec9jemny.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-fbhqfzbq.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-4k4h9rcq.js → vm-hands-entry-lite-fcvf8md1.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-g4zd2d5n.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-gvh1qskx.js +128 -0
- package/bin/vm-hands/vm-hands-entry-lite-hbs3tpdg.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-hek6nw5m.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-hk6trmwa.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-jev771b3.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-jzz73e3f.js +112 -0
- package/bin/vm-hands/vm-hands-entry-lite-m1yxqqaz.js +14 -0
- package/bin/vm-hands/vm-hands-entry-lite-np07qyeq.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-nzmkyezg.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-pf5qtbj5.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-qy9xg6em.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-6y6pz2yw.js → vm-hands-entry-lite-rfz60hb3.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-s1nwwtcs.js +452 -0
- package/bin/vm-hands/vm-hands-entry-lite-s4bharcb.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-s5qkb1fk.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-tdgtpx8e.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-vpz54vwj.js +7 -0
- package/bin/vm-hands/vm-hands-entry-lite-weqw6ykz.js +52 -0
- package/bin/vm-hands/vm-hands-entry-lite-wx4ax7wg.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-fzkfajew.js → vm-hands-entry-lite-ycnrtwdf.js} +5 -9
- package/bin/vm-hands/vm-hands-entry-lite-yretc2th.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-z76nfb19.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-zp6naptr.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite.js +3 -1
- package/bin/vm-hands/vm-hands-executor-957e80sb.js +11 -0
- package/bin/vm-hands/vm-hands-op-runner-65erpgzp.js +2 -0
- package/bin/vm-hands/vm-hands-runtime-6stbsbbw.js +4 -0
- package/bin/vm-hands/worker-preview-readiness-w62n91kr.js +2 -0
- package/bin/vm-hands/worker-sandbox-2r5nseff.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-s4897qxy.js +0 -2
- package/bin/vm-hands/api-m73x3da5.js +0 -2
- package/bin/vm-hands/ask-relay-4kwcx2b7.js +0 -8
- package/bin/vm-hands/connect-cli-34b18gjs.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-j012b4bd.js +0 -2
- package/bin/vm-hands/desktop-account-0q0arpzk.js +0 -2
- package/bin/vm-hands/device-workspace-3jxhs54b.js +0 -2
- package/bin/vm-hands/hands-worker-source-y64axsw3.js +0 -2
- package/bin/vm-hands/index-194s4vz0.js +0 -12818
- package/bin/vm-hands/install-receipt-1g68b446.js +0 -2
- package/bin/vm-hands/local-automation-k2w46hn2.js +0 -2
- package/bin/vm-hands/local-capabilities-tdzbqmrb.js +0 -2
- package/bin/vm-hands/local-desktop-users-6thzvydd.js +0 -2
- package/bin/vm-hands/local-display-mac-59ma7sxa.js +0 -2
- package/bin/vm-hands/local-display-session-4833qq7h.js +0 -2
- package/bin/vm-hands/local-display-video-c1143mz6.js +0 -2
- package/bin/vm-hands/local-managed-process-mr0zpk7c.js +0 -2
- package/bin/vm-hands/local-pty-session-bwarwpsd.js +0 -2
- package/bin/vm-hands/managed-runtime-vz1wqwwg.js +0 -2
- package/bin/vm-hands/network-contract-gprc37sw.js +0 -2
- package/bin/vm-hands/package-ej9snd47.js +0 -2
- package/bin/vm-hands/permissions-7sfghef4.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-jsrkawe2.js +0 -2
- package/bin/vm-hands/serve-service-kngyzh74.js +0 -2
- package/bin/vm-hands/status-jz29fb95.js +0 -96
- package/bin/vm-hands/version-g29vt13t.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-0h4qmgm2.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-0k13wmzm.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1exfjv79.js +0 -52
- package/bin/vm-hands/vm-hands-entry-lite-26q3hbdc.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-28s7v15d.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-2m5dwrdf.js +0 -6
- package/bin/vm-hands/vm-hands-entry-lite-37hvds7z.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-3rqdzqhk.js +0 -112
- package/bin/vm-hands/vm-hands-entry-lite-4gh5kfr4.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-6nwbqg37.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-714wspqb.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-7zk0r3p9.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-9qep7pka.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-am6kj1n1.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-as1tkffn.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-bxt4n1nj.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-c2g3wmkp.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-d2w8tghq.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-d98m00b8.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-daxcxjze.js +0 -344
- package/bin/vm-hands/vm-hands-entry-lite-dcnyve97.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-e1b89x66.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ej5ffjck.js +0 -105
- package/bin/vm-hands/vm-hands-entry-lite-ejkba2nk.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-f3wh0dza.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-f5xb489y.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-feybcq63.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-fpp2bs9y.js +0 -452
- package/bin/vm-hands/vm-hands-entry-lite-gt497d5x.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-gxper06w.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-j2ng164q.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-jp9q2vsx.js +0 -127
- package/bin/vm-hands/vm-hands-entry-lite-magmzx9c.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ntx8fdyq.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-pfzczmaa.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-pkc4ry5x.js +0 -539
- package/bin/vm-hands/vm-hands-entry-lite-pp7jfqzr.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-q8wkrzer.js +0 -66
- package/bin/vm-hands/vm-hands-entry-lite-s823n1q9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-s9xf5z69.js +0 -7
- package/bin/vm-hands/vm-hands-entry-lite-tchc7z17.js +0 -128
- package/bin/vm-hands/vm-hands-entry-lite-tytfs183.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-v4jtxgaj.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-vgpt2n1v.js +0 -11
- package/bin/vm-hands/vm-hands-entry-lite-xp3qzxk5.js +0 -3
- package/bin/vm-hands/vm-hands-executor-epyhpjv3.js +0 -11
- package/bin/vm-hands/vm-hands-op-runner-fn1qph82.js +0 -2
- package/bin/vm-hands/vm-hands-runtime-8vt9etvv.js +0 -4
- package/bin/vm-hands/worker-preview-readiness-yfjgban2.js +0 -2
- package/bin/vm-hands/worker-sandbox-z0t69av8.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yr,Qr,en,nr}from"./vm-hands-entry-lite-3krzmhkk.js";import{uo,po,P,Mr,$r,Ln,ut,Mn,Br,Ke,ve,$n,Je,ne,Ze,Se,Vt,Fr,jr,Fn}from"./vm-hands-entry-lite-tdgtpx8e.js";import{sr}from"./vm-hands-entry-lite-rfz60hb3.js";import{qt}from"./vm-hands-entry-lite-21qpxvt8.js";import{ke}from"./vm-hands-entry-lite-dk79tnax.js";var r=["cgroup_membership_read_failed","cgroup_v2_membership_absent","cgroup_scope_invalid","cgroup_root_unavailable","cgroup_directory_unavailable","cgroup_limit_read_failed","cgroup_events_read_failed","cgroup_current_read_failed","cgroup_stat_read_failed","boot_id_read_failed","boot_id_invalid","guest_meminfo_read_failed","guest_vmstat_read_failed","memory_counter_invalid","memory_field_missing","memory_capacity_invalid"];var o=String.raw`(function(fs, path) {
|
|
3
3
|
const fail = (message, reasonCode) => { throw Object.assign(Error(message), {reasonCode}); };
|
|
4
4
|
const read = (p, reasonCode, trim=true) => { try { const text=fs.readFileSync(p, "utf8"); return trim?text.trim():text; }
|
|
5
5
|
catch { fail("memory_read", reasonCode); } };
|
|
@@ -64,7 +64,7 @@ import{yh as H}from"./vm-hands-entry-lite-agsp101y.js";import{Ah as m,Bh as L,Ch
|
|
|
64
64
|
if(!Number.isSafeInteger(limitBytes)||limitBytes<=0||!Number.isSafeInteger(available)||available>limitBytes) fail("memory_capacity", "memory_capacity_invalid");
|
|
65
65
|
return {bootId,oomKills:field(read("/proc/vmstat", "guest_vmstat_read_failed"),"oom_kill"),currentBytes:limitBytes-available,
|
|
66
66
|
limitBytes,inactiveFileBytes:0,capacitySource:"guest",memoryScope:"/proc"};
|
|
67
|
-
})`;var
|
|
67
|
+
})`;var i=String.raw`import os,sys,json,stat,fcntl,time,ctypes
|
|
68
68
|
v=json.load(sys.stdin)
|
|
69
69
|
root=v['root']; paths=list(dict.fromkeys([v['source'],v['snapshot']]))
|
|
70
70
|
marker=('# reason-job-env-owner:'+v['runId']+'\n').encode()
|
|
@@ -309,7 +309,7 @@ function fileOperation(request) {
|
|
|
309
309
|
});
|
|
310
310
|
return { promise, cancel() {} };
|
|
311
311
|
}
|
|
312
|
-
`;var
|
|
312
|
+
`;var s="a3e39eb55160acfc116fa9871ccc594c68be7a642d2331b24baa707c8f601ec0";import{createHash as I}from"crypto";var H=Object.freeze({"api.ara.so":"api.reasonmachines.com","api.reasonmachines.ai":"api.reasonmachines.com","api-staging.ara.so":"staging-api.reasonmachines.com","staging-api.reasonmachines.ai":"staging-api.reasonmachines.com"});var a=Object.freeze({trailingSlashPattern:/\/+$/.source,keyPrefix:"http.",keySuffix:"/.extraheader",valuePrefix:"Authorization: Bearer "});var c=Object.freeze({tokenEnv:"ARA_GIT_BROKER_TOKEN",reasonTokenEnv:"REASON_GIT_BROKER_TOKEN",urlEnv:"ARA_GIT_BROKER_URL",keyPrefix:"credential.",keySuffix:"/.helper",value:'!f(){ printf "username=%s\\npassword=%s\\n" "ara-run" "${REASON_GIT_BROKER_TOKEN:-$ARA_GIT_BROKER_TOKEN}"; };f'});var It=/^[A-Za-z_][A-Za-z0-9_]*$/;var h=new Set(["ARA_INFERENCE_TOKEN","AI_GATEWAY_API_KEY","CLOUD_AGENT_AI_GATEWAY_API_KEY","INFERENCE_V2_GATEWAY_API_KEY","VERCEL_AI_GATEWAY_API_KEY","INFERENCE_V2_CONCENTRATE_API_KEY","INFERENCE_V2_OPENAI_API_KEY","INFERENCE_V2_ANTHROPIC_API_KEY","INFERENCE_V2_FINGERPRINT_SECRET","OPENAI_API_KEY","OPENROUTER_API_KEY","ANTHROPIC_API_KEY","CODEX_ACCESS_TOKEN","GITHUB_COPILOT_API_KEY","AZURE_OPENAI_API_KEY","AZURE_OPENAI_CLIENT_SECRET"]),m=new Set(["ARA_OPERATOR_KEY","BL_API_KEY","BLAXEL_API_KEY","NSC_TOKEN","NSC_TOKEN_FILE","NAMESPACE_API_KEY","NAMESPACE_ACCESS_TOKEN","NAMESPACE_TOKEN","NAMESPACE_TOKEN_JSON","NAMESPACE_SANDBOX_TOKEN_JSON","ARA_LOCAL_QA_NAMESPACE_WORKLOAD_TOKEN_FILE","NAMESPACE_SANDBOX_USE_LOCAL_USER_TOKEN","COMPUTE_SERVICE_TOKEN"]),g=["INFISICAL_","NSC_"],_=new Set(["ARA_JOB_ENV","ARA_DELIVERY_BASE_SHA","WORK_ROOT","REPO_DIR","ARA_CONTROL_DIR","ARA_PRESERVE_WORKSPACE","ARA_PINNED_CHECKOUT_REUSE","FOLLOWUP_BRANCH","REPO_URL","TOKENLESS_URL","REPOSITORY_IDENTITY_URL","DEFAULT_BRANCH","BRANCH","BRANCH_GENERATED","BASE_REF","REPO_EMPTY","REPO_WRITABLE","ARA_DELIVERY_BASE_BRANCH","ARA_SERVER_GIT_PUBLICATION","ARA_EMPTY_REPOSITORY_COMMIT","REASON_MODEL","REASON_DELIVERY_BASE_BRANCH","REASON_DELIVERY_BASE_SHA","REASON_EMPTY_REPOSITORY_COMMIT","REASON_SCRATCH_SESSION_ID","REASON_SERVER_GIT_PUBLICATION","REASON_ALLOW_INSTALL_SCRIPTS","SCM_TOKEN","SCM_TOKEN_USER","REASON_OIDC_TOKEN_URL","REASON_OIDC_REQUEST_TOKEN","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","BASH_ENV","ENV","BASHOPTS","SHELLOPTS","PS4","IFS","CDPATH","GLOBIGNORE","PROMPT_COMMAND","PATH","HOME","TMPDIR","TMP","TEMP","XDG_CONFIG_HOME","GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_COMMON_DIR","GIT_NAMESPACE","GIT_CEILING_DIRECTORIES","GIT_DISCOVERY_ACROSS_FILESYSTEM","GIT_SHALLOW_FILE","GIT_ALLOW_PROTOCOL","GIT_PROTOCOL_FROM_USER","GIT_REPLACE_REF_BASE","NODE_OPTIONS","NODE_PATH","NODE_REPL_EXTERNAL_MODULES","CLASSPATH","PYTHONPATH","PYTHONSTARTUP","PYTHONHOME","RUBYOPT","RUBYLIB","PERL5LIB","PERL5OPT","JAVA_TOOL_OPTIONS","_JAVA_OPTIONS","JDK_JAVA_OPTIONS","GEM_PATH","GEM_HOME","GIT_SSH","GIT_SSH_COMMAND","GIT_EXEC_PATH","GIT_TEMPLATE_DIR","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_PROXY_COMMAND","GIT_EXTERNAL_DIFF","GIT_PAGER","GIT_EDITOR","GIT_ASKPASS","SSH_ASKPASS","PAGER","EDITOR","TAR_OPTIONS","CURL_HOME","WGETRC","APT_CONFIG","PERLLIB","GIT_GRAFT_FILE","POSIXLY_CORRECT"]),y=["GIT_TRACE","CONTEXT_REPO_","ARA_CHECKPOINT_BOOTSTRAP_","_","ARA_HANDS_","ARA_DEVICE_","ARA_GIT_BROKER_","REASON_HANDS_","REASON_DEVICE_","REASON_GIT_BROKER_","LD_","DYLD_","GIT_CONFIG","BASH_FUNC_"];var t="^(?!(?:"+[...h,...m,..._].join("|")+")$)(?!(?:"+[...g,...y].join("|")+"))"+It.source.slice(1),W=new RegExp(t);var v=["HOME","PWD","OLDPWD","TMPDIR","TMP","TEMP","SHELL","USER","LOGNAME","SCM_TOKEN","SCM_TOKEN_USER","GH_TOKEN","GITHUB_TOKEN","GH_ENTERPRISE_TOKEN","GITHUB_ENTERPRISE_TOKEN","GITLAB_TOKEN"],E=["ARA_HANDS_","ARA_DEVICE_","ARA_GIT_BROKER_","REASON_HANDS_","REASON_DEVICE_","REASON_GIT_BROKER_","BUN_"],S="^(?!(?:"+v.join("|")+")$)(?!(?:"+E.join("|")+"))"+t.slice(1),w="ARA_DELIVERY_BASE_SHA|WORK_ROOT|FOLLOWUP_BRANCH|ARA_PRESERVE_WORKSPACE|ARA_PINNED_CHECKOUT_REUSE|CONTEXT_REPO_[A-Z0-9_]+|REPO_URL|TOKENLESS_URL|REPOSITORY_IDENTITY_URL|DEFAULT_BRANCH|BRANCH|BRANCH_GENERATED|BASE_REF|REPO_EMPTY|REPO_WRITABLE|ARA_DELIVERY_BASE_BRANCH|ARA_SERVER_GIT_PUBLICATION|ARA_EMPTY_REPOSITORY_COMMIT|REASON_MODEL|REASON_DELIVERY_BASE_BRANCH|REASON_DELIVERY_BASE_SHA|REASON_EMPTY_REPOSITORY_COMMIT|REASON_SCRATCH_SESSION_ID|REASON_SERVER_GIT_PUBLICATION|REASON_ALLOW_INSTALL_SCRIPTS",n="^(?:"+w+"|"+S.slice(1,-1)+")$",O=new RegExp(n);function Sr(u){return O.test(u)}var st=Object.freeze({tokenPath:"/identity/token",awsPath:"/identity/aws",tokenPattern:/^[A-Za-z0-9_.~-]+$/.source}),V=Object.freeze({variables:256,valueBytes:130816,snapshotBytes:1048576}),Z=Object.freeze({valueChars:16384,snapshotBytes:65536});var l=["set -g history-limit 50000","set -g status off","set -g window-size smallest","set -gq fill-character ' '","set -g escape-time 10","set -g prefix None","set -g prefix2 None","set -g terminal-overrides ',*:smcup@:rmcup@'"];var D=2,R="ara-hands-worker.cjs",d=["/usr/local/go/bin","/opt/node/bin","/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin","/usr/local/cargo/bin"],A=d.join(":"),T=["/opt/homebrew/bin",...d].join(":"),k='(platform, linuxPath, macosPath) => platform === "darwin" ? macosPath : linuxPath';var N=String.raw`(function(anchor, pid, native) {
|
|
313
313
|
const token = native.identity(pid);
|
|
314
314
|
const session = native.session(pid);
|
|
315
315
|
if (!native.same(anchor)) throw new Error("pty_session_identity_lost");
|
|
@@ -317,7 +317,7 @@ function fileOperation(request) {
|
|
|
317
317
|
if (session.id !== anchor[5]) throw new Error("pty_member_session_changed");
|
|
318
318
|
if (!token) return { retry: true, token: null };
|
|
319
319
|
return { retry: false, token };
|
|
320
|
-
})`,
|
|
320
|
+
})`,C=String.raw`(function(native) {
|
|
321
321
|
let probe;
|
|
322
322
|
try {
|
|
323
323
|
try {
|
|
@@ -327,7 +327,7 @@ function fileOperation(request) {
|
|
|
327
327
|
native.signal(probe);
|
|
328
328
|
} finally { if (probe) native.release(probe); }
|
|
329
329
|
} catch (error) { native.close(); throw error; }
|
|
330
|
-
})`,
|
|
330
|
+
})`,x=String.raw`(function(bootstrap) {
|
|
331
331
|
const { dlopen, ptr } = require("bun:ffi");
|
|
332
332
|
const api = dlopen("libc.so.6", {
|
|
333
333
|
prctl: { args: ["i32", "u64", "u64", "u64", "u64"], returns: "i32" },
|
|
@@ -348,7 +348,7 @@ function fileOperation(request) {
|
|
|
348
348
|
require("node:fs").writeSync(3, "subreaper\n");
|
|
349
349
|
api.execve(ptr(args[0]), ptr(argv), ptr(envp));
|
|
350
350
|
throw new Error("pty_exec_failed");
|
|
351
|
-
})`,
|
|
351
|
+
})`,Zo=String.raw`
|
|
352
352
|
"use strict";
|
|
353
353
|
const crypto = require("node:crypto");
|
|
354
354
|
const fs = require("node:fs");
|
|
@@ -356,46 +356,46 @@ const net = require("node:net");
|
|
|
356
356
|
const path = require("node:path");
|
|
357
357
|
const { spawn, spawnSync } = require("node:child_process");
|
|
358
358
|
const { StringDecoder } = require("node:string_decoder");
|
|
359
|
-
const GIT_BROKER_HTTP_HEADER_POLICY = ${JSON.stringify(
|
|
360
|
-
const GIT_BROKER_CREDENTIAL_HELPER_POLICY = ${JSON.stringify(
|
|
361
|
-
const DEVICE_ENVIRONMENT_NAME_RE = new RegExp(${JSON.stringify(
|
|
362
|
-
const DEVICE_CLOUD_ACCESS_POLICY = ${JSON.stringify(
|
|
363
|
-
const DEVICE_ENVIRONMENT_LIMITS = ${JSON.stringify(
|
|
359
|
+
const GIT_BROKER_HTTP_HEADER_POLICY = ${JSON.stringify(a)};
|
|
360
|
+
const GIT_BROKER_CREDENTIAL_HELPER_POLICY = ${JSON.stringify(c)};
|
|
361
|
+
const DEVICE_ENVIRONMENT_NAME_RE = new RegExp(${JSON.stringify(n)});
|
|
362
|
+
const DEVICE_CLOUD_ACCESS_POLICY = ${JSON.stringify(st)};
|
|
363
|
+
const DEVICE_ENVIRONMENT_LIMITS = ${JSON.stringify(V)};
|
|
364
364
|
|
|
365
|
-
const VERSION = ${
|
|
366
|
-
const WORKER_VERSION = ${
|
|
367
|
-
const WORKER_ENTRYPOINT = ${JSON.stringify(
|
|
368
|
-
const GUEST_MEMORY_UNAVAILABLE_REASONS = ${JSON.stringify(
|
|
369
|
-
const sampleGuestMemory = ${
|
|
370
|
-
const inspectMacPtyMember = ${
|
|
371
|
-
const probeLinuxPtyLibrary = ${
|
|
372
|
-
const windowsPtyApi = ${
|
|
373
|
-
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(
|
|
374
|
-
const CLOSE_CODES = ${JSON.stringify(
|
|
365
|
+
const VERSION = ${P};
|
|
366
|
+
const WORKER_VERSION = ${D};
|
|
367
|
+
const WORKER_ENTRYPOINT = ${JSON.stringify(R)};
|
|
368
|
+
const GUEST_MEMORY_UNAVAILABLE_REASONS = ${JSON.stringify(r)};
|
|
369
|
+
const sampleGuestMemory = ${o};
|
|
370
|
+
const inspectMacPtyMember = ${N};
|
|
371
|
+
const probeLinuxPtyLibrary = ${C};
|
|
372
|
+
const windowsPtyApi = ${qt};
|
|
373
|
+
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(x)};
|
|
374
|
+
const CLOSE_CODES = ${JSON.stringify(jr)};
|
|
375
375
|
const SHA256_RE = /^[0-9a-f]{64}$/;
|
|
376
|
-
const MAX_FRAME_BYTES = ${
|
|
377
|
-
const MAX_INPUT_CHARS = ${
|
|
378
|
-
const MAX_STRUCTURED_INPUT_CHARS = ${
|
|
379
|
-
const MAX_OUTPUT_CHARS = ${
|
|
380
|
-
const WORKSPACE_BEFORE_MAX_OUTPUT_CHARS = ${
|
|
381
|
-
const MAX_ERROR_CHARS = ${
|
|
376
|
+
const MAX_FRAME_BYTES = ${Mr};
|
|
377
|
+
const MAX_INPUT_CHARS = ${$r};
|
|
378
|
+
const MAX_STRUCTURED_INPUT_CHARS = ${Ln};
|
|
379
|
+
const MAX_OUTPUT_CHARS = ${ut};
|
|
380
|
+
const WORKSPACE_BEFORE_MAX_OUTPUT_CHARS = ${Fn};
|
|
381
|
+
const MAX_ERROR_CHARS = ${Mn};
|
|
382
382
|
const MAX_LEDGER_IDS = 16384;
|
|
383
383
|
const MAX_CACHED_RESULTS = 256;
|
|
384
|
-
const MAX_JOB_INPUT_CHARS = ${
|
|
385
|
-
const MAX_JOB_OUTPUT_CHARS = ${
|
|
386
|
-
const MAX_JOB_OUTPUT_CHUNKS = ${
|
|
387
|
-
const MAX_JOBS = ${
|
|
384
|
+
const MAX_JOB_INPUT_CHARS = ${Br};
|
|
385
|
+
const MAX_JOB_OUTPUT_CHARS = ${Ke};
|
|
386
|
+
const MAX_JOB_OUTPUT_CHUNKS = ${ve};
|
|
387
|
+
const MAX_JOBS = ${$n};
|
|
388
388
|
const MAX_JOB_RECORD_BYTES = 262144;
|
|
389
389
|
const MAX_JOB_JOURNAL_BYTES = MAX_JOBS * MAX_JOB_RECORD_BYTES;
|
|
390
|
-
const MAX_JOB_CONTROL_FRAME_BYTES = ${
|
|
391
|
-
const MAX_PTY_INPUT_BYTES = ${
|
|
392
|
-
const MAX_PTY_OUTPUT_BYTES = ${
|
|
393
|
-
const MAX_PTY_DIMENSION = ${
|
|
390
|
+
const MAX_JOB_CONTROL_FRAME_BYTES = ${Je};
|
|
391
|
+
const MAX_PTY_INPUT_BYTES = ${ne};
|
|
392
|
+
const MAX_PTY_OUTPUT_BYTES = ${Ze};
|
|
393
|
+
const MAX_PTY_DIMENSION = ${Se};
|
|
394
394
|
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/;
|
|
395
395
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
396
396
|
const WINDOWS = process.platform === "win32";
|
|
397
397
|
// Each Bash leader's tree on Windows, children that outlive it included (shared/windows-job-object.ts).
|
|
398
|
-
const windowsJobs = WINDOWS ? ${
|
|
398
|
+
const windowsJobs = WINDOWS ? ${sr}(require) : null;
|
|
399
399
|
/** Windows has no POSIX owner or mode bits: the user's own profile folders are
|
|
400
400
|
* private by their ACLs, and the worker runs as that ordinary user. */
|
|
401
401
|
function ownedPrivately(stat, mask = 0o077) {
|
|
@@ -492,9 +492,9 @@ function jobsUserPrefix(model) {
|
|
|
492
492
|
return user ? ["/usr/bin/setpriv", "--reuid=" + user.uid, "--regid=" + gid, "--clear-groups", "--no-new-privs", "--",
|
|
493
493
|
"/usr/bin/env", "HOME=" + user.home, "USER=" + user.username, "LOGNAME=" + user.username] : [];
|
|
494
494
|
}
|
|
495
|
-
const FIXED_CLOUD_CHILD_PATH = ${JSON.stringify(
|
|
496
|
-
const FIXED_MACOS_CLOUD_CHILD_PATH = ${JSON.stringify(
|
|
497
|
-
const selectCloudChildPath = ${
|
|
495
|
+
const FIXED_CLOUD_CHILD_PATH = ${JSON.stringify(A)};
|
|
496
|
+
const FIXED_MACOS_CLOUD_CHILD_PATH = ${JSON.stringify(T)};
|
|
497
|
+
const selectCloudChildPath = ${k};
|
|
498
498
|
const config = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
499
499
|
const FIXED_BASH = WINDOWS ? config.bashExecutable : "/bin/bash";
|
|
500
500
|
const allowedTools = config.allowedTools === undefined
|
|
@@ -577,12 +577,12 @@ function validJobEnvSourcePath() {
|
|
|
577
577
|
if (config.jobEnvSourcePath === undefined || config.jobEnvSourcePath === path.join(config.workRoot, "job.env")) return true;
|
|
578
578
|
// A cloud workspace's job.env is in its Session's root-only control
|
|
579
579
|
// directory (shared/device-workspace.ts), derived from the root alone.
|
|
580
|
-
const cloud = new RegExp(${JSON.stringify(
|
|
580
|
+
const cloud = new RegExp(${JSON.stringify(nr.source)}).exec(config.workRoot);
|
|
581
581
|
if (process.platform === "linux" && cloud) {
|
|
582
582
|
const workspaceId = cloud[3];
|
|
583
|
-
const owner = (new RegExp(${JSON.stringify(
|
|
584
|
-
?? (new RegExp(${JSON.stringify(
|
|
585
|
-
return config.jobEnvSourcePath === ${JSON.stringify(
|
|
583
|
+
const owner = (new RegExp(${JSON.stringify(Qr.source)}).exec(workspaceId) || [])[1]
|
|
584
|
+
?? (new RegExp(${JSON.stringify(en.source)}).exec(workspaceId) || [])[1] ?? workspaceId;
|
|
585
|
+
return config.jobEnvSourcePath === ${JSON.stringify(Yr)} + "/" + owner + "/job.env";
|
|
586
586
|
}
|
|
587
587
|
// Personal Cloud controls are root-owned and outside the writable grant.
|
|
588
588
|
// Admit only the same canonical session, never a caller-selected private path.
|
|
@@ -1027,7 +1027,7 @@ function initializeJobs() {
|
|
|
1027
1027
|
// (shared/local-protected-paths.ts) that the file tools and every confinement
|
|
1028
1028
|
// refuse. A home-folder worker keeps it in ~/.config/reason, so its Session may
|
|
1029
1029
|
// work in the home folder itself, as a Mac's home grant does.
|
|
1030
|
-
const PROTECTED_STATE_DIRECTORIES = ${JSON.stringify(
|
|
1030
|
+
const PROTECTED_STATE_DIRECTORIES = ${JSON.stringify(ke)};
|
|
1031
1031
|
function stateOverlapsWorkspace(state, root) {
|
|
1032
1032
|
if (pathWithin(root, state)) return true;
|
|
1033
1033
|
if (!pathWithin(state, root)) return false;
|
|
@@ -1372,7 +1372,7 @@ async function handleTerminalCleanup(target, claim, raw) {
|
|
|
1372
1372
|
let child, timer, killTimer;
|
|
1373
1373
|
const finish = ok => { clearTimeout(timer); clearTimeout(killTimer); if (!ok) cleanupUnconfirmed = true; resolve(ok); };
|
|
1374
1374
|
try {
|
|
1375
|
-
child = spawn("/usr/bin/python3", ["-I", "-c", ${JSON.stringify(
|
|
1375
|
+
child = spawn("/usr/bin/python3", ["-I", "-c", ${JSON.stringify(i)}],
|
|
1376
1376
|
{ stdio: ["pipe", "ignore", "ignore"], env: { PATH: "/usr/bin:/bin" }, detached: true });
|
|
1377
1377
|
let timedOut = false;
|
|
1378
1378
|
timer = setTimeout(() => { timedOut = true; try { process.kill(-child.pid, "SIGTERM"); } catch { cleanupUnconfirmed = true; }
|
|
@@ -2347,7 +2347,7 @@ function windowsPtyOperation(request, managed) {
|
|
|
2347
2347
|
try {
|
|
2348
2348
|
if (pty.activeProcesses() > 0) pty.terminate();
|
|
2349
2349
|
for (const startedAt = Date.now(); pty.activeProcesses() > 0;) {
|
|
2350
|
-
if (Date.now() - startedAt > ${
|
|
2350
|
+
if (Date.now() - startedAt > ${Vt}) throw new Error("pty_cleanup_timeout");
|
|
2351
2351
|
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
2352
2352
|
}
|
|
2353
2353
|
pty.close();
|
|
@@ -2651,7 +2651,7 @@ function linuxPtyOwner() {
|
|
|
2651
2651
|
// user detaches from the shell (nohup, setsid, disown, or jobs left at exit)
|
|
2652
2652
|
// are not swept. At most TERMINAL_HOST_LIMIT shells per scope.
|
|
2653
2653
|
const TERMINAL_SHELL = "/bin/bash --noprofile --norc -i";
|
|
2654
|
-
const TERMINAL_TMUX_CONFIG = ${JSON.stringify([...
|
|
2654
|
+
const TERMINAL_TMUX_CONFIG = ${JSON.stringify([...l,"new-session -d -s main /bin/bash --noprofile --norc -i","set -g exit-empty on","run-shell -b -d 43200 -C kill-server",""].join(`
|
|
2655
2655
|
`))};
|
|
2656
2656
|
const TERMINAL_HOST_LIMIT = 4;
|
|
2657
2657
|
const terminalViewers = new Map();
|
|
@@ -2795,7 +2795,7 @@ function ptyOperation(request, managed, program = TERMINAL_SHELL) {
|
|
|
2795
2795
|
const { members, empty } = native.session(anchor, device);
|
|
2796
2796
|
try {
|
|
2797
2797
|
if (empty && exitCode !== null && subreaper) break;
|
|
2798
|
-
if (Date.now() - startedAt > ${
|
|
2798
|
+
if (Date.now() - startedAt > ${Vt}) throw new Error("pty_cleanup_timeout");
|
|
2799
2799
|
for (const token of members) {
|
|
2800
2800
|
if (!native.same(anchor)) throw new Error("pty_session_identity_lost");
|
|
2801
2801
|
const id = native.identityKey(token);
|
|
@@ -2811,7 +2811,7 @@ function ptyOperation(request, managed, program = TERMINAL_SHELL) {
|
|
|
2811
2811
|
controlReleased = true;
|
|
2812
2812
|
let exitTimer;
|
|
2813
2813
|
try { await Promise.race([child.exited, new Promise((_, reject) => {
|
|
2814
|
-
exitTimer = setTimeout(() => reject(new Error("pty_anchor_exit_unconfirmed")), ${
|
|
2814
|
+
exitTimer = setTimeout(() => reject(new Error("pty_anchor_exit_unconfirmed")), ${Fr});
|
|
2815
2815
|
})]); } finally { clearTimeout(exitTimer); }
|
|
2816
2816
|
if (timedOut) finish("timeout", 124);
|
|
2817
2817
|
else if (cancelled) finish("cancelled", 130);
|
|
@@ -3329,7 +3329,7 @@ function replOperation(request) {
|
|
|
3329
3329
|
// timeout and the lease, and background processes retained until the worker
|
|
3330
3330
|
// stops. One departure from stock: a command idle on a watcher's banner is
|
|
3331
3331
|
// stopped (PI_WATCH_BANNER). PI_* variables are not set here.
|
|
3332
|
-
const PI_TOOLS_SHA256 = "${
|
|
3332
|
+
const PI_TOOLS_SHA256 = "${s}";
|
|
3333
3333
|
const piToolsSource = typeof araHandsPiToolsSource === "function" ? araHandsPiToolsSource : null;
|
|
3334
3334
|
let piTools = null;
|
|
3335
3335
|
function loadPiTools() {
|
|
@@ -3362,10 +3362,10 @@ const PI_EXIT_STDIO_GRACE_MS = 100;
|
|
|
3362
3362
|
// the token once under quoteDepth layers of single quoting, so the confined
|
|
3363
3363
|
// script is byte-identical to what the Brain's confineBashPayload gives the
|
|
3364
3364
|
// bash tool: srt/bwrap, the payload uid, the network allowlist and allowWrite.
|
|
3365
|
-
const PI_TOOL_CONFINEMENT_TOKEN = "${
|
|
3365
|
+
const PI_TOOL_CONFINEMENT_TOKEN = "${uo}";
|
|
3366
3366
|
function validPiToolConfinement(value) {
|
|
3367
3367
|
return hasOnlyKeys(value, ["template", "quoteDepth"]) && typeof value.template === "string"
|
|
3368
|
-
&& value.template.length <= ${
|
|
3368
|
+
&& value.template.length <= ${po} && !value.template.includes("\0")
|
|
3369
3369
|
&& value.template.split(PI_TOOL_CONFINEMENT_TOKEN).length === 2 && [1, 2, 3].includes(value.quoteDepth);
|
|
3370
3370
|
}
|
|
3371
3371
|
// The script T when this command is exactly this policy's confineBashPayload(T)
|
|
@@ -4176,5 +4176,5 @@ void startJobControl().then(() => {
|
|
|
4176
4176
|
try { loadJobs(); prepareRequestJournal(); } catch { process.exit(44); }
|
|
4177
4177
|
if (validPrivateJob) markReady(); else connect();
|
|
4178
4178
|
}, () => process.exit(45));
|
|
4179
|
-
`.trimStart()
|
|
4180
|
-
export{
|
|
4179
|
+
`.trimStart();var b=I("sha256").update(Zo,"utf8").digest("hex");
|
|
4180
|
+
export{It,Sr,st,V,D,R,Zo,b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{t,o,i,W,ee,s,n}from"./vm-hands-entry-lite-avc65bd7.js";var ct=32768,Lt=67108864,Cr=16384,E=204800,Sn=600000,_=["content-type","anthropic-version","user-agent"],m=s(["openai-completions","openai-responses","anthropic-messages"]),f=new Set(_),C=ee(t(),t().max(2048)).refine((e)=>Object.keys(e).every((r)=>f.has(r))&&Object.values(e).every((r)=>!/[\r\n\0]/.test(r)),"Only non-secret custom endpoint request headers are permitted");function u(e){try{let r=new URL(e);return["http:","https:"].includes(r.protocol)&&!r.username&&!r.password&&!r.search&&!r.hash?r:null}catch{return null}}function Ar(e,r){let c=u(e.baseUrl),l=u(r.baseUrl),a=u(e.url);if(!c||!l||!a||e.method!=="POST"||r.execution!=="device")return!1;let d=(p)=>p.origin+p.pathname.replace(/\/+$/,"");if(d(c)!==d(l)||a.origin!==c.origin)return!1;let h=r.api==="openai-completions"?"/chat/completions":r.api==="openai-responses"?"/responses":"/v1/messages";return a.pathname===c.pathname.replace(/\/+$/,"")+h}var En=i({baseUrl:t().max(2048),url:t().max(4096),method:n("POST"),body:t().refine((e)=>new TextEncoder().encode(e).byteLength<=E).optional(),headers:C,credentialOrganizationId:t().uuid(),accountKey:t().min(1).max(256).optional()}).strict().refine((e)=>m.options.some((r)=>Ar(e,{baseUrl:e.baseUrl,api:r,execution:"device"})),"Invalid custom endpoint inference URL"),x=i({status:o().int().min(200).max(599),statusText:t().max(256).refine((e)=>!/[\r\n\0]/.test(e)),headers:ee(t(),t().max(4096)).refine((e)=>Object.keys(e).every((r)=>["content-type","retry-after","x-request-id","request-id"].includes(r))&&Object.values(e).every((r)=>!/[\r\n\0]/.test(r)))}).strict(),D=W([i({eof:n(!0)}).strict(),i({eof:n(!1),data:t().max(Math.ceil(ct/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((e)=>e.length>0&&e.length*3/4-(e.endsWith("==")?2:e.endsWith("=")?1:0)<=ct)}).strict()]),y=i({bytes:o().int().min(0).max(Lt),chunks:o().int().min(0).max(Cr)}).strict(),xn=i({apiKey:t().min(1).max(16384).refine((e)=>!/[\r\n\0]/.test(e)),api:m}).strict(),S=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed"];function kn(e){return typeof e==="string"&&S.includes(e)}var g="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",T={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${g}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."};var I=new Set(Object.values(T));export{ct,Lt,Cr,Sn,Ar,En,xn,kn};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{readdirSync as b,readFileSync as P}from"fs";import{userInfo as k}from"os";var ar="--vm-hands-op-runner-kind=person",cr="--vm-hands-op-runner-kind=surface",Ct="--vm-hands-surface-uid=",At="--vm-hands-surface-dir=",Pt=new Set(["automation.call.v1","display.stream.v1","preview.serve.v1"]);function R(t){let c=new Set([t]),l=[];try{l=b("/proc")}catch{}for(let o of l){if(!/^\d+$/.test(o))continue;try{let d=P(`/proc/${o}/stat`,"utf8");if(Number(d.slice(d.lastIndexOf(")")+2).split(" ")[3])===t)c.add(Number(o))}catch{}}for(let o of c)try{process.kill(o,"SIGKILL")}catch{}}var A=(t)=>{let c=globalThis.Bun;if(!c)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");let l=c.spawn({cmd:[t.shell,...t.args],cwd:t.cwd,env:{...t.environment,TERM:"xterm-256color"},terminal:{cols:t.cols,rows:t.rows,data:(i,s)=>t.onData(s)}}),o=l.terminal,d=()=>{R(l.pid);try{o?.close()}catch{}};if(!o)throw d(),new r("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(i)=>o.write(i),resize:(i,s)=>o.resize(i,s),kill:d,exited:l.exited.then((i)=>typeof i==="number"?i:null,()=>null)}};function x(){let t=(()=>{try{return k().username}catch{return}})();return{PATH:process.env.PATH,HOME:process.env.HOME,SHELL:process.env.SHELL,LANG:"C.UTF-8",...t?{USER:t,LOGNAME:t}:{}}}async function E(t){let[{localAutomationAvailable:c},{localDisplayReady:l},{localDisplayVideoAvailable:o},{probeWorkerPreview:d},y]=await Promise.all([import("./local-automation-764g234v.js"),import("./local-display-session-a59620te.js"),import("./local-display-video-6zdpjv5n.js"),import("./worker-preview-readiness-w62n91kr.js"),import("fs")]),i=AbortSignal.timeout(15000),s=null;try{y.mkdirSync(t,{recursive:!0,mode:448}),s=y.mkdtempSync(`${t}/probe-`);let[g,p,m]=await Promise.all([Promise.resolve().then(()=>c()).catch(()=>!1),l().catch(()=>!1),d(s,i).catch(()=>!1)]);return{t:"readiness",display_video:p&&await o().catch(()=>!1),lanes:{"automation.call.v1":g,"display.stream.v1":p,"preview.serve.v1":m,"tunnel.open":m,"tunnel.close":m}}}finally{if(s)y.rmSync(s,{recursive:!0,force:!0})}}async function as(){let[{executeLocalOperation:t,spawnCaptured:c},{runLocalPtySession:l},{configureDesktopAccount:o,desktopAccount:d},{configureWorkerSandbox:y}]=await Promise.all([import("./local-capabilities-mg6eae35.js"),import("./local-pty-session-rpk05ap5.js"),import("./desktop-account-6sjrxy69.js"),import("./worker-sandbox-2r5nseff.js")]);y();let i=process.argv.includes(ar),s=process.argv.includes(cr),g=(a,e,u)=>c(a,e[0]==="-lic"?["-lc",...e.slice(1)]:e,u),p=(process.geteuid?.()??0)!==0;if(s){p=!1;let a=process.argv.find((e)=>e.startsWith(Ct))?.slice(Ct.length);if((process.geteuid?.()??-1)===0&&a)try{p=o({value:a})!==null&&d()!==null}catch{p=!1}}let m=new Map,v=new Map,f=(a)=>{try{process.send?.(a)}catch{}};if(process.on("message",(a)=>{let e=a;if(e?.t==="cancel"){m.get(e.id)?.abort();return}if(e?.t==="control"){let n=v.get(e.id);if(s&&n&&e.control&&typeof e.control.kind==="string")import("./local-managed-process-s7j196kq.js").then(({controlManagedDeviceProcess:_})=>_(n,{kind:e.control.kind,payload:e.control.payload??{}})).catch(()=>!1);return}if(e?.t==="retire"){if(s&&typeof e.operation_id==="string"&&typeof e.status==="string")import("./local-managed-process-s7j196kq.js").then(({retireManagedDeviceProcess:n})=>n(e.operation_id,e.status)).catch(()=>!1);return}if(e?.t!=="op")return;if(!p){f({t:"done",id:e.id,completion:{status:"failed",error_code:"vm_hands_payload_account_unavailable"}});return}let u=e.claim.capability;if(u==="pty.start"&&!i){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}if(Pt.has(u)!==s){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}let w=new AbortController;m.set(e.id,w),v.set(e.id,e.claim);let S=u==="pty.start"?{runPtySession:(n)=>l(n,{spawnPty:A,environment:x(),loadProxy:()=>null})}:{worker:e.worker,...u==="exec.full"?{spawnFullControl:g}:{}};t(e.state,e.claim,{...S,signal:w.signal,emit:(n)=>{let{deliverySignal:_,...h}=n;f({t:"event",id:e.id,event:h})}}).then((n)=>f({t:"done",id:e.id,completion:n}),(n)=>f({t:"done",id:e.id,completion:{status:"failed",error_code:n&&typeof n==="object"&&"code"in n&&typeof n.code==="string"?n.code:"vm_hands_op_failed"}})).finally(()=>{m.delete(e.id),v.delete(e.id)})}),process.on("disconnect",()=>process.exit(0)),s){let a=process.argv.find((u)=>u.startsWith(At))?.slice(At.length),e={t:"readiness",display_video:!1,lanes:{}};f(p&&a?await E(a).catch(()=>e):e)}await new Promise(()=>{})}
|
|
3
|
+
export{ar,cr,Ct,At,Pt,as};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var er={name:"github-native-engineer-device-worker-production",version:"0.2.421",private:!0,type:"module",engines:{node:">=22",bun:">=1.3.0"},workspaces:["../../packages/runtime-distribution"],dependencies:{"@anthropic-ai/sandbox-runtime":"^0.0.73","@earendil-works/pi-tui":"1.0.0","@modelcontextprotocol/sdk":"^1.29.0","@reason/runtime-distribution":"workspace:*","playwright-core":"1.60.0",zod:"^4.4.3"},overrides:{"@hono/node-server":"^1.19.15","@earendil-works/pi-agent-core":"1.0.0","@earendil-works/pi-ai":"1.0.0","@earendil-works/pi-coding-agent":"1.0.0","@earendil-works/chord":"1.0.0","@earendil-works/pi-codemode":"1.0.0","@earendil-works/pi-mcp":"1.0.0","@earendil-works/pi-telemetry":"1.0.0","@earendil-works/pi-tui":"1.0.0","brace-expansion":"2.1.7",axios:"^1.20.0","basic-ftp":"^6.2.1","@grpc/grpc-js":"^1.14.5",browserslist:"^4.28.8","engine.io":"^6.6.7","fast-uri":"^3.1.8",hono:"^4.13.7","ip-address":"^10.7.1",nanoid:"^3.3.18",dompurify:"^3.4.17",postcss:"^8.5.23",qs:"^6.16.0","shell-quote":"^1.11.0","socket.io-parser":"^4.2.7",tmp:"^0.2.7",toml:"^4.2.0",undici:"^8.10.2",ws:"^8.21.0","js-yaml":"^4.3.2","@modelcontextprotocol/sdk":"^1.31.0","proxy-addr":"^2.0.8","source-map-js":"^1.2.2"}};
|
|
3
|
+
export{er};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{resolve as s,sep as i}from"path";var ke=[[".ssh"],[".gnupg"],[".aws"],[".azure"],[".kube"],[".docker"],[".infisical"],[".password-store"],[".terraform.d"],[".config","ara"],[".config","reason"],[".config","gh"],[".config","gcloud"],[".config","infisical"],[".config","op"],[".config","1password"],[".config","pass"],[".local","share","keyrings"],["library","keychains"],["library","application support","so.ara.desktop"],["appdata","roaming","github cli"],["appdata","roaming","gcloud"],["appdata","roaming","microsoft","credentials"],["appdata","local","microsoft","credentials"],["appdata","roaming","microsoft","protect"],["appdata","roaming","1password"],["appdata","local","1password"],["appdata","roaming","microsoft","windows","start menu","programs","startup"],["documents","windowspowershell"],["documents","powershell"],["appdata","local","reason"]],Zt=[[".codex","config.toml"],[".cursor","mcp.json"],[".claude","settings.json"],[".claude","settings.local.json"],[".cargo","credentials"],[".cargo","credentials.toml"],[".gem","credentials"],[".config","git","config"],[".config","git","credentials"],[".config","pip","pip.conf"]],Xt=new Set([".bash_login",".bash_profile",".bashrc",".bunfig.toml",".claude.json",".env",".envrc",".git-credentials",".gitconfig",".mcp.json",".netrc",".npmrc",".profile",".pypirc",".terraformrc",".yarnrc",".yarnrc.yml",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","auth.json","credentials.json","credentials.tfrc.json","local-daemon.json","local-device.json","mcp.json"]),Yt=[".key",".p12",".pfx",".pem"];function t(n,a){if(n.length<a.length)return!1;for(let r=0;r<=n.length-a.length;r+=1)if(a.every((o,e)=>n[r+e]===o))return!0;return!1}function E(n){let a=s(n).split(i).filter(Boolean).map((o)=>o.toLowerCase());if(ke.some((o)=>t(a,o)))return!0;if(Zt.some((o)=>t(a,o)))return!0;let r=a.at(-1)??"";return Xt.has(r)||r.startsWith(".env.")||Yt.some((o)=>r.endsWith(o))}
|
|
3
|
+
export{ke,Zt,Xt,Yt,E};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{H}from"./vm-hands-entry-lite-3krzmhkk.js";import{D,R,b}from"./vm-hands-entry-lite-beyyy1gz.js";import{je,pr,hr,gn,_n,ot}from"./vm-hands-entry-lite-s1nwwtcs.js";import{Nr}from"./vm-hands-entry-lite-pf5qtbj5.js";import{p,at,yn,_e,we}from"./vm-hands-entry-lite-s4bharcb.js";import{v,h}from"./vm-hands-entry-lite-wx4ax7wg.js";import{a,tr,Io}from"./vm-hands-entry-lite-jev771b3.js";import{nn,y,t,k,o,d,rs,Ie,Ri,u,i,W,_,ee,s,n,on}from"./vm-hands-entry-lite-avc65bd7.js";import{se,A}from"./vm-hands-entry-lite-6c67a3jc.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{randomUUID as Q}from"crypto";import{spawn as Le}from"child_process";import{existsSync as Z,lstatSync as me,mkdirSync as We,readFileSync as Ne,realpathSync as G,rmSync as Ve,writeFileSync as He}from"fs";import{dirname as Ue,join as j,relative as qe,sep as Je}from"path";var Se=["process.run.v1","process.full.v1"],xe=600000,Pe=1800000,Ee=20000,ne="process.cancel.v1",ie=i({action:n("start"),request_id:t().uuid(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),cwd:t().min(1).max(4096).refine((e)=>!e.includes("\x00")&&!e.startsWith("/")&&!e.split(/[\\/]/).includes("..")).describe("Path relative to the granted device root; omit to use that root. Must not start with /, contain a .. path segment, or contain a NUL character.").optional(),mode:s(["host","confined"]).default("host"),timeout_ms:o().int().min(1000).max(Pe).default(xe).describe("Absolute process budget including queue and startup time. Defaults to ten minutes; longer explicit requests require the selected root's advertised max_timeout_ms. Retrying never renews the deadline.")}).strict(),K={device_id:t().uuid(),root_id:t().uuid()},Re=_("action",[ie.extend(K),i({...K,action:n("inspect"),process_id:t().uuid(),after:o().int().min(0).default(0),wait_ms:o().int().min(0).max(Ee).default(0).describe("Wait for new output or a state change, bounded by this call's wait budget. Expiring this wait does not cancel the process or extend its deadline.")}).strict(),i({...K,action:n("cancel"),process_id:t().uuid()}).strict()]),Fe=nn(Re,{io:"input"}),Ke=ie.extend({process_brain_fence:t().uuid(),process_expires_at:y.datetime()}).strict(),J=i({version:n(1),process_id:t().uuid(),state:s(["starting","running","exited","cancelled","expired","uncertain"]),exit_code:o().int().nullable(),first_cursor:o().int().min(0),next_cursor:o().int().min(0),truncated:d(),observed_at:y.datetime(),output:u(i({cursor:o().int().min(1),stream:s(["stdout","stderr"]),text:t().max(32768)}).strict()).max(128)}).strict().refine((e)=>{if(Buffer.byteLength(JSON.stringify(e))>1e5||e.next_cursor<e.first_cursor-1)return!1;if((e.state==="starting"||e.state==="running"||e.state==="uncertain")&&e.exit_code!==null)return!1;if(e.state==="exited"&&(e.exit_code===null||e.exit_code<0||e.exit_code>255))return!1;if(e.state==="cancelled"&&e.exit_code!==130||e.state==="expired"&&e.exit_code!==124)return!1;let f=e.first_cursor-1;for(let l of e.output){if(l.cursor<=f||l.cursor>e.next_cursor)return!1;f=l.cursor}return!0});function ae(e){return Se.includes(e)}var Xe=i({operation_constraints:ee(t(),Ie())}),Ye=i({ready:n(!0),version:n(1),execution_mode:s(["host","confined"]),max_timeout_ms:o().int().min(1000).optional()});var De=i({version:n(1),process_id:t().uuid(),state:s(["queued","cancelled_before_start","not_started"]),exit_code:rs(),output:u(Ri()).length(0),first_cursor:n(0),next_cursor:n(0),truncated:n(!1),cancellation_requested:n(!1),reason_code:s(["cancelled_before_start","process_journal_capacity","path_not_found","process_timeout_unsupported"]).optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it.")}).strict(),Ce=i({...J.shape,state:s(["queued","starting","running","exited","cancelled","expired","uncertain","cancelled_before_start","not_started"]),observed_at:y.datetime().optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it."),cancellation_requested:d(),reason_code:t().nullable().optional(),execution_authority:n("lost").optional().describe("Historical receipt only; the current Brain cannot control this older-generation process."),recovery:i({cause:n("brain_generation_changed"),terminal_confirmed:d(),next_step:s(["inspect_until_terminal","reconcile_effects_before_new_intent"])}).strict().optional().describe("Historical process recovery only. An unconfirmed outcome forbids replay. A confirmed terminal observation proves the old process stopped, not that its command had no effects. Reconcile the result; only restart still-needed, safely repeatable work with a new request_id and current authority. Respect user cancellation."),last_observed_state:J.shape.state.or(n("cancelled_before_start")).nullable().optional().describe("Last saved observation before authority was lost; a running observation does not establish current child liveness.")}).strict(),$e=nn(Ce),Qe=W([J,De.refine((e)=>e.state==="cancelled_before_start")]),X=i({version:n(1),process_id:t().uuid(),state:s(["exited","cancelled","expired"]),exit_code:o().int().min(0).max(255),observed_at:y.datetime()}).strict().refine((e)=>(e.state!=="cancelled"||e.exit_code===130)&&(e.state!=="expired"||e.exit_code===124)),Ze=i({process_terminal_observation:X}).strict();var Bi="preview.serve.v1",Fi=43200000;var ce="preview.open.v1",de=1,dn="gid_proxy_v1",ji="egress",pn=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[1-9][0-9]{0,4})?$/,Ae=i({version:n(dn),allowed_domains:u(t().max(260).regex(pn)).max(1024)}).strict(),ke=on((e)=>H(e)!==null,"invalid workspace"),Oe=i({version:n(1),request_id:k(),session_id:k(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),port:o().int().min(1024).max(65535),workspace:ke,egress:Ae.optional()}).strict(),Ui=Oe.extend({expires_at:y.datetime()}).strict();var Me=4,Te=5000;function Y(e,c,f){let l=null;try{l=at(e)}catch{}yn({deviceRelayUrl:l?.deviceRelayUrl??"",binding:l?.binding??null,jobId:c,port:l?.binding.port??0,reason:l?f:"binding_invalid"})}function le(e){let c=new Map;return{open(f){let l=(x)=>Y(f,e.claim.operation_id,x),C;try{C=at(f)}catch{return l("binding_invalid")}let{binding:w,deviceRelayUrl:z}=C,E=e.claim.owner;if(!E||w.organizationId!==E.organization_id||w.userId!==E.user_id||w.deviceId!==E.device_id||w.rootId!==e.claim.root_id||w.jobId!==e.claim.operation_id||w.fenceId!==e.claim.operation_id||w.generation!==de||w.expiresAtMs>Math.min(Date.now()+p.lifetimeMs+Te,e.expiresAtMs))return l("binding_mismatch");if(w.expiresAtMs<=Date.now())return l("binding_expired");if(c.get(w.port)?.abort(),c.delete(w.port),c.size>=Me)return l("preview_capacity");let L=new AbortController;c.set(w.port,L);let P=we({binding:w,deniedPorts:e.deniedPorts,readCurrentJob:async()=>{if(L.signal.aborted)return null;let x=await e.inspect();return x?{binding:w,executorLaunchId:e.executorLaunchId,job:x}:null}});_e({binding:w,deviceRelayUrl:z,port:P,signal:L.signal}).then((x)=>x.closed,(x)=>{let I=x instanceof Error?x.message:"preview_failed";if(I!=="preview_not_authorized")process.stderr.write(`${JSON.stringify({event:"worker_preview.open_failed",job_id:w.jobId,port:w.port,reason_code:I})}
|
|
3
|
+
`)}).finally(()=>{if(c.get(w.port)===L)c.delete(w.port)})},dispose(){for(let f of c.values())f.abort();c.clear()}}}class nt extends r{observation;constructor(e){super("process_authority_lost","Process authority was lost; the owned process group has stopped.");this.observation=e}}var fe=256,B=new Map,he="preview.serve.v1",V=new Map;function be(e){let c=V.get(e.operation_id);if(c){if(c.claim!==e)throw M("process_authority_lost");return c}if(V.size>=fe)throw M("process_journal_capacity");let f={claim:e,executing:!1,cancelRequested:!1,phase:"pending"};return V.set(e.operation_id,f),f}function pe(e){return{version:1,process_id:e,state:"cancelled_before_start",exit_code:null,output:[],first_cursor:0,next_cursor:0,truncated:!1,cancellation_requested:!1,reason_code:"cancelled_before_start"}}var ue=(e)=>new Promise((c)=>setTimeout(c,e)),M=(e="process_outcome_uncertain")=>new r(e,"The managed process outcome could not be confirmed; inspect its saved receipt before starting another intent.");function ze(e=a(),c=Ge()){let f=Ue(Nr({},e)),l=qe(tr(e),f),[C,...w]=l.split(Je);return{directory:j(c,l,"processes"),previous:[j(f,"processes"),...C==="reason"?[j(c,"ara",...w,"processes")]:[]]}}function Ge(){if(process.platform!=="darwin")throw new r("process_unavailable","Managed Mac process execution is unavailable.");let e=Io();if(!e)throw new r("process_unavailable","The private per-user process directory is unavailable.");return e}async function ur(e){if(!e.claim.owner||e.signal.aborted||e.expiresAtMs<=Date.now())throw M("process_authority_lost");let c=be(e.claim);if(c.executing)throw M("process_busy");if(c.executing=!0,c.cancelRequested)return c.phase="settling",pe(e.claim.operation_id);c.phase="starting";let f=e.journals??ze();We(f.directory,{recursive:!0,mode:448});let l=pr({runtimeDirectory:G(f.directory),previousRuntimeDirectories:(f.previous??[]).filter((m)=>Z(m)).map((m)=>G(m)),root:e.root,runId:JSON.stringify([e.claim.owner,e.claim.run_id,e.claim.root_id,e.claim.operation_id]),maxScopes:fe});try{for(let m of[e.root,e.cwd])if(!je(G(m),l.journalDirectory))throw new r("process_journal_inside_workspace","The selected root contains the private process journal. Select an existing narrower granted workspace root outside the journal; no command was dispatched.")}catch(m){throw l.disposeSocket(),m}let C=me(l.journalDirectory),w=e.claim.capability===he,z=()=>B.set(e.claim.operation_id,{path:l.journalDirectory,ino:C.ino,dev:C.dev,anyCompletion:w}),E=l.launchDirectory,L=j(E,"config.json"),P={url:"",transport:"local_job_ipc",directShell:{mode:e.mode,executable:e.shell,jobId:e.claim.operation_id},workerVersion:D,protocolVersion:2,workerArtifactSha256:b,workerEntrypoint:R,targetGeneration:1,fenceId:Q(),...process.platform==="win32"?{bashExecutable:se()}:{},workRoot:e.root,workspaceAliasPath:e.root,repoPath:e.cwd,jobEnvPath:j(E,"unused.env"),replSocketPath:j(E,"unused.sock"),readyPath:j(E,"ready.json"),directTerminalReceiptPath:j(E,"terminal.json"),launchId:Q(),expiresAtMs:e.expiresAtMs+5000,bashTimeoutMs:60000,replTimeoutMs:1000,allowedTools:["bash"],managedJobs:{journalDirectory:l.journalDirectory,scopeId:l.scopeId},jobControlSocketPath:l.socketPath,...e.prefix?{bashCommandPrefix:e.prefix}:{},...e.jobsUser?{jobsUser:e.jobsUser}:{}},x;try{He(L,JSON.stringify(P),{mode:384});let m=gn({configPath:L,root:e.cwd,grantedRoot:e.root,workRoot:e.root,temporaryDirectory:E});x=e.spawnWorker?.(L,P)??Le(m.command,m.args,{...m.options,env:e.environment,stdio:[_n,"ignore","ignore"]})}catch(m){throw l.disposeSocket(),m}let I=!1,F=new Promise((m,S)=>{x.once("exit",(g)=>{I=!0,m(g)}),x.once("error",(g)=>{I=!0,S(g)})});F.catch(()=>{});let ge={root:e.root,runId:e.claim.run_id,scopeId:l.scopeId,socketPath:l.socketPath,generation:1,fenceId:P.fenceId,executorLaunchId:P.launchId,expiresAtMs:P.expiresAtMs},N=async(m)=>{let S=await hr(ge,{type:"job",version:2,generation:1,id:Q(),jobId:e.claim.operation_id,...m==="start"?{action:m,input:{script:e.command,leaseExpiresAtMs:e.expiresAtMs}}:m==="inspect"?{action:m,input:{after:0}}:m==="probe"?{action:"inspect",input:{after:Number.MAX_SAFE_INTEGER}}:{action:m,input:{}}},new AbortController().signal);if(!S.ok)throw M(S.error);return S.job},U=!1,q=!1,te,re=()=>{U=!0,ot(x,"SIGTERM")};e.signal.addEventListener("abort",re,{once:!0});let T,oe=0,ve=async(m)=>{let S=[...m.output],g={version:1,process_id:e.claim.operation_id,state:m.state,exit_code:m.exitCode,first_cursor:m.firstCursor,next_cursor:m.nextCursor,truncated:m.truncated,output:S,observed_at:new Date().toISOString()};while(Buffer.byteLength(JSON.stringify(g))>90000&&S.length)S.shift(),g.truncated=!0,g.first_cursor=S[0]?.cursor??g.next_cursor+1;T=J.parse(g),await e.emit(T),oe=Date.now()};try{let m=Math.min(Date.now()+1e4,e.expiresAtMs);while(!Z(P.readyPath)){if(I)throw new r("process_start_failed","The managed process supervisor exited before accepting a command; no command was dispatched.");if(e.signal.aborted||Date.now()>=m)throw M("process_start_unconfirmed");await ue(25)}let S=JSON.parse(Ne(P.readyPath,"utf8"));if(S.launchId!==P.launchId||S.fenceId!==P.fenceId||S.workerArtifactSha256!==b)throw M();if(e.signal.throwIfAborted(),c.cancelRequested)return pe(e.claim.operation_id);let g;try{q=!0,g=await N("start")}catch(O){if(!(O instanceof r)||O.code!=="hands_job_result_unknown")throw O;g=await N("inspect")}if(c.phase="running",c.cancel=async()=>{await N("cancel")},w&&e.preview)c.tunnels=le({claim:e.claim,executorLaunchId:P.launchId,expiresAtMs:e.expiresAtMs,deniedPorts:e.preview.deniedPorts,inspect:async()=>c.phase==="running"&&!I?await N("probe"):null});if(c.cancelRequested)await c.cancel(),g=await N("inspect");for(;;){if(!["starting","running"].includes(g.state))c.phase="settling",c.cancel=void 0;if(!T||T.state!==g.state||T.next_cursor!==g.nextCursor&&Date.now()-oe>=5000)await ve(g);if(!["starting","running"].includes(g.state))break;if(e.signal.aborted||I)throw M();await ue(1000);try{g=await N("inspect"),te=void 0}catch(O){if(!(O instanceof r)||O.code!=="hands_job_result_unknown"||e.signal.aborted||I||Date.now()-(te??=Date.now())>120000)throw O}}if(!T||T.state==="uncertain")throw M();return T}finally{if(c.phase="settling",c.cancel=void 0,c.tunnels?.dispose(),c.tunnels=void 0,await c.cancelInFlight?.catch(()=>{}),e.signal.removeEventListener("abort",re),!I&&!U)ot(x,"SIGTERM");let m,S=await Promise.race([F.then((g)=>({code:g})),new Promise((g)=>{m=setTimeout(()=>g(null),6000)})]).finally(()=>{clearTimeout(m)});if(!S){try{ot(x,"SIGKILL")}catch{}try{await F}finally{if(I)l.disposeSocket()}throw M("process_cleanup_unconfirmed")}try{if((U||e.signal.aborted)&&S.code===0&&q){v(E);let g=JSON.parse(h(P.directTerminalReceiptPath)),O=X.safeParse(g.observation);if(Object.keys(g).length===4&&g.launch_id===P.launchId&&g.fence_id===P.fenceId&&g.scope_id===l.scopeId&&O.success&&O.data.process_id===e.claim.operation_id){if(w)z();throw new nt(O.data)}}}catch(g){if(g instanceof nt)throw g}finally{if(I)l.disposeSocket()}if(S.code!==0&&!U&&q)throw M("process_cleanup_unconfirmed");if(!U&&S.code===0&&(T&&["exited","cancelled","expired"].includes(T.state)||!q&&c.cancelRequested)||w&&S.code===0&&!q)z()}}async function Ts(e,c){if(c.kind===ce&&e.capability===he){let C=V.get(e.operation_id);if(C?.claim===e&&C.tunnels)C.tunnels.open(c.payload);else Y(c.payload,e.operation_id,"server_not_running");return!0}if(c.kind!==ne||!ae(e.capability)||!e.owner||c.payload.process_id!==e.operation_id)return!1;let f=V.get(e.operation_id);if(f&&f.claim!==e)return!1;let l=be(e);if(l.cancelRequested=!0,l.phase==="running"&&l.cancel)l.cancelInFlight??=l.cancel(),await l.cancelInFlight;return!0}function Rs(e,c){V.delete(e);let f=B.get(e);if(!f||c!=="succeeded"&&!f.anyCompletion)return B.delete(e),!1;try{let l=me(f.path);if(!l.isDirectory()||l.isSymbolicLink()||l.ino!==f.ino||l.dev!==f.dev||!A(l)||G(f.path)!==f.path||Z(j(f.path,"owner.lock")))return!1;return Ve(f.path,{recursive:!0}),B.delete(e),!0}catch{return!1}}
|
|
4
|
+
export{Bi,Fi,dn,ji,pn,Ui,nt,ur,Ts,Rs};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{_e,ye,we}from"./vm-hands-entry-lite-s4bharcb.js";import{Ne,Le,Me}from"./vm-hands-entry-lite-6c67a3jc.js";import{spawn as A}from"child_process";import{randomUUID as s}from"crypto";import{basename as C}from"path";import{fileURLToPath as E}from"url";function S(){let p=C(process.execPath).startsWith("bun");return{command:process.execPath,args:[...p?["--no-env-file",E(new URL("./worker-candidate-entry.ts",import.meta.url))]:[],"worker","__preview-probe"]}}async function ds(p,a,m=S()){if(a.aborted||!["darwin","linux","win32"].includes(process.platform)||process.platform==="win32"&&!ye())return!1;let n=new AbortController,o=()=>n.abort();a.addEventListener("abort",o,{once:!0});let y=setTimeout(o,5000),t=A(m.command,m.args,{cwd:p,...Le(),stdio:["pipe","pipe","ignore"],env:Ne()});Me(t);let l=!1,b=new Promise((e)=>t.once("close",()=>{l=!0,e()}));t.on("error",o);let f,w,k=new Promise((e)=>{f=e}),I=new Promise((e)=>{w=e}),v=new Promise((e)=>n.signal.addEventListener("abort",()=>e(null),{once:!0})),i="",g=0,P=!1;t.stdout.setEncoding("utf8"),t.stdout.on("data",(e)=>{if(g+=Buffer.byteLength(e),i+=e,g>512){o();return}while(i.includes(`
|
|
3
|
+
`)){let c=i.indexOf(`
|
|
4
|
+
`),d=i.slice(0,c);i=i.slice(c+1);try{if(!P){let r=JSON.parse(d);if(!r||Object.keys(r).length!==2||!Number.isInteger(r.port)||r.port<1024||r.port>65535||typeof r.token!=="string"||!/^[a-zA-Z0-9_-]{43}$/.test(r.token))throw Error("probe_receipt_invalid");P=!0,f({port:r.port,token:r.token})}else if(d==="ready")w(!0);else o()}catch{o()}}}),b.then(o);let h,u=!1;try{let e=await Promise.race([k,v]);if(!e||!t.pid||n.signal.aborted||a.aborted)return!1;let c=Date.now()+4500,d=s(),r={organizationId:s(),userId:s(),runId:s(),deviceId:s(),rootId:s(),attachmentRevision:0,grantRevision:1,jobId:"readiness",generation:1,fenceId:s(),port:e.port,expiresAtMs:c},L={binding:r,executorLaunchId:d,job:{jobId:r.jobId,state:"running",startedAtMs:Date.now(),finishedAtMs:null,leaseExpiresAtMs:c,exitCode:null,inputSequence:0,output:[],firstCursor:1,nextCursor:0,truncated:!1,process:{pid:t.pid,processGroupId:t.pid,executorLaunchId:d}}},x=we({binding:r,deniedPorts:new Set,readCurrentJob:async()=>!l&&!n.signal.aborted?L:null});h=await _e({binding:r,deviceRelayUrl:`ws://127.0.0.1:${e.port}/device/readiness/${e.token}`,port:x,signal:n.signal}),u=await Promise.race([I,v])===!0&&!n.signal.aborted&&!a.aborted}catch{u=!1}finally{if(clearTimeout(y),a.removeEventListener("abort",o),h?.close(),n.abort(),t.stdin.destroy(),!l)t.kill("SIGKILL");await b}return u&&l}
|
|
5
|
+
export{ds};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{C}from"./vm-hands-entry-lite-6c67a3jc.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFileSync as b}from"child_process";import{mkdirSync as y,readdirSync as h,readFileSync as D,rmSync as f,statSync as k,writeFileSync as w}from"fs";import{join as p,sep as S}from"path";import{setTimeout as x}from"timers/promises";var L=3000,u=null;function g(e){return p(e,"users")}function kt(e){if(u?.root===e.root)return;let t=g(e.root);y(t,{recursive:!0,mode:448}),w(p(t,String(process.pid)),"",{mode:384}),u=e}function da(){if(!u)return;f(p(g(u.root),String(process.pid)),{force:!0}),u=null}function m(e){try{return process.kill(e,0),!0}catch(t){return t instanceof Error&&"code"in t&&t.code==="EPERM"}}function _(){let e=process.getuid?.();if(process.platform==="linux")return h("/proc").flatMap((n)=>{if(!/^\d+$/.test(n))return[];try{if(k(`/proc/${n}`).uid!==e)return[];let s=D(`/proc/${n}/cmdline`).toString("utf8").split("\x00").join(" ").trim();return s?[{pid:Number(n),command:s}]:[]}catch{return[]}});if(process.platform==="win32")return b(C("powershell.exe"),["-NoLogo","-NoProfile","-NonInteractive","-Command",'Get-CimInstance Win32_Process | ForEach-Object { "$($_.ProcessId) $($_.CommandLine)" }'],{encoding:"utf8",maxBuffer:16777216,windowsHide:!0}).split(/\r?\n/).flatMap((s)=>{let c=/^(\d+) (.+)$/.exec(s.trim());return c?[{pid:Number(c[1]),command:c[2]}]:[]});return b("/bin/ps",["-axww","-o","pid=,uid=,command="],{encoding:"utf8",maxBuffer:16777216}).split(`
|
|
3
|
+
`).flatMap((n)=>{let s=/^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(n);return s&&Number(s[2])===e?[{pid:Number(s[1]),command:s[3]}]:[]})}async function pa(){let e=u;if(!e)return{released:"unused",stopped:0};let t=g(e.root);f(p(t,String(process.pid)),{force:!0}),u=null;let n=!1;for(let o of h(t)){let i=Number(o);if(Number.isSafeInteger(i)&&i>0&&m(i))n=!0;else f(p(t,o),{force:!0})}if(n)return{released:"shared",stopped:0};let s=_().filter((o)=>o.pid!==process.pid&&(o.command.includes(`${e.root}${S}`)||o.command.includes(`${e.automation}${S}`)||o.command.includes(e.extensionDir))),c=(o,i)=>{try{process.kill(o,i)}catch{}};for(let o of s)c(o.pid,"SIGTERM");for(let o=Date.now()+L;Date.now()<o&&s.some((i)=>m(i.pid));)await new Promise((i)=>setTimeout(i,100));for(let o of s)if(m(o.pid))c(o.pid,"SIGKILL");return{released:"stopped",stopped:s.length}}var P=20000,E=30000,M=100,a=new Map,l=null,d=[];function Ii(e){a.set(e,(a.get(e)??0)+1);let t=!1;return()=>{if(t)return;t=!0;let n=(a.get(e)??1)-1;if(n>0){a.set(e,n);return}if(a.delete(e),l?.run===e)l.idleUntil=0}}function N(){return new r("automation_desktop_busy","Another Session, or another agent of this Session, is using this worker's desktop. Retry after it finishes.")}function O(e,t){return l!==null&&l.run!==e&&(l.calls>0||t<l.idleUntil)}async function Di(e,t,n=Date.now){let s=Symbol(e);d.push(s);try{let i=n()+E;for(;;){if(!O(e,n())&&(l?.run===e||d[0]===s))break;if(n()>=i)throw N();await x(M,void 0,{signal:t}).catch(()=>t.throwIfAborted())}}finally{d.splice(d.indexOf(s),1)}if(l?.run!==e)l={run:e,calls:0,idleUntil:0};let c=l;c.calls+=1;let o=!1;return()=>{if(o)return;o=!0,c.calls-=1,c.idleUntil=n()+P}}
|
|
4
|
+
export{kt,da,pa,Ii,Di};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
export{
|
|
2
|
+
var n={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(n),E=new Set;function T(e,A){let N=e[A];if(N?.trim())return N;let _=e[n[A]];if(_?.trim())E.add(n[A]);return _}
|
|
3
|
+
export{T};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pt,g,ht}from"./vm-hands-entry-lite-aj139v8j.js";import{chmodSync as Q,existsSync as C,mkdirSync as Z,readlinkSync as S,readFileSync as b,renameSync as nn,unlinkSync as tn,writeFileSync as en}from"fs";import{homedir as u}from"os";import{basename as _,dirname as h,isAbsolute as p,join as o,normalize as A,relative as O,resolve as N}from"path";var c=3,P=1,D=2,x=1,T=1,L="Reason may read and write files and run commands in this signed-in OS account, subject to saved restrictions and operating system permissions.",M="Reason may later execute on this computer inside a Reason sandbox, limited to folders explicitly attached by the user.",F=[M,"Ara may later execute on this computer inside an Ara sandbox, limited to folders explicitly attached by the user."];function B(n){return typeof n==="string"&&F.includes(n)}var U=["future_device","updates_only","cli_only"];function f(n){return typeof n==="string"&&U.some((t)=>t===n)}function V(n=process.env,t=u()){return n.XDG_CONFIG_HOME?.trim()||o(t,".config")}function Wr(n=process.env,t=u()){let r=g({env:n}),e=V(n,t);return o(e,ht(e).state==="kept"?"ara":"reason",...r==="staging"?["staging"]:[],"installation.json")}function a(n){return typeof n==="string"&&n.trim().length>0}var K=/^[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 z(n){return typeof n==="string"&&K.test(n)}function l(n){return a(n)&&p(n)&&A(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 m(n){return n==="staging"?["reason-staging","ara-staging"]:["reason","ara"]}function qn(n){let t=n.owned_paths.filter((e)=>e.role==="launcher").map((e)=>e.path),[r]=m(n.channel);return t.find((e)=>_(e)===r)??t[0]??null}function I(n){let[t,r]=m(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,R])=>i.path===o(n.install_dir,s)&&i.target===o(n.install_dir,R))&&n.owned_paths?.some((s)=>s.role==="launcher"&&s.path===i.target))??!1}function d(n,t){try{return N(h(n),S(n))===t}catch{return!1}}function Vr(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 w(n,t){let r=O(n,t);return r.length>0&&!r.startsWith("..")&&!p(r)}function E(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 k(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!==x||!a(r.recorded_at))return!1;if(n==="future_device")return r.decision==="authorized"&&B(r.scope);return r.scope===null&&r.decision===(n==="updates_only"?"ask":"disabled")}function G(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n;if(t.schema_version!==P||!pt.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)=>w(t.install_dir,r.path))||!I(t)||!E(t.path_entry))return null;return{...t,schema_version:c,installation_id:null,background_mode:"cli_only",device_consent:null}}function j(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n;if(t.schema_version!==D||!v(t)||!f(t.background_mode)||!k(t.background_mode,t.device_consent))return null;return{...t,schema_version:c,installation_id:null}}function v(n){return pt.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)=>w(n.install_dir,t.path))&&I(n)&&E(n.path_entry)}function H(n){let t=G(n);if(t)return t;let r=j(n);if(r)return r;if(!n||typeof n!=="object"||Array.isArray(n))return null;let e=n;if(e.schema_version!==c||!z(e.installation_id)||!v(e)||!f(e.background_mode)||!k(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!==T||e.desktop_account_access.scope!==L||!a(e.desktop_account_access.recorded_at)||!Number.isFinite(Date.parse(e.desktop_account_access.recorded_at))))return null;return e}function Wn(n=Wr()){if(!C(n))return null;try{return H(JSON.parse(b(n,"utf8")))}catch{return null}}export{Wr,qn,Vr,Wn};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Gn,Ao,Jt}from"./vm-hands-entry-lite-jzz73e3f.js";import{Pn,Ve,ao,Tn,Rn,On,Pr,x}from"./vm-hands-entry-lite-4wpqs406.js";import{kt}from"./vm-hands-entry-lite-fbhqfzbq.js";import{Ir}from"./vm-hands-entry-lite-nzmkyezg.js";import{j}from"./vm-hands-entry-lite-pf5qtbj5.js";import{a}from"./vm-hands-entry-lite-jev771b3.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as z,spawn as H}from"child_process";import{randomBytes as Qe}from"crypto";import{chmodSync as _e,existsSync as I,lstatSync as De,mkdirSync as we,readFileSync as Re,rmSync as ee,writeFileSync as U}from"fs";import{connect as de}from"net";import{join as y}from"path";var P=32,w=76;var B="./desktop-wallpaper-0pjhgyfk.jpg";var O="./dock-browser-afp005mt.png";var F="./dock-files-rywdm96b.png";var k="./dock-terminal-s41cj1jp.png";var K=`# 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 ye(e){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>${P}</x><y>${P}</y></position>
|
|
67
|
+
<size><width>${e.width-P*2}</width><height>${e.height-P-w}</height></size>
|
|
68
|
+
</application>
|
|
69
|
+
</applications>
|
|
70
|
+
</openbox_config>`}var le=`# 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
|
+
`,ue=`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
|
+
`,Pe="/tmp/ara-dock-browser.png",Se=`[Desktop Entry]
|
|
104
|
+
Name=Chrome
|
|
105
|
+
Exec=chromium --no-sandbox %U
|
|
106
|
+
Icon=${Pe}
|
|
107
|
+
Type=Application
|
|
108
|
+
Categories=Network;WebBrowser;
|
|
109
|
+
`,Xe=`[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
|
+
`,fe=`[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 V={"wallpaper.jpg":B,"dock-browser.png":O,"dock-terminal.png":k,"dock-files.png":F},Te=K,he='set_wallpaper() { if command -v feh >/dev/null 2>&1; then feh --bg-fill "$1"; else python3 "$2" "$1"; fi; }';function v(e){let s=(i)=>i.replaceAll("DISPLAY=:99",`DISPLAY=${e.display}`).replaceAll("/tmp/ara-",`${e.root}/ara-`),p=new Set(e.absent??[]),n=le.split(`
|
|
122
|
+
`).filter((i)=>!(p.has("terminal")&&i.endsWith("/ara-terminal.desktop"))&&!(p.has("files")&&i.endsWith("/ara-files.desktop"))).join(`
|
|
123
|
+
`),t={"openbox/rc.xml":ye(e.screen),"tint2/tint2rc":s(n),"picom/picom.conf":ue,...p.has("terminal")?{}:{"ara-terminal.desktop":s(Xe)},...p.has("files")?{}:{"ara-files.desktop":s(fe)},"ara-chromium.desktop":s(Se).replace("chromium --no-sandbox %U",e.browserExec),"ara-set-root-wallpaper.py":Te},o=[...R.slice(0,3),he,'[ ! -f "$ROOT/ara-wallpaper.jpg" ] || set_wallpaper "$ROOT/ara-wallpaper.jpg" "$ROOT/ara-set-root-wallpaper.py" || true',...R.slice(3)];return{files:t,start:o}}var R=['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 Ae=43200000,_=":99",Ee=60000,D=15000,J={width:1280,height:800},Ne=/^[A-Za-z0-9._:-]{1,160}$/;function Le(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}var Je=["video","viewer","viewer_same_network","viewer_network"];function Ce(e,s=Date.now()){let p=["relay_url","session_id","expires_at"];if(!Le(e)||p.some((c)=>!(c in e))||Object.keys(e).some((c)=>!p.includes(c)&&!Je.includes(c)))throw new r("invalid_display_request","Reason desktop request is malformed.");let n="video"in e?Ao(e.video):void 0,t="viewer"in e?Gn(e.viewer):null;if(n===null)throw new r("invalid_display_request","Reason desktop video request is invalid.");let o=null;try{o=typeof e.relay_url==="string"?new URL(e.relay_url):null}catch{}if(!o||o.protocol!=="wss:"&&o.protocol!=="ws:"||o.username||o.password)throw new r("invalid_display_request","Reason desktop relay URL is invalid.");if(typeof e.session_id!=="string"||!Ne.test(e.session_id))throw new r("invalid_display_request","Reason desktop session identity is invalid.");let i=typeof e.expires_at==="string"?Date.parse(e.expires_at):Number.NaN;if(!Number.isFinite(i)||i<=s)throw new r("invalid_display_request","Reason desktop session has already expired.");return{relay_url:e.relay_url,session_id:e.session_id,expires_at:new Date(Math.min(i,s+Ae)).toISOString(),...n?{video:n}:{},...t?{viewer:t}:{},...n&&e.viewer_same_network===!0?{viewer_same_network:!0}:{}}}function $t(e=process.platform){return(e==="linux"||e==="darwin"||e==="win32")&&x()?.features.display===!0}async function Ls(){if(process.platform==="win32")return $t()&&await Pr();if(process.platform!=="darwin")return $t();return await Pr()}function G(e){we(e,{recursive:!0,mode:448});let s=De(e);if(!s.isDirectory()||s.isSymbolicLink()||process.getuid&&s.uid!==process.getuid())throw new r("display_unavailable","Reason desktop state directory is not private.");_e(e,448)}function Ue(e,s){let p=(t)=>{let o=Buffer.alloc(2);return o.writeUInt16BE(t.length),Buffer.concat([o,t])},n=Buffer.from([255,255]);return Buffer.concat([n,p(Buffer.alloc(0)),p(Buffer.from(e)),p(Buffer.from("MIT-MAGIC-COOKIE-1")),p(s)])}function f(e,s,p=2000){return new Promise((n)=>{let t=de(e),o="",i=(c)=>{t.destroy(),n(c)};t.setTimeout(p,()=>i(!1)),t.once("error",()=>i(!1)),t.once("close",()=>i(!1)),t.once("connect",()=>{if(!s)i(!0)}),t.on("data",(c)=>{if(o+=c.toString("latin1"),o.length>=4)i(o.startsWith("RFB "))})})}async function g(e,s){let p=Date.now()+s;while(Date.now()<p){if(await e())return!0;await new Promise((n)=>setTimeout(n,100))}return!1}function d(e,s,p){return new Promise((n)=>{let t=H(e,s,{detached:!0,stdio:"ignore",env:p});t.once("error",()=>n(-1)),t.once("exit",(o)=>n(o)),t.unref(),setTimeout(()=>n(null),D).unref()})}var C=null;function qe(e=a()){return C??=ge(e).finally(()=>{C=null}),C}async function ge(e){let s=x({home:e});if(!s?.xvfb||!s.x11vnc||!s.openbox)throw new r("display_unavailable","Run `reason desktop install` on this machine to enable its desktop.");kt({root:s.root,automation:s.automation,extensionDir:s.extensionDir});let p=y(s.root,"display");G(p);let n=await Me(e,p,s.x11vnc);if(n)return n;let t={display:_,xauthority:y(p,"Xauthority"),rfbSocket:y(p,"rfb.sock")},o=y(p,"pulse"),i=(async()=>{try{G(o)}catch{return null}return await ao(o,s.pulseaudio)})();G(y(p,"home"));let c=re(p,t,s.pulseaudio),T=async()=>({...t,sound:await i});if(await f({path:t.rfbSocket},!0))return pe(y(p,"theme"),R,c),await T();if(!I(t.xauthority))U(t.xauthority,Ue(_.slice(1),Qe(16)),{mode:384,flag:"wx"});let l=te(y(p,"theme"),t.display,J),S={path:`/tmp/.X11-unix/X${_.slice(1)}`};if(!await f(S,!1)){let u=`${J.width}x${J.height}`;if(s.xvnc)ee(t.rfbSocket,{force:!0}),d(s.xvnc,[t.display,"-geometry",u,"-depth","24","-nolisten","tcp","-auth",t.xauthority,"-rfbport","-1","-rfbunixpath",t.rfbSocket,"-SecurityTypes","None","-AlwaysShared","-desktop","Reason"],c);else d(s.xvfb,[t.display,"-screen","0",`${u}x24`,"-nolisten","tcp","-auth",t.xauthority],c);if(!await g(()=>f(S,!1),D)||s.xvnc&&!await g(()=>f({path:t.rfbSocket},!0),D))throw new r("display_unavailable","Reason could not start the virtual display.");d(s.openbox,["--config-file",l.openboxConfig],c)}if(await ne(l,c),!await se(s.x11vnc,t,p,"x11vnc.log",c))throw new r("display_unavailable","Reason could not start the desktop server.");return await T()}function re(e,s,p){let n={HOME:y(e,"home"),PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:s.display,XAUTHORITY:s.xauthority};if(p)n.PULSE_SERVER=Ve(Pn(y(e,"pulse")));return n}async function se(e,s,p,n,t){if(await f({path:s.rfbSocket},!0))return!0;ee(s.rfbSocket,{force:!0});let o=await d(e,["-display",s.display,"-auth",s.xauthority,"-rfbport","0","-rfbportv6","-1","-unixsock",s.rfbSocket,"-nopw","-forever","-shared","-noxdamage","-sb","0","-rfbversion","3.7","-quiet","-bg","-o",y(p,n)],t);if(o!==null&&o!==0)return!1;return await g(()=>f({path:s.rfbSocket},!0),D)}async function me(){let e=["DISPLAY","XAUTHORITY","WAYLAND_DISPLAY","XDG_SESSION_TYPE"],s=(p)=>Object.fromEntries(e.flatMap((n)=>p[n]?[[n,p[n]]]:[]));if(process.env.DISPLAY)return s(process.env);try{let p=await new Promise((n,t)=>z("systemctl",["--user","show-environment"],{encoding:"utf8",timeout:2000},(o,i)=>o?t(o):n(i)));return s(Object.fromEntries(p.split(`
|
|
124
|
+
`).flatMap((n)=>{let t=n.indexOf("=");return t>0?[[n.slice(0,t),n.slice(t+1)]]:[]})))}catch{return{}}}var Z=new Set;async function Me(e,s,p){let n=await me(),t=/^:(\d+)(?:\.\d+)?$/.exec(n.DISPLAY??"")?.[1];if(!t||`:${t}`===_||n.WAYLAND_DISPLAY||n.XDG_SESSION_TYPE==="wayland")return null;let o={display:`:${t}`,xauthority:n.XAUTHORITY??y(e,".Xauthority"),rfbSocket:y(s,`rfb-${t}.sock`)},i=`${o.display} ${o.xauthority}`;if(Z.has(i)||!await f({path:`/tmp/.X11-unix/X${t}`},!1))return null;let c={HOME:e,PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:o.display,XAUTHORITY:o.xauthority};if(await se(p,o,s,`x11vnc-${t}.log`,c))return{...o,sound:null};return Z.add(i),process.stderr.write(`Reason worker: your screen ${o.display} could not be served; using the virtual desktop
|
|
125
|
+
`),null}function te(e,s,p){let n=`chromium --no-first-run --no-default-browser-check${process.geteuid?.()===0?" --no-sandbox":""} %U`,t=[["terminal","xterm"],["files","pcmanfm"]].filter(([,i])=>!I(`/usr/bin/${i}`)).map(([i])=>i),o=v({root:e,display:s,screen:p,browserExec:n,absent:t});for(let i of["","openbox","tint2","picom"])G(y(e,i));for(let[i,c]of Object.entries(o.files))U(y(e,i),c,{mode:384});for(let[i,c]of Object.entries(V))U(y(e,`ara-${i}`),Re(c),{mode:384});return{root:e,openboxConfig:y(e,"openbox","rc.xml"),start:o.start}}function ne(e,s){return pe(e.root,[...e.start,"openbox --reconfigure >/dev/null 2>&1 || true"],s)}function pe(e,s,p){let n=[`ROOT=${JSON.stringify(e)}`,...s].join(`
|
|
126
|
+
`);return new Promise((t)=>{let o=H("/bin/sh",["-c",n],{stdio:"ignore",env:{...p,PATH:"/usr/bin:/bin"}}),i=setTimeout(()=>{o.kill(),t()},D);o.once("error",()=>{clearTimeout(i),t()}),o.once("exit",()=>{clearTimeout(i),t()})})}var We=2073600,je=320;function Be(e,s){let p=Math.min(1,Math.sqrt(We/(e.width*e.height))),n=(t,o)=>Math.min(Math.floor(o/8)*8,Math.max(je,Math.round(t*p/8)*8));return{width:n(e.width,s.width),height:n(e.height,s.height)}}function oe(e,s,p){return new Promise((n)=>z(e,s,{env:p,encoding:"utf8",timeout:5000},(t,o)=>n(t?null:o)))}function Oe(e){let s=/current (\d+) x (\d+), maximum (\d+) x (\d+)/.exec(e),p=e.split(`
|
|
127
|
+
`),n=p.findIndex((o)=>/^\S+ connected/.test(o));if(!s||n<0)return null;let t=[];for(let o of p.slice(n+1)){let i=/^\s+(\d+x\d+)\s/.exec(o);if(!i)break;t.push(i[1])}return{current:{width:Number(s[1]),height:Number(s[2])},maximum:{width:Number(s[3]),height:Number(s[4])},output:p[n].split(" ")[0],modes:t}}async function Fe(e,s,p){if(e.display!==_)return null;let n={PATH:"/usr/bin:/bin",DISPLAY:e.display,XAUTHORITY:e.xauthority},t=(T)=>oe("xrandr",T,n),o=Oe(await t(["--query"])??"");if(!o||o.maximum.width<=o.current.width&&o.maximum.height<=o.current.height)return null;let i=Be(s,o.maximum);if(i.width===o.current.width&&i.height===o.current.height)return{size:i,changed:!1};let c=`${i.width}x${i.height}`;if(!o.modes.includes(c)){if(await t(["--newmode",c,"60",...[i.width,i.width,i.width,i.width,i.height,i.height,i.height,i.height].map(String)]),await t(["--addmode",o.output,c])===null)return null}return p(),await t(["--output",o.output,"--mode",c])===null?null:{size:i,changed:!0}}async function ke(e,s){let p=x({home:a()});if(!p)return;let n=y(p.root,"display"),t=re(n,e,p.pulseaudio);await ne(te(y(n,"theme"),e.display,s),t);let o=s.width-P*2,i=s.height-P-w;await oe("xdotool",["search","--onlyvisible","--class","Chromium","windowsize","%@",String(o),String(i),"windowmove","%@",String(P),String(P)],{...t,PATH:"/usr/bin:/bin"})}var Y=Promise.resolve();function Ge(e,s,p=()=>{}){let n=Y.then(()=>Fe(e,s,p));return Y=n.then((t)=>t?.changed?ke(e,t.size):void 0).catch(()=>{}),n.then((t)=>t?.size??null,()=>null)}async function Bt(e,s={}){let p=s.now??Date.now,n=Ce(e.payload,p());if(e.signal.throwIfAborted(),!n.video)throw new r("display_video_required","Reason desktops stream as video now; this request came without it.");let t=s.platform??process.platform;if(t!=="linux"&&t!=="darwin"&&t!=="win32")throw new r("display_video_unsupported","This machine does not serve desktop video.");let o=n.video,i=(s.video?.desktop??(t==="darwin"?async()=>Tn:t==="win32"?async()=>Rn:qe))();return await Ke(e.signal,n,s,p,(c)=>On(c,{request:o,desktop:i,...n.viewer?{viewer:n.viewer}:{},viewerSameNetwork:n.viewer_same_network===!0},{resizeDesktop:Ge,...s.video}),(c)=>Jt({type:"error",code:c}))}function Ke(e,s,p,n,t,o){let i=n();return new Promise((c,T)=>{let l=null,S=!1,u=!1,m,A,h,M=!1,q=null,X=(b)=>{if(u)return;if(q)b=q;u=!0,clearTimeout(m),clearTimeout(A),e.removeEventListener("abort",N),h?.close();try{l?.close(1000,"display_session_over")}catch{}if("error"in b){T(b.error);return}c({reason:b.reason,...h?.summary(),duration_ms:Math.max(0,n()-i)})},E=()=>X({error:new r("display_relay_unavailable","Reason could not reach the desktop relay.")}),N=()=>{let b=e.reason;X({error:b instanceof r?b:new r("cancelled","Reason closed the desktop session.")})},W=()=>{if(!q||!l)return;let b=q.error;try{l.send(o(b instanceof r?b.code:"display_unavailable"))}catch{}X(q)};if(h=t({get done(){return u||q!==null},get open(){return S&&!u&&q===null},get bufferedAmount(){return l?.bufferedAmount??0},send(b){if(u||q||!S||!l)return;try{l.send(b)}catch{X({reason:"relay_closed"})}},end:(b)=>{if(u||q)return;if(!("error"in b)){X(b);return}if(q=b,M&&S)W()}}),u){h.close();return}if(e.aborted){N();return}e.addEventListener("abort",N,{once:!0}),m=setTimeout(()=>X({reason:"session_expired"}),Math.max(1,Date.parse(s.expires_at)-n())),A=setTimeout(()=>X({reason:"viewer_absent"}),p.viewerWaitMs??Ee);try{l=(p.connect??Ir)(s.relay_url,(p.loadProxy??j)()?.url)}catch{E();return}l.binaryType="arraybuffer",l.onopen=()=>{if(u||!l)return;S=!0,h?.opened()},l.onmessage=(b)=>{if(u)return;let Q=b.data,L=Q instanceof ArrayBuffer?new Uint8Array(Q):ArrayBuffer.isView(Q)?new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength):null;if(!L||L.byteLength===0)return;if(clearTimeout(A),M=!0,q){W();return}h?.received(L)},l.onclose=()=>{if(u)return;if(!S){E();return}X({reason:"relay_closed"})},l.onerror=()=>{if(u||S)return;E()}})}
|
|
128
|
+
export{$t,Ls,G,qe,Bt};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var l=Object.create;var{getPrototypeOf:m,defineProperty:h,getOwnPropertyNames:n}=Object;var k=Object.prototype.hasOwnProperty;function o(a){return this[a]}var p,q,Oi=(a,b,c)=>{var d=a!=null&&typeof a==="object";if(d){var i=b?p??=new WeakMap:q??=new WeakMap,j=i.get(a);if(j)return j}c=a!=null?l(m(a)):{};let f=b||!a||!a.__esModule||!k.call(a,"default")?h(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let g of n(a))if(!k.call(f,g))h(f,g,{get:o.bind(a,g),enumerable:!0})}if(d)i.set(a,f);return f};var he=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var r=(a)=>a;function s(a,b){this[a]=r.bind(null,b)}var os=(a,b)=>{for(var c in b)h(a,c,{get:b[c],enumerable:!0,configurable:!0,set:s.bind(b,c)})};var ss=(a,b,c)=>()=>{if(a)try{b=a(a=0)}catch(d){c=[d]}if(c)throw c[0];return b};var e=import.meta.require;
|
|
3
|
+
export{Oi,he,os,ss,e};
|