@reason-machines/cli-linux-x64 0.2.561 → 0.2.565
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/reason +2 -2
- package/bin/vm-hands/agent-network-mnv1fm1c.js +2 -0
- package/bin/vm-hands/api-credentials-082cnpn9.js +2 -0
- package/bin/vm-hands/api-sq672f51.js +2 -0
- package/bin/vm-hands/{ask-relay-xx0rzpch.js → ask-relay-v5btnjvb.js} +2 -2
- package/bin/vm-hands/connect-cli-rxb3qtra.js +2 -0
- package/bin/vm-hands/credentials-sk4sag42.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-3jscber1.js +2 -0
- package/bin/vm-hands/desktop-account-xma0330a.js +2 -0
- package/bin/vm-hands/desktop-components-099xyxmz.js +2 -0
- package/bin/vm-hands/desktop-delegate-tch2qzx0.js +2 -0
- package/bin/vm-hands/device-workspace-4bj43nxq.js +2 -0
- package/bin/vm-hands/{fsevents-vxv56sp5.js → fsevents-ezcg3e40.js} +1 -1
- package/bin/vm-hands/hands-worker-source-8pe7yv0m.js +2 -0
- package/bin/vm-hands/{index-03p9c17x.js → index-w92ys6ra.js} +16 -16
- package/bin/vm-hands/install-receipt-68xxg7hn.js +2 -0
- package/bin/vm-hands/local-automation-7pjd5nc1.js +2 -0
- package/bin/vm-hands/local-capabilities-ha0ey4zh.js +2 -0
- package/bin/vm-hands/local-desktop-users-jpf0resr.js +2 -0
- package/bin/vm-hands/local-display-mac-h5yz0ydd.js +2 -0
- package/bin/vm-hands/local-display-session-0mkswxgk.js +2 -0
- package/bin/vm-hands/local-display-video-c3fk87c5.js +2 -0
- package/bin/vm-hands/local-managed-process-ahr2jync.js +2 -0
- package/bin/vm-hands/local-pty-session-tqn2xmph.js +2 -0
- package/bin/vm-hands/managed-runtime-shzb3tr3.js +2 -0
- package/bin/vm-hands/network-auto-update-3m94436w.js +3 -0
- package/bin/vm-hands/network-contract-nkwcf4r9.js +2 -0
- package/bin/vm-hands/{network-sign-in-61gmpmaa.js → network-sign-in-xm79s170.js} +2 -2
- package/bin/vm-hands/package-9w0mmxb5.js +2 -0
- package/bin/vm-hands/permissions-scffy1px.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-pck5har9.js +2 -0
- package/bin/vm-hands/serve-service-grp91ybk.js +2 -0
- package/bin/vm-hands/{status-khqk4cjw.js → status-89999mdn.js} +7 -7
- package/bin/vm-hands/version-wyshazh7.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zawytz09.js → vm-hands-entry-lite-12ck5swp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-j10cw3d9.js → vm-hands-entry-lite-13nx02p7.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-vdv4nm5f.js → vm-hands-entry-lite-1b21avcs.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-1eyg750p.js +48 -0
- package/bin/vm-hands/{vm-hands-entry-lite-2dak7e1h.js → vm-hands-entry-lite-1xhpn3hw.js} +3 -5
- package/bin/vm-hands/{vm-hands-entry-lite-ms99mzp0.js → vm-hands-entry-lite-284z7ct8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-a7bf7xr7.js → vm-hands-entry-lite-2qfmabqn.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-q9s1e2y1.js → vm-hands-entry-lite-33at6g06.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-jgk5z8zc.js → vm-hands-entry-lite-34b4tws6.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-e3fn8ys2.js → vm-hands-entry-lite-3gc2bn5a.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hxfxs7r9.js → vm-hands-entry-lite-3q2ng4e9.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-432khjd5.js +150 -0
- package/bin/vm-hands/vm-hands-entry-lite-6vnjgy77.js +81 -0
- package/bin/vm-hands/{vm-hands-entry-lite-ht6hzkgj.js → vm-hands-entry-lite-7r27208j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hs6sdn60.js → vm-hands-entry-lite-88dxn9b5.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-997y1m1r.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zh6ncdjn.js → vm-hands-entry-lite-a3gq377t.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-m1we91g4.js → vm-hands-entry-lite-af45ma9p.js} +10 -10
- package/bin/vm-hands/{vm-hands-entry-lite-0wb1n769.js → vm-hands-entry-lite-b1vanmtv.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-5y4phfv1.js → vm-hands-entry-lite-bsk184m7.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-q9djb28r.js → vm-hands-entry-lite-cc8hwgxc.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-chq0qx9f.js +12 -0
- package/bin/vm-hands/{vm-hands-entry-lite-84mc1f7h.js → vm-hands-entry-lite-cmmb9k3g.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-gxpw14jv.js → vm-hands-entry-lite-dy204qh4.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-ptycjmkc.js → vm-hands-entry-lite-fccn6s4j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-qf990rxw.js → vm-hands-entry-lite-fn2805g8.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-71ebge0c.js → vm-hands-entry-lite-fxptf351.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-vkhacd00.js → vm-hands-entry-lite-gcqqnnze.js} +19 -19
- package/bin/vm-hands/{vm-hands-entry-lite-57ajjwmh.js → vm-hands-entry-lite-gxf2r5en.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hjjbjpd7.js → vm-hands-entry-lite-jj7873n8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-9g52kxyj.js → vm-hands-entry-lite-kbnxk71q.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-ncyrz48z.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-y3nz20wb.js → vm-hands-entry-lite-ngn4tafr.js} +105 -105
- package/bin/vm-hands/{vm-hands-entry-lite-52qz0n30.js → vm-hands-entry-lite-ngry8nkq.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-8xv6c0rm.js → vm-hands-entry-lite-pg7nnyc6.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-h7nk2848.js → vm-hands-entry-lite-pt19vacn.js} +42 -42
- package/bin/vm-hands/{vm-hands-entry-lite-tcmye5ny.js → vm-hands-entry-lite-q62g6sx0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-v4hr9x9h.js → vm-hands-entry-lite-qjrgvdbj.js} +34 -34
- package/bin/vm-hands/{vm-hands-entry-lite-bj3w2ven.js → vm-hands-entry-lite-rqfhfp09.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-krpqqx12.js → vm-hands-entry-lite-rxydyqke.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-weqam12f.js → vm-hands-entry-lite-s93f3pbv.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-z0ht62s4.js → vm-hands-entry-lite-sh4mqy93.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-xvccy3z4.js → vm-hands-entry-lite-sz7z1qby.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-wcgm41jq.js → vm-hands-entry-lite-t43bz0ey.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-6jxshhps.js → vm-hands-entry-lite-t86kt9jz.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-7pfhwxn5.js → vm-hands-entry-lite-tnj3483k.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-wnqqjsew.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-pxtycfdv.js → vm-hands-entry-lite-xfak34av.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-sy7dcccg.js → vm-hands-entry-lite-y0jtj8zz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-yvws5zpx.js → vm-hands-entry-lite-yg4dk99m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-2rgf8866.js → vm-hands-entry-lite-z65xva21.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-jpvmkce5.js → vm-hands-entry-lite-zp7chzcc.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-k5ytpgzz.js → vm-hands-entry-lite-zpvr7wc6.js} +19 -19
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/vm-hands-executor-kyb5t371.js +12 -0
- package/bin/vm-hands/vm-hands-op-runner-gkt79hcp.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-1qxf96z7.js → vm-hands-runtime-tdr6j55n.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-h96yr4wf.js +2 -0
- package/bin/vm-hands/worker-sandbox-6kkhvryn.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/agent-network-kk36zca7.js +0 -2
- package/bin/vm-hands/api-credentials-mtfdk175.js +0 -2
- package/bin/vm-hands/api-w6w7vfp3.js +0 -2
- package/bin/vm-hands/connect-cli-dmwph620.js +0 -2
- package/bin/vm-hands/credentials-s7ps7y6s.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-3xnrp33e.js +0 -2
- package/bin/vm-hands/desktop-account-eg8thn79.js +0 -2
- package/bin/vm-hands/device-workspace-h5rsecq8.js +0 -2
- package/bin/vm-hands/hands-worker-source-vk664w8p.js +0 -2
- package/bin/vm-hands/install-receipt-j04hdw1k.js +0 -2
- package/bin/vm-hands/local-automation-vvt9d9xb.js +0 -2
- package/bin/vm-hands/local-capabilities-pwv76ns5.js +0 -2
- package/bin/vm-hands/local-desktop-users-sq4trh07.js +0 -2
- package/bin/vm-hands/local-display-mac-yxcxvg2z.js +0 -2
- package/bin/vm-hands/local-display-session-axh9mfdk.js +0 -2
- package/bin/vm-hands/local-display-video-pxhztqk7.js +0 -2
- package/bin/vm-hands/local-managed-process-4mgqn7tg.js +0 -2
- package/bin/vm-hands/local-pty-session-edd8ttf9.js +0 -2
- package/bin/vm-hands/managed-runtime-pcagtyfz.js +0 -2
- package/bin/vm-hands/network-auto-update-wkzb91qz.js +0 -3
- package/bin/vm-hands/network-contract-8mxtma3w.js +0 -2
- package/bin/vm-hands/package-vwvzjtn0.js +0 -2
- package/bin/vm-hands/permissions-348prrcx.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-1nkpw1v3.js +0 -2
- package/bin/vm-hands/serve-service-3dkyznay.js +0 -2
- package/bin/vm-hands/version-c1hen0wn.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-9yfmkd1f.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ab1pq3xg.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-hn9pq7zj.js +0 -127
- package/bin/vm-hands/vm-hands-entry-lite-nn6zcvmp.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-z213y4pj.js +0 -150
- package/bin/vm-hands/vm-hands-executor-csdtg7kj.js +0 -12
- package/bin/vm-hands/vm-hands-op-runner-z7tsd84c.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-06tygyjs.js +0 -2
- package/bin/vm-hands/worker-sandbox-e1cpkzfz.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rr,
|
|
2
|
+
import{rr,jr}from"./vm-hands-entry-lite-gxf2r5en.js";import{t,Ur,V,o,_,d,h,P,$e,c,i}from"./vm-hands-entry-lite-zpvr7wc6.js";var w=t().max(201).regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/).refine((e)=>e.split("/").every((n)=>n!=="."&&n!=="..")),b=t().min(1).max(255).regex(/^[A-Za-z0-9_][A-Za-z0-9_./-]*$/).refine((e)=>!e.includes("..")&&!e.includes("//")&&!e.endsWith("/")&&!e.endsWith(".lock")),L=t().regex(/^[a-f0-9]{40}$/),O=o().int().positive(),I=t().min(1).max(256),T=t().max(60000),y={version:i(1),repoFullName:w},A=d(t().max(1024).regex(/^(?:Co-authored-by: [^<>\r\n\x00]+ <[^<>\s]+@[^<>\s]+>|Reason-Contributor-ID: rc_[a-f0-9]{32})$/)).max(1000),j=h({expectedTrailers:A,missingFromHead:A}),G=P("action",[h({action:i("edit"),title:I.optional(),body:T.optional(),base:b.optional()}),h({action:c(["ready","draft","close"])}),h({action:i("metadata"),field:c(["reviewer","assignee","label"]),change:c(["add","remove"]),value:t().min(1).max(100).refine((e)=>!/[\r\n\0]/.test(e))})]),Ct=P("kind",[h({...y,kind:i("read"),path:t().min(1).max(2048),accept:c(["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"]).optional()}),h({...y,kind:i("pr_review_context"),number:O,after:t().min(1).max(1024).optional()}),h({...y,kind:i("prepare"),branch:b,baseSha:L,defaultBranch:b,diagnosticsVersion:i(1).optional()}),h({...y,kind:i("publish"),branch:b,defaultBranch:b,baseSha:L,remoteHeadSha:L.nullable(),contributorTrailers:A.optional()}),h({...y,kind:i("pr_create"),head:b,base:b,title:I,body:T,draft:_()}),h({...y,kind:i("pr_mutation"),number:O,mutation:G}),h({...y,kind:i("pr_merge"),number:O,expectedHeadSha:L,expectedBaseRef:b,method:c(["merge","squash","rebase"]),commitBody:t().max(65536).optional()})]),z=["local_device_gh_prepare_setup","local_device_gh_prepare_metadata","local_device_gh_prepare_private_init","local_device_gh_prepare_fetch","local_device_gh_prepare_base_mismatch","local_device_gh_prepare_checkout_validation","local_device_gh_prepare_checkout_init","local_device_gh_prepare_materialization"];function B(e){return z.some((n)=>n===e)}class Bn extends Error{code;constructor(e){super(e);this.code=e}}function bs(e,n,r){let p=Ct.safeParse(e);return n==="failed"&&p.success&&p.data.kind==="prepare"&&p.data.diagnosticsVersion===1&&B(r)}var Or=245760,Vc=P("kind",[h({kind:i("pr_review_context"),body:t().max(Or)}),h({kind:i("prepare"),headSha:L}),h({kind:i("read"),status:o().int().min(200).max(599),headers:$e(t(),t().max(8192)).refine((e)=>Object.keys(e).every((n)=>n==="link"||n==="content-type")),body:t().max(Or)}),h({kind:i("publish"),headSha:L,scannedObjectCount:o().int().min(0).max(5000),attribution:j.optional()}),h({kind:i("pr_create"),url:t().max(1024).regex(/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/)}),h({kind:i("pr_mutation"),number:O,applied:i(!0)}),h({kind:i("pr_merge"),number:O,merged:i(!0)})]).refine((e)=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=Or,"local_device_gh_result_too_large"),F=h({source:c(["agent","human"]),operationId:V()}),Je=h({version:i(1),userId:Ur(),deviceId:Ur(),rootId:Ur(),runId:Ur(),merge:F.optional(),contributorRefresh:Ur().optional(),repoFullName:w.nullable(),rootRevision:t().regex(/^[1-9][0-9]*$/),readOnly:_(),generation:o().int().positive().nullable(),fenceId:Ur().nullable()}).refine((e)=>e.generation===null===(e.fenceId===null));function v(e){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(e)&&e.split("/").every((n)=>n!=="."&&n!=="..")}function Gc(e,n,r={},p="read"){if(v(e)&&(n==="/search/issues"||n.startsWith("/search/issues?")))return Y(e,n,r);if(!v(e)||!n.startsWith(`/repos/${e}/`)&&n!==`/repos/${e}`)throw Error("local_device_gh_repository_mismatch");if(/[\\#\u0000-\u001f]/.test(n)||/%(?:2e|5c|00)/i.test(n))throw Error("local_device_gh_path_denied");let m=new URL(n,"https://api.github.com");if(m.pathname!==n.split("?")[0]||m.username||m.password)throw Error("local_device_gh_path_denied");let R;try{R=decodeURIComponent(m.pathname.slice(`/repos/${e}`.length))}catch{throw Error("local_device_gh_path_denied")}if(R.includes("%")||R.split("/").some((s)=>s==="."||s===".."))throw Error("local_device_gh_path_denied");if((r.method??"GET").toUpperCase()!=="GET"||r.body!=null)throw Error("local_device_gh_mutation_not_admitted");if(![/^$/,/^\/commits$/,/^\/pulls$/,/^\/pulls\/[1-9][0-9]*(?:\/(?:commits|files|reviews|comments))?$/,/^\/issues\/[1-9][0-9]*(?:\/comments)?$/,/^\/issues\/comments\/[1-9][0-9]*\/reactions$/,/^\/commits\/[A-Za-z0-9_./-]+(?:\/(?:check-runs|status))?$/,/^\/check-runs\/[1-9][0-9]*(?:\/annotations)?$/,/^\/branches\/[A-Za-z0-9_./-]+$/,/^\/git\/ref\/heads\/[A-Za-z0-9_./-]+$/,/^\/compare\/[A-Za-z0-9_./-]+\.\.\.[A-Za-z0-9_./-]+$/].some((s)=>s.test(R)))throw Error("local_device_gh_path_denied");if(m.searchParams.forEach((s,f)=>{if(f==="per_page"&&/^[1-9][0-9]*$/.test(s)&&Number(s)<=100)return;if(f==="page"&&/^[1-9][0-9]*$/.test(s)&&Number(s)<=100)return;if(R==="/pulls"&&f==="state"&&["open","closed","all"].includes(s))return;if(R==="/pulls"&&f==="sort"&&s==="updated")return;if(R==="/pulls"&&f==="direction"&&s==="desc")return;if(R==="/pulls"&&["head","base"].includes(f)&&/^[A-Za-z0-9_./:-]{1,255}$/.test(s))return;throw Error("local_device_gh_query_denied")}),r.headers)new Headers(r.headers).forEach((f,q)=>{if(q!=="accept"||!["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"].includes(f))throw Error("local_device_gh_header_denied")})}function Y(e,n,r){if(/[\\#\u0000-\u001f]/.test(n))throw Error("local_device_gh_path_denied");let p=new URL(n,"https://api.github.com");if(p.pathname!=="/search/issues"||p.username||p.password)throw Error("local_device_gh_path_denied");if((r.method??"GET").toUpperCase()!=="GET"||r.body!=null)throw Error("local_device_gh_mutation_not_admitted");let m=null;p.searchParams.forEach((g,s)=>{if(s==="q"&&m===null){m=g;return}if(s==="per_page"&&/^[1-9][0-9]*$/.test(g)&&Number(g)<=100)return;if(s==="page"&&/^[1-9][0-9]*$/.test(g)&&Number(g)<=100)return;throw Error("local_device_gh_query_denied")});let R=`repo:${e.toLowerCase()} `,x=m?.toLowerCase()??"";if(x.length>512||!(x+" ").startsWith(R)||/(?:^|\s)(?:repo|org|user):/.test(x.slice(R.length)))throw Error("local_device_gh_query_denied");if(r.headers)new Headers(r.headers).forEach((g,s)=>{if(s!=="accept"||g!=="application/vnd.github+json")throw Error("local_device_gh_header_denied")})}var Kc=`query PullRequestReviewContext($owner: String!, $repo: String!, $number: Int!, $after: String) {
|
|
3
3
|
repository(owner: $owner, name: $repo) {
|
|
4
4
|
nameWithOwner
|
|
5
5
|
pullRequest(number: $number) {
|
|
@@ -34,9 +34,9 @@ import{rr,Nr}from"./vm-hands-entry-lite-57ajjwmh.js";import{t,$r,V,o,_,d,h,A,$e,
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
}`;function Qt(e){return e.kind==="read"||e.kind==="pr_review_context"}var
|
|
37
|
+
}`;function Qt(e){return e.kind==="read"||e.kind==="pr_review_context"}var Nr=["inspect_project","fs.read","fs.write","fs.search","fs.watch","fs.upload","fs.export","fs.import","fs.download","exec.run","exec.full","process.run.v1","process.full.v1","pty.start","pty.input","pty.resize","pty.close","git.run","process.list","process.signal","ports.list","tunnel.open","tunnel.close","env.discover","setup.run","mcp.discover","mcp.start","mcp.proxy","browser.snapshot","browser.navigate","browser.act","computer.snapshot","computer.act","computer.use","browser.use","browser.recording.v1","browser.pr-proof.v1","hands.connect","jobs.control","environment.install","github.local.v1","inference.ollama.v1","inference.custom.v1","delegate.devin.copy.v1","delegate.cursor.copy.v1","display.stream.v1","automation.call.v1","preview.serve.v1","workspace.setup.v1","simulator.call.v1","simulator.stream.v1"];var er=2,N="/app/local-runtime",Xe=262144,vs="x-reason-relay-host-alias",Ss="v1";function l(e,n){return{path:`${N}${e}`,routerPath:e,auth:n}}function E(e,n){return{...l(e,"device_proof"),forOperation(r){return l(`/operations/${encodeURIComponent(r)}${n}`,"device_proof")}}}var M={register:l("/register","registration_bearer"),enroll:l("/enroll","none"),authChallenge:l("/auth/challenge","none"),identity:l("/identity","device_proof"),heartbeat:l("/heartbeat","device_proof"),rootsSync:l("/roots/sync","device_proof"),disconnect:l("/disconnect","device_proof"),lifecycle:l("/lifecycle","device_proof"),localSubscription:l("/local-subscription","device_proof"),ownerWorkspaces:l("/owner-workspaces","device_proof"),ownerWorkspaceEnrollment:l("/owner-workspaces/enrollment","device_proof"),sessionWorktrees:l("/session-worktrees","device_proof"),operationClaim:l("/operations/claim","device_proof"),operationHeartbeat:E("/operations/:operationId/heartbeat","/heartbeat"),operationEvents:E("/operations/:operationId/events","/events"),operationComplete:E("/operations/:operationId/complete","/complete"),operationEnvironment:E("/operations/:operationId/environment","/environment"),operationEnvironmentAck:E("/operations/:operationId/environment-ack","/environment-ack"),operationCustomEndpointCredential:E("/operations/:operationId/custom-endpoint-credential","/custom-endpoint-credential")},At=`${N}/session`;var J=[/^\/app\/local-runtime\/heartbeat$/,/^\/app\/local-runtime\/operations\/claim$/,/^\/app\/local-runtime\/operations\/[0-9a-fA-F-]{36}\/(?:heartbeat|events|complete|environment|environment-ack)$/];function Es(e){return J.some((n)=>n.test(e))}var Fn=60000;var ks="hands_control_v1",Lr="environment.deliver",xs="vm_hands_workspace_deferred",Cs="vm_hands.workspace_grant",As="hands.unbind_unverified",Ps="claim_v1",Rs="environment_at_claim",Ts="ready_v1",Is="workspace_check",Ds="rebind_v1",Os="resident_rebind",Ns="hands.rebind",Ls="snapshot_v1",$s="cloud_access",Ms="playwright_v1",Bs="headless_browser",Fs="v1",js="job_env_large_values",ct="srt_root_v1",Le="hands_confinement",Pt="gid_v1",xe="model_jobs_egress",Hs="setpriv_v1",Us="jobs_user",zs="spawning_attempt_v1",pe="hands_session_group";var qs="session_cap",Ws="none",Vs="same_launch_v1",Gs="exit_v1",Ks="start_wait",$r="user_chrome",Js="cloud_sessions";function C(e){if(!a(e)||Object.keys(e).length!==5||e.version!==1)return!1;let n=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return["boot_generation","recording_operation_id","recording_attempt_id"].every((r)=>typeof e[r]==="string"&&n.test(e[r]))&&typeof e.root_version==="string"&&/^[0-9]{1,20}(?:\.[0-9]{1,6})?$/.test(e.root_version)}function S(e){if(!a(e)||Object.keys(e).length!==6)return!1;let n=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return typeof e.device_id==="string"&&n.test(e.device_id)&&(e.binding==="workspace_source"||e.binding==="mcp_control")&&Number.isSafeInteger(e.target_revision)&&Number(e.target_revision)>=0&&Number.isSafeInteger(e.root_grant_revision)&&Number(e.root_grant_revision)>0&&Number.isSafeInteger(e.target_generation)&&Number(e.target_generation)>0&&typeof e.target_fence_id==="string"&&n.test(e.target_fence_id)}var Xs=["lock_acquired","enrollment_started","enrollment_completed","readiness_started","readiness_completed","inventory_completed","control_ready"],tr=86400000;var W=["production","staging"];function k(e){if(!a(e)||Object.keys(e).length!==3)return!1;let n=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return["organization_id","user_id","device_id"].every((r)=>Object.hasOwn(e,r)&&typeof e[r]==="string"&&n.test(e[r])&&e[r]!=="00000000-0000-0000-0000-000000000000")}var K="DEVICE-PROOF-V2";function Mr(e,n=K){let r=e.method.toUpperCase();if(!/^[A-Z]+$/.test(r)||!e.pathAndQuery.startsWith(`${N}/`)||e.pathAndQuery.includes(`
|
|
38
38
|
`)||!/^[0-9]{1,20}$/.test(e.timestamp)||!/^[A-Za-z0-9_-]{22,43}$/.test(e.nonce)||e.challenge.length<16||e.challenge.length>1024||e.challenge.includes(`
|
|
39
39
|
`)||!/^[a-f0-9]{64}$/.test(e.bodySha256))throw Error("Invalid Reason Device proof input.");return Buffer.from([n,r,e.pathAndQuery,e.timestamp,e.nonce,e.challenge,e.bodySha256].join(`
|
|
40
|
-
`),"utf8")}function a(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function Z(e,n){return typeof e==="string"&&n.some((r)=>r===e)}function
|
|
41
|
-
`)||typeof e.expires_at!=="string"||!Number.isFinite(Date.parse(e.expires_at)))u("Reason returned an invalid Device proof challenge.");return{challenge:e.challenge,expires_at:e.expires_at}}function H(e,n){if(!a(e)||typeof e.device_id!=="string"||e.auth_scheme!=="p256"||e.organization_id!==void 0&&typeof e.organization_id!=="string"||e.protocol_version!==er||!Array.isArray(e.roots)||!e.roots.every(
|
|
42
|
-
export{
|
|
40
|
+
`),"utf8")}function a(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function Z(e,n){return typeof e==="string"&&n.some((r)=>r===e)}function D(e){return a(e)&&typeof e.id==="string"&&typeof e.label==="string"&&typeof e.path_fingerprint==="string"}function X(e){return a(e)&&Number.isInteger(e.seq)&&Number(e.seq)>=0&&typeof e.kind==="string"&&/^[A-Za-z0-9._:-]{1,64}$/.test(e.kind)&&a(e.payload)}function u(e){throw Error(e)}function Ys(e,n){let r=a(e)?e:{},p=typeof r.error==="string"?r.error:`http_${n}`,m=typeof r.detail==="string"?r.detail:typeof r.message==="string"?r.message:`Reason Device request failed (${n})`;return{code:p,message:m}}function Vi(e){if(!a(e)||typeof e.challenge!=="string"||e.challenge.length<16||e.challenge.length>1024||e.challenge.includes(`
|
|
41
|
+
`)||typeof e.expires_at!=="string"||!Number.isFinite(Date.parse(e.expires_at)))u("Reason returned an invalid Device proof challenge.");return{challenge:e.challenge,expires_at:e.expires_at}}function H(e,n){if(!a(e)||typeof e.device_id!=="string"||e.auth_scheme!=="p256"||e.organization_id!==void 0&&typeof e.organization_id!=="string"||e.protocol_version!==er||!Array.isArray(e.roots)||!e.roots.every(D)||n&&typeof e.organization_id!=="string"||e.device_credential!==void 0)u(n?"Reason returned an invalid Device enrollment.":"Reason returned an invalid Device registration.");return{...{device_id:e.device_id,...typeof e.organization_id==="string"?{organization_id:e.organization_id}:{},protocol_version:er,roots:e.roots},auth_scheme:"p256"}}function Zs(e){return H(e,!1)}function Qs(e){let n=H(e,!0);if(typeof n.organization_id!=="string")return u("Reason returned an invalid Device enrollment.");return{...n,organization_id:n.organization_id}}function ea(e){if(!a(e)||typeof e.server_time!=="string"||typeof e.drain!=="boolean")return u("Reason returned an invalid Device heartbeat.");return{server_time:e.server_time,drain:e.drain,...U(e),...typeof e.update_policy==="string"||e.update_policy===null?{update_policy:e.update_policy}:{},...typeof e.supported_protocol_version==="number"?{supported_protocol_version:e.supported_protocol_version}:{},...ee(e.latest_cli_versions),...e.hands_prespawn===!0?{hands_prespawn:!0}:{}}}var Q=["account_root_metadata_supported","workspace_root_metadata_supported","account_root_path_supported","home_contained_roots_supported","root_paths_supported","startup_supported"];function U(e){return Object.fromEntries(Q.filter((n)=>e[n]===!0).map((n)=>[n,!0]))}function jn(e){if(!a(e))return;try{return{...Vi(e),...U(e)}}catch{return}}function ee(e){if(!a(e))return{};let n={};for(let r of W){let p=e[r];if(typeof p==="string"&&/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/.test(p))n[r]=p}return Object.keys(n).length>0?{latest_cli_versions:n}:{}}function ta(e){if(!a(e)||!Array.isArray(e.roots)||!e.roots.every(D))return u("Reason returned an invalid Device root sync.");return{roots:e.roots}}function ra(e){if(!a(e)||e.user_id!==void 0&&typeof e.user_id!=="string"||typeof e.organization_id!=="string"||typeof e.organization_name!=="string"||typeof e.organization_slug!=="string")return u("Reason returned an invalid Device identity.");return{...typeof e.user_id==="string"?{user_id:e.user_id}:{},organization_id:e.organization_id,organization_name:e.organization_name,organization_slug:e.organization_slug}}function na(e){if(!a(e)||e.disconnected!==!0)return u("Reason did not disconnect this Device.");let n=e.sessions_moved;return typeof n==="number"&&Number.isSafeInteger(n)&&n>=0?{disconnected:!0,sessions_moved:n}:{disconnected:!0}}function ia(e){if(a(e)&&e.ok===!0&&typeof e.expires==="number")return{ok:!0,expires:e.expires};if(a(e)&&e.ok===!1&&typeof e.error==="string")return{ok:!1,error:e.error};return u("Reason did not answer the local login hand-over.")}function oa(e){if(!a(e)||e.accepted!==!0)return u("Reason did not accept the Device lifecycle event.");return{accepted:!0}}function te(e){return Buffer.byteLength(JSON.stringify(e),"utf8")}function sa(e,n=Nr){if(!a(e)||typeof e.operation_id!=="string"||typeof e.attempt_id!=="string"||typeof e.attempt_token!=="string"||!/^(?:reason|ara)_attempt_/.test(e.attempt_token)||typeof e.lease_until!=="string"||typeof e.run_id!=="string"||typeof e.root_id!=="string"||e.owner!==void 0&&!k(e.owner)||!Z(e.capability,n)||!a(e.payload)||e.protocol_version!==er||te(e.payload)>(e.capability===rr?jr:Xe)||e.authority!==void 0&&!S(e.authority)||e.local_github_authority!==void 0&&!Je.safeParse(e.local_github_authority).success||e.capability==="github.local.v1"&&!Je.safeParse(e.local_github_authority).success||e.recording_authority!==void 0&&!C(e.recording_authority)||e.capability==="browser.recording.v1"&&(!C(e.recording_authority)||!k(e.owner))||e.capability!=="browser.recording.v1"&&e.recording_authority!==void 0)return u("Reason returned an invalid Device operation claim.");let r={operation_id:e.operation_id,attempt_id:e.attempt_id,attempt_token:e.attempt_token,lease_until:e.lease_until,run_id:e.run_id,root_id:e.root_id,capability:e.capability,payload:e.payload,...S(e.authority)?{authority:e.authority}:{},...C(e.recording_authority)?{recording_authority:Object.freeze({...e.recording_authority})}:{},...e.local_github_authority!==void 0?{local_github_authority:Je.parse(e.local_github_authority)}:{},...e.capability==="hands.connect"&&a(e.environment)&&a(e.environment.payload)&&S(e.environment.authority)?{environment:{payload:e.environment.payload,authority:e.environment.authority}}:{},protocol_version:er};if(e.owner!==void 0)r.owner=Object.freeze({...e.owner});return r}function aa(e){if(!a(e)||typeof e.lease_until!=="string"||!Array.isArray(e.controls)||!e.controls.every(X)||!Number.isInteger(e.next_control_seq)||Number(e.next_control_seq)<0)return u("Reason returned an invalid Device operation heartbeat.");return{lease_until:e.lease_until,controls:e.controls,next_control_seq:Number(e.next_control_seq)}}function ca(e){if(!a(e)||!Number.isInteger(e.next_event_seq)||Number(e.next_event_seq)<0||typeof e.duplicate!=="boolean"||!Number.isInteger(e.accepted_count)||Number(e.accepted_count)<0)return u("Reason returned an invalid Device operation event result.");return{next_event_seq:Number(e.next_event_seq),duplicate:e.duplicate,accepted_count:Number(e.accepted_count)}}function la(e){if(!a(e)||!a(e.payload)||!S(e.authority))return u("Reason returned an invalid Device environment delivery.");return{payload:e.payload,authority:e.authority}}function oe(e){return e==="succeeded"||e==="failed"||e==="cancelled"||e==="expired"}function ua(e){if(!a(e)||!oe(e.status)||typeof e.idempotent!=="boolean")return u("Reason returned an invalid Device operation completion.");return{status:e.status,idempotent:e.idempotent}}
|
|
42
|
+
export{Ct,Bn,bs,Or,Vc,Je,Gc,Kc,Qt,Nr,er,Xe,vs,Ss,M,At,Es,Fn,ks,Lr,xs,Cs,As,Ps,Rs,Ts,Is,Ds,Os,Ns,Ls,$s,Ms,Bs,Fs,js,ct,Le,Pt,xe,Hs,Us,zs,pe,qs,Ws,Vs,Gs,Ks,$r,Js,Xs,tr,Mr,Ys,Vi,Zs,Qs,ea,jn,ta,ra,na,ia,oa,sa,aa,ca,la,ua};
|