@reason-machines/cli-linux-arm64-musl 0.2.276 → 0.2.278
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ara +1 -1
- package/bin/vm-hands/connect-cli-qphdm1f1.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-92914wyp.js +2 -0
- package/bin/vm-hands/desktop-account-vsrtgkk9.js +2 -0
- package/bin/vm-hands/desktop-wallpaper-0pjhgyfk.jpg +0 -0
- package/bin/vm-hands/device-workspace-zk5xwd10.js +2 -0
- package/bin/vm-hands/dock-browser-afp005mt.png +0 -0
- package/bin/vm-hands/dock-files-rywdm96b.png +0 -0
- package/bin/vm-hands/dock-terminal-s41cj1jp.png +0 -0
- package/bin/vm-hands/hands-worker-source-da93x0qx.js +2 -0
- package/bin/vm-hands/index-w9nq2f0p.js +12818 -0
- package/bin/vm-hands/local-automation-tvf2dbfq.js +2 -0
- package/bin/vm-hands/local-capabilities-p579j21r.js +2 -0
- package/bin/vm-hands/local-desktop-users-3j79jbyp.js +2 -0
- package/bin/vm-hands/local-display-mac-j1v3mcgx.js +2 -0
- package/bin/vm-hands/local-display-session-jwdq3jb4.js +2 -0
- package/bin/vm-hands/network-contract-41qanjhp.js +2 -0
- package/bin/vm-hands/package-rx9y4bwe.js +2 -0
- package/bin/vm-hands/permissions-2s0qyrg0.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-51gs8j7v.js +2 -0
- package/bin/vm-hands/status-2d21kwsn.js +96 -0
- package/bin/vm-hands/version-1qgvgegp.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-1bvbhwbb.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-1hwdab4e.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-2xas56hm.js +43 -0
- package/bin/vm-hands/vm-hands-entry-lite-51hcyapr.js +529 -0
- package/bin/vm-hands/vm-hands-entry-lite-5pxbx31d.js +179 -0
- package/bin/vm-hands/vm-hands-entry-lite-65pbrs1x.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-7gh1rbn7.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-84aq8d12.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-8wyfep1z.js +343 -0
- package/bin/vm-hands/vm-hands-entry-lite-9pmag2qk.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-anaydk9m.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-bfwf82rw.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-bwt3y6wz.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-c2nrar90.js +4046 -0
- package/bin/vm-hands/vm-hands-entry-lite-ffg7rf02.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-fraghb8k.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-gqncr2j0.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-htn1genx.js +459 -0
- package/bin/vm-hands/vm-hands-entry-lite-jwqqfjba.js +759 -0
- package/bin/vm-hands/vm-hands-entry-lite-k4c504n7.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-n07kxrd1.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-ptmqg51y.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-qvrnx0vk.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-s2xydt0n.js +112 -0
- package/bin/vm-hands/vm-hands-entry-lite-s5qn1k80.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-sv6xwe0h.js +66 -0
- package/bin/vm-hands/vm-hands-entry-lite-y4sjgfqz.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -0
- package/bin/vm-hands/vm-hands-executor-v2qjnrb5.js +9 -0
- package/bin/vm-hands/vm-hands-op-runner-ej1c20a6.js +2 -0
- package/bin/vm-hands/vm-hands-runtime-yyy4ad4z.js +4 -0
- package/bin/vm-hands/worker-sandbox-nnce49w0.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ac as a,Bc as b,Cc as c,Dc as d,Ec as e,Fc as f,Gc as g,Hc as h,Ic as i,Jc as j,Kc as k,Lc as l}from"./vm-hands-entry-lite-jwqqfjba.js";import"./vm-hands-entry-lite-gqncr2j0.js";import"./vm-hands-entry-lite-sv6xwe0h.js";import"./vm-hands-entry-lite-5pxbx31d.js";import"./vm-hands-entry-lite-bfwf82rw.js";import"./vm-hands-entry-lite-ptmqg51y.js";import"./vm-hands-entry-lite-2xas56hm.js";import"./vm-hands-entry-lite-s2xydt0n.js";import"./vm-hands-entry-lite-s5qn1k80.js";import"./vm-hands-entry-lite-9pmag2qk.js";import"./vm-hands-entry-lite-84aq8d12.js";import"./vm-hands-entry-lite-y4sjgfqz.js";import"./vm-hands-entry-lite-1bvbhwbb.js";import"./vm-hands-entry-lite-anaydk9m.js";import"./vm-hands-entry-lite-ffg7rf02.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{d as runRelayed,e as runMacComputerUse,l as runLocalAutomation,k as runAutomationCallLocally,b as parseAutomationPayload,g as localUserChromeProfiles,h as localUserChromeInstance,f as localUserChromeHost,j as localBrowserProfile,c as localAutomationAvailable,i as ensureLocalBrowser,a as AUTOMATION_CHUNK_BYTES};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as o,P as c,Q as d,R as e,S as f,T as g,U as h,V as i,W as j,X as k,Y as l,Z as m,_ as n,aa as p,ba as q,ca as r,da as s,ea as t,fa as u}from"./vm-hands-entry-lite-51hcyapr.js";import"./vm-hands-entry-lite-htn1genx.js";import"./vm-hands-entry-lite-c2nrar90.js";import"./vm-hands-entry-lite-65pbrs1x.js";import"./vm-hands-entry-lite-qvrnx0vk.js";import{Zb as b}from"./vm-hands-entry-lite-n07kxrd1.js";import"./vm-hands-entry-lite-1hwdab4e.js";import"./vm-hands-entry-lite-jwqqfjba.js";import"./vm-hands-entry-lite-gqncr2j0.js";import"./vm-hands-entry-lite-sv6xwe0h.js";import"./vm-hands-entry-lite-5pxbx31d.js";import"./vm-hands-entry-lite-bfwf82rw.js";import"./vm-hands-entry-lite-ptmqg51y.js";import"./vm-hands-entry-lite-2xas56hm.js";import"./vm-hands-entry-lite-s2xydt0n.js";import"./vm-hands-entry-lite-s5qn1k80.js";import"./vm-hands-entry-lite-9pmag2qk.js";import"./vm-hands-entry-lite-84aq8d12.js";import"./vm-hands-entry-lite-y4sjgfqz.js";import"./vm-hands-entry-lite-1bvbhwbb.js";import"./vm-hands-entry-lite-anaydk9m.js";import{Gh as a}from"./vm-hands-entry-lite-ffg7rf02.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{g as spawnCaptured,f as sandboxProfile,e as safeEnvironment,k as runTransferCapability,i as runFileCapability,t as rebindLocalHandsControl,j as localGithubPreviewServerLaunch,b as isProtectedLocalPath,u as executeLocalOperation,m as enrolledWorkspaceRootFingerprint,q as enrolledRootPaths,p as enrolledHomeContainedRootFingerprints,n as enrolledAccountRootPath,o as enrolledAccountRootFingerprint,s as deliverLocalHandsEnvironment,h as defaultLocalCommandRunner,d as confinedExecutionShell,r as capabilityInventoryForRoots,c as SHORT_REQUEST_CAPABILITIES,a as LocalCapabilityError,l as LOCAL_CAPABILITY_REGISTRY};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ah as b,Bh as c,Ch as d,Dh as e,Eh as f,Fh as g,zh as a}from"./vm-hands-entry-lite-anaydk9m.js";import"./vm-hands-entry-lite-ffg7rf02.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{f as trackDesktopRun,c as releaseLocalDesktop,a as noteLocalDesktopUse,g as holdLocalDesktop,b as forgetLocalDesktopUse,e as DESKTOP_WAIT_MS,d as DESKTOP_IDLE_MS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Lg as a,Mg as b,Ng as c,Og as d,Pg as e,Qg as f,Rg as g}from"./vm-hands-entry-lite-s2xydt0n.js";import"./vm-hands-entry-lite-ffg7rf02.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{c as requestMacScreenAccess,d as parseMacWindowBounds,a as parseMacScreenStatus,e as openMacWindowBounds,g as openMacInput,b as macScreenStatus,f as MacInputTranslator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{re as a,se as b,te as c,ue as d,ve as e,we as f,xe as g,ye as h}from"./vm-hands-entry-lite-5pxbx31d.js";import"./vm-hands-entry-lite-bfwf82rw.js";import"./vm-hands-entry-lite-ptmqg51y.js";import"./vm-hands-entry-lite-2xas56hm.js";import"./vm-hands-entry-lite-s2xydt0n.js";import"./vm-hands-entry-lite-s5qn1k80.js";import"./vm-hands-entry-lite-9pmag2qk.js";import"./vm-hands-entry-lite-84aq8d12.js";import"./vm-hands-entry-lite-y4sjgfqz.js";import"./vm-hands-entry-lite-1bvbhwbb.js";import"./vm-hands-entry-lite-anaydk9m.js";import"./vm-hands-entry-lite-ffg7rf02.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{h as runLocalDisplayStream,f as privateDirectory,c as parseDisplayStreamPayload,e as localDisplayReady,d as localDisplayAvailable,g as ensureLinuxDesktop,a as LOCAL_DISPLAY_MAX_SESSION_MS,b as LINUX_WORKER_DISPLAY};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$c as h,Ad as I,Bd as J,Cd as K,Dd as L,Ed as M,Fd as N,Gd as O,Hd as P,Id as Q,Jd as R,Kd as S,Ld as T,Md as U,Nd as V,Od as W,Pd as X,Qd as Y,Rd as Z,Sd as _,Td as $,Uc as a,Ud as aa,Vc as b,Vd as ba,Wc as c,Wd as ca,Xc as d,Xd as da,Yc as e,Yd as ea,Zc as f,Zd as fa,_c as g,ad as i,bd as j,cd as k,dd as l,ed as m,fd as n,gd as o,hd as p,id as q,jd as r,kd as s,ld as t,md as u,nd as v,od as w,pd as x,qd as y,rd as z,sd as A,td as B,ud as C,vd as D,wd as E,xd as F,yd as G,zd as H}from"./vm-hands-entry-lite-gqncr2j0.js";import"./vm-hands-entry-lite-sv6xwe0h.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{Y as parseLocalRuntimeRootsSyncResponse,U as parseLocalRuntimeRegistrationResponse,T as parseLocalRuntimeProofChallenge,ca as parseLocalRuntimeOperationHeartbeatResponse,da as parseLocalRuntimeOperationEventsResponse,ea as parseLocalRuntimeOperationEnvironmentResponse,fa as parseLocalRuntimeOperationCompletionResponse,ba as parseLocalRuntimeOperationClaim,$ as parseLocalRuntimeLocalSubscriptionResponse,aa as parseLocalRuntimeLifecycleResponse,Z as parseLocalRuntimeIdentityResponse,W as parseLocalRuntimeHeartbeatResponse,X as parseLocalRuntimeFirstHeartbeat,S as parseLocalRuntimeErrorEnvelope,V as parseLocalRuntimeEnrollmentResponse,_ as parseLocalRuntimeDisconnectResponse,j as localRuntimeSessionRoutable,R as buildLocalRuntimeDeviceProofBytes,I as WORKER_PREVIEW_CARRIED_JOBS,e as RELAY_HOST_ALIAS_VERSION,d as RELAY_HOST_ALIAS_HEADER,N as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,k as LOCAL_RUNTIME_SESSION_VM_HANDS_REGISTER,h as LOCAL_RUNTIME_SESSION_PRE_AUTH_MAX_BYTES,g as LOCAL_RUNTIME_SESSION_PATH,m as LOCAL_RUNTIME_SESSION_CLOSE,l as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,i as LOCAL_RUNTIME_SESSION_AUTH_DEADLINE_MS,b as LOCAL_RUNTIME_ROUTE_PREFIX,f as LOCAL_RUNTIME_ROUTES,a as LOCAL_RUNTIME_PROTOCOL_VERSION,O as LOCAL_RUNTIME_LIFECYCLE_EVENTS,Q as LOCAL_RUNTIME_LEGACY_DEVICE_PROOF_TAG,P as LOCAL_RUNTIME_DEVICE_PROOF_TAG,c as LOCAL_OPERATION_MAX_BYTES,K as JOBS_START_WAIT_KEY,J as JOBS_START_WAIT,H as HANDS_SESSION_GROUP_KEY,G as HANDS_SESSION_GROUP,s as HANDS_REBIND_KEY,t as HANDS_REBIND_CONTROL,r as HANDS_REBIND,D as HANDS_MODEL_JOBS_EGRESS_KEY,C as HANDS_MODEL_JOBS_EGRESS,z as HANDS_LARGE_ENVIRONMENT_KEY,y as HANDS_LARGE_ENVIRONMENT,F as HANDS_JOBS_USER_KEY,E as HANDS_JOBS_USER,x as HANDS_HEADLESS_BROWSER_KEY,w as HANDS_HEADLESS_BROWSER,o as HANDS_ENVIRONMENT_DELIVER_CONTROL,n as HANDS_ENVIRONMENT_DELIVERY,q as HANDS_ENVIRONMENT_AT_CLAIM_KEY,p as HANDS_ENVIRONMENT_AT_CLAIM,B as HANDS_CONFINEMENT_KEY,A as HANDS_CONFINEMENT,v as HANDS_CLOUD_ACCESS_KEY,u as HANDS_CLOUD_ACCESS,L as AUTOMATION_USER_CHROME,M as AUTOMATION_CLOUD_SESSIONS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{og as a,pg as b,qg as c,rg as d,sg as e,tg as f,ug as g,vg as h,wg as i,xg as j}from"./vm-hands-entry-lite-2xas56hm.js";import"./vm-hands-entry-lite-s2xydt0n.js";import"./vm-hands-entry-lite-9pmag2qk.js";import"./vm-hands-entry-lite-84aq8d12.js";import"./vm-hands-entry-lite-y4sjgfqz.js";import"./vm-hands-entry-lite-1bvbhwbb.js";import"./vm-hands-entry-lite-ffg7rf02.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{j as runPermissionsCli,d as reasonIdentity,e as readMacPermissions,f as permissionsSummary,i as parsePermissionsArgs,c as fullDiskAccessTarget,g as formatMacPermissions,h as allowMacPermissions,a as PERMISSIONS_HELP,b as MAC_PERMISSION_IDS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$f as U,Af as t,Bf as u,Cf as v,Df as w,Ef as x,Ff as y,Gf as z,Hf as A,If as B,Jf as C,Kf as D,Lf as E,Mf as F,Nf as G,Of as H,Pf as I,Qf as J,Rf as K,Sf as L,Tf as M,Uf as N,Vf as O,Wf as P,Xf as Q,Yf as R,Zf as S,_f as T,ag as V,bg as W,cg as X,dg as Y,hf as a,if as b,jf as c,kf as d,lf as e,mf as f,nf as g,of as h,pf as i,qf as j,rf as k,sf as l,tf as m,uf as n,vf as o,wf as p,xf as q,yf as r,zf as s}from"./vm-hands-entry-lite-ptmqg51y.js";import"./vm-hands-entry-lite-84aq8d12.js";import"./vm-hands-entry-lite-7gh1rbn7.js";export{w as reasonHandsCloseReason,X as parseReasonHandsSdkResponse,W as parseReasonHandsSdkRequest,I as parseReasonHandsResult,H as parseReasonHandsRequest,O as parseReasonHandsPtyReceipt,J as parseReasonHandsProgress,N as parseReasonHandsJobResult,M as parseReasonHandsJobRequest,L as parseReasonHandsClaimAck,K as parseReasonHandsClaim,P as parseReasonHandsCancelRequest,Q as parseReasonHandsCancelAck,E as isReasonHandsUuid,C as isReasonHandsRequestId,F as isReasonHandsPtyJobId,D as isReasonHandsGeneration,G as isReasonHandsArtifactSha256,Y as encodeReasonHandsSdkResponse,S as encodeReasonHandsResult,R as encodeReasonHandsRequest,T as encodeReasonHandsProgress,V as encodeReasonHandsClaimAck,U as encodeReasonHandsClaim,z as REASON_HANDS_SDK_MAX_QUERY_CHARS,y as REASON_HANDS_SDK_MAX_NAME_CHARS,n as REASON_HANDS_PTY_PROTOCOL_VERSION,q as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,p as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,o as REASON_HANDS_PTY_MAX_INPUT_BYTES,r as REASON_HANDS_PTY_MAX_DIMENSION,s as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,u as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,t as REASON_HANDS_PTY_ANCHOR_EXIT_MS,a as REASON_HANDS_PROTOCOL_VERSION,f as REASON_HANDS_OUTPUT_TRUNCATED_MARKER,d as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,e as REASON_HANDS_MAX_OUTPUT_CHARS,c as REASON_HANDS_MAX_INPUT_CHARS,b as REASON_HANDS_MAX_FRAME_BYTES,g as REASON_HANDS_MAX_ERROR_CHARS,h as REASON_HANDS_JOB_PROTOCOL_VERSION,l as REASON_HANDS_JOB_MAX_RECORDS,k as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,j as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,i as REASON_HANDS_JOB_MAX_INPUT_CHARS,A as REASON_HANDS_JOB_ERRORS,m as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,x as REASON_HANDS_ERROR_CODES,v as REASON_HANDS_CLOSE_CODES,B as HandsProtocolError};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{a as Yq,b as Zq,c as $q,d as Gq,e as Wq,f as Bq,i as bq,j as Fq,o as kq}from"./vm-hands-entry-lite-8wyfep1z.js";import"./vm-hands-entry-lite-k4c504n7.js";import"./vm-hands-entry-lite-51hcyapr.js";import"./vm-hands-entry-lite-htn1genx.js";import"./vm-hands-entry-lite-c2nrar90.js";import"./vm-hands-entry-lite-65pbrs1x.js";import"./vm-hands-entry-lite-qvrnx0vk.js";import"./vm-hands-entry-lite-n07kxrd1.js";import"./vm-hands-entry-lite-1hwdab4e.js";import{lc as Qq}from"./vm-hands-entry-lite-jwqqfjba.js";import"./vm-hands-entry-lite-gqncr2j0.js";import{_d as G}from"./vm-hands-entry-lite-sv6xwe0h.js";import"./vm-hands-entry-lite-5pxbx31d.js";import{$e as Xq,Ce as A,De as C,Ee as o}from"./vm-hands-entry-lite-bfwf82rw.js";import"./vm-hands-entry-lite-ptmqg51y.js";import"./vm-hands-entry-lite-2xas56hm.js";import"./vm-hands-entry-lite-s2xydt0n.js";import"./vm-hands-entry-lite-s5qn1k80.js";import{Xg as g}from"./vm-hands-entry-lite-9pmag2qk.js";import"./vm-hands-entry-lite-84aq8d12.js";import{uh as I}from"./vm-hands-entry-lite-y4sjgfqz.js";import"./vm-hands-entry-lite-1bvbhwbb.js";import"./vm-hands-entry-lite-anaydk9m.js";import"./vm-hands-entry-lite-ffg7rf02.js";import{Kh as xq}from"./vm-hands-entry-lite-7gh1rbn7.js";import{createHash as uq,randomBytes as lq}from"crypto";import{readFileSync as oq,realpathSync as jq,renameSync as cq,unlinkSync as iq,writeFileSync as tq}from"fs";import{dirname as rq,join as Dq}from"path";import{spawnSync as Iq}from"child_process";import{accessSync as Oq,constants as Tq,existsSync as _,mkdirSync as Uq,readFileSync as vq,renameSync as Mq,writeFileSync as Eq}from"fs";import{homedir as _q}from"os";import{delimiter as wq,dirname as Lq,join as v}from"path";import{existsSync as Pq,readFileSync as yq}from"fs";import{join as Rq}from"path";var Nq=`---
|
|
3
|
+
name: reason
|
|
4
|
+
description: Integrate software with Reason's public REST API using a scoped API key. Use for API clients, CI, service integrations, or cloud coding-session automation.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Reason API
|
|
8
|
+
|
|
9
|
+
Reason integrations use the public REST API. Public customer MCP is retired.
|
|
10
|
+
|
|
11
|
+
Base URL: \`https://api.reasonmachines.com/v3\`
|
|
12
|
+
|
|
13
|
+
- API quickstart: \`https://docs.reasonmachines.com/api-quickstart\`
|
|
14
|
+
- Endpoint reference: \`https://docs.reasonmachines.com/api-reference\`
|
|
15
|
+
|
|
16
|
+
## Authentication and scope
|
|
17
|
+
|
|
18
|
+
1. Create a least-privilege \`ara_\` key in Reason Settings \u2192 Developers (the Code
|
|
19
|
+
/ API keys picker) and keep it only in the calling service or CI secret
|
|
20
|
+
manager. Never
|
|
21
|
+
put it in source, prompts, logs, generated files, or a repository
|
|
22
|
+
environment file. A new key from that picker includes the ordinary public
|
|
23
|
+
scopes for session, skill, repo, and org reads.
|
|
24
|
+
2. Send it as \`Authorization: Bearer <api-key>\`. Call \`GET /v3/self\` first
|
|
25
|
+
to resolve the key's organization before reading or mutating resources.
|
|
26
|
+
3. Request only the scopes needed by the integration. Treat secret values as
|
|
27
|
+
write-only and never expose them in API responses or diagnostics.
|
|
28
|
+
4. Use the endpoint reference as the source of truth for request/response
|
|
29
|
+
shapes, pagination, and error handling. Do not recreate an old MCP client,
|
|
30
|
+
route, OAuth flow, or plugin configuration. Do not connect to the retired
|
|
31
|
+
public MCP transport.
|
|
32
|
+
|
|
33
|
+
## Session automation
|
|
34
|
+
|
|
35
|
+
- Create and monitor sessions through the documented \`/v3/organizations/:orgId/
|
|
36
|
+
sessions\` endpoints. Return the session URL or identifier to the caller, then
|
|
37
|
+
poll or stream only as the API reference specifies.
|
|
38
|
+
- Omit \`hands_mode\` for adaptive lazy Hands, or set it to \`brain_only\` when
|
|
39
|
+
physical execution must remain permanently disabled for that Conversation.
|
|
40
|
+
- Keep API work idempotent where the endpoint supports it, and surface failed
|
|
41
|
+
mutations rather than retrying destructive operations blindly.
|
|
42
|
+
- Scope every request to the intended organization and repository. Do not infer
|
|
43
|
+
authority from a repository name or an untrusted task payload.
|
|
44
|
+
`;function f(q){return Rq(q,".agents","skills","ara","SKILL.md")}function d(q){let J=f(q);return Pq(J)&&yq(J,"utf8")===Nq}var S=["codex","claude","cursor"],u={codex:"Codex",claude:"Claude Code",cursor:"Cursor"};function fq(q,J=process.env){let x=J.PATH??"";for(let Y of x.split(wq)){if(!Y)continue;try{return Oq(v(Y,q),Tq.X_OK),!0}catch{}}return!1}function Sq(){return{exists:fq,run(q,J,x={}){let Y=x.interactive===!0,X=Iq(q,J,{encoding:"utf8",env:process.env,stdio:Y?"inherit":"pipe"});return{status:X.status??1,stdout:Y?"":X.stdout??"",stderr:Y?X.error?.message??"":`${X.stderr??""}${X.error?`${X.error.message}
|
|
45
|
+
`:""}`}}}}function U(q){return`${q.stdout}
|
|
46
|
+
${q.stderr}`}function D(q){return q.status===0}function T(q,J,x,Y={}){let X=q.run(J,x,Y);if(D(X))return X;let $=U(X).trim();throw Error(`${J} ${x.join(" ")} failed${$?`: ${$}`:` with exit code ${X.status}`}`)}function hq(q=process.env){return o(A({env:q}))}function h(q,J){return q.split(/\s+/).some((x)=>c(x,J))}function E(q){return v(q,".cursor","mcp.json")}function l(q){if(!_(q))return{};try{let J=JSON.parse(vq(q,"utf8"));if(!J||typeof J!=="object"||Array.isArray(J))throw Error("top-level value must be an object");return J}catch(J){let x=J instanceof Error?J.message:String(J);throw Error(`Cursor MCP config at ${q} is invalid; refusing to overwrite it (${x})`)}}function Cq(q,J){Uq(Lq(q),{recursive:!0,mode:448});let x=`${q}.ara-${process.pid}.tmp`;Eq(x,`${JSON.stringify(J,null,2)}
|
|
47
|
+
`,{mode:384}),Mq(x,q)}function c(q,J){if(typeof q!=="string")return!1;if(q===J)return!0;try{let x=new URL(q);return["https://api.ara.so","https://api-staging.ara.so","https://api.reasonmachines.ai","https://staging-api.reasonmachines.ai","https://api.reasonmachines.com","https://staging-api.reasonmachines.com"].includes(x.origin)&&!x.username&&!x.password&&x.pathname==="/mcp/ara"&&!x.search&&!x.hash}catch{return!1}}function gq(q,J){let x=q.mcpServers?.ara;return Boolean(x&&typeof x==="object"&&!Array.isArray(x)&&c(x.url,J))}class w{runner;home;mcpUrl;constructor(q=Sq(),J=_q(),x=hq()){this.runner=q;this.home=J;this.mcpUrl=x}isAvailable(q){if(q==="codex")return this.runner.exists("codex");if(q==="claude")return this.runner.exists("claude");return this.runner.exists("cursor")||_("/Applications/Cursor.app")||_(v(this.home,"Applications","Cursor.app"))||_(E(this.home))}availableClients(){return S.filter((q)=>this.isAvailable(q))}installationPath(q){if(q==="cursor")return E(this.home);if(q==="codex")return v(this.home,".codex","plugins","cache","ara");return v(this.home,".claude","plugins","cache","ara")}sharedSkillStatus(){return{installed:d(this.home),path:f(this.home)}}status(q){let J=u[q];if(!this.isAvailable(q))return{id:q,label:J,available:!1,installed:!1,connection:null,detail:"Client not detected",legacyInstallations:[]};if(q==="cursor"){let F=E(this.home),P=gq(l(F),this.mcpUrl);return{id:q,label:J,available:!0,installed:P,connection:P?"configured":null,detail:P?`Retired Reason MCP configuration in ${F}`:`No retired Reason MCP configuration in ${F}`,legacyInstallations:[]}}if(q==="codex"){let F=this.runner.run("codex",["plugin","list"]);if(!(D(F)&&U(F).includes("ara@ara")))return{id:q,label:J,available:!0,installed:!1,connection:null,detail:"No retired Reason plugin installed",legacyInstallations:[]};let V=this.runner.run("codex",["mcp","list"]),k=U(V).split(/\r?\n/).find((y)=>y.trimStart().startsWith("ara ")&&h(y,this.mcpUrl)),j=D(V)&&Boolean(k),W=!D(V)?"error":k?.includes("Not logged in")?"not_logged_in":k?.includes("OAuth")?"oauth":k?"configured":"unknown";return{id:q,label:J,available:!0,installed:j,connection:W,detail:k?.trim()||"The retired Reason plugin is installed but has no verified retired MCP registration",legacyInstallations:[]}}let x=this.runner.run("claude",["plugin","list"]),Y=U(x),X=D(x)&&Y.includes("ara@ara"),$=D(x)&&Y.includes("ara-handoff@ara");if(!X&&!$)return{id:q,label:J,available:!0,installed:!1,connection:null,detail:"No retired Reason plugin installed",legacyInstallations:[]};let Q=this.runner.run("claude",["mcp","list"]),K=U(Q),B=K.split(/\r?\n/).find((F)=>F.includes("plugin:ara:ara")&&h(F,this.mcpUrl)),H=K.split(/\r?\n/).find((F)=>F.includes("plugin:ara-handoff:ara")&&h(F,this.mcpUrl)),z=D(Q)&&Boolean(B),M=D(Q)&&H?["ara-handoff@ara"]:[],b=!D(Q)?"error":B?.includes("Connected")?"connected":B?.includes("Failed")?"error":B?"configured":"unknown";return{id:q,label:J,available:!0,installed:z,connection:b,detail:B?.trim()||"The retired Reason plugin is installed but has no verified retired MCP registration",legacyInstallations:M}}statuses(){return S.map((q)=>this.status(q))}logout(q){let J=this.status(q);if(!J.available||!J.installed)return`${J.label}: not connected`;if(q==="cursor")return this.uninstall("cursor").replace("removed retired Reason","signed out and removed retired Reason");if(q==="codex")return T(this.runner,"codex",["mcp","logout","ara"]),"Codex: signed out of Reason";return T(this.runner,"claude",["mcp","logout","plugin:ara:ara"]),"Claude Code: signed out of Reason"}uninstall(q){let J=this.status(q);if(!J.available||!J.installed)return`${J.label}: Reason is not installed`;if(q==="cursor"){let x=E(this.home),Y=l(x),X={...Y.mcpServers??{}};return delete X.ara,Y.mcpServers=X,Cq(x,Y),`Cursor: removed retired Reason MCP from ${x}`}if(q==="codex")return T(this.runner,"codex",["plugin","remove","ara@ara"]),"Codex: removed retired ara@ara";return T(this.runner,"claude",["plugin","uninstall","ara@ara","--scope","user"]),"Claude Code: removed retired ara@ara"}removeLegacyClaudePlugin(){if(!this.runner.exists("claude"))return"Claude Code: not installed";if(!this.status("claude").legacyInstallations.includes("ara-handoff@ara"))return"Claude Code: no legacy Reason plugin found";return T(this.runner,"claude",["plugin","uninstall","ara-handoff@ara","--scope","user"]),"Claude Code: removed obsolete ara-handoff@ara"}removeRetiredInstallations(){let q=[],J=[];for(let x of S){let Y;try{Y=this.status(x)}catch(X){J.push(`${u[x]}: ${X instanceof Error?X.message:String(X)}`);continue}if(Y.installed){if(x!=="cursor")try{q.push(this.logout(x))}catch(X){J.push(`${Y.label}: ${X instanceof Error?X.message:String(X)}`)}try{q.push(this.uninstall(x))}catch(X){J.push(`${Y.label}: ${X instanceof Error?X.message:String(X)}`)}}if(x==="claude"&&Y.legacyInstallations.includes("ara-handoff@ara"))try{q.push(this.removeLegacyClaudePlugin())}catch(X){J.push(`${Y.label}: ${X instanceof Error?X.message:String(X)}`)}}if(q.length===0&&J.length===0)q.push("No retired Reason MCP configuration found.");return{messages:q,failures:J}}}function i(q){return`claude mcp add --transport http reason ${q}`}function t(q){return`codex mcp add reason --url ${q}
|
|
48
|
+
codex mcp login reason`}var D3=i("https://mcp.reasonmachines.com/mcp"),K3=t("https://mcp.reasonmachines.com/mcp"),V3=`https://claude.ai/settings/connectors?add=custom&url=${encodeURIComponent("https://mcp.reasonmachines.com/mcp")}`,A3=`https://cursor.com/install-mcp?name=reason&config=${encodeURIComponent(btoa(JSON.stringify({url:"https://mcp.reasonmachines.com/mcp"})))}`;var mq="https://github.com/reason-machines/reason-plugins",N3=`Connect a coding agent to Reason over MCP
|
|
49
|
+
|
|
50
|
+
Usage:
|
|
51
|
+
reason mcp Show how to connect Claude Code, Codex, or another MCP client
|
|
52
|
+
reason mcp uninstall Remove only this machine's registrations of the earlier, retired server
|
|
53
|
+
|
|
54
|
+
Plugins for Claude Code and Codex: ${mq}
|
|
55
|
+
`;function r(q){if(!q.available)return"not detected";if(q.installed||q.legacyInstallations.length>0)return"retired configuration";return"not installed"}function pq(q,J){let x=J.toLowerCase();if(q==="codex")return x.includes("codex");if(q==="claude")return x.includes("claude");return x.includes("cursor")}function s(q,J){return(J.mcp_connections??[]).filter((Y)=>pq(q.id,Y.client_name)).flatMap((Y)=>Y.last_used_at?[Y.last_used_at]:[]).sort().at(-1)??null}function a(q,J=new Date){if(!q)return"never";let x=Date.parse(q);if(!Number.isFinite(x))return"never";let Y=Math.max(0,Math.floor((J.getTime()-x)/1000));if(Y<45)return"just now";let X=Math.floor(Y/60);if(X<60)return`${X} ${X===1?"minute":"minutes"} ago`;let $=Math.floor(X/60);if($<24)return`${$} ${$===1?"hour":"hours"} ago`;let Q=Math.floor($/24);return`${Q} ${Q===1?"day":"days"} ago`}function e(q){let J=q.name?.trim(),x=q.email?.trim();if(J&&x)return`${J} (${x})`;return J||x||q.id||"Reason user"}function n(q){let J=q.name?.trim(),x=q.slug?.trim();if(J&&x)return`${J} (${x})`;return J||x||q.id}var dq=G.enum(["granted","not_granted","unknown"]),qq=G.object({status:dq,checkedAt:G.number().finite(),executablePath:G.string().min(1)});var sq=`Reason status
|
|
56
|
+
|
|
57
|
+
Usage:
|
|
58
|
+
reason status [--json]
|
|
59
|
+
|
|
60
|
+
Show the installed version, signed-in account and organization, this
|
|
61
|
+
computer's connection (\`reason connect\`) and the workspaces it serves, any
|
|
62
|
+
retired MCP configuration that can be cleaned up, and automatic updates.
|
|
63
|
+
`,aq=5000,eq=300000,nq=G.object({version:G.literal(1),key:G.string(),at:G.number(),self:G.object({principal_type:G.string(),user_id:G.string().optional(),user_name:G.string().nullish(),email:G.string().nullish(),org_id:G.string(),organization_name:G.string().nullish(),organization_slug:G.string().nullish(),mcp_connections:G.array(G.object({client_id:G.string(),client_name:G.string(),last_used_at:G.string().nullable()})).optional()})}),Kq=(q)=>`${q.apiOrigin}
|
|
64
|
+
${uq("sha256").update(q.accessToken).digest("hex")}`;function q3(q,J,x){try{let Y=nq.safeParse(JSON.parse(oq(q,"utf8")));if(!Y.success||Y.data.key!==Kq(J))return null;let X=x-Y.data.at;return X>=0&&X<eq?Y.data.self:null}catch{return null}}function x3(q,J,x,Y){let X=`${q}.${process.pid}.${lq(6).toString("hex")}.tmp`;try{let $={version:1,key:Kq(J),at:Y,self:x};tq(X,`${JSON.stringify($)}
|
|
65
|
+
`,{mode:384,flag:"wx"}),cq(X,q)}catch{try{iq(X)}catch{}}}var J3=30000;function X3(q,J=Date.now()){let x=Xq(q),Y=(()=>{if(x?.state!=="connected"&&x?.state!=="starting")return!1;try{return process.kill(x.pid,0),!0}catch{return!1}})(),X=Y&&x?.state==="connected",$=(K)=>X&&J-K>=0&&J-K<J3,Q=qq.safeParse(x?.fullDiskAccess);return{full_disk_access:Q.success&&$(Q.data.checkedAt)?Q.data.status:"unknown",keep_awake:{enabled:Wq(q)==="battery_and_ac",holding:x?.idleSleepHold===!0&&$(Date.parse(x.lastHeartbeatAt??""))},executable:Y&&Q.success?Q.data.executablePath:null}}function Y3(q=A()){if(process.platform!=="darwin")return null;let J=Bq(Dq(bq(jq(g()),q),"worker.json"));return J?X3(Gq(J).daemon):null}var Jq={connected:"connected",starting:"starting",reconnecting:"reconnecting",stopping:"stopping",not_running:"not running",removed:"removed from Reason (run `reason connect` to connect it again)"};async function r3(q,J={}){let x=J.io??{stdout:process.stdout,stderr:process.stderr};if(q.includes("--help")||q.includes("-h"))return x.stdout.write(sq),0;if(q.some(($)=>$!=="--json"))return x.stderr.write(`Usage: reason status [--json]
|
|
66
|
+
`),1;let Y=new AbortController,X=setTimeout(()=>Y.abort(Error("timed out reading the account")),aq);try{let $=J.now?.()??new Date,Q=null,K=(Z)=>{return Q=Z instanceof Error?Z.message:String(Z),null},B=await $q(J).catch(K),H=B?.credentialKind==="api_key",z=B&&!H?Dq(rq(Yq(J.env??process.env)),"status-account.json"):null,M=B&&z&&q.includes("--json")?q3(z,B,$.getTime()):null,b=M??(B?await(J.getSelf??((Z,N)=>new Zq(Z).self(N)))(B,Y.signal).catch(K):null);if(B&&b&&!M&&z)x3(z,B,b,$.getTime());let F=J.manager??new w,P=F.statuses(),V=(J.loadReceipt??Qq)(),k=await(J.readConnection??(()=>kq({channel:J.channel})))().catch(()=>null),j=null;try{if(k)j=(J.readConnectionMacState??(()=>Y3(J.channel??A())))()}catch{}let W=k&&j?{...k,...j}:k,y=(()=>{try{return(J.readDisconnected??(()=>Fq(jq(g()),J.channel??A())))()}catch{return!1}})(),m=b?{id:b.org_id,name:b.organization_name??null,slug:b.organization_slug??null}:null,O=b?{id:b.user_id??null,name:(H?b.service_user_name:b.user_name)??null,email:b.email??null,credential:H?"api_key":"login"}:null,L=J.channel??A(),R={version:I,channel:L,api_origin:B?.apiOrigin??C(L),account:O,account_error:Q,organization:m,mcp:P.map((Z)=>({client:Z.id,label:Z.label,status:r(Z),installed_at:Z.installed?F.installationPath(Z.id):null,last_used_at:b?s(Z,b):null})),connection:W,disconnected:y,installation:V?{background_mode:V.background_mode,automatic_updates:V.background_mode!=="cli_only",future_device_consent:V.device_consent?.decision??"disabled"}:null};if(q.includes("--json"))return x.stdout.write(`${JSON.stringify(R,null,2)}
|
|
67
|
+
`),0;if(L==="staging")x.stdout.write(`Reason ${I} \xB7 channel: STAGING
|
|
68
|
+
`),x.stdout.write(`API: ${R.api_origin}
|
|
69
|
+
`);else x.stdout.write(`Reason ${I}
|
|
70
|
+
`);if(O)x.stdout.write(H?`Account: API key (REASON_API_KEY)${O.name?`: ${O.name}`:""}
|
|
71
|
+
`:`Account: ${e(O)}
|
|
72
|
+
`),x.stdout.write(`Organization: ${n(m)}
|
|
73
|
+
`);else if(Q)x.stdout.write(`Account: unavailable (${Q})
|
|
74
|
+
`);else x.stdout.write(`Account: signed out
|
|
75
|
+
`),x.stdout.write(`Organization: none
|
|
76
|
+
`);if(x.stdout.write(`
|
|
77
|
+
This computer
|
|
78
|
+
`),!W)x.stdout.write(y?"Disconnected. Run `reason connect` to connect it again.\n":"Not connected. Run `reason connect` to run your Sessions here.\n");else{if(x.stdout.write(`Connection: ${Jq[W.state]} (${W.name})${y?", disconnected (run `reason connect` to connect it again)":""}
|
|
79
|
+
`),W.version)x.stdout.write(`Version: ${W.version}${W.version===I?"":` (${I} is installed; \`reason connect\` restarts it on that)`}
|
|
80
|
+
`);if(x.stdout.write(`Folder: ${W.folder}
|
|
81
|
+
`),x.stdout.write(`Sessions: ${W.sessions_running===null?"":`${W.sessions_running} running, `}${W.sessions_max===1?"one at a time":`up to ${W.sessions_max} at once`}
|
|
82
|
+
`),j){let Z=j,N=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Vq,readMacPermissions:Aq,reasonIdentity:Hq}=await import("./permissions-2s0qyrg0.js"),{macScreenStatus:zq}=await import("./local-display-mac-j1v3mcgx.js");return Vq(await Aq({identity:()=>Hq(),grants:zq,worker:async()=>Z}))}))().catch(()=>null);if(N)x.stdout.write(`${N}
|
|
83
|
+
`);x.stdout.write(`Keep awake: ${j.keep_awake.enabled?"on":"off"}${j.keep_awake.holding?" (holding)":""}
|
|
84
|
+
`)}if(W.service)x.stdout.write(`Logs: ${W.service.logs}
|
|
85
|
+
`);for(let Z of W.workspaces??[]){let N=Z.state==="removed"?"removed from that workspace":Z.blocked?"offline (this computer is outside that workspace's allowed networks)":Z.device_id?Jq[Z.state]:"connecting";x.stdout.write(`Also in workspace ${Z.name??Z.organization_id}${Z.account?" (another Reason account's)":""}: ${N}
|
|
86
|
+
`)}if(W.workspaces_off==="sign_in")x.stdout.write("Other workspaces: off. This computer's sign-in is not one the Reason app or the setup command\n Reason shows you made for it (or that sign-in ended, or it is in use on another computer), so it is\n connected in one workspace only. Run the setup command from Reason here (it ends in --pair CODE);\n if this computer was connected before that, run `reason disconnect` and `reason connect` once.\n")}let p=R.mcp.filter((Z)=>Z.installed_at||Z.status!=="not installed");if(p.length>0)x.stdout.write(`
|
|
87
|
+
Retired MCP configuration
|
|
88
|
+
`);for(let Z of p)if(x.stdout.write(`${Z.label}: ${Z.status}
|
|
89
|
+
`),Z.installed_at)x.stdout.write(` Installed: ${Z.installed_at}
|
|
90
|
+
`),x.stdout.write(` Last used: ${a(Z.last_used_at,$)}
|
|
91
|
+
`);if(R.mcp.some((Z)=>Z.status==="retired configuration"))x.stdout.write("Run `reason mcp uninstall` to remove only the retired Reason MCP registrations.\n");if(x.stdout.write(`
|
|
92
|
+
Background access
|
|
93
|
+
`),!R.installation)x.stdout.write(`Not managed by the Reason installer
|
|
94
|
+
`);else x.stdout.write(`Automatic updates: ${R.installation.automatic_updates?"enabled":"disabled"}
|
|
95
|
+
`);return 0}catch($){return x.stderr.write(`Reason status: ${$ instanceof Error?$.message:String($)}
|
|
96
|
+
`),1}finally{clearTimeout(X)}}export{X3 as workerMacState,r3 as runStatusCli,Y3 as connectionMacState,sq as STATUS_HELP};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var r={name:"github-native-engineer-device-worker-production",version:"0.2.278",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.13",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{r as yh};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{_d as j}from"./vm-hands-entry-lite-sv6xwe0h.js";var p="inference.custom.v1",R=32768,$=67108864,x=16384,A=204800,z=600000,P=["content-type","anthropic-version","user-agent"],W=j.enum(["openai-completions","openai-responses","anthropic-messages"]),U=new Set(P),V=j.record(j.string(),j.string().max(2048)).refine((w)=>Object.keys(w).every((F)=>U.has(F))&&Object.values(w).every((F)=>!/[\r\n\0]/.test(F)),"Only non-secret custom endpoint request headers are permitted");function J(w){try{let F=new URL(w);return["http:","https:"].includes(F.protocol)&&!F.username&&!F.password&&!F.search&&!F.hash?F:null}catch{return null}}function X(w,F){let G=J(w.baseUrl),K=J(F.baseUrl),H=J(w.url);if(!G||!K||!H||w.method!=="POST"||F.execution!=="device")return!1;let L=(Q)=>Q.origin+Q.pathname.replace(/\/+$/,"");if(L(G)!==L(K)||H.origin!==G.origin)return!1;let Z=F.api==="openai-completions"?"/chat/completions":F.api==="openai-responses"?"/responses":"/v1/messages";return H.pathname===G.pathname.replace(/\/+$/,"")+Z}var B=j.object({baseUrl:j.string().max(2048),url:j.string().max(4096),method:j.literal("POST"),body:j.string().refine((w)=>new TextEncoder().encode(w).byteLength<=A).optional(),headers:V,credentialOrganizationId:j.string().uuid(),accountKey:j.string().min(1).max(256).optional()}).strict().refine((w)=>W.options.some((F)=>X(w,{baseUrl:w.baseUrl,api:F,execution:"device"})),"Invalid custom endpoint inference URL"),C=j.object({status:j.number().int().min(200).max(599),statusText:j.string().max(256).refine((w)=>!/[\r\n\0]/.test(w)),headers:j.record(j.string(),j.string().max(4096)).refine((w)=>Object.keys(w).every((F)=>["content-type","retry-after","x-request-id","request-id"].includes(F))&&Object.values(w).every((F)=>!/[\r\n\0]/.test(F)))}).strict(),I=j.union([j.object({eof:j.literal(!0)}).strict(),j.object({eof:j.literal(!1),data:j.string().max(Math.ceil(R/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((w)=>w.length>0&&w.length*3/4-(w.endsWith("==")?2:w.endsWith("=")?1:0)<=R)}).strict()]),M=j.object({bytes:j.number().int().min(0).max($),chunks:j.number().int().min(0).max(x)}).strict(),N=j.object({apiKey:j.string().min(1).max(16384).refine((w)=>!/[\r\n\0]/.test(w)),api:W}).strict();
|
|
3
|
+
export{p as _b,R as $b,$ as ac,x as bc,A as cc,z as dc,P as ec,X as fc,B as gc,C as hc,I as ic,M as jc,N as kc};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mg as wz,Ng as Nz}from"./vm-hands-entry-lite-s2xydt0n.js";import{Xg as N}from"./vm-hands-entry-lite-9pmag2qk.js";import{uh as A}from"./vm-hands-entry-lite-y4sjgfqz.js";import{Kh as Fz}from"./vm-hands-entry-lite-7gh1rbn7.js";import{spawnSync as iz}from"child_process";import{dirname as g}from"path";import{spawn as cz}from"child_process";import{accessSync as lz,constants as sz}from"fs";import{basename as nz,join as pz}from"path";import{randomUUID as p}from"crypto";import{spawnSync as M}from"child_process";import{chmodSync as Hz,cpSync as Rz,existsSync as U,lstatSync as O,mkdirSync as i,readdirSync as Cz,readFileSync as E,readlinkSync as Lz,realpathSync as T,renameSync as R,rmdirSync as Mz,rmSync as P,symlinkSync as c,writeFileSync as Oz}from"fs";import{dirname as C,join as D,relative as Uz,resolve as Tz}from"path";var a="so.ara.cli",_z="5LJFSBRY2F";var o="ReasonBackgroundIdentity",r="Contents/Helpers/ReasonPermissionTile";var x="AraBackgroundIdentity",Az="Reason",Iz=`anchor apple generic and identifier "${a}" and certificate leaf[subject.OU] = "${_z}"`;class L extends Error{code;constructor(z,J){super(J);this.code=z;this.name="MacOSBackgroundIdentityError"}}var k="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";function v(z=N()){return D(z,"Library","Application Support","Reason","Background","Reason.app")}function _(z=N()){return D(z,"Library","Application Support","Ara","Background","Ara.app")}function kz(z){try{return O(z).isFile()}catch{return!1}}function y(z){return[o,x].map((J)=>D(z,"Contents","MacOS",J)).find(kz)??null}function w(z){try{if(!O(z).isDirectory())return!1;let J=E(D(z,"Contents","Info.plist"),"utf8");return J.includes(`<string>${a}</string>`)&&(J.includes(`<string>${Az}</string>`)||J.includes("<string>Ara</string>"))&&y(z)!==null}catch{return!1}}function I(z=N()){let J=v(z);if(!w(J))return null;try{let Z=E(D(J,"Contents","Info.plist"),"utf8");return/<key>CFBundleVersion<\/key>\s*<string>(\d+\.\d+\.\d+)<\/string>/.exec(Z)?.[1]??null}catch{return null}}function Sz(z,J=N()){let Z=I(J);return Z===null||$z(S(Z.split(".")),S(z.split(/[.-]/).slice(0,3)))}var fz=1e4;function t(z,J){return M(z,[...J],{stdio:"ignore",timeout:fz}).status??1}var e=new Set;function zz(z){if(process.env.REASON_TEST_REFUSE_REAL_IDENTITY!=="1")return;let J=(Z)=>{try{return T(Z)}catch{return Tz(Z)}};if(z!==void 0&&J(z)!==J(N()))return;throw Error("A test tried to change this computer's real Reason background identity; pass a temporary home. Refused by scripts/test-env.ts.")}var Jz=/\/(?:runtime|CLI)\/versions\/(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$|\/\.ara(?:-staging)?-worker-(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$/,Zz=new Set(["ara","ara.exe","reason","reason.exe"]);function S(z){return z.map((J)=>Number(J))}function $z(z,J){for(let Z=0;Z<3;Z+=1)if(z[Z]!==J[Z])return z[Z]<J[Z];return!1}var Ez=[0,2,161];function xz(z){if(z===null)return!0;let J=Ez,Z=null;try{Z=T(process.execPath)}catch{}return z.some(($)=>{let j=Jz.exec($);if(j){let Q=j[1]===void 0?j.slice(4,7):j.slice(1,4);return $z(S(Q),J)}let q=$.slice($.lastIndexOf("/")+1);return Zz.has(q)&&$!==Z&&$!==process.execPath})}function yz(){let z=M("/bin/ps",["-xo","pid=,comm="],{encoding:"utf8",timeout:5000});if(z.status!==0)return null;let J=[];for(let Z of z.stdout.split(`
|
|
3
|
+
`)){let $=/^\s*(\d+)\s+(\S.*)$/.exec(Z);if(!$||Number($[1])===process.pid)continue;let j=$[2].trimEnd(),q=j.slice(j.lastIndexOf("/")+1);if(!Jz.test(j)&&Zz.has(q)){let V=M("/usr/sbin/lsof",["-a","-p",$[1],"-d","txt","-Fn"],{encoding:"utf8",timeout:5000}).stdout?.split(`
|
|
4
|
+
`).find((X)=>X.startsWith("n/"));if(V)j=V.slice(1)}J.push(j)}return J}function bz(z){if(zz(z.home),!w(z.sourceApp))throw new L("identity_invalid","The packaged Reason background identity is missing or invalid.");let J=z.command??t,Z=v(z.home),$=C(Z);i($,{recursive:!0,mode:448}),Hz($,448);let j=T(z.sourceApp),q=null;try{q=T(Z)}catch{}if(j!==q){let Q=`${process.pid}.${p()}`,V=D($,`.Reason.app.${Q}.tmp`),X=D($,`.Reason.app.${Q}.old`),W=!1;try{if(Rz(j,V,{recursive:!0,errorOnExist:!0,preserveTimestamps:!0}),!w(V))throw new L("identity_invalid","The copied Reason background identity is invalid.");let Y=z.releaseSigned?["--test-requirement",`=${Iz}`]:[];if(J("/usr/bin/codesign",["--verify","--strict",...Y,V])!==0)throw new L("identity_invalid_signature","The installed Reason background identity has an invalid signature.");let B=!1;for(let F=0;F<4;F+=1){let G=!1;try{R(Z,X),G=!0,W=!0}catch(K){if(K.code!=="ENOENT")throw K}if(F===0)z.beforePublish?.();try{R(V,Z),B=!0}catch(K){let m=K.code;if(!["EEXIST","ENOTEMPTY"].includes(m??""))throw K;if(G)P(X,{recursive:!0,force:!0}),W=!1;if(F===3)throw K;continue}if(G)P(X,{recursive:!0,force:!0}),W=!1;break}if(!B)throw Error("Could not publish Reason's background identity.")}catch(Y){if(W&&!U(Z)&&U(X))R(X,Z);throw Y}finally{P(V,{recursive:!0,force:!0}),P(X,{recursive:!0,force:!0})}}return Wz(Z,z,{verified:j!==q}),Z}function jz(z){return D(C(z),".Reason.app.registered")}function qz(z){try{let J=O(z);return J.isDirectory()?`${J.ino}:${J.birthtimeMs}`:null}catch{return null}}function f(z){let J=qz(z);try{return J!==null&&E(jz(z),"utf8")===J}catch{return!1}}function Qz(z){if(w(z))return"bundle";try{if(O(D(z,"Contents","Info.plist"),{throwIfNoEntry:!1}))return null;return O(D(z,"Contents","MacOS",x)).isSymbolicLink()?"retired":null}catch{return null}}function Wz(z,J,Z={}){let $=J.command??t;if(!Z.verified&&$("/usr/bin/codesign",["--verify","--strict",z])!==0)throw new L("identity_invalid_signature","The installed Reason background identity has an invalid signature.");if($(k,["-f",z])!==0)throw new L("identity_register_failed","Could not register Reason's macOS background identity.");let j=qz(z);try{if(j)Oz(jz(z),j,{mode:384})}catch{}try{gz(z,J.home,$,J.runningExecutables??yz)}catch(q){let Q=q.code??"unknown";process.stderr.write(`Reason background identity: legacy_identity_retire_failed (${Q})
|
|
5
|
+
`)}}function gz(z,J,Z,$){let j=y(z);if(!j)return;let q=_(J),Q=C(q),V=(K)=>D(K,"Contents","MacOS",x),X=Uz(C(V(q)),j),W=`${process.pid}.${p()}`,Y=Qz(q);if(Y===null)return;let B=Y==="bundle";if(B)Z(k,["-u",q]);let F=D(Q,`.Ara.app.${W}.old`);if(!e.has(q)&&!xz($())){if(!B)Z(k,["-u",q]);try{R(q,F)}catch(K){if(K.code==="ENOENT")return;throw K}P(F,{recursive:!0,force:!0}),uz(Q);return}if(!B){if(Lz(V(q))===X)return;let K=`${V(q)}.${W}`;c(X,K);try{R(K,V(q))}finally{P(K,{force:!0})}return}let G=D(Q,`.Ara.app.${W}.shim`);i(C(V(G)),{recursive:!0}),c(X,V(G));try{try{R(q,F)}catch(K){if(K.code==="ENOENT")return;throw K}try{R(G,q)}catch(K){if(U(q))return;throw R(F,q),K}}finally{P(G,{recursive:!0,force:!0}),P(F,{recursive:!0,force:!0})}}function uz(z){try{if(Cz(z).some((Z)=>Z!==".DS_Store"))return;P(D(z,".DS_Store"),{force:!0}),Mz(z)}catch{}}var l=new Map;function hz(z=N()){let J=l.get(z);if(J)return J;if(process.platform!=="darwin")return[];let Z=s(z);if(Z===null&&U(C(v(z))))Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,100),Z=s(z);if(Z===null)return[];return l.set(z,Z),Z}function s(z){let J=v(z),Z=_(z);if(!w(J)||!f(J))try{dz({home:z,skipWhenSettled:!0})}catch{}let $=w(J)&&(f(J)||!w(Z))?J:w(Z)?Z:null,j=$?y($):null;if(!j)return null;if($===Z)e.add(Z);let q=M(j,["--can-spawn"],{env:{},timeout:2000,encoding:"utf8"});return q.status===0&&q.stdout===`spawn
|
|
6
|
+
`?[j,"--spawn"]:[]}var n=new Map;function b(z=N()){let J=hz(z),Z=J[0];if(!Z)return[];let $=n.get(Z);if($===void 0){let j=M(Z,["--can-spawn-computer-use"],{env:{},timeout:2000,encoding:"utf8"});$=j.status===0&&j.stdout===`spawn
|
|
7
|
+
`,n.set(Z,$)}return $?J:[]}function Kz(z=b(),J=N()){if(z.length>0)return null;if(I(J)===null)return"computer_use_identity_missing";return Sz(A,J)?"computer_use_identity_outdated":"computer_use_identity_unavailable"}function dz(z={}){zz(z.home);let J=v(z.home);if(z.skipWhenSettled&&w(J)&&f(J)&&Qz(_(z.home))===null)return!0;if(!w(J)){let Z=_(z.home);if(!w(Z))return!1;try{return bz({...z,sourceApp:Z}),!0}catch($){if(!w(J))throw $}}return Wz(J,z),!0}var mz="REASON_WORKER_IDENTITY_APP";function VJ(z,J=process.env,Z=N()){let $=J[mz];return $&&$===v(Z)?$:z}function XJ(z,J){if(process.platform!=="darwin")return null;let Z=v(z),$=D(Z,"Contents","MacOS",o),j=M($,["--can-run-worker",J],{env:{},timeout:2000,encoding:"utf8"});return j.status===0&&j.stdout===`run-worker
|
|
8
|
+
`?{app:Z,executable:$}:null}var H=null;function Vz(z){if(H===z)H=null;if(z.exitCode===null&&z.signalCode===null)z.kill("SIGTERM")}var Xz=(z,J)=>{if(H)Vz(H);let Z=pz(z,r);try{lz(Z,sz.X_OK)}catch{return()=>{}}let $;try{$=cz(Z,["--app",z,"--name",nz(z,".app"),"--permission",J==="screen"?"screen_recording":"accessibility"],{detached:!0,stdio:"ignore"})}catch{return()=>{}}return $.on("error",()=>{if(H===$)H=null}),$.once("exit",()=>{if(H===$)H=null}),$.unref(),H=$,()=>Vz($)};var Dz=`Reason permissions
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
reason permissions [--json]
|
|
12
|
+
reason permissions allow [screen|accessibility|disk]
|
|
13
|
+
|
|
14
|
+
The macOS privacy permissions of this computer's Reason worker:
|
|
15
|
+
screen Screen & System Audio Recording: desktop video, computer-use screenshots
|
|
16
|
+
accessibility Accessibility: computer-use clicks and typing, desktop input
|
|
17
|
+
disk Full Disk Access (recommended): Sessions in Desktop, Documents,
|
|
18
|
+
Downloads, iCloud Drive and Mail
|
|
19
|
+
|
|
20
|
+
allow asks for each missing one, or the one named. macOS cannot ask for Full
|
|
21
|
+
Disk Access: allow disk opens its pane, shows the file to add in Finder and
|
|
22
|
+
waits until the worker has it.
|
|
23
|
+
`,u="x-apple.systempreferences:com.apple.preference.security",az="curl -fsSL https://reasonmachines.com/install.sh | bash",oz=180000,rz=2000,h=["screen","accessibility","disk"],d={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${u}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${u}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${u}?Privacy_AllFiles`}};function Bz(z){return z.executable}function tz(z,J){if(z==="computer_use_identity_missing")return`Reason's background identity is not installed (${z}); reinstall Reason: ${az}`;if(z==="computer_use_identity_outdated")return`Reason's background identity is outdated (${I(J)??"unknown"}; this CLI is ${A}) (${z}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${z}); run the installed \`reason\``}function ez(z=N()){let J=b(z);if(J.length>0)return{state:"ready",path:g(g(g(J[0]))),prefix:J};let Z=Kz(J,z)??"computer_use_identity_unavailable";return{state:Z,path:v(z),detail:tz(Z,z)}}function Pz(){return{identity:()=>ez(),grants:(z)=>wz(z),request:(z,J)=>Nz(z,J),worker:async()=>(await import("./status-2d21kwsn.js")).connectionMacState(),open:(z)=>{iz("/usr/bin/open",z,{stdio:"ignore",timeout:1e4})},tile:Xz,restartConnection:async()=>(await import("./connect-cli-qphdm1f1.js")).restartConnection(),sleep:(z)=>new Promise((J)=>setTimeout(J,z)),now:()=>Date.now()}}function Yz(z,J,Z){if(z.state!=="ready"||!J)return"unknown";return J[Z]?"granted":"missing"}async function vz(z){let J=z.identity(),Z=J.state==="ready"?await z.grants(J.prefix):null,$=await z.worker(),j=$?Bz($):null,q=!j||$?.full_disk_access==="unknown"?"unknown":$?.full_disk_access==="granted"?"granted":"missing",Q=(V,X,W)=>{let{label:Y,purpose:B,level:F}=d[V];return{id:V,label:Y,purpose:B,level:F,state:X,holder:W}};return{identity:{state:J.state,path:J.path,detail:J.state==="ready"?null:J.detail},worker_detail:j?null:"Full Disk Access is read from this computer's running worker; `reason connect` starts it.",permissions:[Q("screen",Yz(J,Z,"screen"),J.path),Q("accessibility",Yz(J,Z,"accessibility"),J.path),Q("disk",q,j)]}}function MJ(z){let J=z.identity.state==="ready"?null:z.identity.state,Z=z.permissions.filter((q)=>q.state==="granted").length,$=[...J?[J]:[],...z.permissions.filter((q)=>q.state!=="granted"&&!(J&&q.id!=="disk")).map((q)=>`${q.label} ${q.state}`)],j=!J&&z.permissions.some((q)=>q.state==="missing");return`Permissions: ${Z} of ${z.permissions.length}${$.length>0?` (${$.join(", ")})`:""}`+(j?" \u2014 reason permissions allow":$.length>0?" \u2014 reason permissions":"")}function zJ(z){let J=[];if(z.identity.detail)J.push(z.identity.detail);J.push(`Reason: ${z.identity.path}`);let Z=z.permissions.find(($)=>$.id==="disk");J.push(Z?.holder?`Worker: ${Z.holder}`:`Worker: ${z.worker_detail}`),J.push("");for(let $ of z.permissions){let j=`${$.label}${$.level==="recommended"?" (recommended)":""}`;J.push(` ${$.id.padEnd(13)} ${$.state.padEnd(7)} ${j}: ${$.purpose}`)}if(z.permissions.some(($)=>$.state==="missing"))J.push("","Allow the missing ones: reason permissions allow");return`${J.join(`
|
|
24
|
+
`)}
|
|
25
|
+
`}async function Gz(z,J){let Z=J.now()+oz;for(;;){if(await z())return!0;if(J.now()>=Z)return!1;await J.sleep(rz)}}async function JJ(z,J){let Z=J.host??Pz(),{io:$}=J,j=await vz(Z),q=j.permissions.filter((W)=>z.includes(W.id)&&W.state!=="granted");if(q.length===0)return $.stdout.write(`Reason permissions: ${z.map((W)=>d[W].label).join(", ")} already allowed.
|
|
26
|
+
`),0;let Q=!1,V=!1,X=Z.identity();for(let W of q){let{label:Y,pane:B}=d[W.id];if(W.id!=="disk"){if(X.state!=="ready"){if(!Q)$.stderr.write(`Reason permissions: ${X.detail}
|
|
27
|
+
`);Q=!0;continue}let G=W.id;await Z.request(X.prefix,G),Z.open([B]);let K=Z.tile(X.path,G);if($.stdout.write(`Allow Reason in System Settings > Privacy & Security > ${Y}.
|
|
28
|
+
`),!J.wait)continue;if($.stdout.write(`Waiting for it (Ctrl-C to stop)\u2026
|
|
29
|
+
`),await Gz(async()=>(await Z.grants(X.prefix))?.[G]===!0,Z).finally(K))$.stdout.write(`${Y}: granted.
|
|
30
|
+
`),V=!0;else $.stderr.write(`${Y} is not allowed yet; turn on Reason there, then run \`reason permissions\`.
|
|
31
|
+
`),Q=!0;continue}let F=Bz(await Z.worker()??{executable:null});if(!F){$.stderr.write(`Reason permissions: ${j.worker_detail} Then run \`reason permissions allow disk\`.
|
|
32
|
+
`),Q=!0;continue}if(Z.open([B]),Z.open(["-R",F]),$.stdout.write(`Full Disk Access: click + and choose ${F} (shown in Finder), or drag it into the list.
|
|
33
|
+
`),!J.wait)continue;if($.stdout.write(`Waiting for the worker to report it (Ctrl-C to stop)\u2026
|
|
34
|
+
`),await Gz(async()=>(await Z.worker())?.full_disk_access==="granted",Z))$.stdout.write(`Full Disk Access: granted.
|
|
35
|
+
`);else $.stderr.write("Full Disk Access is not reported yet. If you allowed it, `reason connect` restarts the worker with it.\n"),Q=!0}if(V)try{if(await Z.restartConnection())$.stdout.write(`This computer's Reason connection restarted to use them.
|
|
36
|
+
`)}catch(W){$.stderr.write(`This computer's Reason connection uses them after it restarts (\`reason connect\`): ${W instanceof Error?W.message:String(W)}
|
|
37
|
+
`)}return Q?1:0}function ZJ(z){if(z.some(($)=>["--help","-h","help"].includes($)))return{command:"help"};let[J,...Z]=z;if(J===void 0||J==="--json")return z.length<=1?{command:"list",json:J==="--json"}:{error:`Unknown option: ${z[1]}`};if(J!=="allow")return{error:`Unknown permissions command: ${J}`};if(Z.length>1)return{error:`Unknown option: ${Z[1]}`};if(Z.length===0)return{command:"allow",ids:[...h]};if(!h.includes(Z[0]))return{error:`allow expects ${h.join(", ")}.`};return{command:"allow",ids:[Z[0]]}}async function OJ(z,J={}){let Z=J.io??{stdout:process.stdout,stderr:process.stderr},$=ZJ(z);if("error"in $)return Z.stderr.write(`${$.error}
|
|
38
|
+
|
|
39
|
+
${Dz}`),1;if($.command==="help")return Z.stdout.write(Dz),0;let j=J.platform??process.platform;if(j!=="darwin")return Z.stdout.write($.command==="list"&&$.json?`${JSON.stringify({platform:j,applicable:!1})}
|
|
40
|
+
`:`Reason permissions: macOS privacy permissions do not apply on this computer.
|
|
41
|
+
`),0;let q=J.host??Pz();if($.command==="allow")return JJ($.ids,{io:Z,wait:!0,host:q});let Q=await vz(q);return Z.stdout.write($.json?`${JSON.stringify({platform:j,applicable:!0,...Q},null,2)}
|
|
42
|
+
`:zJ(Q)),0}
|
|
43
|
+
export{a as eg,k as fg,hz as gg,b as hg,Kz as ig,dz as jg,mz as kg,VJ as lg,XJ as mg,Xz as ng,Dz as og,h as pg,Bz as qg,ez as rg,vz as sg,MJ as tg,zJ as ug,JJ as vg,ZJ as wg,OJ as xg};
|