@verirun/cli 0.2.2 → 0.2.3
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/README.md +34 -6
- package/dist/cli.js +13 -13
- package/dist/gate.mjs +1 -1
- package/man/verirun.1 +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,12 +74,21 @@ invalid: the CLI keeps working off the last lease, silently for 15 days, then
|
|
|
74
74
|
with a "connect to the internet" notice every run, and stops at 30 days offline
|
|
75
75
|
until it can revalidate. The server can also refuse very old CLI versions.
|
|
76
76
|
|
|
77
|
-
**Hardware binding.** Each check sends a fingerprint of this machine
|
|
78
|
-
the
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
**Hardware binding.** Each check sends a fingerprint of this machine — a hash of
|
|
78
|
+
the identifier your OS assigns its own installation (`/etc/machine-id` on Linux,
|
|
79
|
+
`IOPlatformUUID` on macOS, `MachineGuid` on Windows), plus platform, architecture
|
|
80
|
+
and OS user. The raw values never leave the machine. Because it is anchored on
|
|
81
|
+
the install rather than on your network hardware, docking a laptop, changing
|
|
82
|
+
Wi-Fi, toggling a VPN or renaming the machine all leave it unchanged.
|
|
83
|
+
|
|
84
|
+
On a system that exposes no such identifier the CLI falls back to hashing the
|
|
85
|
+
physical MAC addresses and hostname, which *can* shift when the network changes
|
|
86
|
+
and would then take a second seat.
|
|
87
|
+
|
|
88
|
+
Your plan includes a set number of machine seats; connecting a new machine past
|
|
89
|
+
that is blocked until you release one from
|
|
90
|
+
<https://get-verirun.duely.in/account>. Reinstalling the OS issues a new
|
|
91
|
+
identifier, so that does count as a new machine — release the stale one.
|
|
83
92
|
|
|
84
93
|
`verirun --help`, `verirun --version`, `verirun log` and `verirun agent` do not require an account.
|
|
85
94
|
`verirun map` does.
|
|
@@ -646,6 +655,25 @@ run this often.
|
|
|
646
655
|
|
|
647
656
|
## Changelog
|
|
648
657
|
|
|
658
|
+
### 0.2.3
|
|
659
|
+
|
|
660
|
+
- **`verirun whoami` shows this machine's fingerprint**, in the same 24-character
|
|
661
|
+
form the account page lists, so a user with several machines of the same
|
|
662
|
+
hostname can tell which row is which. The seat-limit message names it too,
|
|
663
|
+
instead of only saying to go release something.
|
|
664
|
+
- An unlimited seat count (admin keys) no longer prints as a raw integer.
|
|
665
|
+
- **A seat now follows the machine, not the network.** The fingerprint is
|
|
666
|
+
anchored on the identifier the OS assigns its own installation
|
|
667
|
+
(`/etc/machine-id`, `IOPlatformUUID`, `MachineGuid`) instead of on MAC
|
|
668
|
+
addresses and hostname. Docking a laptop, changing Wi-Fi, toggling a VPN or
|
|
669
|
+
renaming the machine used to produce a new fingerprint, taking a second seat
|
|
670
|
+
and — on a one-seat plan — locking the user out of the machine they were
|
|
671
|
+
already using. Where an OS exposes no such identifier the old MAC-based
|
|
672
|
+
fingerprint remains as a fallback.
|
|
673
|
+
|
|
674
|
+
This shifts every fingerprint once. Machines connected on an earlier version
|
|
675
|
+
register as new; release the stale entry from the account page.
|
|
676
|
+
|
|
649
677
|
### 0.2.2
|
|
650
678
|
|
|
651
679
|
Networking fixes. On a network that forces traffic through a proxy, the CLI
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire as __cr}from'node:module';const require=__cr(import.meta.url);
|
|
3
|
-
import{createPublicKey as Gn,verify as Hn}from"node:crypto";import{readFileSync as Kn}from"node:fs";import Er from"node:path";import{fileURLToPath as Jn}from"node:url";import{Command as Yn}from"commander";import se from"node:os";import{setTimeout as xe}from"node:timers/promises";var Ce=!1,Ar=["https_proxy","HTTPS_PROXY","http_proxy","HTTP_PROXY"];function B(){for(let e of Ar){let r=process.env[e]?.trim();if(r)return r}}function Nr(e,r=process.env.NO_PROXY??process.env.no_proxy){let o=r?.trim();if(!o)return!1;if(o==="*")return!0;let t=e.toLowerCase();return o.split(",").map(i=>i.trim().toLowerCase().replace(/^\./,"").split(":")[0]??"").filter(Boolean).some(i=>t===i||t.endsWith(`.${i}`))}async function Lr(e){if(Ce)return;Ce=!0;let r=B();if(!r)return;let o;try{o=(typeof e=="string"?new URL(e):e).hostname}catch{return}if(!Nr(o))try{let{ProxyAgent:t,setGlobalDispatcher:i}=await import("undici");i(new t(r))}catch{}}async function E(e,r){return await Lr(e),fetch(e,r)}function je(e){let r=Tr(e);if(r)switch(r){case"ENOTFOUND":case"EAI_AGAIN":return`${r} \u2014 the address could not be resolved. A DNS filter or a captive portal will do this.`;case"ECONNREFUSED":case"ECONNRESET":case"EHOSTUNREACH":case"ENETUNREACH":return`${r} \u2014 the connection was blocked. ${Ie()}`;case"UND_ERR_CONNECT_TIMEOUT":case"ETIMEDOUT":return`${r} \u2014 the connection timed out. ${Ie()}`;case"UNABLE_TO_GET_ISSUER_CERT_LOCALLY":case"SELF_SIGNED_CERT_IN_CHAIN":case"DEPTH_ZERO_SELF_SIGNED_CERT":case"CERT_HAS_EXPIRED":return`${r} \u2014 the TLS certificate was not trusted. A proxy that inspects traffic causes this; point NODE_EXTRA_CA_CERTS at your organisation's CA file.`;default:return r}}function Ie(){let e=B();return e?`Reached through the proxy ${e}, so check that the proxy is correct and running.`:"If this network needs a proxy, set HTTPS_PROXY."}function Tr(e){for(let r=e,o=0;r&&o<4;o++){if(typeof r=="object"&&"code"in r&&typeof r.code=="string")return r.code;r=typeof r=="object"&&"cause"in r?r.cause:void 0}}import{spawn as Pr}from"node:child_process";function L(e){let r=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",o=process.platform==="win32"?["/c","start","",e]:[e];try{let t=Pr(r,o,{stdio:"ignore",detached:!0});t.on("error",()=>{}),t.unref()}catch{}}var _r=!!process.stdout.isTTY&&!process.env.NO_COLOR,P=(e,r)=>_r?`\x1B[${e}m${r}\x1B[0m`:r,n={info:e=>console.log(e),step:e=>console.log(`${P("90","\xB7")} ${e}`),success:e=>console.log(`${P("32","\u2713")} ${e}`),warn:e=>console.warn(`${P("33","!")} ${e}`),error:e=>console.error(`${P("31","\u2717")} ${e}`),dim:e=>P("90",e),bold:e=>P("1",e)};var T="0.2.
|
|
4
|
-
${u}`:" Check your connection."}`)}if(!
|
|
5
|
-
`,{mode:384}),ce(e,"file")}import{existsSync as Oe}from"node:fs";import C from"node:path";var G=".verirun";function Kr(e=process.cwd()){let r=C.resolve(e),o;for(;;){if(Oe(C.join(r,".git")))return r;!o&&Oe(C.join(r,"package.json"))&&(o=r);let t=C.dirname(r);if(t===r)break;r=t}return o??C.resolve(e)}function w(e){let r=Kr(e),o=C.join(r,G);return{repoRoot:r,dataDir:o,workflowsDir:C.join(o,"workflows"),runsDir:C.join(o,"runs"),configPath:C.join(o,"config.json")}}function _(e,r){return C.join(e.workflowsDir,`${r}.json`)}function De(e=new Date){return e.toISOString().replace(/[:.]/g,"-")}function Ue(e,r,o){return C.join(e.runsDir,`${r}-${o}`)}var H=1;function qr(e){return e.commands.filter(r=>r.name()!=="help").map(r=>{let o=r.registeredArguments.map(t=>t.required?`<${t.name()}>`:`[${t.name()}]`).join(" ");return{name:r.name(),usage:`verirun ${r.name()}${o?` ${o}`:""}${r.options.length?" [options]":""}`,description:r.description(),options:r.options.map(t=>({flags:t.flags,description:t.description}))}})}async function Xr(e){try{return(await Me(e)).filter(r=>r.endsWith(".json")).map(r=>r.slice(0,-5)).sort()}catch{return[]}}async function zr(e,r){try{return(await Me(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort().slice(-r).reverse()}catch{return[]}}async function Qr(){let e=w(),r={};try{r=await N(e.configPath)}catch{}let o=["supabase","vercel","railway"].filter(t=>r[t]);return{repoRoot:e.repoRoot,dataDir:e.dataDir,dataDirExists:Ve(e.dataDir),configPath:e.configPath,configExists:Ve(e.configPath),logSources:[...o],userFilter:typeof r.userFilter=="string"?r.userFilter:null,workflows:await Xr(e.workflowsDir),recentRuns:await zr(e.runsDir,5)}}var de="verirun records a browser workflow once, replays those exact steps headless on demand, and captures the backend logs produced during the replay. Deterministic: the same recording gives the same run and the same answer. `verirun map` is the static half: it reads a React/TypeScript repo and emits the interaction graph \u2014 every page, the interactive elements on it, where they navigate, and the backend calls they make \u2014 without running anything.",ue=["```jsonc","{",' "schemaVersion": 1,',' "name": "<same as the filename>",',' "createdAt": "<ISO>",',' "startUrl": "https://app.example.com/login", // optional',' "browser": "chromium", // chromium | firefox | webkit',' "channel": "chrome", // optional: installed browser',' "steps": [',' { "index": 0, "action": "navigate", "params": { "url": "https://app.example.com/login" }, "signals": [] },',' { "index": 1, "action": "fill", "selector": "role=textbox[name=\\"Email\\"i]", "params": { "text": "ada@example.com" }, "signals": [] },',' { "index": 2, "action": "click", "selector": "role=button[name=\\"Log in\\"i]", "params": {}, "signals": [] }'," ]","}","```","","**Click your way through the app; do not walk it by URL.** Use `navigate` for the","first step, and after that reach a page by clicking the thing that goes there \u2014 a","workflow that jumps between URLs proves nothing about the UI, and a dead link or a","button that stopped submitting still passes. `verirun map --bfs <route> --depth 2`","prints each reachable page with the element that gets you there, and every element","in `map --json` carries the `selector` to click. Navigate mid-workflow only for a","page with no path to it, or to deliberately deep-link into a state.","","Actions and their required `params`: `navigate` (`url`, absolute), `click` /","`dblclick`, `fill` (`text`), `press` (`key`), `check` / `uncheck`, `select`","(`values`), `setInputFiles` (`files`). Everything except `navigate` needs a","`selector`. An unknown action stops the run; `assert*` is skipped with a warning.","`selector` goes straight to `page.locator()`, so it must be Playwright selector",'syntax \u2014 `role=button[name="Log in"i]`, `[data-testid="x"]`, or CSS.'],fe=["Anything behind a login needs a browser profile that is already signed in.","Pass the profile to `record` and `run`:","","```bash","# macOS / Linux \u2014 the shell expands ~ before verirun sees it","verirun run <name> --channel chrome --user-data-dir ~/.verirun-profile","verirun record <name> --channel chrome --user-data-dir ~/.verirun-profile","```","","```powershell","# Windows \u2014 cmd and PowerShell do NOT expand ~ inside this argument, so pass an",'# absolute path. A literal ~ creates a directory named "~" and the run silently',"# starts logged out.",'verirun run <name> --channel chrome --user-data-dir "$env:USERPROFILE\\.verirun-profile"',"```","","verirun never expands `~` itself \u2014 the path goes straight through to Playwright.","","The profile has to be created once **by a human**, because identity providers","refuse to authenticate an automation-launched browser:","","```bash","# macOS / Linux",'google-chrome --user-data-dir="$HOME/.verirun-profile" --password-store=basic',"```","","```powershell","# Windows (PowerShell)",'& "$env:ProgramFiles\\Google\\Chrome\\Application\\chrome.exe" `',' --user-data-dir="$env:USERPROFILE\\.verirun-profile"',"```","","Sign in to the app in that window, then close it.","","`--password-store=basic` (and `--use-mock-keychain` on macOS) matter on Unix:","Playwright passes both on every platform, and cookies written under the OS keyring","cannot be decrypted without them \u2014 the run would silently start logged out.","Both switches are Unix-only, so on Windows they are ignored and the profile just","has to be created by the same Windows user that runs verirun. The Windows path is","untested \u2014 if a run there starts logged out despite a signed-in profile, report","that rather than guessing.","","On every platform, do not point `--user-data-dir` at the human's everyday Chrome","profile.","","If you are asked to test a signed-in flow and no such profile exists, say so and","give the command above rather than trying to script the login."],pe=["A human records the workflow once: `verirun record <name> --url <app-url>` (needs a display).","After a code change, run it: `verirun run <name>`. Add `--user <email>` to keep only that user's log lines.","Exit code 0 = every step replayed. Exit code 1 = a step failed, or a licensing / setup error.","Read `.verirun/runs/<name>-<newest>/logs.json`: check `status`; on `failed` read `error` and `steps.failedAt`; then scan `entries` for the backend's side \u2014 a 200 that hid an exception, a write that never landed, a job that threw after the screen said done.","`verirun run` writes logs.json even when replay fails, so partial logs survive.","Do not edit files under `.verirun/workflows/` by hand unless you understand the selector format; re-record instead.","`verirun map` needs no recording and no run: use it to find what a page can do before writing a workflow, `--json` for the whole graph, `--bfs <route> --depth N` for what is reachable from one page."];function Zr(e,r){let o=[],t=(i="")=>{o.push(i)};t("# verirun \u2014 agent reference"),t(),t(de),t(),t(`Version ${T}. Full docs: https://get-verirun.duely.in and the bundled README.md / \`man verirun\`.`),t(),t("## This checkout"),t(),t(`- repo root: ${e.repoRoot}`),t(`- data dir: ${e.dataDir} ${e.dataDirExists?"(exists)":"(not created yet)"}`),t(`- config: ${e.configPath} ${e.configExists?"(present)":"(absent)"}`),t(`- log sources: ${e.logSources.length?e.logSources.join(", "):"none configured \u2014 `verirun run` still replays, just with no backend logs"}`),t(`- user filter: ${e.userFilter??"none"}`),t(`- workflows: ${e.workflows.length?e.workflows.join(", "):"none recorded yet"}`),t(`- recent runs: ${e.recentRuns.length?e.recentRuns.join(", "):"none yet"}`),t(),t("Account: `record`, `run` and `map` need a connected account (`verirun login`, or `$VERIRUN_LICENSE_KEY` in CI). `verirun whoami` shows status. `--help`, `--version`, `verirun log`, and `verirun agent` do not need one."),t(),t("## Commands");for(let i of r){t(),t(`### ${i.usage}`),i.description&&t(i.description);for(let s of i.options)t(`- \`${s.flags}\` \u2014 ${s.description}`)}t(),t("## `.verirun/` layout (at the repo root shown above)"),t(),t("```"),t(".verirun/"),t(" config.json log sources, userFilter, testIdAttribute"),t(" workflows/<name>.json one recorded workflow each"),t(" runs/<name>-<timestamp>/logs.json captured logs, one directory per run"),t("```"),t(),t("Per-user, not per-project: `~/.verirun/config.json` (device token), `~/.verirun/state.json` (signed license lease)."),t(),t(`## logs.json (schemaVersion ${H})`),t(),t("```jsonc"),t("{"),t(` "schemaVersion": ${H},`),t(' "workflow": "<name>",'),t(' "status": "ok" | "failed", // "failed" => process exit code 1'),t(' "window": { "startedAt": "<ISO>", "endedAt": "<ISO>" },'),t(' "steps": { "total": N, "replayed": N, "failedAt"?: N },'),t(' "error"?: "<message>", // present only when status is "failed"'),t(' "filter"?: { "user": "<needle>" }, // present when --user / config.userFilter narrowed entries'),t(' "sources": [ { "id": "supabase"|"vercel"|"railway", "name": "...", "entries": N } ],'),t(' "entries": ['),t(" {"),t(' "source": "supabase"|"vercel"|"railway",'),t(' "stream": "<sub-stream, e.g. edge_logs / lambda>",'),t(' "timestamp": "<ISO>",'),t(' "level": "<info|warn|error|...>",'),t(' "message": "<rendered log line>",'),t(' "raw": { /* provider payload, untouched */ }'),t(" }"),t(" ]"),t("}"),t("```"),t(),t("`entries` is every source merged and sorted by `timestamp`. When a `--user` filter is active, `entries` and every `sources[].entries` count are post-filter."),t(),t("## Writing a workflow yourself"),t(),t("`verirun map --json` gives every page element a `selector`, a `selectorConfidence` (`high` / `medium` / `low`) and a suggested `action`. That is enough to author `.verirun/workflows/<name>.json` without recording:"),t();for(let i of ue)t(i);t(),t("Then `verirun workflow check <name>` (add `--json` for machine-readable findings) validates shape, actions, selectors and params without opening a browser. It cannot tell you a selector matches the live page \u2014 only `verirun run <name>` can. Prefer `high`-confidence selectors; a `low` one is a guess. A recorded workflow is still more faithful, so do not overwrite one with a generated file: pick a different name."),t(),t("## Signed-in runs"),t();for(let i of fe)t(i);return t(),t("## Recommended agent loop"),t(),pe.forEach((i,s)=>t(`${s+1}. ${i}`)),t(),t("Save this into your agent context: `verirun agent > .verirun/AGENT.md`, or paste it into `CLAUDE.md` / `.cursorrules` / an AGENTS.md. `verirun agent --json` emits the same information as JSON."),t(),o.join(`
|
|
3
|
+
import{createPublicKey as Gn,verify as Hn}from"node:crypto";import{readFileSync as Kn}from"node:fs";import Er from"node:path";import{fileURLToPath as Jn}from"node:url";import{Command as Yn}from"commander";import se from"node:os";import{setTimeout as xe}from"node:timers/promises";var Ce=!1,Ar=["https_proxy","HTTPS_PROXY","http_proxy","HTTP_PROXY"];function B(){for(let e of Ar){let r=process.env[e]?.trim();if(r)return r}}function Nr(e,r=process.env.NO_PROXY??process.env.no_proxy){let o=r?.trim();if(!o)return!1;if(o==="*")return!0;let t=e.toLowerCase();return o.split(",").map(i=>i.trim().toLowerCase().replace(/^\./,"").split(":")[0]??"").filter(Boolean).some(i=>t===i||t.endsWith(`.${i}`))}async function Lr(e){if(Ce)return;Ce=!0;let r=B();if(!r)return;let o;try{o=(typeof e=="string"?new URL(e):e).hostname}catch{return}if(!Nr(o))try{let{ProxyAgent:t,setGlobalDispatcher:i}=await import("undici");i(new t(r))}catch{}}async function E(e,r){return await Lr(e),fetch(e,r)}function je(e){let r=Tr(e);if(r)switch(r){case"ENOTFOUND":case"EAI_AGAIN":return`${r} \u2014 the address could not be resolved. A DNS filter or a captive portal will do this.`;case"ECONNREFUSED":case"ECONNRESET":case"EHOSTUNREACH":case"ENETUNREACH":return`${r} \u2014 the connection was blocked. ${Ie()}`;case"UND_ERR_CONNECT_TIMEOUT":case"ETIMEDOUT":return`${r} \u2014 the connection timed out. ${Ie()}`;case"UNABLE_TO_GET_ISSUER_CERT_LOCALLY":case"SELF_SIGNED_CERT_IN_CHAIN":case"DEPTH_ZERO_SELF_SIGNED_CERT":case"CERT_HAS_EXPIRED":return`${r} \u2014 the TLS certificate was not trusted. A proxy that inspects traffic causes this; point NODE_EXTRA_CA_CERTS at your organisation's CA file.`;default:return r}}function Ie(){let e=B();return e?`Reached through the proxy ${e}, so check that the proxy is correct and running.`:"If this network needs a proxy, set HTTPS_PROXY."}function Tr(e){for(let r=e,o=0;r&&o<4;o++){if(typeof r=="object"&&"code"in r&&typeof r.code=="string")return r.code;r=typeof r=="object"&&"cause"in r?r.cause:void 0}}import{spawn as Pr}from"node:child_process";function L(e){let r=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",o=process.platform==="win32"?["/c","start","",e]:[e];try{let t=Pr(r,o,{stdio:"ignore",detached:!0});t.on("error",()=>{}),t.unref()}catch{}}var _r=!!process.stdout.isTTY&&!process.env.NO_COLOR,P=(e,r)=>_r?`\x1B[${e}m${r}\x1B[0m`:r,n={info:e=>console.log(e),step:e=>console.log(`${P("90","\xB7")} ${e}`),success:e=>console.log(`${P("32","\u2713")} ${e}`),warn:e=>console.warn(`${P("33","!")} ${e}`),error:e=>console.error(`${P("31","\u2717")} ${e}`),dim:e=>P("90",e),bold:e=>P("1",e)};var T="0.2.3";var Or=1440*60*1e3;function ae(){return import("./gate.mjs")}async function Ae(e){let{getMachineId:r,saveGlobalConfig:o,clearLicenseState:t,loadGlobalConfig:i,resolveServer:s,persistLease:a}=await ae(),c=await i(),l=e.server?e.server.replace(/\/+$/,""):s(c.licenseServer);if(c.token&&!e.force){n.info("This machine is already connected. Run `verirun whoami`, or"),n.info("`verirun login --force` to connect it to a different account.");return}let d=await r(),p;try{p=await E(`${l}/api/cli/link`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fingerprint:d,hostname:se.hostname(),os:`${se.platform()} ${se.release()}`,cliVersion:T})})}catch(h){let u=je(h);throw new Error(`Could not reach ${l}.${u?`
|
|
4
|
+
${u}`:" Check your connection."}`)}if(!p.ok)throw new Error(p.status===429?`${l} is rate limiting this machine (429). Wait a few minutes and try again.`:`${l} could not start the login (HTTP ${p.status}). This is a server-side problem, not your connection.`);let f=await p.json(),g=`${f.verifyUrl}?code=${encodeURIComponent(f.userCode)}`;n.info(""),n.info("To connect this machine to your Verirun account:"),n.info(""),n.info(` 1. Open ${n.bold(f.verifyUrl)}`),n.info(` 2. Enter ${n.bold(f.userCode)}`),n.info(""),n.info(n.dim(`(trying to open ${g} for you)`)),L(g),n.info(""),n.step("Waiting for approval in the browser..."),e.server&&await o({licenseServer:l});let m=Date.now()+f.expiresIn*1e3,w=Math.max(2,f.interval)*1e3;for(;Date.now()<m;){await xe(w);let h=await E(`${l}/api/cli/link/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:f.deviceCode,fingerprint:d})}).catch(()=>{});if(!h)continue;if(h.status===429){await xe(w);continue}let u=await h.json().catch(()=>({status:"server_error"}));if(u.status==="ok"&&u.token){await o({token:u.token,licenseKey:void 0}),await t();let v={kind:"token",value:u.token,server:l},S=u.license?.lease;if(S){await a(v,S);let $=u.license,x=$?.planName??$?.plan??"trial",A=typeof $?.seats=="number"&&$.seats>1?`, ${$.seats} machine seats`:"";n.success(`Connected. Plan: ${x} (${$?.status??"ok"})${A}.`)}else u.license&&u.license.valid===!1?(n.success("Connected."),u.license.reason==="trial_device_limit"?n.warn("This machine has already been used for the free trial on two other accounts, so record and run are blocked. Email support to request another trial, or subscribe from your account."):n.warn(`The account is connected but not active (${u.license.reason??u.license.status??"unknown"}). Check your subscription at your account page.`)):n.success("Connected.");return}if(u.status!=="pending"){if(u.status==="expired")throw new Error("The code expired. Run `verirun login` again.");if(u.status==="denied")throw new Error("The request was denied in the browser.");if(u.status==="no_license")throw new Error("That account has no license. Contact support.");if(u.status==="fingerprint_mismatch")throw new Error("This machine does not match the one that started the login.")}}throw new Error("Timed out waiting for approval. Run `verirun login` again.")}async function Ne(){let{loadGlobalConfig:e,resolveServer:r,saveGlobalConfig:o,clearLicenseState:t}=await ae(),i=await e(),s=r(i.licenseServer);i.token&&await E(`${s}/api/cli/logout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i.token})}).catch(()=>{}),await o({token:void 0,licenseKey:void 0}),await t(),n.success("Disconnected this machine. Run `verirun login` to reconnect.")}async function Le(e){let{resolveCredential:r,checkWithServer:o,persistLease:t,readStoredLease:i,getMachineId:s}=await ae(),a=await r();if(n.info(""),!a){n.info(n.bold("Verirun: not connected")),n.info(""),n.info(`Run ${n.bold("verirun login")} to connect this machine.`),n.info("");return}let c=e.server?e.server.replace(/\/+$/,""):a.server,l={...a,server:c};n.info(n.bold("Verirun")),n.info(` credential ${a.kind==="token"?"device token":"license key"}`+(process.env.VERIRUN_LICENSE_KEY?n.dim(" (from $VERIRUN_LICENSE_KEY)"):"")),n.info(` server ${c}`),n.info(` machine ${(await s()).slice(0,24)}\u2026`);let d=await o(l);if(d.reachable&&d.lease){await t(l,d.lease);let m=(await i(l))?.payload;if(n.info(` status ${n.bold(m?.status??"valid")}`),m?.planName||m?.plan){let w=m.planName&&m.plan&&m.planName!==m.plan?n.dim(` (${m.plan})`):"";n.info(` plan ${m.planName??m.plan}${w}`)}typeof m?.seats=="number"&&n.info(` seats ${m.seats>1e3?"unlimited":`${m.seats} machine${m.seats===1?"":"s"}`}`),m?.exp&&n.info(` lease until ${new Date(m.exp*1e3).toISOString()}`),n.info(""),n.info(n.dim("Checked just now, lease signature verified.")),n.info("");return}if(d.reachable&&d.result&&!d.result.valid){n.info(` status ${d.result.status??"invalid"} (${d.result.reason??"\u2014"})`),n.info(""),n.info("record and run will not proceed."),n.info("");return}n.warn(" the license server is not reachable right now."),d.detail&&n.info(` reason ${d.detail}`);let p=B();p&&!d.detail?.includes(p)&&n.info(` network using proxy ${p}`);let f=await i(l);if(f){let g=Math.floor((Date.now()-f.payload.iat*1e3)/Or);n.info(` lease valid, issued ${g} day${g===1?"":"s"} ago`),n.info(n.dim(" Nags after 15 days offline, stops after 30."))}else n.info(n.dim(" No valid lease stored. Connect to the internet and run this again."));n.info("")}import{existsSync as Ve}from"node:fs";import{mkdir as Jr,readdir as Me,writeFile as Yr}from"node:fs/promises";import{join as Fe}from"node:path";import{existsSync as le}from"node:fs";import{mkdir as Br,readFile as Te,writeFile as Gr}from"node:fs/promises";import Hr from"node:path";import{execFile as Dr}from"node:child_process";import{chmod as Ur}from"node:fs/promises";import Vr from"node:os";import{promisify as Fr}from"node:util";var Mr=Fr(Dr);async function ce(e,r){if(process.platform!=="win32")try{return await Ur(e,r==="dir"?448:384),!0}catch{return!1}let o=Wr();if(!o)return!1;let t=r==="dir"?`${o}:(OI)(CI)F`:`${o}:F`;try{return await Mr("icacls",[e,"/inheritance:r","/grant:r",t],{timeout:1e4,windowsHide:!0}),!0}catch{return!1}}function Wr(){let e=process.env.USERNAME;if(!e)try{e=Vr.userInfo().username}catch{return}if(!e)return;let r=process.env.USERDOMAIN;return r&&r!==e?`${r}\\${e}`:e}var Pe="data-testid";async function N(e){let r={};if(le(e)){let a=await Te(e,"utf8");try{r=JSON.parse(a)}catch(c){throw new Error(`Config file is not valid JSON: ${e}`,{cause:c})}}let o=process.env.VERIRUN_SUPABASE_ACCESS_TOKEN;o&&(r.supabase={...r.supabase,accessToken:o});let t=process.env.VERIRUN_RAILWAY_TOKEN;t&&(r.railway={...r.railway,token:t});let i=process.env.VERIRUN_VERCEL_DRAIN_SECRET;i&&(r.vercel={...r.vercel,drainSecret:i});let s=process.env.VERIRUN_VERCEL_TOKEN?.trim();return s&&(r.vercel={...r.vercel,token:s}),r}async function _e(e,r){let o={};if(le(e))try{o=JSON.parse(await Te(e,"utf8"))}catch(a){throw new Error(`Config file is not valid JSON: ${e}`,{cause:a})}let t={...o,...r,supabase:r.supabase?{...o.supabase,...r.supabase}:o.supabase,vercel:r.vercel?{...o.vercel,...r.vercel}:o.vercel,railway:r.railway?{...o.railway,...r.railway}:o.railway},i=Hr.dirname(e),s=le(i);return await Br(i,{recursive:!0,mode:448}),s||await ce(i,"dir"),await Gr(e,`${JSON.stringify(t,null,2)}
|
|
5
|
+
`,{mode:384}),ce(e,"file")}import{existsSync as Oe}from"node:fs";import C from"node:path";var G=".verirun";function Kr(e=process.cwd()){let r=C.resolve(e),o;for(;;){if(Oe(C.join(r,".git")))return r;!o&&Oe(C.join(r,"package.json"))&&(o=r);let t=C.dirname(r);if(t===r)break;r=t}return o??C.resolve(e)}function y(e){let r=Kr(e),o=C.join(r,G);return{repoRoot:r,dataDir:o,workflowsDir:C.join(o,"workflows"),runsDir:C.join(o,"runs"),configPath:C.join(o,"config.json")}}function _(e,r){return C.join(e.workflowsDir,`${r}.json`)}function De(e=new Date){return e.toISOString().replace(/[:.]/g,"-")}function Ue(e,r,o){return C.join(e.runsDir,`${r}-${o}`)}var H=1;function qr(e){return e.commands.filter(r=>r.name()!=="help").map(r=>{let o=r.registeredArguments.map(t=>t.required?`<${t.name()}>`:`[${t.name()}]`).join(" ");return{name:r.name(),usage:`verirun ${r.name()}${o?` ${o}`:""}${r.options.length?" [options]":""}`,description:r.description(),options:r.options.map(t=>({flags:t.flags,description:t.description}))}})}async function Xr(e){try{return(await Me(e)).filter(r=>r.endsWith(".json")).map(r=>r.slice(0,-5)).sort()}catch{return[]}}async function zr(e,r){try{return(await Me(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort().slice(-r).reverse()}catch{return[]}}async function Qr(){let e=y(),r={};try{r=await N(e.configPath)}catch{}let o=["supabase","vercel","railway"].filter(t=>r[t]);return{repoRoot:e.repoRoot,dataDir:e.dataDir,dataDirExists:Ve(e.dataDir),configPath:e.configPath,configExists:Ve(e.configPath),logSources:[...o],userFilter:typeof r.userFilter=="string"?r.userFilter:null,workflows:await Xr(e.workflowsDir),recentRuns:await zr(e.runsDir,5)}}var de="verirun records a browser workflow once, replays those exact steps headless on demand, and captures the backend logs produced during the replay. Deterministic: the same recording gives the same run and the same answer. `verirun map` is the static half: it reads a React/TypeScript repo and emits the interaction graph \u2014 every page, the interactive elements on it, where they navigate, and the backend calls they make \u2014 without running anything.",ue=["```jsonc","{",' "schemaVersion": 1,',' "name": "<same as the filename>",',' "createdAt": "<ISO>",',' "startUrl": "https://app.example.com/login", // optional',' "browser": "chromium", // chromium | firefox | webkit',' "channel": "chrome", // optional: installed browser',' "steps": [',' { "index": 0, "action": "navigate", "params": { "url": "https://app.example.com/login" }, "signals": [] },',' { "index": 1, "action": "fill", "selector": "role=textbox[name=\\"Email\\"i]", "params": { "text": "ada@example.com" }, "signals": [] },',' { "index": 2, "action": "click", "selector": "role=button[name=\\"Log in\\"i]", "params": {}, "signals": [] }'," ]","}","```","","**Click your way through the app; do not walk it by URL.** Use `navigate` for the","first step, and after that reach a page by clicking the thing that goes there \u2014 a","workflow that jumps between URLs proves nothing about the UI, and a dead link or a","button that stopped submitting still passes. `verirun map --bfs <route> --depth 2`","prints each reachable page with the element that gets you there, and every element","in `map --json` carries the `selector` to click. Navigate mid-workflow only for a","page with no path to it, or to deliberately deep-link into a state.","","Actions and their required `params`: `navigate` (`url`, absolute), `click` /","`dblclick`, `fill` (`text`), `press` (`key`), `check` / `uncheck`, `select`","(`values`), `setInputFiles` (`files`). Everything except `navigate` needs a","`selector`. An unknown action stops the run; `assert*` is skipped with a warning.","`selector` goes straight to `page.locator()`, so it must be Playwright selector",'syntax \u2014 `role=button[name="Log in"i]`, `[data-testid="x"]`, or CSS.'],fe=["Anything behind a login needs a browser profile that is already signed in.","Pass the profile to `record` and `run`:","","```bash","# macOS / Linux \u2014 the shell expands ~ before verirun sees it","verirun run <name> --channel chrome --user-data-dir ~/.verirun-profile","verirun record <name> --channel chrome --user-data-dir ~/.verirun-profile","```","","```powershell","# Windows \u2014 cmd and PowerShell do NOT expand ~ inside this argument, so pass an",'# absolute path. A literal ~ creates a directory named "~" and the run silently',"# starts logged out.",'verirun run <name> --channel chrome --user-data-dir "$env:USERPROFILE\\.verirun-profile"',"```","","verirun never expands `~` itself \u2014 the path goes straight through to Playwright.","","The profile has to be created once **by a human**, because identity providers","refuse to authenticate an automation-launched browser:","","```bash","# macOS / Linux",'google-chrome --user-data-dir="$HOME/.verirun-profile" --password-store=basic',"```","","```powershell","# Windows (PowerShell)",'& "$env:ProgramFiles\\Google\\Chrome\\Application\\chrome.exe" `',' --user-data-dir="$env:USERPROFILE\\.verirun-profile"',"```","","Sign in to the app in that window, then close it.","","`--password-store=basic` (and `--use-mock-keychain` on macOS) matter on Unix:","Playwright passes both on every platform, and cookies written under the OS keyring","cannot be decrypted without them \u2014 the run would silently start logged out.","Both switches are Unix-only, so on Windows they are ignored and the profile just","has to be created by the same Windows user that runs verirun. The Windows path is","untested \u2014 if a run there starts logged out despite a signed-in profile, report","that rather than guessing.","","On every platform, do not point `--user-data-dir` at the human's everyday Chrome","profile.","","If you are asked to test a signed-in flow and no such profile exists, say so and","give the command above rather than trying to script the login."],pe=["A human records the workflow once: `verirun record <name> --url <app-url>` (needs a display).","After a code change, run it: `verirun run <name>`. Add `--user <email>` to keep only that user's log lines.","Exit code 0 = every step replayed. Exit code 1 = a step failed, or a licensing / setup error.","Read `.verirun/runs/<name>-<newest>/logs.json`: check `status`; on `failed` read `error` and `steps.failedAt`; then scan `entries` for the backend's side \u2014 a 200 that hid an exception, a write that never landed, a job that threw after the screen said done.","`verirun run` writes logs.json even when replay fails, so partial logs survive.","Do not edit files under `.verirun/workflows/` by hand unless you understand the selector format; re-record instead.","`verirun map` needs no recording and no run: use it to find what a page can do before writing a workflow, `--json` for the whole graph, `--bfs <route> --depth N` for what is reachable from one page."];function Zr(e,r){let o=[],t=(i="")=>{o.push(i)};t("# verirun \u2014 agent reference"),t(),t(de),t(),t(`Version ${T}. Full docs: https://get-verirun.duely.in and the bundled README.md / \`man verirun\`.`),t(),t("## This checkout"),t(),t(`- repo root: ${e.repoRoot}`),t(`- data dir: ${e.dataDir} ${e.dataDirExists?"(exists)":"(not created yet)"}`),t(`- config: ${e.configPath} ${e.configExists?"(present)":"(absent)"}`),t(`- log sources: ${e.logSources.length?e.logSources.join(", "):"none configured \u2014 `verirun run` still replays, just with no backend logs"}`),t(`- user filter: ${e.userFilter??"none"}`),t(`- workflows: ${e.workflows.length?e.workflows.join(", "):"none recorded yet"}`),t(`- recent runs: ${e.recentRuns.length?e.recentRuns.join(", "):"none yet"}`),t(),t("Account: `record`, `run` and `map` need a connected account (`verirun login`, or `$VERIRUN_LICENSE_KEY` in CI). `verirun whoami` shows status. `--help`, `--version`, `verirun log`, and `verirun agent` do not need one."),t(),t("## Commands");for(let i of r){t(),t(`### ${i.usage}`),i.description&&t(i.description);for(let s of i.options)t(`- \`${s.flags}\` \u2014 ${s.description}`)}t(),t("## `.verirun/` layout (at the repo root shown above)"),t(),t("```"),t(".verirun/"),t(" config.json log sources, userFilter, testIdAttribute"),t(" workflows/<name>.json one recorded workflow each"),t(" runs/<name>-<timestamp>/logs.json captured logs, one directory per run"),t("```"),t(),t("Per-user, not per-project: `~/.verirun/config.json` (device token), `~/.verirun/state.json` (signed license lease)."),t(),t(`## logs.json (schemaVersion ${H})`),t(),t("```jsonc"),t("{"),t(` "schemaVersion": ${H},`),t(' "workflow": "<name>",'),t(' "status": "ok" | "failed", // "failed" => process exit code 1'),t(' "window": { "startedAt": "<ISO>", "endedAt": "<ISO>" },'),t(' "steps": { "total": N, "replayed": N, "failedAt"?: N },'),t(' "error"?: "<message>", // present only when status is "failed"'),t(' "filter"?: { "user": "<needle>" }, // present when --user / config.userFilter narrowed entries'),t(' "sources": [ { "id": "supabase"|"vercel"|"railway", "name": "...", "entries": N } ],'),t(' "entries": ['),t(" {"),t(' "source": "supabase"|"vercel"|"railway",'),t(' "stream": "<sub-stream, e.g. edge_logs / lambda>",'),t(' "timestamp": "<ISO>",'),t(' "level": "<info|warn|error|...>",'),t(' "message": "<rendered log line>",'),t(' "raw": { /* provider payload, untouched */ }'),t(" }"),t(" ]"),t("}"),t("```"),t(),t("`entries` is every source merged and sorted by `timestamp`. When a `--user` filter is active, `entries` and every `sources[].entries` count are post-filter."),t(),t("## Writing a workflow yourself"),t(),t("`verirun map --json` gives every page element a `selector`, a `selectorConfidence` (`high` / `medium` / `low`) and a suggested `action`. That is enough to author `.verirun/workflows/<name>.json` without recording:"),t();for(let i of ue)t(i);t(),t("Then `verirun workflow check <name>` (add `--json` for machine-readable findings) validates shape, actions, selectors and params without opening a browser. It cannot tell you a selector matches the live page \u2014 only `verirun run <name>` can. Prefer `high`-confidence selectors; a `low` one is a guess. A recorded workflow is still more faithful, so do not overwrite one with a generated file: pick a different name."),t(),t("## Signed-in runs"),t();for(let i of fe)t(i);return t(),t("## Recommended agent loop"),t(),pe.forEach((i,s)=>t(`${s+1}. ${i}`)),t(),t("Save this into your agent context: `verirun agent > .verirun/AGENT.md`, or paste it into `CLAUDE.md` / `.cursorrules` / an AGENTS.md. `verirun agent --json` emits the same information as JSON."),t(),o.join(`
|
|
6
6
|
`)}function et(e,r){let o=[],t=(i="")=>{o.push(i)};t("---"),t("name: verirun"),t("description: >-"),t(" Test this app end to end with verirun: map the interaction graph to find what a"),t(" page does, replay a recorded browser workflow, and read the backend logs that the"),t(" replay produced. Use when asked to test a user flow, verify a change end to end,"),t(" reproduce a bug, or find out what a page can do and which API calls it makes."),t("---"),t(),t("# verirun"),t(),t(de),t(),t("## Decide which command you need"),t(),t("| You want to | Command | Needs a recording? |"),t("|---|---|---|"),t("| Know what a page does / which endpoints it calls | `verirun map` | no |"),t("| Know what is reachable from a page | `verirun map --bfs /route --depth 2` | no |"),t("| Re-run a user flow after a change | `verirun run <name>` | yes |"),t("| Write a test for a flow yourself | `verirun map --json` then author the workflow | no |"),t("| Validate what you wrote | `verirun workflow check <name>` | no |"),t("| Capture a flow faithfully (incl. auth) | ask the human to run `verirun record <name>` | \u2014 |"),t(),t("## Static analysis first \u2014 `verirun map`"),t(),t("`map` reads the source and needs no browser, so reach for it before anything else."),t("It reports every page, the interactive elements on it, where they navigate, and the"),t("backend calls each one makes. `--json` gives the whole graph for programmatic use."),t("Limits to keep in mind: a target computed at runtime shows as `unresolved`, an"),t("endpoint passed through a variable as `?`, and Supabase `.auth.*` calls are not"),t("classified yet. `verirun map --reach` shows how much of each page it actually"),t("attached, so check it before trusting a page that looks empty."),t(),t("## Replay \u2014 `verirun run <name>`"),t(),t("A workflow is either recorded by a human (ground truth) or written by you from the"),t("map (a guess until `run` confirms it). Do not edit a recorded one by hand. Recording"),t("needs a display and a human, so ask for it rather than attempting it. For anything"),t("behind a login, see **Signed-in runs** below."),t(),pe.slice(1).forEach((i,s)=>t(`${s+1}. ${i}`)),t(),t("## Writing a workflow from the map"),t(),t("`verirun map --json` gives each element a `selector`, a `selectorConfidence`"),t("(`high`/`medium`/`low`) and a suggested `action`, so you can author"),t("`.verirun/workflows/<name>.json` yourself instead of asking for a recording:"),t();for(let i of ue)t(i);t(),t("Loop: write the file \u2192 `verirun workflow check <name>` (static: shape, actions,"),t("params, selectors \u2014 no browser) \u2192 fix \u2192 `verirun run <name>` to find out whether"),t("the selectors actually match. Prefer `high` confidence; `low` means the selector"),t("matches more than one element. Never overwrite a recorded workflow with a"),t("generated one \u2014 use a new name; a recording is ground truth and yours is a guess."),t(),t("## Signed-in runs"),t();for(let i of fe)t(i);return t(),t("## Reading the result"),t(),t(`\`.verirun/runs/<name>-<newest>/logs.json\` (schemaVersion ${H}): check \`status\`;`),t("on `failed` read `error` and `steps.failedAt`; then scan `entries` (every source"),t("merged, sorted by `timestamp`, each with `source` / `level` / `message` / `raw`) for"),t("the backend side of the failure. Exit code 1 means a step failed or setup is wrong."),t(),t("## This checkout"),t(),t(`- repo root: ${e.repoRoot}`),t(`- log sources configured: ${e.logSources.length?e.logSources.join(", "):"none \u2014 `run` replays but captures nothing"}`),t(`- workflows: ${e.workflows.length?e.workflows.join(", "):"none recorded yet"}`),t(),t("## Full reference"),t(),t(`Run \`verirun agent\` for every command and flag (${r.length} commands), the`),t("`.verirun/` layout and the complete `logs.json` schema. `verirun <command> --help`"),t("works for any single one."),t(),o.join(`
|
|
7
7
|
`)}async function We(e,r){let o=await Qr(),t=qr(e);if(r.json){process.stdout.write(`${JSON.stringify({about:de,version:T,docs:"https://get-verirun.duely.in",checkout:o,commands:t,layout:{config:"<repo>/.verirun/config.json",workflows:"<repo>/.verirun/workflows/<name>.json",runs:"<repo>/.verirun/runs/<name>-<timestamp>/logs.json",userConfig:"~/.verirun/config.json",userState:"~/.verirun/state.json"},logsJsonSchemaVersion:H,signedIn:fe.join(`
|
|
8
8
|
`),workflowSchema:{version:1,authoring:ue.join(`
|
|
9
9
|
`),validate:"verirun workflow check <name> --json"},agentLoop:pe},null,2)}
|
|
10
10
|
`);return}if(r.skill){let i=`${et(o,t)}
|
|
11
|
-
`;if(!r.install){process.stdout.write(i);return}let s=Fe(
|
|
11
|
+
`;if(!r.install){process.stdout.write(i);return}let s=Fe(y().repoRoot,".claude","skills","verirun");await Jr(s,{recursive:!0});let a=Fe(s,"SKILL.md");await Yr(a,i),n.success(`Wrote ${a}`),n.info(n.dim("Claude Code loads it automatically when a task looks like app testing."));return}process.stdout.write(`${Zr(o,t)}
|
|
12
12
|
`)}import{spawnSync as ht}from"node:child_process";import{existsSync as wt,readFileSync as yt}from"node:fs";import vt from"node:path";import{createInterface as bt}from"node:readline/promises";var rt="https://backboard.railway.com/graphql/v2",ge="https://railway.com/account/tokens";async function Be(e,r,o){let t;try{t=await E(rt,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:r,variables:o})})}catch(s){return{error:s instanceof Error?s.message:String(s)}}let i=await t.json().catch(()=>{});return t.ok?i?.errors?.length?{error:i.errors.map(s=>s.message).filter(Boolean).join("; ")||"GraphQL error"}:i?.data?{data:i.data}:{error:"Railway returned no data."}:{error:i?.errors?.[0]?.message??`HTTP ${t.status}`}}async function K(e){if(e.deploymentId)return{deploymentId:e.deploymentId};if(!e.token||!e.projectId||!e.environmentId||!e.serviceId)return{error:"set railway.deploymentId, or railway.projectId + railway.environmentId + railway.serviceId"};let o=await Be(e.token,`
|
|
13
13
|
query($input: JSON!) {
|
|
14
14
|
deployments(input: $input, first: 1) {
|
|
@@ -19,12 +19,12 @@ import{createPublicKey as Gn,verify as Hn}from"node:crypto";import{readFileSync
|
|
|
19
19
|
deploymentLogs(deploymentId: $id, startDate: $start, endDate: $end, filter: $filter, limit: 1000) {
|
|
20
20
|
timestamp message severity tags attributes
|
|
21
21
|
}
|
|
22
|
-
}`,{id:r,start:o.startedAt,end:o.endedAt,filter:s});return"error"in c?c:{entries:Array.isArray(c.data.deploymentLogs)?c.data.deploymentLogs:[]}}function tt(e){let r=typeof e.severity=="string"?e.severity:void 0;return{source:"railway",stream:r?r.toLowerCase():"deploy",timestamp:typeof e.timestamp=="string"?e.timestamp:void 0,level:r,message:typeof e.message=="string"?e.message:void 0,raw:e}}var me=class{id="railway";name="Railway";cfg;constructor(r){this.cfg=r}async start(){if(!this.cfg.token)throw new Error("Railway log capture needs an API token. Set VERIRUN_RAILWAY_TOKEN or railway.token in .verirun/config.json.");if(!this.cfg.deploymentId&&!(this.cfg.projectId&&this.cfg.environmentId&&this.cfg.serviceId))throw new Error("Railway log capture needs railway.deploymentId, or railway.projectId + railway.environmentId + railway.serviceId, in .verirun/config.json.")}async collect(r,o){let t=await K(this.cfg);if("error"in t)return n.warn(`Railway: ${t.error}`),[];let i=await he(this.cfg.token,t.deploymentId,o,{userNeedle:r.userFilter});if("error"in i)return n.warn(`Railway: ${i.error}`),[];let s=i.entries.map(tt);return s.sort((a,c)=>(a.timestamp??"").localeCompare(c.timestamp??"")),s}async dispose(){}};function Ge(e){return e.railway?new me(e.railway):void 0}var nt="https://api.supabase.com",ye=["postgres_logs","edge_logs","auth_logs"],we=class{id="supabase";name="Supabase";projectRef;accessToken;sources;constructor(r){this.projectRef=r.projectRef,this.accessToken=r.accessToken,this.sources=r.sources&&r.sources.length>0?r.sources:ye}async start(){if(!this.projectRef)throw new Error("Supabase log capture needs supabase.projectRef in .verirun/config.json.");if(!this.accessToken)throw new Error("Supabase log capture needs an access token. Set VERIRUN_SUPABASE_ACCESS_TOKEN or supabase.accessToken in .verirun/config.json.")}async collect(r,o){let t=r.userFilter,i=[],s=!1;for(let a of this.sources){let c=await J(this.projectRef,this.accessToken,a,o,{userNeedle:t});if("error"in c){n.warn(`Supabase ${a}: ${c.error}`);continue}t&&!c.serverFiltered&&(s=!0);for(let l of c.rows)i.push(it(a,l))}return t&&s&&n.info(n.dim("Supabase: user filter applied client-side for a source (more rows pulled).")),i.sort((a,c)=>(a.timestamp??"").localeCompare(c.timestamp??"")),i}async dispose(){}},ot=/^[A-Za-z0-9._@%+-]{1,256}$/;async function He(e,r,o,t){let i=new URL(`/v1/projects/${e}/analytics/endpoints/logs.all`,nt);i.searchParams.set("sql",o),i.searchParams.set("iso_timestamp_start",t.startedAt),i.searchParams.set("iso_timestamp_end",t.endedAt);let s;try{s=await E(i,{headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})}catch(c){return{error:c instanceof Error?c.message:String(c)}}let a=await s.json().catch(()=>{});if(!s.ok){let c=(typeof a?.error=="string"?a.error:a?.error?.message)??a?.message??`HTTP ${s.status}`;return{error:`${c}${c.startsWith("HTTP")?"":` (HTTP ${s.status})`}`}}return{rows:Array.isArray(a?.result)?a.result:[]}}async function J(e,r,o,t,i={}){let s=i.userNeedle?.trim().toLowerCase(),a=s&&ot.test(s)?s:void 0,c=
|
|
23
|
-
`);f=
|
|
24
|
-
`).map(o=>o.trim()).filter(Boolean).map(o=>JSON.parse(o))}function gt(e){return{source:"vercel",stream:typeof e.source=="string"?e.source:void 0,timestamp:typeof e.timestamp=="number"?new Date(e.timestamp).toISOString():void 0,level:typeof e.level=="string"?e.level:void 0,message:typeof e.message=="string"?e.message:void 0,raw:e}}function Xe(e){if(e.vercel)return e.vercel.token?new Y(e.vercel):new V(e.vercel)}var ze=["vercel","supabase","railway"];async function Qe(e,r){if(e!==void 0&&!ze.includes(e))throw new Error(`Unknown log source "${e}". Use one of: ${ze.join(", ")}.`);let o=w(),t=await N(o.configPath);if(e===void 0){St(t);return}if(e==="vercel"){await Ct(t,r);return}if(e==="railway"){await _t(t,r);return}await Lt(t,r)}function St(e){let r=e.vercel,o=e.supabase,t=e.railway;n.info(""),n.info(n.bold("Log sources")),n.info(""),n.info(` ${"vercel".padEnd(10)} ${r?.token&&r.projectId?`configured project ${r.projectId}`:r?`drain mode listener :${r.listenerPort??Q}${r.listenerPath??Z}`:n.dim("not configured")}`),n.info(` ${"supabase".padEnd(10)} ${o?`configured project ${o.projectRef??n.dim("(no projectRef)")}`:n.dim("not configured")}`),n.info(` ${"railway".padEnd(10)} ${t?`configured ${t.deploymentId?`deployment ${t.deploymentId}`:`service ${t.serviceId??n.dim("(none)")}`}`:n.dim("not configured")}`),n.info(""),n.info(`Run ${n.bold("verirun log vercel")}, ${n.bold("verirun log supabase")} or ${n.bold("verirun log railway")} to connect one.`)}var $t="https://vercel.com/d?to=%2F%5Bteam%5D%2F~%2Fsettings%2Flog-drains&title=Log%20Drains";function kt(e){let r=vt.join(e,".vercel","project.json");if(wt(r))try{let o=JSON.parse(yt(r,"utf8"));return o.projectId?{projectId:o.projectId,...o.orgId?.startsWith("team_")?{teamId:o.orgId}:{}}:void 0}catch{return}}async function Rt(e){let r=await qe(e),o;if("error"in r)n.warn(` Could not list teams: ${r.error}`);else if(r.teams.length===1)o=r.teams[0].id,n.info(` team ${r.teams[0].name??o}`);else if(r.teams.length>1){n.info(" Which team?"),n.info(` 1. ${n.dim("(personal account)")}`),r.teams.forEach((c,l)=>n.info(` ${l+2}. ${c.name??c.slug??c.id}`));let a=Number.parseInt(await b(" Number: "),10)-2;r.teams[a]&&(o=r.teams[a].id)}let t=await Ye(e,o);if("error"in t){n.error(` Could not list projects: ${t.error}`);return}if(t.projects.length===0){n.warn(" That token can see no projects.");return}if(t.projects.length===1){let a=t.projects[0];return n.info(` project ${a.name} (${a.id})`),{projectId:a.id,...o?{teamId:o}:{}}}n.info(" Which project?"),t.projects.forEach((a,c)=>n.info(` ${c+1}. ${a.name}`));let i=Number.parseInt(await b(" Number: "),10)-1,s=t.projects[i];if(!s){n.warn(" Not one of the choices.");return}return{projectId:s.id,...o?{teamId:o}:{}}}async function Et(e){if(!e.token||!e.projectId)throw new Error("--test needs a connected project. Run `verirun log vercel` first.");let r=await X(e);if("error"in r){n.error(` ${r.error}`),process.exitCode=1;return}n.info(""),n.info(`Reading runtime logs for ${n.bold(r.label)}\u2026`);let o=await z(e,r.deploymentId,e.readMs??8e3);if("error"in o){n.error(` ${o.error}`),process.exitCode=1;return}let t=Date.now()-5*6e4,i=o.rows.filter(s=>typeof s.timestampInMs!="number"||s.timestampInMs>=t);n.success(` ${o.rows.length} line(s) on the stream, ${i.length} from the last 5 minutes.`);for(let s of i.slice(-5)){let a=Se(s);n.info(` ${n.dim(a.timestamp??"")} ${a.message??""}`)}o.rows.length===0&&n.info(n.dim(" No lines yet \u2014 hit the deployed app once, then re-run with --test."))}async function Ct(e,r){let{configPath:o,repoRoot:t}=w(),i=e.vercel??{},s=process.env.VERIRUN_VERCEL_TOKEN;if(r.drain||r.listen){await It(e,r);return}if(r.test){await Et(i);return}if(i.token&&i.projectId&&!r.reconnect){n.info(""),n.info(n.bold("Vercel logs \u2014 connected")),n.info(` project ${i.projectId}`),i.teamId&&n.info(` team ${i.teamId}`),n.info(` token ${s?"from $VERIRUN_VERCEL_TOKEN":"from config.json"}`),n.info(` deployment ${i.deploymentId??n.dim(`newest ready ${i.environment??"production"}`)}`),n.info(""),n.info(n.dim("--reconnect to replace it \xB7 --test to read the last 5 minutes"));return}n.info(""),n.info(n.bold("Connect Vercel logs"));let a=s??i.token;if(!a||r.reconnect){if(!process.stdin.isTTY){n.info(""),n.info("Not an interactive shell. Set these and re-run:"),n.info(` export VERIRUN_VERCEL_TOKEN=... ${n.dim(`(create at ${q})`)}`),n.info(` ${n.dim("and vercel.projectId (+ vercel.teamId) in .verirun/config.json")}`);return}n.info(` Opening ${n.bold(q)}`),n.info(" Create a token, copy it, come back here."),L(q),n.info("");let h=await b(" Paste the token: ");if(!h){n.warn(" Nothing pasted. No changes made.");return}a=h}let c=r.reconnect?void 0:kt(t);c&&n.info(` project ${c.projectId} ${n.dim("\u2014 from .vercel/project.json")}`);let l=c??await Rt(a);if(!l){n.warn(" No project chosen. No changes made.");return}let d={projectId:l.projectId,...l.teamId?{teamId:l.teamId}:{}};s||(d.token=a),await ee(o,{vercel:d}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.info(" Checking it works\u2026");let m={...i,...d,token:a},f=await X(m);if("error"in f){n.error(` ${f.error}`),n.info(n.dim(" Token or project looks wrong. Re-run `verirun log vercel --reconnect`.")),process.exitCode=1;return}let p=await z(m,f.deploymentId,4e3);if("error"in p){n.error(` Reading logs failed: ${p.error}`),n.info(n.dim(" The token may lack access to this project. Re-run with --reconnect.")),process.exitCode=1;return}n.success(` Connected to ${f.label}. \`verirun run\` now includes Vercel logs.`),p.rows.length===0&&n.info(n.dim(" (No log lines in the stream right now \u2014 that is normal for an idle app.)"))}async function It(e,r){let{configPath:o}=w(),t=e.vercel??{},i=t.listenerPort??Q,s=t.listenerPath??Z,a=t.drainGraceMs??$e;if(r.listen){await jt({...t,listenerPort:i,listenerPath:s});return}let c=process.env.VERIRUN_VERCEL_DRAIN_SECRET;if((t.drainSecret||c)&&!r.reconnect){n.info(""),n.info(n.bold("Vercel logs \u2014 drain mode")),n.info(` endpoint http://localhost:${i}${s}`),n.info(` drain secret ${c?"from $VERIRUN_VERCEL_DRAIN_SECRET":"from config.json"}`),n.info(` grace ${a}ms`),n.info(` project ${t.project??n.dim("all projects on the drain")}`),n.info(""),n.info(n.dim("--reconnect to change it \xB7 --listen to run the verification listener")),n.info(n.dim("`verirun log vercel` (no --drain) switches to the simpler API mode"));return}if(n.info(""),n.info(n.bold("Connect Vercel logs the old way (drain) \u2014 do these in order:")),n.info(n.dim(" You probably want `verirun log vercel` instead: a token, no tunnel.")),n.info(""),n.info(" 1. New terminal. Start a tunnel to port "+i+" and copy the https URL it prints:"),n.info(` ${n.bold(`ngrok http ${i}`)}`),n.info(n.dim(` (or: cloudflared tunnel --url http://localhost:${i})`)),n.info(""),n.info(" 2. Another new terminal. Start the listener and leave it running:"),n.info(` ${n.bold("verirun log vercel --listen")}`),n.info(""),n.info(" 3. Vercel page opening now (your team \u2192 Settings \u2192 Log Drains) \u2192 Add a drain:"),n.info(" Sources ......... check "+n.bold("Edge")+" and "+n.bold("Serverless")+", uncheck the rest"),n.info(" Delivery format . "+n.bold("JSON")),n.info(` Endpoint ........ ${n.bold(`<https URL from step 1>${s}`)}`),n.info(" then Save."),n.info(""),n.info(" 4. Vercel shows a Signing Secret. Copy it, paste it below."),!process.stdin.isTTY){n.info(""),n.info(n.dim(" Then: VERIRUN_VERCEL_DRAIN_SECRET=<secret> (or vercel.drainSecret in .verirun/config.json)"));return}L($t),n.info("");let l=await b(" Signing secret: ");if(!l){n.warn(" No secret. Deliveries would NOT be verified \u2014 anyone who finds the tunnel URL"),n.warn(" could feed fake logs into your runs.");let f=(await b(" Save without a secret anyway? [y/N]: ")).toLowerCase();if(f!=="y"&&f!=="yes"){n.info(" Nothing saved. Re-run `verirun log vercel --drain` once you have the secret.");return}l=""}let d=await b(" Only one project's logs? Paste its name or prj_\u2026 ID, or press Enter for all: "),m={};l&&(m.drainSecret=l),d&&(m.project=d),await ee(o,{vercel:m}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.success(" Done. `verirun run` starts its own listener \u2014 you only need --listen for tailing.")}async function jt(e){let r=new V(e,{onEntry:o=>{let t=o.timestamp??new Date().toISOString(),i=(o.level??"log").padEnd(5),s=o.stream?`${o.stream} `:"";n.info(`${n.dim(t)} ${i} ${n.dim(s)}${o.message??""}`)}});await r.start(),e.project&&n.info(n.dim(`Filtering to project "${e.project}".`)),n.info(n.dim("Waiting for deliveries. Press Ctrl+C to stop.")),n.info(""),await new Promise(o=>{let t=()=>{process.off("SIGINT",t),process.off("SIGTERM",t),n.info(""),r.dispose().then(o)};process.on("SIGINT",t),process.on("SIGTERM",t)}),n.step("Listener stopped.")}var ke="https://supabase.com/dashboard/account/tokens";async function b(e){if(!process.stdin.isTTY)return"";let r=bt({input:process.stdin,output:process.stdout});try{return(await r.question(e)).trim()}finally{r.close()}}async function ee(e,r){await _e(e,r)||n.warn(`Could not restrict ${e} to your account. It holds an API token \u2014 check its permissions.`)}function xt(){let e=ht("supabase",["projects","list","--output","json"],{encoding:"utf8",shell:process.platform==="win32"});if(!(e.error||e.status!==0))try{let o=JSON.parse(e.stdout).map(t=>({ref:String(t.id??t.ref??t.reference_id??""),name:String(t.name??"")})).filter(t=>t.ref!=="");return o.length>0?o:void 0}catch{return}}async function At(e){if(e)return e;let r=xt();if(r&&r.length===1){let t=r[0];return n.info(` project ${t.name} (${t.ref}) ${n.dim("\u2014 from the supabase CLI")}`),t.ref}if(r&&r.length>1){n.info(" Which project?"),r.forEach((i,s)=>n.info(` ${s+1}. ${i.name} (${i.ref})`));let t=Number.parseInt(await b(" Number: "),10)-1;if(r[t])return r[t].ref;n.warn(" Not one of the choices.")}return await b(" Project ref (the <ref> in dashboard/project/<ref>): ")||void 0}async function Nt(e,r,o){if(!e.projectRef)throw new Error("--test needs a connected project. Run `verirun log supabase` first.");if(!o)throw new Error("--test needs an access token. Run `verirun log supabase`, or set $VERIRUN_SUPABASE_ACCESS_TOKEN.");let t=new Date,i={startedAt:new Date(t.getTime()-5*6e4).toISOString(),endedAt:t.toISOString()};n.info(""),n.info(`Querying ${r.length} source${r.length===1?"":"s"} for the last 5 minutes\u2026`),n.info("");let s=!1;for(let a of r){let c=await J(e.projectRef,o,a,i);"error"in c?(s=!0,n.error(`${a.padEnd(16)} ${c.error}`)):n.success(`${a.padEnd(16)} ${c.rows.length} row${c.rows.length===1?"":"s"}`)}s&&(process.exitCode=1)}async function Lt(e,r){let{configPath:o}=w(),t=e.supabase??{},i=t.sources&&t.sources.length>0?t.sources:ye,s=process.env.VERIRUN_SUPABASE_ACCESS_TOKEN,a=s??t.accessToken;if(r.test){await Nt(t,i,a);return}if(t.projectRef&&a&&!r.reconnect){n.info(""),n.info(n.bold("Supabase logs \u2014 connected")),n.info(` project ${t.projectRef}`),n.info(` token ${s?"from $VERIRUN_SUPABASE_ACCESS_TOKEN":"from config.json"}`),n.info(` sources ${i.join(", ")}`),n.info(""),n.info(n.dim("--reconnect to replace the token \xB7 --test to query the last 5 minutes"));return}if(n.info(""),n.info(n.bold("Connect Supabase logs")),!a||r.reconnect){if(!process.stdin.isTTY){n.info(""),n.info("Not an interactive shell. Set these and re-run:"),n.info(` export VERIRUN_SUPABASE_ACCESS_TOKEN=sbp_... ${n.dim(`(create at ${ke})`)}`),n.info(` ${n.dim("and supabase.projectRef in .verirun/config.json")}`);return}n.info(` Opening ${n.bold(ke)}`),n.info(' Click "Generate new token", copy it, come back here.'),L(ke),n.info("");let p=await b(" Paste the token: ");if(!p){n.warn(" Nothing pasted. No changes made.");return}p.startsWith("sbp_")||n.warn(" That does not look like a Supabase token (expected sbp_\u2026). Saving it anyway."),a=p}let c=await At(r.reconnect?void 0:t.projectRef);if(!c){n.warn(" No project ref given. No changes made.");return}let l={projectRef:c};s||(l.accessToken=a),await ee(o,{supabase:l}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.info(" Checking it works\u2026");let d=new Date,m={startedAt:new Date(d.getTime()-5*6e4).toISOString(),endedAt:d.toISOString()},f=await J(c,a,i[0],m);if("error"in f){n.error(` ${i[0]} query failed: ${f.error}`),n.info(n.dim(" Token or project ref looks wrong. Re-run `verirun log supabase --reconnect`.")),process.exitCode=1;return}n.success(` Connected. \`verirun run\` now includes Supabase logs (${i.join(", ")}).`)}function Ze(e){return!!(e.deploymentId||e.projectId&&e.environmentId&&e.serviceId)}function Tt(e){try{let r=new URL(e.trim());if(!/(^|\.)railway\.(com|app)$/.test(r.hostname))return;let o=r.pathname.match(/\/project\/([^/]+)\/service\/([^/?#]+)/),t=r.searchParams.get("environmentId");return!o||!o[1]||!o[2]||!t?void 0:{projectId:o[1],environmentId:t,serviceId:o[2]}}catch{return}}async function Pt(e,r){if(!r)throw new Error("--test needs a token. Run `verirun log railway`, or set $VERIRUN_RAILWAY_TOKEN.");if(!Ze(e))throw new Error("--test needs a connected deployment. Run `verirun log railway` first.");let o=await K({...e,token:r});if("error"in o)throw new Error(`Railway: ${o.error}`);let t=new Date,i={startedAt:new Date(t.getTime()-5*6e4).toISOString(),endedAt:t.toISOString()};n.info(""),n.info(`Querying deployment ${o.deploymentId} for the last 5 minutes\u2026`);let s=await he(r,o.deploymentId,i);if("error"in s){n.error(`railway ${s.error}`),process.exitCode=1;return}n.success(`railway ${s.entries.length} row${s.entries.length===1?"":"s"}`)}async function _t(e,r){let{configPath:o}=w(),t=e.railway??{},i=process.env.VERIRUN_RAILWAY_TOKEN,s=i??t.token;if(r.test){await Pt(t,s);return}if(s&&Ze(t)&&!r.reconnect){n.info(""),n.info(n.bold("Railway logs \u2014 connected")),n.info(` token ${i?"from $VERIRUN_RAILWAY_TOKEN":"from config.json"}`),t.deploymentId?n.info(` deployment ${t.deploymentId} ${n.dim("(pinned)")}`):(n.info(` project ${t.projectId}`),n.info(` environment ${t.environmentId}`),n.info(` service ${t.serviceId} ${n.dim("(latest deployment resolved per run)")}`)),n.info(""),n.info(n.dim("--reconnect to change it \xB7 --test to query the last 5 minutes"));return}if(n.info(""),n.info(n.bold("Connect Railway logs \u2014 2 things:")),n.info(""),n.info(` 1. On the page opening now (${ge}):`),n.info(' "Create Token" \u2192 name it \u2192 pick your team \u2192 Create \u2192 copy the value.'),n.info(" 2. In Railway, open the service you want logs from. Copy its URL from the"),n.info(" address bar \u2014 looks like:"),n.info(" https://railway.com/project/PROJECT/service/SERVICE?environmentId=ENV"),!process.stdin.isTTY){n.info(""),n.info(n.dim("Then: VERIRUN_RAILWAY_TOKEN=<token>, and railway.projectId / environmentId / serviceId (from that URL) in .verirun/config.json."));return}if(!s||r.reconnect){L(ge),n.info("");let d=await b(" Railway token: ");if(!d){n.warn(" Nothing pasted. No changes made.");return}s=d}let a={};i||(a.token=s);let c=Tt(await b(" Service URL (paste the whole thing): "));if(c)a.projectId=c.projectId,a.environmentId=c.environmentId,a.serviceId=c.serviceId;else{n.warn(" Couldn't read that URL. Enter the three IDs from it by hand:");let d=await b(" Project ID: "),m=await b(" Environment ID: "),f=await b(" Service ID: ");if(!d||!m||!f){n.warn(" Need all three. No changes made.");return}a.projectId=d,a.environmentId=m,a.serviceId=f}await ee(o,{railway:a}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.info(" Checking it works\u2026");let l=await K({...t,...a,token:s});if("error"in l){n.error(` ${l.error}`),n.info(n.dim(" Re-run `verirun log railway --reconnect` with the right token / IDs.")),process.exitCode=1;return}n.success(` Connected. Deployment ${l.deploymentId}. \`verirun run\` now includes Railway logs.`)}import{existsSync as rr,readFileSync as tr}from"node:fs";import{mkdir as Ot,readdir as Dt,writeFile as er}from"node:fs/promises";import I from"node:path";var Ut=new Set(["node_modules",".git",".next",".verirun","dist","build","out","coverage",".turbo",".vercel"]);async function Vt(e){let r=[],o=async t=>{for(let i of await Dt(t,{withFileTypes:!0})){if(i.name.startsWith(".")&&i.name!==".")continue;let s=I.join(t,i.name);if(i.isDirectory()){if(Ut.has(i.name))continue;await o(s)}else/\.tsx?$/.test(i.name)&&!i.name.endsWith(".d.ts")&&r.push({file:I.relative(e,s).split(I.sep).join("/"),source:tr(s,"utf8")})}};return await o(e),r}function Ft(e){let r=I.join(e,"tsconfig.json");if(!rr(r))return{};try{let o=tr(r,"utf8").replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:])\/\/.*$/gm,"$1").replace(/,(\s*[}\]])/g,"$1"),t=JSON.parse(o),i={};for(let[s,a]of Object.entries(t.compilerOptions?.paths??{})){let c=a[0];!s.endsWith("/*")||!c?.endsWith("/*")||(i[s.slice(0,-1)]=c.slice(0,-2).replace(/^\.\//,""))}return i}catch{return{}}}function Mt(e,r){let o={...r};for(let t of e??[]){let[i,s]=t.split("=");i&&(o[i]=s??"")}return o}function Wt(e,r){let o=e.nodes.pages.filter(i=>!i.inferred);n.info(`${n.bold(String(o.length))} pages \xB7 ${n.bold(String(e.nodes.leaves.length))} backend effects \xB7 ${n.bold(String(e.edges.length))} edges ${n.dim(`(${r.length} files)`)}`),n.info("");for(let i of e.nodes.pages){let s=e.edges.filter(d=>d.from===i.id),a=s.filter(d=>d.kind==="nav").length,c=s.filter(d=>d.kind==="effect").length,l=i.inferred?n.dim(" (inferred)"):"";n.info(` ${i.path}${l} ${n.dim(`\u2014 ${i.component}, ${i.elements.length} element(s), ${a} nav, ${c} effect`)}`)}let t=e.diagnostics;t.parseErrors.length>0&&n.warn(`${t.parseErrors.length} file(s) failed to parse`),t.unresolvedTargets.length>0&&(n.info(""),n.info(n.dim(`${t.unresolvedTargets.length} nav target(s) could not be resolved to a page`)))}async function nr(e){let{assertLicensed:r}=await import("./gate.mjs"),{assembleTree:o,bfs:t,buildCoverage:i,measureReach:s,renderBfs:a,renderMarkdown:c,renderReachTable:l}=await import("./graph.mjs"),d=await r();d.note&&n.warn(d.note);let m=w(),f=e.dir?I.resolve(e.dir):m.repoRoot;if(!rr(f))throw new Error(`no such directory: ${f}`);let p=await Vt(f);if(p.length===0)throw new Error(`no .ts/.tsx files found under ${f}`);let y={aliases:Mt(e.alias,Ft(f)),...e.followChildren===!1?{followChildren:!1}:{},...e.appFile?{appFile:e.appFile}:{}};if(e.bfs){let u=o(p,y),v=e.kind==="nav"||e.kind==="effect"?[e.kind]:void 0,S=t(u,e.bfs,{depth:e.depth?Number(e.depth):2,...v?{kinds:v}:{}});n.info(n.dim(`${S.order.length-1} node(s) within ${S.maxDepth} step(s) of ${S.from}`)),n.info(a(S));return}if(e.reach){let u=s(p,y);n.info(l(u));for(let v of u.unreachedFiles)n.info(n.dim(`unreached: ${v.file} (${v.elements} elements)`));return}let g=o(p,y);if(e.json){process.stdout.write(`${JSON.stringify(g,null,2)}
|
|
25
|
-
`);return}if(e.report){let u=e.out?I.resolve(e.out):I.join(
|
|
26
|
-
`),await er(I.join(u,"coverage.md"),`${c(v,
|
|
27
|
-
`);let S=I.relative(process.cwd(),u),$=S.startsWith("..")?u:S;n.success(`wrote ${$}/interaction-tree.json + coverage.md`);let x=v.bar.filter(A=>A.pass===!1).length;n.info(n.dim(`${v.bar.length-x}/${v.bar.length} coverage checks pass`));return}Wt(g
|
|
22
|
+
}`,{id:r,start:o.startedAt,end:o.endedAt,filter:s});return"error"in c?c:{entries:Array.isArray(c.data.deploymentLogs)?c.data.deploymentLogs:[]}}function tt(e){let r=typeof e.severity=="string"?e.severity:void 0;return{source:"railway",stream:r?r.toLowerCase():"deploy",timestamp:typeof e.timestamp=="string"?e.timestamp:void 0,level:r,message:typeof e.message=="string"?e.message:void 0,raw:e}}var me=class{id="railway";name="Railway";cfg;constructor(r){this.cfg=r}async start(){if(!this.cfg.token)throw new Error("Railway log capture needs an API token. Set VERIRUN_RAILWAY_TOKEN or railway.token in .verirun/config.json.");if(!this.cfg.deploymentId&&!(this.cfg.projectId&&this.cfg.environmentId&&this.cfg.serviceId))throw new Error("Railway log capture needs railway.deploymentId, or railway.projectId + railway.environmentId + railway.serviceId, in .verirun/config.json.")}async collect(r,o){let t=await K(this.cfg);if("error"in t)return n.warn(`Railway: ${t.error}`),[];let i=await he(this.cfg.token,t.deploymentId,o,{userNeedle:r.userFilter});if("error"in i)return n.warn(`Railway: ${i.error}`),[];let s=i.entries.map(tt);return s.sort((a,c)=>(a.timestamp??"").localeCompare(c.timestamp??"")),s}async dispose(){}};function Ge(e){return e.railway?new me(e.railway):void 0}var nt="https://api.supabase.com",ye=["postgres_logs","edge_logs","auth_logs"],we=class{id="supabase";name="Supabase";projectRef;accessToken;sources;constructor(r){this.projectRef=r.projectRef,this.accessToken=r.accessToken,this.sources=r.sources&&r.sources.length>0?r.sources:ye}async start(){if(!this.projectRef)throw new Error("Supabase log capture needs supabase.projectRef in .verirun/config.json.");if(!this.accessToken)throw new Error("Supabase log capture needs an access token. Set VERIRUN_SUPABASE_ACCESS_TOKEN or supabase.accessToken in .verirun/config.json.")}async collect(r,o){let t=r.userFilter,i=[],s=!1;for(let a of this.sources){let c=await J(this.projectRef,this.accessToken,a,o,{userNeedle:t});if("error"in c){n.warn(`Supabase ${a}: ${c.error}`);continue}t&&!c.serverFiltered&&(s=!0);for(let l of c.rows)i.push(it(a,l))}return t&&s&&n.info(n.dim("Supabase: user filter applied client-side for a source (more rows pulled).")),i.sort((a,c)=>(a.timestamp??"").localeCompare(c.timestamp??"")),i}async dispose(){}},ot=/^[A-Za-z0-9._@%+-]{1,256}$/;async function He(e,r,o,t){let i=new URL(`/v1/projects/${e}/analytics/endpoints/logs.all`,nt);i.searchParams.set("sql",o),i.searchParams.set("iso_timestamp_start",t.startedAt),i.searchParams.set("iso_timestamp_end",t.endedAt);let s;try{s=await E(i,{headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})}catch(c){return{error:c instanceof Error?c.message:String(c)}}let a=await s.json().catch(()=>{});if(!s.ok){let c=(typeof a?.error=="string"?a.error:a?.error?.message)??a?.message??`HTTP ${s.status}`;return{error:`${c}${c.startsWith("HTTP")?"":` (HTTP ${s.status})`}`}}return{rows:Array.isArray(a?.result)?a.result:[]}}async function J(e,r,o,t,i={}){let s=i.userNeedle?.trim().toLowerCase(),a=s&&ot.test(s)?s:void 0,c=p=>{let f=p&&a?` where strpos(lower(event_message), '${a}') > 0 or strpos(lower(to_json_string(metadata)), '${a}') > 0`:"";return`select id, timestamp, event_message, metadata from ${o}${f} order by timestamp asc limit 1000`},l=await He(e,r,c(!0),t);if(!("error"in l))return{rows:l.rows,serverFiltered:!!a};if(!a)return l;let d=await He(e,r,c(!1),t);return"error"in d?d:{rows:d.rows,serverFiltered:!1}}function it(e,r){return{source:"supabase",stream:e,timestamp:st(r.timestamp),message:typeof r.event_message=="string"?r.event_message:void 0,raw:r}}function st(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e)){let r=e>1e14?e/1e3:e;return new Date(r).toISOString()}}function Ke(e){return e.supabase?new we(e.supabase):void 0}import{createHmac as dt,timingSafeEqual as ut}from"node:crypto";import{createServer as ft}from"node:http";import{setTimeout as pt}from"node:timers/promises";var Je="https://api.vercel.com",q="https://vercel.com/account/settings/tokens",at=8e3,ct=1500,lt=3e3;function ve(e){return e?`&teamId=${encodeURIComponent(e)}`:""}async function be(e,r){let o;try{o=await E(`${Je}${e}`,{headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})}catch(i){return{error:i instanceof Error?i.message:String(i)}}let t=await o.json().catch(()=>{});return o.ok?{data:t}:{error:t?.error?.message??`HTTP ${o.status}`}}async function Ye(e,r){let o=await be(`/v9/projects?limit=100${ve(r)}`,e);return"error"in o?o:{projects:o.data.projects??[]}}async function qe(e){let r=await be("/v2/teams?limit=100",e);return"error"in r?r:{teams:r.data.teams??[]}}async function X(e){if(e.deploymentId)return{deploymentId:e.deploymentId,label:e.deploymentId};if(!e.token)return{error:"no token"};if(!e.projectId)return{error:"no projectId"};let r=e.environment??"production",o=await be(`/v6/deployments?projectId=${encodeURIComponent(e.projectId)}&limit=1&state=READY&target=${encodeURIComponent(r)}${ve(e.teamId)}`,e.token);if("error"in o)return{error:o.error};let t=o.data.deployments?.[0];return t?{deploymentId:t.uid,label:t.url??t.uid}:{error:`no READY ${r} deployment found for this project`}}async function z(e,r,o){let t=`/v1/projects/${encodeURIComponent(e.projectId)}/deployments/${encodeURIComponent(r)}/runtime-logs?limit=1000${ve(e.teamId)}`,i=new AbortController,s=setTimeout(()=>i.abort(),o),a,c=()=>{a&&clearTimeout(a),a=setTimeout(()=>i.abort(),ct)},l=[];try{let d=await E(`${Je}${t}`,{headers:{Authorization:`Bearer ${e.token}`,Accept:"application/x-ndjson, application/json"},signal:i.signal});if(!d.ok)return{error:(await d.json().catch(()=>{}))?.error?.message??`HTTP ${d.status}`};if(!d.body)return{rows:l};c();let p=new TextDecoder,f="";for await(let g of d.body){f+=p.decode(g,{stream:!0});let m=f.split(`
|
|
23
|
+
`);f=m.pop()??"";for(let w of m){let h=w.trim();if(h)try{let u=JSON.parse(h);Array.isArray(u)?l.push(...u):l.push(u)}catch{}}c()}}catch(d){if(!(d instanceof Error&&d.name==="AbortError"))return{error:d instanceof Error?d.message:String(d)}}finally{clearTimeout(s),a&&clearTimeout(a)}return{rows:l}}function Se(e){let r=e.requestPath?` ${e.requestMethod??""} ${e.requestPath}`.trim():"",o=e.responseStatusCode?` (${e.responseStatusCode})`:"";return{source:"vercel",...e.source?{stream:e.source}:{},...e.timestampInMs?{timestamp:new Date(e.timestampInMs).toISOString()}:{},...e.level?{level:e.level}:{},message:e.message??`${r}${o}`.trim(),raw:e}}var Y=class{id="vercel";name="Vercel";config;constructor(r){this.config=r}async start(){if(!this.config.token)throw new Error("Vercel log capture needs an API token. Run `verirun log vercel`, or set VERIRUN_VERCEL_TOKEN / vercel.token in .verirun/config.json.");if(!this.config.projectId)throw new Error("Vercel log capture needs vercel.projectId. Run `verirun log vercel`.")}async collect(r,o){let t=await X(this.config);if("error"in t)return n.warn(`Vercel: ${t.error}`),[];let i=await z(this.config,t.deploymentId,this.config.readMs??at);if("error"in i)return n.warn(`Vercel: ${i.error}`),[];let s=Date.parse(o.startedAt),a=Date.parse(o.endedAt)+(this.config.tailGraceMs??lt);return i.rows.filter(c=>typeof c.timestampInMs!="number"?!0:c.timestampInMs>=s&&c.timestampInMs<=a).map(Se)}async dispose(){}};var Q=4319,Z="/drain",$e=3e3,V=class{id="vercel";name="Vercel";port;path;secret;graceMs;project;onEntry;server;received=[];droppedByProject=0;constructor(r,o={}){this.port=r.listenerPort??Q,this.path=r.listenerPath??Z,this.secret=r.drainSecret,this.graceMs=r.drainGraceMs??$e,this.project=r.project?.trim()||void 0,this.onEntry=o.onEntry}projectMatches(r){return this.project?r.projectId===this.project||r.projectName===this.project:!0}async start(){let r=ft((o,t)=>this.handle(o,t));this.server=r,await new Promise((o,t)=>{let i=s=>{t(s.code==="EADDRINUSE"?new Error(`Vercel log listener: port ${this.port} is already in use.`):s)};r.once("error",i),r.listen(this.port,()=>{r.off("error",i),o()})}),n.step(`Vercel log listener on http://localhost:${this.port}${this.path}`)}async collect(){return this.graceMs>0&&await pt(this.graceMs),this.received.length===0&&this.droppedByProject>0&&n.warn(`Vercel: ${this.droppedByProject} log line(s) arrived but none matched project "${this.project}". Check the name/ID in .verirun/config.json (vercel.project).`),[...this.received]}async dispose(){let r=this.server;r&&(this.server=void 0,await new Promise(o=>r.close(()=>o())))}handle(r,o){let t=r.headers["x-vercel-verify"];if(typeof t=="string"&&o.setHeader("x-vercel-verify",t),r.method!=="POST"||!this.matchesPath(r.url)){o.statusCode=r.method==="POST"?404:200,o.end();return}let i=[];r.on("data",s=>i.push(s)),r.on("error",()=>{o.statusCode=400,o.end()}),r.on("end",()=>{let s=Buffer.concat(i);if(!this.verifySignature(r,s)){n.warn("Vercel log drain: rejected a delivery with a bad signature."),o.statusCode=401,o.end();return}try{for(let a of mt(s.toString("utf8"))){if(!this.projectMatches(a)){this.droppedByProject+=1;continue}let c=gt(a);this.received.push(c),this.onEntry?.(c)}}catch{n.warn("Vercel log drain: could not parse a delivery body.")}o.statusCode=200,o.end()})}matchesPath(r){return r?(r.split("?")[0]??"")===this.path:!1}verifySignature(r,o){if(!this.secret)return!0;let t=r.headers["x-vercel-signature"];if(typeof t!="string")return!1;let i=dt("sha1",this.secret).update(o).digest("hex"),s=Buffer.from(i),a=Buffer.from(t);return s.length===a.length&&ut(s,a)}};function mt(e){let r=e.trim();if(!r)return[];if(r.startsWith("[")){let o=JSON.parse(r);return Array.isArray(o)?o:[]}return r.split(`
|
|
24
|
+
`).map(o=>o.trim()).filter(Boolean).map(o=>JSON.parse(o))}function gt(e){return{source:"vercel",stream:typeof e.source=="string"?e.source:void 0,timestamp:typeof e.timestamp=="number"?new Date(e.timestamp).toISOString():void 0,level:typeof e.level=="string"?e.level:void 0,message:typeof e.message=="string"?e.message:void 0,raw:e}}function Xe(e){if(e.vercel)return e.vercel.token?new Y(e.vercel):new V(e.vercel)}var ze=["vercel","supabase","railway"];async function Qe(e,r){if(e!==void 0&&!ze.includes(e))throw new Error(`Unknown log source "${e}". Use one of: ${ze.join(", ")}.`);let o=y(),t=await N(o.configPath);if(e===void 0){St(t);return}if(e==="vercel"){await Ct(t,r);return}if(e==="railway"){await _t(t,r);return}await Lt(t,r)}function St(e){let r=e.vercel,o=e.supabase,t=e.railway;n.info(""),n.info(n.bold("Log sources")),n.info(""),n.info(` ${"vercel".padEnd(10)} ${r?.token&&r.projectId?`configured project ${r.projectId}`:r?`drain mode listener :${r.listenerPort??Q}${r.listenerPath??Z}`:n.dim("not configured")}`),n.info(` ${"supabase".padEnd(10)} ${o?`configured project ${o.projectRef??n.dim("(no projectRef)")}`:n.dim("not configured")}`),n.info(` ${"railway".padEnd(10)} ${t?`configured ${t.deploymentId?`deployment ${t.deploymentId}`:`service ${t.serviceId??n.dim("(none)")}`}`:n.dim("not configured")}`),n.info(""),n.info(`Run ${n.bold("verirun log vercel")}, ${n.bold("verirun log supabase")} or ${n.bold("verirun log railway")} to connect one.`)}var $t="https://vercel.com/d?to=%2F%5Bteam%5D%2F~%2Fsettings%2Flog-drains&title=Log%20Drains";function kt(e){let r=vt.join(e,".vercel","project.json");if(wt(r))try{let o=JSON.parse(yt(r,"utf8"));return o.projectId?{projectId:o.projectId,...o.orgId?.startsWith("team_")?{teamId:o.orgId}:{}}:void 0}catch{return}}async function Rt(e){let r=await qe(e),o;if("error"in r)n.warn(` Could not list teams: ${r.error}`);else if(r.teams.length===1)o=r.teams[0].id,n.info(` team ${r.teams[0].name??o}`);else if(r.teams.length>1){n.info(" Which team?"),n.info(` 1. ${n.dim("(personal account)")}`),r.teams.forEach((c,l)=>n.info(` ${l+2}. ${c.name??c.slug??c.id}`));let a=Number.parseInt(await b(" Number: "),10)-2;r.teams[a]&&(o=r.teams[a].id)}let t=await Ye(e,o);if("error"in t){n.error(` Could not list projects: ${t.error}`);return}if(t.projects.length===0){n.warn(" That token can see no projects.");return}if(t.projects.length===1){let a=t.projects[0];return n.info(` project ${a.name} (${a.id})`),{projectId:a.id,...o?{teamId:o}:{}}}n.info(" Which project?"),t.projects.forEach((a,c)=>n.info(` ${c+1}. ${a.name}`));let i=Number.parseInt(await b(" Number: "),10)-1,s=t.projects[i];if(!s){n.warn(" Not one of the choices.");return}return{projectId:s.id,...o?{teamId:o}:{}}}async function Et(e){if(!e.token||!e.projectId)throw new Error("--test needs a connected project. Run `verirun log vercel` first.");let r=await X(e);if("error"in r){n.error(` ${r.error}`),process.exitCode=1;return}n.info(""),n.info(`Reading runtime logs for ${n.bold(r.label)}\u2026`);let o=await z(e,r.deploymentId,e.readMs??8e3);if("error"in o){n.error(` ${o.error}`),process.exitCode=1;return}let t=Date.now()-5*6e4,i=o.rows.filter(s=>typeof s.timestampInMs!="number"||s.timestampInMs>=t);n.success(` ${o.rows.length} line(s) on the stream, ${i.length} from the last 5 minutes.`);for(let s of i.slice(-5)){let a=Se(s);n.info(` ${n.dim(a.timestamp??"")} ${a.message??""}`)}o.rows.length===0&&n.info(n.dim(" No lines yet \u2014 hit the deployed app once, then re-run with --test."))}async function Ct(e,r){let{configPath:o,repoRoot:t}=y(),i=e.vercel??{},s=process.env.VERIRUN_VERCEL_TOKEN;if(r.drain||r.listen){await It(e,r);return}if(r.test){await Et(i);return}if(i.token&&i.projectId&&!r.reconnect){n.info(""),n.info(n.bold("Vercel logs \u2014 connected")),n.info(` project ${i.projectId}`),i.teamId&&n.info(` team ${i.teamId}`),n.info(` token ${s?"from $VERIRUN_VERCEL_TOKEN":"from config.json"}`),n.info(` deployment ${i.deploymentId??n.dim(`newest ready ${i.environment??"production"}`)}`),n.info(""),n.info(n.dim("--reconnect to replace it \xB7 --test to read the last 5 minutes"));return}n.info(""),n.info(n.bold("Connect Vercel logs"));let a=s??i.token;if(!a||r.reconnect){if(!process.stdin.isTTY){n.info(""),n.info("Not an interactive shell. Set these and re-run:"),n.info(` export VERIRUN_VERCEL_TOKEN=... ${n.dim(`(create at ${q})`)}`),n.info(` ${n.dim("and vercel.projectId (+ vercel.teamId) in .verirun/config.json")}`);return}n.info(` Opening ${n.bold(q)}`),n.info(" Create a token, copy it, come back here."),L(q),n.info("");let m=await b(" Paste the token: ");if(!m){n.warn(" Nothing pasted. No changes made.");return}a=m}let c=r.reconnect?void 0:kt(t);c&&n.info(` project ${c.projectId} ${n.dim("\u2014 from .vercel/project.json")}`);let l=c??await Rt(a);if(!l){n.warn(" No project chosen. No changes made.");return}let d={projectId:l.projectId,...l.teamId?{teamId:l.teamId}:{}};s||(d.token=a),await ee(o,{vercel:d}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.info(" Checking it works\u2026");let p={...i,...d,token:a},f=await X(p);if("error"in f){n.error(` ${f.error}`),n.info(n.dim(" Token or project looks wrong. Re-run `verirun log vercel --reconnect`.")),process.exitCode=1;return}let g=await z(p,f.deploymentId,4e3);if("error"in g){n.error(` Reading logs failed: ${g.error}`),n.info(n.dim(" The token may lack access to this project. Re-run with --reconnect.")),process.exitCode=1;return}n.success(` Connected to ${f.label}. \`verirun run\` now includes Vercel logs.`),g.rows.length===0&&n.info(n.dim(" (No log lines in the stream right now \u2014 that is normal for an idle app.)"))}async function It(e,r){let{configPath:o}=y(),t=e.vercel??{},i=t.listenerPort??Q,s=t.listenerPath??Z,a=t.drainGraceMs??$e;if(r.listen){await jt({...t,listenerPort:i,listenerPath:s});return}let c=process.env.VERIRUN_VERCEL_DRAIN_SECRET;if((t.drainSecret||c)&&!r.reconnect){n.info(""),n.info(n.bold("Vercel logs \u2014 drain mode")),n.info(` endpoint http://localhost:${i}${s}`),n.info(` drain secret ${c?"from $VERIRUN_VERCEL_DRAIN_SECRET":"from config.json"}`),n.info(` grace ${a}ms`),n.info(` project ${t.project??n.dim("all projects on the drain")}`),n.info(""),n.info(n.dim("--reconnect to change it \xB7 --listen to run the verification listener")),n.info(n.dim("`verirun log vercel` (no --drain) switches to the simpler API mode"));return}if(n.info(""),n.info(n.bold("Connect Vercel logs the old way (drain) \u2014 do these in order:")),n.info(n.dim(" You probably want `verirun log vercel` instead: a token, no tunnel.")),n.info(""),n.info(" 1. New terminal. Start a tunnel to port "+i+" and copy the https URL it prints:"),n.info(` ${n.bold(`ngrok http ${i}`)}`),n.info(n.dim(` (or: cloudflared tunnel --url http://localhost:${i})`)),n.info(""),n.info(" 2. Another new terminal. Start the listener and leave it running:"),n.info(` ${n.bold("verirun log vercel --listen")}`),n.info(""),n.info(" 3. Vercel page opening now (your team \u2192 Settings \u2192 Log Drains) \u2192 Add a drain:"),n.info(" Sources ......... check "+n.bold("Edge")+" and "+n.bold("Serverless")+", uncheck the rest"),n.info(" Delivery format . "+n.bold("JSON")),n.info(` Endpoint ........ ${n.bold(`<https URL from step 1>${s}`)}`),n.info(" then Save."),n.info(""),n.info(" 4. Vercel shows a Signing Secret. Copy it, paste it below."),!process.stdin.isTTY){n.info(""),n.info(n.dim(" Then: VERIRUN_VERCEL_DRAIN_SECRET=<secret> (or vercel.drainSecret in .verirun/config.json)"));return}L($t),n.info("");let l=await b(" Signing secret: ");if(!l){n.warn(" No secret. Deliveries would NOT be verified \u2014 anyone who finds the tunnel URL"),n.warn(" could feed fake logs into your runs.");let f=(await b(" Save without a secret anyway? [y/N]: ")).toLowerCase();if(f!=="y"&&f!=="yes"){n.info(" Nothing saved. Re-run `verirun log vercel --drain` once you have the secret.");return}l=""}let d=await b(" Only one project's logs? Paste its name or prj_\u2026 ID, or press Enter for all: "),p={};l&&(p.drainSecret=l),d&&(p.project=d),await ee(o,{vercel:p}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.success(" Done. `verirun run` starts its own listener \u2014 you only need --listen for tailing.")}async function jt(e){let r=new V(e,{onEntry:o=>{let t=o.timestamp??new Date().toISOString(),i=(o.level??"log").padEnd(5),s=o.stream?`${o.stream} `:"";n.info(`${n.dim(t)} ${i} ${n.dim(s)}${o.message??""}`)}});await r.start(),e.project&&n.info(n.dim(`Filtering to project "${e.project}".`)),n.info(n.dim("Waiting for deliveries. Press Ctrl+C to stop.")),n.info(""),await new Promise(o=>{let t=()=>{process.off("SIGINT",t),process.off("SIGTERM",t),n.info(""),r.dispose().then(o)};process.on("SIGINT",t),process.on("SIGTERM",t)}),n.step("Listener stopped.")}var ke="https://supabase.com/dashboard/account/tokens";async function b(e){if(!process.stdin.isTTY)return"";let r=bt({input:process.stdin,output:process.stdout});try{return(await r.question(e)).trim()}finally{r.close()}}async function ee(e,r){await _e(e,r)||n.warn(`Could not restrict ${e} to your account. It holds an API token \u2014 check its permissions.`)}function xt(){let e=ht("supabase",["projects","list","--output","json"],{encoding:"utf8",shell:process.platform==="win32"});if(!(e.error||e.status!==0))try{let o=JSON.parse(e.stdout).map(t=>({ref:String(t.id??t.ref??t.reference_id??""),name:String(t.name??"")})).filter(t=>t.ref!=="");return o.length>0?o:void 0}catch{return}}async function At(e){if(e)return e;let r=xt();if(r&&r.length===1){let t=r[0];return n.info(` project ${t.name} (${t.ref}) ${n.dim("\u2014 from the supabase CLI")}`),t.ref}if(r&&r.length>1){n.info(" Which project?"),r.forEach((i,s)=>n.info(` ${s+1}. ${i.name} (${i.ref})`));let t=Number.parseInt(await b(" Number: "),10)-1;if(r[t])return r[t].ref;n.warn(" Not one of the choices.")}return await b(" Project ref (the <ref> in dashboard/project/<ref>): ")||void 0}async function Nt(e,r,o){if(!e.projectRef)throw new Error("--test needs a connected project. Run `verirun log supabase` first.");if(!o)throw new Error("--test needs an access token. Run `verirun log supabase`, or set $VERIRUN_SUPABASE_ACCESS_TOKEN.");let t=new Date,i={startedAt:new Date(t.getTime()-5*6e4).toISOString(),endedAt:t.toISOString()};n.info(""),n.info(`Querying ${r.length} source${r.length===1?"":"s"} for the last 5 minutes\u2026`),n.info("");let s=!1;for(let a of r){let c=await J(e.projectRef,o,a,i);"error"in c?(s=!0,n.error(`${a.padEnd(16)} ${c.error}`)):n.success(`${a.padEnd(16)} ${c.rows.length} row${c.rows.length===1?"":"s"}`)}s&&(process.exitCode=1)}async function Lt(e,r){let{configPath:o}=y(),t=e.supabase??{},i=t.sources&&t.sources.length>0?t.sources:ye,s=process.env.VERIRUN_SUPABASE_ACCESS_TOKEN,a=s??t.accessToken;if(r.test){await Nt(t,i,a);return}if(t.projectRef&&a&&!r.reconnect){n.info(""),n.info(n.bold("Supabase logs \u2014 connected")),n.info(` project ${t.projectRef}`),n.info(` token ${s?"from $VERIRUN_SUPABASE_ACCESS_TOKEN":"from config.json"}`),n.info(` sources ${i.join(", ")}`),n.info(""),n.info(n.dim("--reconnect to replace the token \xB7 --test to query the last 5 minutes"));return}if(n.info(""),n.info(n.bold("Connect Supabase logs")),!a||r.reconnect){if(!process.stdin.isTTY){n.info(""),n.info("Not an interactive shell. Set these and re-run:"),n.info(` export VERIRUN_SUPABASE_ACCESS_TOKEN=sbp_... ${n.dim(`(create at ${ke})`)}`),n.info(` ${n.dim("and supabase.projectRef in .verirun/config.json")}`);return}n.info(` Opening ${n.bold(ke)}`),n.info(' Click "Generate new token", copy it, come back here.'),L(ke),n.info("");let g=await b(" Paste the token: ");if(!g){n.warn(" Nothing pasted. No changes made.");return}g.startsWith("sbp_")||n.warn(" That does not look like a Supabase token (expected sbp_\u2026). Saving it anyway."),a=g}let c=await At(r.reconnect?void 0:t.projectRef);if(!c){n.warn(" No project ref given. No changes made.");return}let l={projectRef:c};s||(l.accessToken=a),await ee(o,{supabase:l}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.info(" Checking it works\u2026");let d=new Date,p={startedAt:new Date(d.getTime()-5*6e4).toISOString(),endedAt:d.toISOString()},f=await J(c,a,i[0],p);if("error"in f){n.error(` ${i[0]} query failed: ${f.error}`),n.info(n.dim(" Token or project ref looks wrong. Re-run `verirun log supabase --reconnect`.")),process.exitCode=1;return}n.success(` Connected. \`verirun run\` now includes Supabase logs (${i.join(", ")}).`)}function Ze(e){return!!(e.deploymentId||e.projectId&&e.environmentId&&e.serviceId)}function Tt(e){try{let r=new URL(e.trim());if(!/(^|\.)railway\.(com|app)$/.test(r.hostname))return;let o=r.pathname.match(/\/project\/([^/]+)\/service\/([^/?#]+)/),t=r.searchParams.get("environmentId");return!o||!o[1]||!o[2]||!t?void 0:{projectId:o[1],environmentId:t,serviceId:o[2]}}catch{return}}async function Pt(e,r){if(!r)throw new Error("--test needs a token. Run `verirun log railway`, or set $VERIRUN_RAILWAY_TOKEN.");if(!Ze(e))throw new Error("--test needs a connected deployment. Run `verirun log railway` first.");let o=await K({...e,token:r});if("error"in o)throw new Error(`Railway: ${o.error}`);let t=new Date,i={startedAt:new Date(t.getTime()-5*6e4).toISOString(),endedAt:t.toISOString()};n.info(""),n.info(`Querying deployment ${o.deploymentId} for the last 5 minutes\u2026`);let s=await he(r,o.deploymentId,i);if("error"in s){n.error(`railway ${s.error}`),process.exitCode=1;return}n.success(`railway ${s.entries.length} row${s.entries.length===1?"":"s"}`)}async function _t(e,r){let{configPath:o}=y(),t=e.railway??{},i=process.env.VERIRUN_RAILWAY_TOKEN,s=i??t.token;if(r.test){await Pt(t,s);return}if(s&&Ze(t)&&!r.reconnect){n.info(""),n.info(n.bold("Railway logs \u2014 connected")),n.info(` token ${i?"from $VERIRUN_RAILWAY_TOKEN":"from config.json"}`),t.deploymentId?n.info(` deployment ${t.deploymentId} ${n.dim("(pinned)")}`):(n.info(` project ${t.projectId}`),n.info(` environment ${t.environmentId}`),n.info(` service ${t.serviceId} ${n.dim("(latest deployment resolved per run)")}`)),n.info(""),n.info(n.dim("--reconnect to change it \xB7 --test to query the last 5 minutes"));return}if(n.info(""),n.info(n.bold("Connect Railway logs \u2014 2 things:")),n.info(""),n.info(` 1. On the page opening now (${ge}):`),n.info(' "Create Token" \u2192 name it \u2192 pick your team \u2192 Create \u2192 copy the value.'),n.info(" 2. In Railway, open the service you want logs from. Copy its URL from the"),n.info(" address bar \u2014 looks like:"),n.info(" https://railway.com/project/PROJECT/service/SERVICE?environmentId=ENV"),!process.stdin.isTTY){n.info(""),n.info(n.dim("Then: VERIRUN_RAILWAY_TOKEN=<token>, and railway.projectId / environmentId / serviceId (from that URL) in .verirun/config.json."));return}if(!s||r.reconnect){L(ge),n.info("");let d=await b(" Railway token: ");if(!d){n.warn(" Nothing pasted. No changes made.");return}s=d}let a={};i||(a.token=s);let c=Tt(await b(" Service URL (paste the whole thing): "));if(c)a.projectId=c.projectId,a.environmentId=c.environmentId,a.serviceId=c.serviceId;else{n.warn(" Couldn't read that URL. Enter the three IDs from it by hand:");let d=await b(" Project ID: "),p=await b(" Environment ID: "),f=await b(" Service ID: ");if(!d||!p||!f){n.warn(" Need all three. No changes made.");return}a.projectId=d,a.environmentId=p,a.serviceId=f}await ee(o,{railway:a}),n.info(""),n.info(` Saved to ${n.dim(o)}`),n.info(" Checking it works\u2026");let l=await K({...t,...a,token:s});if("error"in l){n.error(` ${l.error}`),n.info(n.dim(" Re-run `verirun log railway --reconnect` with the right token / IDs.")),process.exitCode=1;return}n.success(` Connected. Deployment ${l.deploymentId}. \`verirun run\` now includes Railway logs.`)}import{existsSync as rr,readFileSync as tr}from"node:fs";import{mkdir as Ot,readdir as Dt,writeFile as er}from"node:fs/promises";import I from"node:path";var Ut=new Set(["node_modules",".git",".next",".verirun","dist","build","out","coverage",".turbo",".vercel"]);async function Vt(e){let r=[],o=async t=>{for(let i of await Dt(t,{withFileTypes:!0})){if(i.name.startsWith(".")&&i.name!==".")continue;let s=I.join(t,i.name);if(i.isDirectory()){if(Ut.has(i.name))continue;await o(s)}else/\.tsx?$/.test(i.name)&&!i.name.endsWith(".d.ts")&&r.push({file:I.relative(e,s).split(I.sep).join("/"),source:tr(s,"utf8")})}};return await o(e),r}function Ft(e){let r=I.join(e,"tsconfig.json");if(!rr(r))return{};try{let o=tr(r,"utf8").replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:])\/\/.*$/gm,"$1").replace(/,(\s*[}\]])/g,"$1"),t=JSON.parse(o),i={};for(let[s,a]of Object.entries(t.compilerOptions?.paths??{})){let c=a[0];!s.endsWith("/*")||!c?.endsWith("/*")||(i[s.slice(0,-1)]=c.slice(0,-2).replace(/^\.\//,""))}return i}catch{return{}}}function Mt(e,r){let o={...r};for(let t of e??[]){let[i,s]=t.split("=");i&&(o[i]=s??"")}return o}function Wt(e,r){let o=e.nodes.pages.filter(i=>!i.inferred);n.info(`${n.bold(String(o.length))} pages \xB7 ${n.bold(String(e.nodes.leaves.length))} backend effects \xB7 ${n.bold(String(e.edges.length))} edges ${n.dim(`(${r.length} files)`)}`),n.info("");for(let i of e.nodes.pages){let s=e.edges.filter(d=>d.from===i.id),a=s.filter(d=>d.kind==="nav").length,c=s.filter(d=>d.kind==="effect").length,l=i.inferred?n.dim(" (inferred)"):"";n.info(` ${i.path}${l} ${n.dim(`\u2014 ${i.component}, ${i.elements.length} element(s), ${a} nav, ${c} effect`)}`)}let t=e.diagnostics;t.parseErrors.length>0&&n.warn(`${t.parseErrors.length} file(s) failed to parse`),t.unresolvedTargets.length>0&&(n.info(""),n.info(n.dim(`${t.unresolvedTargets.length} nav target(s) could not be resolved to a page`)))}async function nr(e){let{assertLicensed:r}=await import("./gate.mjs"),{assembleTree:o,bfs:t,buildCoverage:i,measureReach:s,renderBfs:a,renderMarkdown:c,renderReachTable:l}=await import("./graph.mjs"),d=await r();d.note&&n.warn(d.note);let p=y(),f=e.dir?I.resolve(e.dir):p.repoRoot;if(!rr(f))throw new Error(`no such directory: ${f}`);let g=await Vt(f);if(g.length===0)throw new Error(`no .ts/.tsx files found under ${f}`);let w={aliases:Mt(e.alias,Ft(f)),...e.followChildren===!1?{followChildren:!1}:{},...e.appFile?{appFile:e.appFile}:{}};if(e.bfs){let u=o(g,w),v=e.kind==="nav"||e.kind==="effect"?[e.kind]:void 0,S=t(u,e.bfs,{depth:e.depth?Number(e.depth):2,...v?{kinds:v}:{}});n.info(n.dim(`${S.order.length-1} node(s) within ${S.maxDepth} step(s) of ${S.from}`)),n.info(a(S));return}if(e.reach){let u=s(g,w);n.info(l(u));for(let v of u.unreachedFiles)n.info(n.dim(`unreached: ${v.file} (${v.elements} elements)`));return}let h=o(g,w);if(e.json){process.stdout.write(`${JSON.stringify(h,null,2)}
|
|
25
|
+
`);return}if(e.report){let u=e.out?I.resolve(e.out):I.join(p.dataDir,"map");await Ot(u,{recursive:!0});let v=i(g,h);await er(I.join(u,"interaction-tree.json"),`${JSON.stringify(h,null,2)}
|
|
26
|
+
`),await er(I.join(u,"coverage.md"),`${c(v,h)}
|
|
27
|
+
`);let S=I.relative(process.cwd(),u),$=S.startsWith("..")?u:S;n.success(`wrote ${$}/interaction-tree.json + coverage.md`);let x=v.bar.filter(A=>A.pass===!1).length;n.info(n.dim(`${v.bar.length-x}/${v.bar.length} coverage checks pass`));return}Wt(h,g)}import{existsSync as yn}from"node:fs";import{mkdir as vn}from"node:fs/promises";import ur from"node:path";import{spawnSync as Bt}from"node:child_process";var Gt={browser:"chromium",channel:"chrome",label:"Chrome",approximated:!1},Ht={browser:"chromium",channel:"msedge",label:"Edge",approximated:!1},Kt={browser:"firefox",label:"Firefox",approximated:!1},Jt={browser:"chromium",label:"Chromium",approximated:!1};function Re(e,r){let o=e.toLowerCase(),t=i=>r?{...i,label:r}:i;if(o.includes("firefox")||o.includes("mozilla"))return t(Kt);if(o.includes("msedge")||o.includes("microsoft-edge")||o.includes("edgemac")||o.includes("microsoftedge"))return t(Ht);if(o.includes("google-chrome")||o.includes("com.google.chrome")||o==="chromehtml"||o.includes("chrome"))return t(Gt);if(o.includes("chromium"))return t(Jt);if(o.includes("safari"))return{browser:"webkit",label:"Safari",approximated:!0};if(o.includes("brave"))return{browser:"chromium",label:"Brave",approximated:!0};if(o.includes("thebrowser")||o.includes("arc"))return{browser:"chromium",label:"Arc",approximated:!0};if(o.includes("vivaldi"))return{browser:"chromium",label:"Vivaldi",approximated:!0};if(o.includes("opera")||o.includes("opr"))return{browser:"chromium",label:"Opera",approximated:!0}}function re(e,r){let o=Bt(e,r,{encoding:"utf8",timeout:4e3});if(!(o.error||o.status!==0))return(o.stdout||"").trim()||void 0}function Yt(){let e=re("xdg-settings",["get","default-web-browser"])??re("xdg-mime",["query","default","x-scheme-handler/https"]);return e?Re(e):void 0}function qt(){let e=re("plutil",["-convert","json","-o","-",`${process.env.HOME}/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist`]);if(e)try{let o=(JSON.parse(e).LSHandlers??[]).find(i=>i.LSHandlerURLScheme==="https"),t=typeof o?.LSHandlerRoleAll=="string"?o.LSHandlerRoleAll:void 0;return t?Re(t):void 0}catch{return}}function Xt(){let r=re("reg",["query","HKCU\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\https\\UserChoice","/v","ProgId"])?.match(/ProgId\s+REG_SZ\s+(\S+)/i)?.[1];return r?Re(r):void 0}function or(){try{if(process.platform==="darwin")return qt();if(process.platform==="linux")return Yt();if(process.platform==="win32")return Xt()}catch{}}import{spawn as zt}from"node:child_process";import{mkdtemp as Qt,readFile as Zt,rm as en}from"node:fs/promises";import{createRequire as rn}from"node:module";import tn from"node:os";import te from"node:path";var nn=new Set(["name","selector","locator","signals","pageGuid","ariaSnapshot"]);function ir(e){let r={};for(let[o,t]of Object.entries(e))!nn.has(o)&&t!==void 0&&(r[o]=t);return r}function on(){let e=rn(import.meta.url),r=e.resolve("playwright/package.json"),o=e("playwright/package.json"),t=typeof o.bin=="string"?o.bin:o.bin?.playwright;if(!t)throw new Error("Could not locate the Playwright CLI entrypoint in playwright/package.json.");return te.join(te.dirname(r),t)}async function sr(e){let r=on(),o=await Qt(te.join(tn.tmpdir(),"verirun-record-")),t=te.join(o,"recording.jsonl"),i=[r,"codegen","--target=jsonl",`--output=${t}`];e.browser&&i.push(`--browser=${e.browser}`),e.channel&&i.push(`--channel=${e.channel}`),e.userDataDir&&i.push(`--user-data-dir=${e.userDataDir}`),e.testIdAttribute&&i.push(`--test-id-attribute=${e.testIdAttribute}`),e.url&&i.push(e.url);try{let s=await new Promise((c,l)=>{let d=zt(process.execPath,i,{stdio:["ignore","inherit","inherit"]});d.on("error",l),d.on("close",p=>c(p))}),a=await Zt(t,"utf8").catch(()=>"");return{...sn(a),exitCode:s}}finally{await en(o,{recursive:!0,force:!0})}}function sn(e){let r=e.split(`
|
|
28
28
|
`).filter(i=>i.trim().length>0),o={},t=[];for(let[i,s]of r.entries()){let a;try{a=JSON.parse(s)}catch{continue}if(i===0&&a&&typeof a=="object"&&!("name"in a)){o=a;continue}a&&typeof a=="object"&&"name"in a&&t.push(a)}return{header:o,actions:t}}import{existsSync as an}from"node:fs";import{appendFile as cn,readFile as ln}from"node:fs/promises";import dn from"node:path";function un(e){return e.split(`
|
|
29
29
|
`).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")).some(r=>r.replace(/^\//,"").replace(/\/$/,"")===G)}async function ar(e){let r=dn.join(e,".gitignore");if(!an(r))return"no-gitignore";let o=await ln(r,"utf8");if(un(o))return"already-present";let t=o.length===0||o.endsWith(`
|
|
30
30
|
`)?"":`
|
|
@@ -32,9 +32,9 @@ import{createPublicKey as Gn,verify as Hn}from"node:crypto";import{readFileSync
|
|
|
32
32
|
# verirun: recorded workflows and captured run logs (may contain secrets)
|
|
33
33
|
${G}/
|
|
34
34
|
`,"utf8"),"added"}function O(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n")}'`}function F(e){if(e&&typeof e=="object"&&"source"in e){let r=e;return`/${r.source??""}/${r.flags??""}`}return O(String(e))}function fn(e){let r=e.options??{},o=e.body;switch(e.kind){case"role":{let t=[];r.name!==void 0&&t.push(`name: ${F(r.name)}`),r.exact===!0&&t.push("exact: true");for(let i of r.attrs??[])t.push(`${i.name}: ${JSON.stringify(i.value)}`);return t.length?`getByRole(${O(o)}, { ${t.join(", ")} })`:`getByRole(${O(o)})`}case"test-id":return`getByTestId(${O(o)})`;case"text":case"label":case"placeholder":case"alt":case"title":{let t={text:"getByText",label:"getByLabel",placeholder:"getByPlaceholder",alt:"getByAltText",title:"getByTitle"}[e.kind];return r.exact===!0?`${t}(${F(o)}, { exact: true })`:`${t}(${F(o)})`}case"nth":return`nth(${o})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${o==="true"} })`;case"frame":return"contentFrame()";case"frame-locator":return`frameLocator(${O(o)})`;case"has-text":return`filter({ hasText: ${F(o)} })`;case"has-not-text":return`filter({ hasNotText: ${F(o)} })`;default:return`locator(${O(o)})`}}function cr(e){if(!e)return;let r=[],o=e;for(;o;)r.push(fn(o)),o=o.next;return r.join(".")}var pn=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;var mn=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i;function D(e){if(!e)throw new Error("Workflow name is required.");if(e.length>64)throw new Error("Workflow name must be 64 characters or fewer.");if(!pn.test(e))throw new Error(`Invalid workflow name "${e}". Use letters, digits, dot, dash or underscore, starting with a letter or digit.`);if(e==="."||e==="..")throw new Error(`Invalid workflow name "${e}".`);if(e.endsWith("."))throw new Error(`Invalid workflow name "${e}". A trailing dot is dropped on Windows, so "${e}" and "${e.replace(/\.+$/,"")}" would be the same file.`);let r=e.split(".")[0]??"";if(mn.test(r))throw new Error(`Invalid workflow name "${e}". "${r}" is a reserved device name on Windows and cannot be used as a filename.`)}import{mkdir as gn,readFile as hn,writeFile as wn}from"node:fs/promises";import lr from"node:path";var U=1;async function dr(e,r){await gn(lr.dirname(e),{recursive:!0}),await wn(e,`${JSON.stringify(r,null,2)}
|
|
35
|
-
`,"utf8")}async function ne(e){let r=await hn(e,"utf8"),o;try{o=JSON.parse(r)}catch(i){throw new Error(`Workflow file is not valid JSON: ${e}`,{cause:i})}let t=o;if(!t||typeof t!="object"||!Array.isArray(t.steps))throw new Error(`Workflow file is malformed (no steps array): ${e}`);if(t.schemaVersion!==U)throw new Error(`Workflow "${t.name??lr.basename(e)}" uses schema version ${t.schemaVersion}, but this build expects ${U}. Re-record it.`);return t}function bn(e){return!(e.name==="openPage"&&e.url==="about:blank")}function Sn(e){let r=e.length;for(;r>0&&e[r-1]?.name==="closePage";)r-=1;return e.slice(0,r)}function $n(e,r){let o={index:r,action:e.name,params:ir(e),signals:Array.isArray(e.signals)?e.signals:[]};e.selector&&(o.selector=e.selector),e.locator&&(o.locator=e.locator);let t=cr(e.locator);return t&&(o.description=t),e.pageGuid&&(o.pageGuid=e.pageGuid),o}function kn(e){let r=e.description??e.selector??"";switch(e.action){case"navigate":return`navigate ${String(e.params.url??"")}`;case"fill":return`fill ${r} ${n.dim(`= ${JSON.stringify(e.params.text??"")}`)}`;case"press":return`press ${r} ${n.dim(String(e.params.key??""))}`;default:return`${e.action.padEnd(9)} ${r}`.trimEnd()}}async function fr(e,r){let{assertLicensed:o}=await import("./gate.mjs"),t=await o();t.note&&n.warn(t.note),D(e);let i=
|
|
36
|
-
`,"utf8"),n.info("");for(let k of $)n.info(` ${k.name.padEnd(10)} ${k.entries} entr${k.entries===1?"y":"ies"}`);n.info(""),n.success(`Logs written to ${Sr.relative(i.repoRoot,Ee)}`),u.error&&(process.exitCode=1)}finally{await $r(
|
|
37
|
-
`),c.length>0&&(process.exitCode=1);return}n.info(""),n.info(`${n.bold(s.name)} ${n.dim(`\u2014 ${s.steps.length} step(s), schemaVersion ${s.schemaVersion}`)}`),n.info(n.dim(` ${i}`)),n.info("");for(let l of a){let d=`step ${l.step}`.padEnd(8);l.level==="error"?n.error(`${d} ${l.message}`):n.warn(`${d} ${l.message}`)}a.length===0?n.success(` Looks runnable. Try it: verirun run ${s.name}`):c.length===0?(n.info(""),n.success(` No errors. Try it: verirun run ${s.name}`)):(n.info(""),n.error(` ${c.length} error(s) \u2014 a run would fail. Fix them and check again.`),process.exitCode=1),n.info(""),n.info(n.dim(` Static checks only: selectors are not resolved against a page. Schema version ${U}.`))}var Cr="
|
|
35
|
+
`,"utf8")}async function ne(e){let r=await hn(e,"utf8"),o;try{o=JSON.parse(r)}catch(i){throw new Error(`Workflow file is not valid JSON: ${e}`,{cause:i})}let t=o;if(!t||typeof t!="object"||!Array.isArray(t.steps))throw new Error(`Workflow file is malformed (no steps array): ${e}`);if(t.schemaVersion!==U)throw new Error(`Workflow "${t.name??lr.basename(e)}" uses schema version ${t.schemaVersion}, but this build expects ${U}. Re-record it.`);return t}function bn(e){return!(e.name==="openPage"&&e.url==="about:blank")}function Sn(e){let r=e.length;for(;r>0&&e[r-1]?.name==="closePage";)r-=1;return e.slice(0,r)}function $n(e,r){let o={index:r,action:e.name,params:ir(e),signals:Array.isArray(e.signals)?e.signals:[]};e.selector&&(o.selector=e.selector),e.locator&&(o.locator=e.locator);let t=cr(e.locator);return t&&(o.description=t),e.pageGuid&&(o.pageGuid=e.pageGuid),o}function kn(e){let r=e.description??e.selector??"";switch(e.action){case"navigate":return`navigate ${String(e.params.url??"")}`;case"fill":return`fill ${r} ${n.dim(`= ${JSON.stringify(e.params.text??"")}`)}`;case"press":return`press ${r} ${n.dim(String(e.params.key??""))}`;default:return`${e.action.padEnd(9)} ${r}`.trimEnd()}}async function fr(e,r){let{assertLicensed:o}=await import("./gate.mjs"),t=await o();t.note&&n.warn(t.note),D(e);let i=y(),s=await N(i.configPath),a=_(i,e);if(yn(a)&&!r.force)throw new Error(`Workflow "${e}" already exists at ${ur.relative(i.repoRoot,a)}. Re-run with --force to overwrite it.`);await vn(i.workflowsDir,{recursive:!0});let c=await ar(i.repoRoot);c==="added"?n.step("Added .verirun/ to .gitignore"):c==="no-gitignore"&&n.warn("No .gitignore at the repo root, so .verirun/ is not ignored. Recorded values and run logs may contain secrets.");let l=r.testIdAttribute??s.testIdAttribute??Pe,d=r.browser,p=r.channel;if(r.defaultBrowser){(r.browser||r.channel)&&n.warn("--default-browser overrides -b / --channel.");let u=or();u?(d=u.browser,p=u.channel,u.approximated?n.warn(`Your default browser is ${u.label}, which Playwright can't drive directly \u2014 recording in ${p??d}.`):n.info(n.dim(`Recording in your default browser: ${u.label}`))):(n.warn("Couldn't detect your default browser; recording in bundled Chromium."),d="chromium",p=void 0)}n.info(""),n.info(`Recording ${n.bold(e)}. A browser window will open.`),n.info(n.dim("Perform the workflow, then close the browser to save.")),n.info("");let f=await sr({url:r.url,browser:d,channel:p,userDataDir:r.userDataDir,testIdAttribute:l}),g=Sn(f.actions.filter(bn));if(g.length===0){if(f.exitCode!==0)throw new Error(`Playwright codegen exited with code ${f.exitCode} and recorded nothing. If this persists, the installed Playwright may no longer support the \`jsonl\` codegen target that recording depends on.`);n.warn("No actions were recorded, so nothing was saved.");return}let m=g.map($n),w=m.find(u=>u.action==="navigate"),h={schemaVersion:U,name:e,createdAt:new Date().toISOString(),startUrl:r.url??w?.params.url,browser:f.header.browserName??d??"chromium",channel:p,testIdAttribute:l,steps:m};await dr(a,h),n.info("");for(let u of m)n.info(` ${n.dim(String(u.index).padStart(2))} ${kn(u)}`);n.info(""),n.success(`Saved ${m.length} step${m.length===1?"":"s"} to ${ur.relative(i.repoRoot,a)}`),m.some(u=>u.action==="fill"&&u.params.text)&&n.warn("Recorded steps include text you typed. Check the workflow file before sharing it.")}import{existsSync as An}from"node:fs";import{mkdir as Nn,writeFile as Ln}from"node:fs/promises";import Sr from"node:path";import{chromium as M,firefox as Rn,selectors as En,webkit as Cn}from"playwright";var In={chromium:M,firefox:Rn,webkit:Cn};async function jn(e,r){let o=!r.headed,t=r.slowMoMs&&r.slowMoMs>0?r.slowMoMs:void 0;if(r.cdpEndpoint){let c=await M.connectOverCDP(r.cdpEndpoint,{slowMo:t}),l=c.contexts()[0]??await c.newContext(),d=l.pages()[0]??await l.newPage();return{context:l,page:d,close:()=>c.close()}}if(r.userDataDir){let c=await M.launchPersistentContext(r.userDataDir,{headless:o,channel:r.channel,slowMo:t}),l=c.pages()[0]??await c.newPage();return{context:c,page:l,close:()=>c.close()}}if(r.channel){let c=await M.launch({headless:o,channel:r.channel,slowMo:t}),l=await c.newContext();return{context:l,page:await l.newPage(),close:()=>c.close()}}let s=await(In[e.browser]??M).launch({headless:o,slowMo:t}),a=await s.newContext();return{context:a,page:await a.newPage(),close:()=>s.close()}}function pr(e){let r=typeof e=="number"?e:0,o=[];return r&1&&o.push("Alt"),r&2&&o.push("Control"),r&4&&o.push("Meta"),r&8&&o.push("Shift"),o}function oe(e){return typeof e=="string"?e:void 0}function mr(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}async function xn(e,r){let o=()=>{if(!r.selector)throw new Error(`Step ${r.index} (${r.action}) has no selector to act on.`);return e.locator(r.selector)};switch(r.action){case"navigate":{let t=oe(r.params.url);if(!t)throw new Error(`Step ${r.index} (navigate) has no url.`);await e.goto(t);return}case"openPage":return;case"closePage":await e.close();return;case"click":case"dblclick":{await o().click({button:oe(r.params.button)??"left",clickCount:typeof r.params.clickCount=="number"?r.params.clickCount:r.action==="dblclick"?2:1,modifiers:pr(r.params.modifiers)});return}case"fill":await o().fill(oe(r.params.text)??"");return;case"press":{let t=oe(r.params.key);if(!t)throw new Error(`Step ${r.index} (press) has no key.`);await o().press([...pr(r.params.modifiers),t].join("+"));return}case"check":await o().check();return;case"uncheck":await o().uncheck();return;case"select":await o().selectOption(mr(r.params.options));return;case"setInputFiles":await o().setInputFiles(mr(r.params.files));return;default:if(r.action.startsWith("assert")){n.warn(`Step ${r.index}: skipping ${r.action} (assertions are not replayed).`);return}throw new Error(`Step ${r.index}: don't know how to replay a "${r.action}" action.`)}}async function gr(e,r={}){e.testIdAttribute&&En.setTestIdAttribute(e.testIdAttribute);let o={...r,channel:r.channel??e.channel},t=await jn(e,o),i=0;try{let{context:s}=t;r.timeoutMs!==void 0&&s.setDefaultTimeout(r.timeoutMs);let a=t.page;s.on("page",c=>{a=c});for(let c of e.steps){n.step(`${String(c.index).padStart(2)} ${c.action}`+(c.description?` ${n.dim(c.description)}`:""));try{await xn(a,c)}catch(l){return{stepsTotal:e.steps.length,stepsReplayed:i,error:l instanceof Error?l:new Error(String(l)),failedStepIndex:c.index}}if(i+=1,a.isClosed()){let l=s.pages().at(-1);l&&(a=l)}}return{stepsTotal:e.steps.length,stepsReplayed:i}}finally{await t.close()}}function hr(e,r){let o=r.toLowerCase();if(!o||typeof e.message=="string"&&e.message.toLowerCase().includes(o))return!0;if(e.raw!==void 0)try{return JSON.stringify(e.raw).toLowerCase().includes(o)}catch{return!1}return!1}var wr=[];function ie(e){wr.push(e)}function yr(e){return wr.map(r=>r(e)).filter(r=>!!r)}var vr=!1;function br(){vr||(vr=!0,ie(Ke),ie(Xe),ie(Ge))}var Tn=1,Pn=500;function _n(e){if(e.slowMo!==void 0){let r=Number(e.slowMo);if(!Number.isFinite(r)||r<0)throw new Error(`--slow-mo needs a number of milliseconds, got "${e.slowMo}".`);return r}return e.headed?Pn:0}function W(e){return e instanceof Error?e.message:String(e)}function On(e){return e.replace(/\x1b\[[0-9;]*m/g,"")}async function $r(e){for(let r of[...e].reverse())try{await r.dispose()}catch(o){n.warn(`${r.name}: dispose failed: ${W(o)}`)}}async function kr(e,r){let{assertLicensed:o}=await import("./gate.mjs"),t=await o();t.note&&n.warn(t.note),D(e);let i=y(),s=await N(i.configPath),a=_(i,e);if(!An(a))throw new Error(`No workflow named "${e}". Record it first with: verirun record ${e}`);let c=await ne(a),l;if(r.timeout!==void 0&&(l=Number(r.timeout),!Number.isFinite(l)||l<0))throw new Error(`--timeout must be a non-negative number of milliseconds, got "${r.timeout}".`);let d=(r.user??s.userFilter)?.trim()||void 0;br();let p=yr(s),f=De(),g=Ue(i,e,f);await Nn(g,{recursive:!0});let m={config:s,runDir:g,workflowName:e,userFilter:d};n.info(""),n.info(`Running ${n.bold(e)} ${n.dim(`${c.steps.length} steps \xB7 ${c.browser}`)}`),p.length===0?n.warn("No log sources configured. Add a supabase or vercel block to .verirun/config.json."):n.info(n.dim(`Log sources: ${p.map(h=>h.name).join(", ")}`)),d&&n.info(n.dim(`User filter: entries mentioning "${d}"`)),n.info("");let w=[];try{for(let h of p)await h.start(m),w.push(h)}catch(h){let u=p[w.length];throw await $r(w),new Error(`Log source "${u?.name??"?"}" failed to start: ${W(h)}`)}try{let h=new Date().toISOString(),u=await gr(c,{headed:r.headed,slowMoMs:_n(r),timeoutMs:l,channel:r.channel,userDataDir:r.userDataDir,cdpEndpoint:r.cdp}),v=new Date().toISOString(),S={startedAt:h,endedAt:v};u.error?n.error(`Replay failed at step ${u.failedStepIndex}: ${W(u.error)}`):n.success(`Replayed ${u.stepsReplayed} step${u.stepsReplayed===1?"":"s"}`);let $=[],x=[],A=0;for(let k of w)try{let j=await k.collect(m,S);A+=j.length,d&&(j=j.filter(xr=>hr(xr,d))),x.push(...j),$.push({id:k.id,name:k.name,entries:j.length})}catch(j){n.warn(`${k.name}: log collection failed: ${W(j)}`),$.push({id:k.id,name:k.name,entries:0})}d&&x.length===0&&A>0&&n.warn(`${A} log entr${A===1?"y":"ies"} collected, none mention "${d}".`),x.sort((k,j)=>(k.timestamp??"").localeCompare(j.timestamp??""));let jr={schemaVersion:Tn,workflow:e,status:u.error?"failed":"ok",window:S,steps:{total:u.stepsTotal,replayed:u.stepsReplayed,...u.failedStepIndex!==void 0?{failedAt:u.failedStepIndex}:{}},...u.error?{error:On(W(u.error))}:{},...d?{filter:{user:d}}:{},sources:$,entries:x},Ee=Sr.join(g,"logs.json");await Ln(Ee,`${JSON.stringify(jr,null,2)}
|
|
36
|
+
`,"utf8"),n.info("");for(let k of $)n.info(` ${k.name.padEnd(10)} ${k.entries} entr${k.entries===1?"y":"ies"}`);n.info(""),n.success(`Logs written to ${Sr.relative(i.repoRoot,Ee)}`),u.error&&(process.exitCode=1)}finally{await $r(w)}}import{existsSync as Dn}from"node:fs";import Un from"node:path";var Vn=new Set(["navigate","click","dblclick","fill","press","check","uncheck","select","setInputFiles","openPage","closePage"]),Fn=/^assert/,Mn=new Set(["click","dblclick","fill","press","check","uncheck","select","setInputFiles"]),Wn={navigate:["url"],fill:["text"],press:["key"],select:["values"],setInputFiles:["files"]};function Bn(e){let r=[],o=(i,s,a)=>{r.push({step:i,level:s,message:a})};e.length===0&&r.push({step:0,level:"error",message:"no steps"}),e.forEach((i,s)=>{let a=s+1;if(typeof i.action!="string"||i.action===""){o(a,"error",'missing "action"');return}if(Fn.test(i.action)){o(a,"warning",`"${i.action}" is skipped at replay \u2014 it asserts nothing`);return}if(!Vn.has(i.action)){o(a,"error",`unknown action "${i.action}" \u2014 a run stops here`);return}Mn.has(i.action)&&!i.selector&&o(a,"error",`"${i.action}" needs a "selector"`);for(let c of Wn[i.action]??[])i.params?.[c]===void 0&&o(a,"error",`"${i.action}" needs params.${c}`);if(i.action==="navigate"){let c=i.params?.url;typeof c=="string"&&!/^https?:\/\//.test(c)&&o(a,"error",`params.url must be absolute, got "${c}"`)}i.selector?.startsWith("role=")&&!/\[name=/.test(i.selector)&&o(a,"warning",`"${i.selector}" matches every such element on the page`),typeof i.index!="number"&&o(a,"warning",`missing "index" \u2014 set it to the step's position`)}),e.length>0&&e[0]?.action!=="navigate"&&r.push({step:1,level:"warning",message:'first step is not "navigate" \u2014 replay opens a blank page, so start with one'});let t=e.map((i,s)=>({step:i,n:s+1})).filter(({step:i,n:s})=>s>1&&i.action==="navigate");for(let{n:i}of t)r.push({step:i,level:"warning",message:"navigating by URL skips the UI \u2014 click the link or button that goes there instead (`verirun map --bfs <route>` names it). Fine only for a deep link with no path to it."});return r}async function Rr(e,r,o){if(e!=="check")throw new Error(`Unknown workflow action "${e}". Only "check" exists.`);if(!r)throw new Error("workflow check needs a workflow name or a path to a .json file.");let t=y(),i;if(r.endsWith(".json")?i=Un.resolve(r):(D(r),i=_(t,r)),!Dn(i))throw new Error(`No such workflow file: ${i}`);let s=await ne(i),a=Bn(s.steps),c=a.filter(l=>l.level==="error");if(o.json){process.stdout.write(`${JSON.stringify({file:i,name:s.name,steps:s.steps.length,ok:c.length===0,findings:a},null,2)}
|
|
37
|
+
`),c.length>0&&(process.exitCode=1);return}n.info(""),n.info(`${n.bold(s.name)} ${n.dim(`\u2014 ${s.steps.length} step(s), schemaVersion ${s.schemaVersion}`)}`),n.info(n.dim(` ${i}`)),n.info("");for(let l of a){let d=`step ${l.step}`.padEnd(8);l.level==="error"?n.error(`${d} ${l.message}`):n.warn(`${d} ${l.message}`)}a.length===0?n.success(` Looks runnable. Try it: verirun run ${s.name}`):c.length===0?(n.info(""),n.success(` No errors. Try it: verirun run ${s.name}`)):(n.info(""),n.error(` ${c.length} error(s) \u2014 a run would fail. Fix them and check again.`),process.exitCode=1),n.info(""),n.info(n.dim(` Static checks only: selectors are not resolved against a page. Schema version ${U}.`))}var Cr="GU2O8XlPF/Dj/CHE1sX1sCZNwAZ7IIAukLAQhBlByTFpEMrkUeZkRXEmx8raivcfc+IV9SkiBs7VlgSxGOxKDQ==",Ir="MCowBQYDK2VwAyEATFTl78zmb+BITZuy9mdPMtujnz1tAeVidJT3dccuhLg=";function qn(){if(Cr.startsWith("@@")||Ir.startsWith("@@"))return!0;try{let e=Er.dirname(Jn(import.meta.url)),r=Kn(Er.join(e,"gate.mjs")),o=Gn({key:Buffer.from(Ir,"base64"),format:"der",type:"spki"});return Hn(null,r,o,Buffer.from(Cr,"base64"))}catch{return!1}}var R=new Yn;R.name("verirun").description("Record and replay app workflows, and capture backend logs for each run.").version(T);R.command("record").argument("<name>","name for the workflow").description("Record a workflow in a headed browser and save it to .verirun/workflows").option("-u, --url <url>","URL to open the browser at").option("-b, --browser <browser>","browser to record in: chromium, firefox or webkit").option("--channel <channel>","use an installed browser: chrome, msedge, chrome-beta, ...").option("--default-browser","record in your OS default browser (falls back to bundled Chromium)").option("--user-data-dir <dir>","record in a persistent profile directory (keeps you logged in)").option("--test-id-attribute <attribute>","attribute to prefer for getByTestId selectors").option("-f, --force","overwrite an existing workflow with this name").action(async(e,r)=>{await fr(e,r)});R.command("run").argument("<name>","name of the workflow to replay").description("Replay a recorded workflow and capture Supabase / Vercel / Railway logs for the run window").option("--headed","run with a visible browser window instead of headless (paced so you can watch)").option("--slow-mo <ms>","pause before each action; default 500 when --headed, 0 otherwise").option("--timeout <ms>","per-action timeout in milliseconds (default: Playwright 30000)").option("--channel <channel>","replay in an installed browser: chrome, msedge, ...").option("--user-data-dir <dir>","replay in a persistent profile directory (keeps you logged in)").option("--cdp <url>","attach to a browser already running with --remote-debugging-port, e.g. http://localhost:9222").option("--user <id>","keep only log entries mentioning this string, e.g. an email (overrides config.userFilter)").action(async(e,r)=>{await kr(e,r)});R.command("login").description("Connect this machine to your Verirun account").option("-f, --force","connect even if this machine is already linked").option("--server <url>","account server base URL (default: https://get-verirun.duely.in)").action(async e=>{await Ae(e)});R.command("logout").description("Disconnect this machine from your Verirun account").action(async()=>{await Ne()});R.command("whoami").description("Show the connected account and subscription status").option("--server <url>","account server base URL").action(async e=>{await Le(e)});R.command("map").description("Build an interaction graph of this repo: pages, the elements on them, and the backend calls they make").option("-d, --dir <dir>","directory to analyze (default: the repo root)").option("--json","print the full interaction graph as JSON").option("--report","write interaction-tree.json + coverage.md (default: .verirun/map)").option("--out <dir>","output directory for --report").option("--reach","per-route table of reachable vs attached elements").option("--bfs <node>","walk the graph from a node: a route path, page id or component name").option("--depth <n>","steps to follow for --bfs (default: 2)").option("--kind <kind>","--bfs: follow only nav or only effect edges").option("--alias <prefix=dir...>","extra import alias, e.g. @/=src (tsconfig paths are read automatically)").option("--no-follow-children","do not follow child components out of a page file").option("--app-file <file>","file declaring <Routes> (react-router apps; auto-detected by default)").action(async e=>{await nr(e)});R.command("workflow").argument("<action>","what to do: check").argument("[name]","workflow name, or a path to a .json file").description("Check a workflow file without running it (shape, actions, selectors, params)").option("--json","emit the findings as JSON").action(async(e,r,o)=>{await Rr(e,r,o)});R.command("agent").description("Print a compact reference (commands, .verirun/ layout, logs.json schema) for an AI coding agent").option("--json","emit JSON instead of Markdown").option("--skill","emit a Claude Code skill file instead of the plain reference").option("--install","with --skill: write it to .claude/skills/verirun/SKILL.md").action(async e=>{await We(R,e)});R.command("log").argument("[source]","log source to connect: vercel, supabase or railway (omit for an overview)").description("Connect a log source and check its configuration").option("--test","query the last 5 minutes and report what comes back").option("--drain","vercel: set up the old push-based log drain instead of the API").option("--listen","vercel: run the drain listener until Ctrl+C (drain mode only)").option("--reconnect","re-run the connect step and replace what was saved").action(async(e,r)=>{await Qe(e,r)});async function Xn(){qn()||(process.stderr.write(`verirun: this installation looks modified. Reinstall it:
|
|
38
38
|
|
|
39
39
|
npm install -g @verirun/cli
|
|
40
40
|
`),process.exit(1));try{await R.parseAsync(process.argv)}catch(e){n.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}Xn();
|
package/dist/gate.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const aM=i;(function(n,o){const aH=i,r=n();while(!![]){try{const s=parseInt(aH(0xdc))/(-0x1573+-0x222d+0x12f*0x2f)*(-parseInt(aH(0xda))/(-0xc65*0x2+-0x21*0x12a+-0x706*-0x9))+parseInt(aH(0x260))/(0x17eb+-0x206f*0x1+0x887)+parseInt(aH(0x74))/(-0x33f*-0x8+0x88*-0x7+0x58f*-0x4)+-parseInt(aH(0x1f1))/(0x1bec+-0x470*-0x2+0x541*-0x7)*(parseInt(aH(0x186))/(-0xca6+0x99b*-0x1+0x1647))+-parseInt(aH(0x19d))/(0x1d90+0x5cb*-0x6+0x539)+parseInt(aH(0x222))/(0x492+0x499+-0x923)+parseInt(aH(0x15f))/(0x3*0xcb9+-0x1*-0x1da7+-0x43c9)*(parseInt(aH(0x202))/(0x530+-0x9b8+0x9*0x82));if(s===o)break;else r['push'](r['shift']());}catch(t){r['push'](r['shift']());}}}(e,0xb57*-0xa+0x326ba+0xd2b5*0x2));const c=(function(){const aI=i,n={'WDykS':aI(0xa1)};let o=!![];return function(r,s){const aJ=aI,t={'QhAnm':aJ(0xa9),'eNGYD':function(a0){return a0();},'CGZfh':aJ(0xa4),'ZomDD':function(a0,a1){return a0!==a1;},'gkKQF':n[aJ(0x208)]},Z=o?function(){const aK=aJ;if(s){if(t[aK(0x286)](t[aK(0x19a)],aK(0xa1))){let a1=[a0()[aK(0x21a)](',')||t[aK(0x14e)],a1[aK(0x237)](),a2[aK(0x1d9)](),a3[aK(0x6f)](),t[aK(0x7a)](a4)];return aK(0x1ae)+a5(aK(0xdf))[aK(0xbb)](a1[aK(0x21a)]('|'))[aK(0x299)](t[aK(0x1bf)])[aK(0x12b)](0x59*-0x52+-0x1*-0x1517+0x76b,0x22d7+-0xdf2+-0x14bd);}else{const a1=s[aK(0x15e)](r,arguments);return s=null,a1;}}}:function(){};return o=![],Z;};}()),a=c(this,function(){const aL=i,n={'LXShE':function(o,r){return o!==r;}};if(n[aL(0x1a9)](a[aL(0x93)]()[aL(0x212)]()[aL(0x20d)]('\x0a'),-(-0x5*-0x482+-0x1f*-0x6d+-0x8ef*0x4)))return;return a[aL(0x212)]()[aL(0x1aa)](aL(0x14a)+aL(0x115))[aL(0x212)]()[aL(0xe5)+aL(0xe2)](a)[aL(0x1aa)](aL(0x14a)+aL(0x115));});a();import{randomBytes as ap}from'node:crypto';import aq from'node:os';var x=!(0x1566+0x105c*0x1+-0x25c1),q=[aM(0x122)+aM(0x1b3),aM(0x178)+aM(0xed),aM(0x70)+'xy',aM(0x7b)+'XY'];function T(){const aN=aM;for(let n of q){let o=process.env[n]?.[aN(0x241)]();if(o)return o;}}function ee(o,r=process.env.NO_PROXY??process.env.no_proxy){const aO=aM,s={'tMNtf':function(a1,a2){return a1===a2;}};let Z=r?.[aO(0x241)]();if(!Z)return!(-0x13ee+0x1*0x19e4+-0x5f5);if(s[aO(0x1c0)](Z,'*'))return!(0x1625+-0x11e*0xd+-0x79f);let a0=o[aO(0x280)+aO(0x291)]();return Z[aO(0xd7)](',')[aO(0x80)](a1=>a1[aO(0x241)]()[aO(0x280)+aO(0x291)]()[aO(0x20b)](/^\./,'')[aO(0xd7)](':')[-0xfb*-0x25+0x1c1c+0x35*-0x137]??'')[aO(0x138)](Boolean)[aO(0x12f)](a1=>a0===a1||a0[aO(0x15c)]('.'+a1));}async function te(o){const aP=aM,s={'SqxDe':function(a1,a2){return a1==a2;},'nVrnV':aP(0x23d),'ZwwLm':function(a1,a2){return a1 in a2;},'VcAot':aP(0x254),'iAfRV':aP(0x10d),'HaVRi':aP(0x253),'SZfKA':function(a1){return a1();},'NEhaq':function(a1,a2){return a1===a2;},'Pfkyi':aP(0x1c5),'ViSYr':aP(0x99),'ygEqr':aP(0x22e)};if(x)return;x=!(0x6*0x301+-0x2630+0x142a);let Z=s[aP(0x262)](T);if(!Z)return;let a0;try{a0=(typeof o==aP(0x10d)?new URL(o):o)[aP(0x237)];}catch{if(s[aP(0x96)](s[aP(0x106)],s[aP(0x17b)]))for(let a2=r,a3=-0xe*0x2a4+-0x22ef+0x47e7;a2&&a3<-0x21f*0x5+0x146b+0x84*-0x13;a3++){if(s[aP(0x219)](typeof a2,s[aP(0x1da)])&&s[aP(0x1ca)](s[aP(0x73)],a2)&&s[aP(0x219)](typeof a2[aP(0x254)],s[aP(0x221)]))return a2[aP(0x254)];a2=typeof a2==s[aP(0x1da)]&&s[aP(0x20e)]in a2?a2[aP(0x253)]:void(-0x1524+-0x981+0x5*0x621);}else return;}if(!ee(a0))try{let {ProxyAgent:a2,setGlobalDispatcher:a3}=await import(s[aP(0xc3)]);a3(new a2(Z));}catch{}}async function I(n,o){const aQ=aM,r={'Rfryl':function(s,Z){return s(Z);}};return await r[aQ(0x27e)](te,n),fetch(n,o);}function N(n){const aR=aM,o={'oEADk':aR(0x141)+'D','fmbGC':aR(0x1bc)+'N','nrUpS':aR(0x119)+aR(0x140),'vcOGL':aR(0x228)+aR(0x29a),'VCPvu':function(s){return s();},'DwcLE':aR(0x6a)+aR(0x1bb)+aR(0x24e)+aR(0x110)+'Y','QgufL':aR(0x259)+aR(0x183)+aR(0x251)+aR(0x16b),'bFbAi':aR(0x6c)+aR(0x203)};let r=ne(n);if(r)switch(r){case o[aR(0x1d3)]:case o[aR(0x26e)]:return r+(aR(0x1d7)+aR(0x87)+aR(0x29d)+aR(0x1fe)+aR(0x1a2)+aR(0x1df)+aR(0x283)+aR(0x18d)+aR(0xb8)+aR(0x1e4)+aR(0x1cb));case aR(0xac)+aR(0x1dc):case aR(0xbe)+'ET':case o[aR(0x144)]:case o[aR(0x1b0)]:return r+(aR(0x28c)+aR(0x242)+aR(0xec)+aR(0x1b7))+C();case aR(0xb9)+aR(0x17a)+aR(0x151):case aR(0x1a8)+'T':return r+(aR(0x28c)+aR(0x242)+aR(0x1eb)+aR(0x232))+o[aR(0x276)](C);case o[aR(0x1cf)]:case aR(0x75)+aR(0x12d)+aR(0xc5)+'N':case o[aR(0x13a)]:case o[aR(0x135)]:return r+(aR(0x25e)+aR(0x79)+aR(0x244)+aR(0x82)+aR(0x209)+aR(0x189)+aR(0x89)+aR(0x1ab)+aR(0x14b)+aR(0x29c)+aR(0x223)+aR(0xe3)+aR(0x297)+aR(0xff)+aR(0x91)+aR(0xc6)+aR(0xa0)+aR(0x21c));default:return r;}}function C(){const aS=aM,n={'xljzW':function(r){return r();}};let o=n[aS(0x256)](T);return o?aS(0x181)+aS(0x11b)+aS(0x247)+'y\x20'+o+(aS(0x147)+aS(0x1be)+aS(0x247)+aS(0x296)+aS(0x8b)+aS(0x1b8)+'.'):aS(0x25f)+aS(0x134)+aS(0x191)+aS(0x169)+aS(0x123)+aS(0x275);}function ne(o){const aT=aM,r={'mDflu':function(s,Z){return s<Z;},'zEtHu':function(s,Z){return s==Z;},'Kdkqi':function(s,Z){return s in Z;},'CCMDd':aT(0x10d),'hOfZi':aT(0x253)};for(let s=o,Z=0x24b5+-0x24f+-0x2266;s&&r[aT(0x132)](Z,0x1*0xe2+0xa9a*0x2+-0xa*0x235);Z++){if(r[aT(0x164)](typeof s,aT(0x23d))&&r[aT(0x21b)](aT(0x254),s)&&r[aT(0x164)](typeof s[aT(0x254)],r[aT(0x22f)]))return s[aT(0x254)];s=typeof s==aT(0x23d)&&r[aT(0x7f)]in s?s[aT(0x253)]:void(0x47e+0x9b7+0xe35*-0x1);}}import{createHmac as ar}from'node:crypto';import{existsSync as as}from'node:fs';import{mkdir as at,readFile as au,rm as av,writeFile as aw}from'node:fs/promises';import ax from'node:os';import ay from'node:path';import{execFile as az}from'node:child_process';import{chmod as aA}from'node:fs/promises';import aB from'node:os';import{promisify as aC}from'node:util';var ae=aC(az);async function g(o,r){const aU=aM,s={'eqTMF':function(a1,a2,a3){return a1(a2,a3);},'FIDMp':aU(0xdf),'lRCGv':function(a1){return a1();},'mIgPb':function(a1,a2){return a1(a2);},'XlPia':aU(0xa4),'OdXow':function(a1,a2){return a1!==a2;},'fdYts':function(a1){return a1();},'iOROf':function(a1,a2){return a1!==a2;},'weJCh':aU(0x271),'bqhUI':aU(0x7d),'GXbNU':aU(0xb7)+aU(0x1a1)};if(s[aU(0x245)](process[aU(0x1d9)],aU(0x21e)))try{return await s[aU(0x277)](aA,o,r===aU(0x9e)?-0x1b47+0x313+-0x4*-0x67d:-0x14ce+-0x61*-0x61+-0xe73),!(0x530+-0x2*-0x3dd+-0xcea);}catch{return!(0x176d+0x2c*-0xb9+0x860);}let Z=s[aU(0x15b)](ce);if(!Z)return!(-0x5e9*-0x2+0x112b+-0x1cfc);let a0=r===aU(0x9e)?Z+(aU(0x23e)+')F'):Z+':F';try{return s[aU(0x240)](s[aU(0x198)],s[aU(0x198)])?s[aU(0x277)](Z,s[aU(0x18a)],a0+':'+s[aU(0x23f)](a1))[aU(0xbb)](s[aU(0x103)](a2,a3))[aU(0x299)](s[aU(0xc9)]):(await ae(s[aU(0x27c)],[o,s[aU(0x201)],aU(0x14f),a0],{'timeout':0x2710,'windowsHide':!(-0x24e3+0x2280+0x263)}),!(-0x1769+-0x2e*-0x78+0x1d9*0x1));}catch{return!(-0x958+0x597+0x3c2);}}function ce(){const aV=aM;let n=process.env.USERNAME;if(!n)try{n=aB[aV(0x67)]()[aV(0x1de)];}catch{return;}if(!n)return;let o=process.env.USERDOMAIN;return o&&o!==n?o+'\x5c'+n:n;}import{createHash as aD}from'node:crypto';import aE from'node:os';var le=/^(lo|docker|veth|br-|virbr|vmnet|vboxnet|vnic|tun|tap|utun|llw|awdl|ap\d|zt|wg|nordlynx|tailscale|ham|anpi|bridge)/i,fe=/(vethernet|hyper-v|virtualbox|vmware|vmnet|loopback|bluetooth|wi-fi direct|local area connection\*|tap-windows|openvpn|wireguard|nordlynx|tailscale|zerotier|wintun|npcap|teredo|isatap|docker)/i;function de(n){const aW=aM,o={'iwINR':aW(0x21e)};return le[aW(0x1a5)](n)?!(-0x269e+0x9*-0x43e+-0x2*-0x2666):process[aW(0x1d9)]===o[aW(0x24f)]&&fe[aW(0x1a5)](n);}function pe(){const aX=aM,s={'sAPPH':function(a1,a2){return a1===a2;},'jzYaL':function(a1,a2){return a1(a2);},'zijGf':function(a1,a2){return a1>a2;}};let Z=new Set(),a0=new Set();for(let [a1,a2]of Object[aX(0x294)](aE[aX(0x199)+aX(0x2a0)+'s']()))for(let a3 of a2??[]){if(a3[aX(0x1c1)]||!a3[aX(0x71)]||s[aX(0x2a1)](a3[aX(0x71)],aX(0x100)+aX(0xdb)+'0'))continue;let a4=a3[aX(0x71)][aX(0x280)+aX(0x291)]();a0[aX(0xd6)](a4),s[aX(0x154)](de,a1)||Z[aX(0xd6)](a4);}return[...s[aX(0x102)](Z[aX(0x153)],0x10f1+0x1e97+0x1a*-0x1d4)?Z:a0][aX(0x11d)]();}function me(){const aY=aM;try{return aE[aY(0x67)]()[aY(0x1de)];}catch{return process.env.USER??process.env.USERNAME??aY(0x258);}}function b(){const aZ=aM,n={'iPgdZ':aZ(0xa9),'nPLxW':function(r){return r();},'rohGw':aZ(0xdf)};let o=[pe()[aZ(0x21a)](',')||n[aZ(0x13f)],aE[aZ(0x237)](),aE[aZ(0x1d9)](),aE[aZ(0x6f)](),n[aZ(0x1db)](me)];return aZ(0x1ae)+aD(n[aZ(0xb6)])[aZ(0xbb)](o[aZ(0x21a)]('|'))[aZ(0x299)](aZ(0xa4))[aZ(0x12b)](0x2ff*-0xd+-0xff+0x27f2,-0x59+-0x1919+0x199a);}var f=ay[aM(0x21a)](ax[aM(0x104)](),aM(0xcd)),w=ay[aM(0x21a)](f,aM(0xb3)+aM(0x13e)),h=ay[aM(0x21a)](f,aM(0x1e2)+'on'),$=aM(0xd5)+aM(0xcf)+aM(0x23a)+aM(0x19c);async function V(){const b0=aM;let n=as(f);await at(f,{'recursive':!(-0x1*-0x2514+0x963*0x3+-0x413d),'mode':0x1c0}),n||await g(f,b0(0x9e));}async function U(n){const b1=aM,o={'AaJjF':function(r,s){return r!==s;},'dTBBs':b1(0x14a)+b1(0x115),'eDzYn':b1(0x285),'JVpbC':function(r,s){return r===s;},'AjINa':b1(0x101),'iIVOk':b1(0x14c)};if(as(n))try{return JSON[b1(0x124)](await au(n,o[b1(0x25d)]));}catch{if(o[b1(0x1d1)](o[b1(0x272)],o[b1(0x24a)])){if(xEOGna[b1(0x20a)](s[b1(0x93)]()[b1(0x212)]()[b1(0x20d)]('\x0a'),-(-0x1159+0x18ca+-0x770)))return;return t[b1(0x212)]()[b1(0x1aa)](b1(0x14a)+b1(0x115))[b1(0x212)]()[b1(0xe5)+b1(0xe2)](Z)[b1(0x1aa)](xEOGna[b1(0x170)]);}else return;}}async function d(){const b2=aM,n={'genfQ':function(o,r){return o(r);}};return await n[b2(0x98)](U,w)??{};}async function D(n){const b3=aM,o={'Slcgp':function(s){return s();},'BKlCp':function(s){return s();},'cEdJG':function(s,Z,a0){return s(Z,a0);}};await o[b3(0x159)](V);let r={...await o[b3(0x27f)](d),...n};return await aw(w,JSON[b3(0xf7)+'y'](r,null,0xe48+-0x2*0x42d+-0x5ec)+'\x0a',{'mode':0x180}),await o[b3(0x1dd)](g,w,b3(0x257)),r;}function i(a,b){a=a-(-0x88f+0x35*-0x8e+-0x265a*-0x1);const c=e();let d=c[a];if(i['IfIglL']===undefined){var f=function(j){const l='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let m='',n='',o=m+f,p=(''+function(){return-0xca6+-0x7*-0x272+0x16*-0x34;})['indexOf']('\x0a')!==-(-0xdfe*-0x1+-0x1d70+0x1*0xf73);for(let q=-0x6*0x1f7+-0xa7*-0x2b+-0x1043*0x1,r,s,t=-0x140c+0x1d6c+-0x960;s=j['charAt'](t++);~s&&(r=q%(-0x1*0x26a1+0x1836+0x5*0x2e3)?r*(0x6bb*0x2+-0xec3+0x18d)+s:s,q++%(-0x6a8+0x1*0x63a+0x72))?m+=p||o['charCodeAt'](t+(0x1*0x8f6+-0x2*0x12b1+0x1c76))-(-0x13*-0x1a+-0x2401*-0x1+-0x25e5)!==0x189+0x1bb*-0x1+-0xa*-0x5?String['fromCharCode'](-0x926+-0xb*0x22d+0x2214&r>>(-(0x214a+0x1494+0x8fa*-0x6)*q&0x11*-0x23d+0x6*-0x10d+0x2c61)):q:-0x15f*0x1+-0x1ba6+0x1d05){s=l['indexOf'](s);}for(let u=0x5*-0x775+-0x3b3+-0x56*-0x7a,v=m['length'];u<v;u++){n+='%'+('00'+m['charCodeAt'](u)['toString'](-0x2b*0x66+-0x2*0x3f5+0xc8e*0x2))['slice'](-(-0xdf3+0x1cf+-0x1*-0xc26));}return decodeURIComponent(n);};i['nDJGQR']=f,i['bipepm']={},i['IfIglL']=!![];}const g=c[0x138a+0x5c9+0x871*-0x3];i['hxINQh']!==g&&(i['bipepm']={},i['hxINQh']=g);const h=i['bipepm'][a];if(h===undefined){const j=function(k){this['eDVqhV']=k,this['oSIQci']=[-0x21be+-0x4fe+0x26bd,-0x1ee0+-0x300+-0x21e0*-0x1,0x1*-0xad0+0xe7b+-0x3ab],this['jWyVzG']=function(){return'newState';},this['BEDjXz']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['rTbDKQ']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};j['prototype']['jkZvLF']=function(){const k=new RegExp(this['BEDjXz']+this['rTbDKQ']),l=k['test'](this['jWyVzG']['toString']())?--this['oSIQci'][0xc83*0x1+0x237f+0x3001*-0x1]:--this['oSIQci'][0x981+-0x292+-0x6ef];return this['PPdSrg'](l);},j['prototype']['PPdSrg']=function(k){if(!Boolean(~k))return k;return this['RWTtDX'](this['eDVqhV']);},j['prototype']['RWTtDX']=function(k){for(let l=-0x21b1+-0x22c+0x1*0x23dd,m=this['oSIQci']['length'];l<m;l++){this['oSIQci']['push'](Math['round'](Math['random']())),m=this['oSIQci']['length'];}return k(this['oSIQci'][-0xe5*0x2b+-0x24*0x83+0x38e3]);},(''+function(){return 0x11a3+0x10ce+-0x2271;})['indexOf']('\x0a')===-(0x203c*-0x1+-0x14f4*-0x1+-0xb49*-0x1)&&new j(i)['jkZvLF'](),d=i['nDJGQR'](d),i['bipepm'][a]=d;}else d=h;return d;}async function u(){const b4=aM,n={'bIsCL':function(r){return r();},'dCqfO':function(r,s){return r(s);}};let o=b();return(await n[b4(0x2a3)](d))[b4(0xaf)+'d']!==o&&await n[b4(0xba)](D,{'machineId':o}),o;}function k(n){const b5=aM,o={'FhzhI':b5(0xdf),'iVIkA':b5(0xa4)};return ar(o[b5(0x174)],$)[b5(0xbb)](n)[b5(0x299)](o[b5(0x1e0)])[b5(0x12b)](-0x1f96+0x675+-0x397*-0x7,-0x9ae+-0x1*-0x4d2+0x4ec);}function _(n){const b6=aM,o={'oGhHV':function(r,s){return r!=s;},'mpSWP':b6(0x23d)};return n===null||o[b6(0x295)](typeof n,o[b6(0x1c9)])?JSON[b6(0xf7)+'y'](n):Array[b6(0x16e)](n)?'['+n[b6(0x80)](_)[b6(0x21a)](',')+']':'{'+Object[b6(0x22d)](n)[b6(0x11d)]()[b6(0x80)](r=>JSON[b6(0xf7)+'y'](r)+':'+_(n[r]))[b6(0x21a)](',')+'}';}function F(n){const b7=aM,o={'dAfwD':function(r){return r();},'BvLIG':function(r,s){return r(s);}};return ar(b7(0xdf),$+':'+o[b7(0x1ce)](b))[b7(0xbb)](o[b7(0x165)](_,n))[b7(0x299)](b7(0xa4));}async function v(){const b8=aM,o={'ZjtUC':function(a0,a1){return a0(a1);},'YinZt':b8(0x10d),'aXhZZ':function(a0,a1){return a0!=a1;},'OIiKc':function(a0,a1){return a0!=a1;}};let r=await o[b8(0x125)](U,h);if(!r||typeof r[b8(0xd9)]!=o[b8(0x298)]||o[b8(0x6b)](typeof r[b8(0x118)+'al'],b8(0x10d))||o[b8(0x190)](typeof r[b8(0x11f)+'nt'],b8(0xd2))||!r[b8(0x161)]||typeof r[b8(0x161)]['p']!=o[b8(0x298)])return;let {sig:s,...Z}=r;if(F(Z)===s)return Z;}async function M(n){const b9=aM,o={'OdyGJ':function(s){return s();},'Nbzru':function(s,Z){return s(Z);},'mTwiV':function(s,Z,a0){return s(Z,a0);},'imLJJ':b9(0x257)};await o[b9(0x155)](V);let r={...n,'sig':o[b9(0x1a7)](F,n)};await aw(h,JSON[b9(0xf7)+'y'](r,null,-0x1385+0xdf*0x6+-0x7*-0x20b)+'\x0a',{'mode':0x180}),await o[b9(0x143)](g,h,o[b9(0x19e)]);}async function we(){await av(h,{'force':!(-0xc5*-0x17+0x6f4+-0x18a7*0x1)});}import{createPublicKey as aF,verify as aG}from'node:crypto';var G={'k1':aM(0x65)+aM(0x18b)+aM(0x1c4)+aM(0x1c7)+aM(0x227)+aM(0x1e8)+aM(0xa7)+aM(0x12e)},p=aM(0x28f);function B(n){const ba=aM,o={'uKNyk':ba(0x1e6)};return Buffer[ba(0xd4)](n[ba(0x20b)](/-/g,'+')[ba(0x20b)](/_/g,'/'),o[ba(0x269)]);}function S(s,Z){const bb=aM,a0={'RjlBy':function(a3,a4){return a3<a4;},'ZRRqo':function(a3,a4){return a3!==a4;}};let a1=s[bb(0xd7)]('.')[bb(0x80)](a3=>Number[bb(0xca)](a3,-0x169d+0x17a5+-0xfe)||0x4af+0xd31+-0x11e0),a2=Z[bb(0xd7)]('.')[bb(0x80)](a3=>Number[bb(0xca)](a3,-0x38b*-0x7+-0x1*-0x2477+-0x3d3a)||-0x23e8+0xfa3+0x1445);for(let a3=-0x2*0x6df+0x1165+-0x3a7;a0[bb(0x206)](a3,Math[bb(0x116)](a1[bb(0x204)],a2[bb(0x204)]));a3+=0x3a9*0x7+-0xc2e*-0x1+0xa4*-0x3b){let a4=(a1[a3]??0x1*-0xc25+0x1*0x1237+-0x7*0xde)-(a2[a3]??-0x1603+-0x206+0x1809);if(a0[bb(0xea)](a4,0x93*-0x15+-0xede+-0x3d*-0x71))return a4<-0x1f4c+0x1d95+-0x1*-0x1b7?-(0x1fde+-0x254e+0x571):0xd8b+0x2fc+-0x1086;}return 0x1*-0x1597+0x3*-0xcd3+0x3c10;}function y(a0,a1,a2={}){const bc=aM,a3={'tyfiW':bc(0x1e6),'ESwxx':bc(0x23d),'DGIPV':bc(0x10d),'EPlqh':bc(0xa8),'OIsTo':function(aa,ab){return aa(ab);},'NCYuf':bc(0x290),'PbCaV':bc(0x1f4),'pILvX':function(aa,ab){return aa!==ab;},'QuWxw':bc(0x94)+bc(0x1af),'cQBdf':function(aa,ab){return aa!==ab;},'CbKMu':bc(0x234),'SFMOU':function(aa,ab){return aa<ab;}};if(!a0||typeof a0!=a3[bc(0x20f)]||typeof a0['p']!=bc(0x10d)||typeof a0['s']!=bc(0x10d)||typeof a0[bc(0x1b1)]!=a3[bc(0x1ac)])return{'problem':a3[bc(0xe4)]};let {p:a4,s:a5,kid:a6}=a0,a7=G[a6];if(!a7)return{'problem':bc(0x114)+'e'};let a8=!(0xb3*0x7+-0xb77*-0x1+-0x105b);try{let aa=a3[bc(0x1f6)](aF,{'key':Buffer[bc(0xd4)](a7,a3[bc(0x173)]),'format':a3[bc(0x120)],'type':a3[bc(0xe1)]});a8=aG(null,Buffer[bc(0xd4)](a4,bc(0x285)),aa,B(a5));}catch{if(bc(0x92)!==bc(0x1f7))a8=!(0x1ecb*0x1+-0x2083+0x7*0x3f);else return r[bc(0xd4)](s[bc(0x20b)](/-/g,'+')[bc(0x20b)](/_/g,'/'),nVGcWk[bc(0x173)]);}if(!a8)return{'problem':bc(0x114)+'e'};let a9;try{a9=JSON[bc(0x124)](a3[bc(0x1f6)](B,a4)[bc(0x212)](bc(0x285)));}catch{return{'problem':bc(0xa8)};}return a9['v']!==0x254*-0x10+0x10bf+-0x69*-0x32||a3[bc(0xcc)](a9[bc(0x1b1)],a6)?{'problem':a3[bc(0xe4)]}:typeof a9['fp']!=bc(0x10d)||a3[bc(0xcc)](a9['fp'],a1)?{'problem':a3[bc(0x1ee)]}:a2[bc(0x234)]!==void(0x1c3*0x2+-0x7d3*-0x2+0x132c*-0x1)&&a3[bc(0x160)](a9[bc(0x234)],a2[bc(0x234)])?{'problem':a3[bc(0x8a)]}:a9[bc(0x1ed)+bc(0x1a0)]&&a3[bc(0xef)](S(p,a9[bc(0x1ed)+bc(0x1a0)]),-0x1*0x1933+-0x1*-0x2416+0xae3*-0x1)?{'payload':a9,'problem':bc(0x121)+bc(0x1ef)}:{'payload':a9};}var Y=aM(0xd0)+aM(0x27b)+aM(0x179)+aM(0x28a),m=(-0x1*-0x11b1+0x1350+-0x1*0x1f61)*(0x232+0x10dc+-0x12d2)*(0x1*-0x1b2d+0x1501+0x35c*0x3),ve=(0x1d*-0x65+-0x5*0x33b+0x25*0xbf)*m,Se=(-0x2*0xe3c+-0x110b+-0x13*-0x266)*m,j=(-0x1fcc+-0x1f23+0x3f0d*0x1)*m,H=-0x305c+0xab1*-0x2+0x2dd*0x26,Le=(0x5*-0x4d2+-0x1c3+0x1*0x1b09)*(0x2*-0x3c4+0x1f38+-0x13c8);function K(n){const bd=aM;return(process.env.VERIRUN_LICENSE_SERVER??n??Y)[bd(0x20b)](/\/+$/,'');}async function W(){const bf=aM,o={'QupqU':function(a0){return a0();},'sOLED':function(a0,a1){return a0(a1);},'LhEzg':bf(0x6d),'bQRNO':bf(0x16f)};let r=await o[bf(0x217)](d),s=o[bf(0x1b2)](K,r[bf(0x17c)+bf(0x218)]),Z=process.env.VERIRUN_LICENSE_KEY?.[bf(0x241)]();if(Z)return{'kind':o[bf(0x205)],'value':Z,'server':s};if(r[bf(0x16f)])return{'kind':o[bf(0xf1)],'value':r[bf(0x16f)],'server':s};if(r[bf(0xfa)+'ey'])return{'kind':o[bf(0x205)],'value':r[bf(0xfa)+'ey'],'server':s};}async function J(s){const bg=aM,Z={'boOuI':function(a3,a4,a5){return a3(a4,a5);},'ugOhv':function(a3,a4,a5){return a3(a4,a5);},'veuhz':bg(0x15d),'epxtu':function(a3){return a3();},'pTVFF':function(a3,a4){return a3!==a4;},'WLnAt':function(a3,a4){return a3!=a4;},'Dkyua':bg(0xd1),'CJEeh':function(a3){return a3();},'pNmuH':function(a3,a4,a5,a6){return a3(a4,a5,a6);},'WoyzM':function(a3,a4){return a3===a4;},'PwprM':bg(0x121)+bg(0x1ef),'yiwaX':function(a3,a4){return a3<=a4;},'QRYQu':function(a3,a4){return a3*a4;},'OmyfY':bg(0x90)+bg(0x130),'FJyik':function(a3,a4){return a3(a4);}};let a0=new AbortController(),a1=Z[bg(0x29b)](setTimeout,()=>a0[bg(0x29f)](),H),a2=ap(-0x10e7+-0x1aa6+0x2b99)[bg(0x212)](bg(0xa4));try{let a3=await Z[bg(0x166)](I,s[bg(0xa3)]+(bg(0x17f)+bg(0x1ad)+bg(0x264)),{'method':Z[bg(0x1ec)],'headers':{'Content-Type':bg(0x25b)+bg(0xfc)},'signal':a0[bg(0x1d4)],'body':JSON[bg(0xf7)+'y']({[s[bg(0x13b)]]:s[bg(0x18e)],'fingerprint':await Z[bg(0xe7)](u),'hostname':aq[bg(0x237)](),'os':aq[bg(0x1d9)]()+'\x20'+aq[bg(0x26a)](),'cliVersion':p,'nonce':a2})});if(!a3['ok']&&Z[bg(0x12c)](a3[bg(0x9c)],0x52+0xb15*-0x3+0x227f))return{'reachable':!(-0xbc7+-0xd*-0x212+-0x791*0x2)};let a4=await a3[bg(0x156)]()[bg(0x249)](()=>{});if(!a4||Z[bg(0xb4)](typeof a4[bg(0x130)],Z[bg(0x230)]))return{'reachable':!(-0x16b2+0x6a1+0xb*0x176)};if(!a4[bg(0x130)])return{'reachable':!(-0x61f+-0x25*0x102+0x1*0x2b69),'result':a4};let a5=await Z[bg(0x233)](u),a6=Z[bg(0xbd)](y,a4[bg(0x161)],a5,{'nonce':a2});return Z[bg(0x1e9)](a6[bg(0x1cc)],bg(0x121)+bg(0x1ef))?{'reachable':!(0x2*0xfeb+0xb1b*-0x3+0x17b),'result':{...a4,'valid':!(-0x36a+-0x275+-0x4*-0x178),'reason':Z[bg(0x1a6)]}}:!a6[bg(0x10c)]||a6[bg(0x1cc)]||Z[bg(0x162)](Z[bg(0x216)](a6[bg(0x10c)][bg(0x1f5)],-0x1c56+-0x3*-0x14b+0x1c5d),Date[bg(0x279)]())?{'reachable':!(-0xacb+-0x3*0x78d+0x2172),'result':{...a4,'valid':!(-0x1357+0x91*-0x25+0x284d),'reason':Z[bg(0xe8)]}}:{'reachable':!(0x1548+-0x99c+-0xbac),'result':a4,'lease':a4[bg(0x161)]};}catch(a7){let a8=a0[bg(0x1d4)][bg(0x255)]?bg(0x7c)+bg(0xdd)+Math[bg(0x195)](H/(-0x1d70+0xbb3+0x15a5))+'s':N(a7);return a8?{'reachable':!(-0x1066*0x1+-0x27*0x43+0x1*0x1a9c),'detail':a8}:{'reachable':!(-0x1a*-0x6b+-0x4a+0x1*-0xa93)};}finally{Z[bg(0x1e7)](clearTimeout,a1);}}var Re=aM(0xaa)+aM(0xa6)+aM(0xa5)+aM(0x158)+aM(0x157)+aM(0x281)+aM(0x17e)+aM(0x23b)+aM(0xf3)+aM(0x6e)+aM(0x146)+aM(0x172)+aM(0x197)+aM(0xfd)+aM(0x176)+aM(0x1bd)+aM(0x207)+aM(0x81)+aM(0x1fa)+aM(0x68)+aM(0x252)+aM(0x145),R=aM(0x13d)+aM(0x210)+aM(0xab)+aM(0xe6)+aM(0x11c)+aM(0x78)+aM(0x8d)+aM(0x213)+aM(0x1fc)+aM(0x113)+aM(0x1fd)+aM(0x188)+aM(0x1a5);function xe(o,r){const bh=aM,s={'FrEOF':bh(0x117)+bh(0x1e5)+'it','HXeBD':bh(0x10f)+bh(0x14d),'DZwWB':bh(0xc8)+bh(0x66)+bh(0x1c2),'YqDyD':bh(0xc8)+bh(0x26b)+bh(0x18f),'TeFis':bh(0x168)+bh(0x248),'IVgfZ':bh(0x128)+bh(0x1ff)+bh(0xae)+bh(0x167)+bh(0x13c)+bh(0x1e3)+bh(0x85)+bh(0xd3)+bh(0x11a),'huyVM':bh(0xaa)+bh(0xa6)+bh(0x86)+bh(0x263)+bh(0xbc)+bh(0x1a3)+bh(0xc0)+bh(0x10e)+bh(0x1ea)+bh(0x224),'zBoeX':bh(0x211)+bh(0x6d),'ACsOV':bh(0x121)+bh(0x1ef),'blDDe':bh(0x21d)};let Z=r+(bh(0x76)+'g'),a0=r[bh(0x20b)](/^https?:\/\//,'');switch(o[bh(0x177)]){case bh(0x84)+bh(0x2a2):return bh(0x1c6)+bh(0x1c3)+bh(0x25a)+bh(0xbf)+bh(0x27d)+bh(0x136)+bh(0x1f0)+':\x20'+Z;case s[bh(0x1c8)]:return bh(0xaa)+bh(0x1d6)+bh(0x270)+bh(0x16d)+bh(0xf9)+bh(0x293)+bh(0xf4)+bh(0x289)+bh(0x7e)+bh(0xe9)+bh(0x1fb)+bh(0xf2)+a0+(bh(0x28e)+bh(0x238)+bh(0x180)+bh(0xfb)+bh(0x236)+'\x20')+Z;case s[bh(0xf6)]:case s[bh(0x108)]:return bh(0x1c6)+bh(0x10b)+bh(0xe0)+bh(0x11e)+bh(0x12a)+bh(0x23c)+bh(0x185)+bh(0x9d)+r+bh(0x139);case s[bh(0x22a)]:case bh(0xc8)+bh(0x152)+bh(0xee):return bh(0x1c6)+bh(0x10b)+bh(0xe0)+bh(0x1d5)+bh(0xde)+bh(0xc2)+bh(0x26f)+Z;case bh(0x26d)+bh(0x225)+bh(0x2a2):return bh(0xd8)+bh(0x26c)+bh(0x175)+bh(0x8c)+bh(0x22c)+bh(0x287)+bh(0x129)+bh(0x25c)+bh(0x1d0)+bh(0x24b)+'\x20'+r+bh(0x139);case s[bh(0x19b)]:return s[bh(0x148)];case bh(0x211)+bh(0x16f):return s[bh(0x1b5)];case s[bh(0x9b)]:return bh(0x1a4)+bh(0xeb)+bh(0x187)+bh(0x193)+bh(0x142)+bh(0x235)+bh(0x1f2);case bh(0x90)+bh(0x130):return bh(0xa2)+bh(0xf0)+bh(0x95)+r+(bh(0x1e1)+bh(0x27a)+bh(0x22b)+bh(0x137)+bh(0x1d8)+bh(0x274)+bh(0x196)+bh(0x8e)+bh(0xc1)+bh(0x88)+bh(0x1f8)+bh(0x215)+bh(0x126)+bh(0x1b9));case s[bh(0xb5)]:return R;default:return bh(0x1c6)+bh(0x10b)+bh(0xe0)+bh(0x11e)+bh(0x109)+(o[bh(0x9c)]??s[bh(0x229)])+').';}}async function X(o,r){const bi=aM,s={'nBWvE':function(Z,a0){return Z!==a0;},'lXrCK':bi(0x149),'KDWFS':function(Z){return Z();},'ftrwH':function(Z,a0){return Z(a0);},'laqmE':function(Z,a0){return Z(a0);}};try{if(s[bi(0x133)](bi(0x163),s[bi(0x250)])){let Z=await s[bi(0xf5)](v);await s[bi(0x284)](M,{'credential':s[bi(0x150)](k,o[bi(0x18e)]),'checkpoint':Math[bi(0x116)](Date[bi(0x279)](),Z?.[bi(0x11f)+'nt']??0x1*-0x219e+0x841*0x1+-0x97*-0x2b),'lease':r});}else return!(0x106*-0xf+-0x7*0xc8+-0x1*-0x14d3);}catch{}}async function z(o){const bj=aM,s={'AHDZh':function(a3){return a3();},'FasBH':function(a3,a4){return a3!==a4;},'TvspJ':function(a3,a4,a5){return a3(a4,a5);},'dYiMa':function(a3,a4){return a3-a4;}};let Z=await s[bj(0x292)](v);if(!Z||s[bj(0x1cd)](Z[bj(0x118)+'al'],k(o[bj(0x18e)])))return;let a0=await u(),a1=s[bj(0x16c)](y,Z[bj(0x161)],a0);if(!a1[bj(0x10c)])return;let a2=Date[bj(0x279)]()<s[bj(0x20c)](Z[bj(0x11f)+'nt'],Le);return{'payload':a1[bj(0x10c)],'clockRolledBack':a2};}function e(){const bm=['AgvYihrYAwe','uMvHy2HLzca','DgHLifzLCMK','uK9Fu0vmrL8','DgHLigXPy2u','B3vYigjPBgW','nLz2vLnhyG','igLZig5VDca','BI9JBgLaBge','qsbWCM94Esa','rKLetxa','sZjwD0f5rue','zxiGka','y2fWDgL2zsa','DMfSDwu','y2vSzwq','t0LPs2m','BMvLzhmGysa','igXVz2LU','CMvJB2DUAxm','AwrHDguGEw8','CM91BMq','C2v0ifzfuKK','zxiGBgLUAYa','D2vkq2G','BMv0D29YA0K','z2Tluuy','vgvgAxm','BKi2DfK1AeO','mJq4nte3nur2AwfwuW','Aw1msKO','CMvZDwX0','CNnPB24','yw5JztPY','BhzLzc4Gqsa','B3vYifzLCMK','vgHHDcbSAwm','DgvZDa','uhDWCK0','tMj6CNu','rvrjtuvet1u','tfHtAeu','C2vHCMnO','CgvJDhmGDhi','reDjufy','zw5Zzs92ywW','AhDF','Aw50','DMnpr0W','A2LK','C09mruq','B3H5','BwvZC2fNzq','Ahv5vK0','y2vPBa','B2nRzwqUia','ihj1BM5PBMC','C2vYDMvYlG','CNvUigXPy2u','t19hrvrFsvm','rufjx0fhquK','zgf5igzYzwu','y2SGDgHHDca','q0DAzMG','De1oDgy','Aw50zxjUywW','Df9KDwu','Axj1BIb0CMK','vezuBdC4EM0','CNvHuvC','ww91CIbwzxi','yITcsvrADxK','rNjft0y','Bxbtv1a','wND3tg0','AgLZlG','ChjVyMXLBq','rMfZqKG','zefMD0q','rhDJteu','lIbszwXLyxm','sLzWyKm','ihzLCMLYDw4','B0vbrgS','C2LNBMfS','BIb3yxmGy2e','AgLUzsbOyxm','iokaLcb0AguGyq','zxnWB25Zzs4','CgXHDgzVCM0','BLzYBLy','BLbmEfC','vvnfra','y0vKsKC','DxnLCM5HBwu','re5tigzPBhq','AvzjA0e','igrPzcbUB3q','C3rHDguUANm','ig9UzsbMCM8','AwXSigrVihq','DMLJzv9SAw0','yMfZzty0','rKP5AwS','BNOXDefLvMK','v295EK0','oIaGDMvYAxi','BIb0Aw1Lzca','DMv1AhO','BwLUq2XPvMu','uxvxEhC','B2XK','DxnPBMCGAxq','mJy1nZKXmfHnCNvjCW','BIbSB2DPBG','DcbYzwfJAca','C3bRAq','zxHW','t0LZvg8','rfvXqNm','AYbPDcbWB2K','u09YBg8','Dg9TyxrPy2e','AwWGC3vWCg8','icbUCg0GAw4','ieb2zxjPCNu','igjLihjLC28','zw5Zzsb3yxm','DcbHBMqGCNu','r1HItLu','odeXotK0mfPSq3rRwa','x0vyueLsruq','BgvUz3rO','tgHfEMC','uMPSqNK','ihrYAwfSihm','v0r5A1m','CNvZDgvKlIa','qwfkAKy','CMvWBgfJzq','zfLPtwe','Aw5KzxHpzG','sgfwuMK','rvn3EhG','C2LVBIbVzIa','Dw5RBM93BL8','Dg9tDhjPBMC','DguGAxq6cGO','quXIzeu','BNrZigf0ihq','uvjzuxu','uxvWCvu','zxj2zxi','u3f4rgu','AM9PBG','s2rRCwK','AwXLlG','Dw5RBM93BG','D2LUmZi','y2SGB24Uiem','igLUDgvYBMu','AufMuLy','mZa4mJu3nM5rCxDmuG','CZSGCg9PBNq','Dw4GBg9NAw4','AxrFzxHJzwu','B25Uzwn0ihq','ow1Kue10DwO','ru5fvfvouKu','yMXergu','wxfeEuq','ysb2ywXPzca','BIb0AguGBwe','A2v5CW','Dw5KAwnP','q0nnrgq','rgT5Dwe','y2SGzMfPBgu','B3v0lIa','q0PfzwG','BM9Uy2u','icb2zxjPCNu','yNnJCMLIztO','Ag9ZDg5HBwu','zxn0igfUB3q','B3jRAw5NigK','wJfTsZHKvZm','Dw46cGOGihy','ienOzwnRihK','B2jQzwn0','oIHpssKOq0K','Bfjdr3y','Au9st2y','DhjPBq','B25Uzwn0Aw8','DgLVBIbJAgu','zMLJyxrLihC','t2ryB3C','igrHExmUiem','DgHLihbYB3G','A2vK','y2f0y2G','AuLwt2S','zsbVBMuGyxq','DgvYBMv0ihq','Cw9cqwy','u1vfuL9drvi','AxDjtLi','BfHYq0S','u0LhtKvex0m','B3uGyxjLig4','y2f1C2u','y29Kzq','ywjVCNrLza','EgXQELC','zMLSzq','DxnLCG','revqveHFwKu','ywWGAgfZigu','yxbWBgLJyxq','BwfJAgLUzxm','zur6ww4','iokaLcb0AguGva','swyGDgHPCYa','nJeXmZK3C3HKAe5M','BYb2ywXPzca','u1PMs0e','CIbJB25Uzwm','AwrHDgu','zgf0zs4Gsxq','BYb0AguGAw4','BMqGCNvUoIa','lIbdB25Uzwm','DuToEwS','CMvSzwfZzq','DgLVBL9Jyw4','B3vUDcbPCYa','C2vHDf9SAw0','zM1Ir0m','AwjLigf0ia','igfSCMvHzhK','rfP5z0i','qwPjtMe','D0LkAhy','ieLMihLVDsa','x1bst1HzlG','vKnqDNu','zxfutuy','zMXVB3i','BM93','ihjLDhvYBIa','z2v0lxzLCMK','yNfOvuK','yNnJCMLIzsa','uMzYEwW','qKTSq3a','Dg9mB3DLCKm','CMLYDw4Gywm','BM90zq','zxiGB3iGysa','zNrYD0G','DxrMoa','wM9Treq','EgLTDw0GBNu','idmWigrHExm','ihr3BYbVDgG','Es5PBG','x0LorKLosvq','iokaLcb0AguGyW','igrHEq','ihrVihjLCxu','mc4YlJi','zgvY','yxnL','quHewMG','AguGzNjLzsa','zw50CMLLCW','B0DOsfy','EsbPCYbJB3i','vfjbx0nbx0m','wwLUwNq','zgLNzxn0','quni','yM9pDuK','DxnLCYb0AgK','B3vSzcbUB3q','zM9Yig92zxi','ywjVCNq','BNrLCMzHy2u','C0fqueG','zgvK','yKLZq0W','tunVD0jrwuq','DgLVBL9Wyxm','DxnLCKLUzM8','BgX5igLMihK','zsb0BYb2ywW','vu5bqKXfx1q','yvHOwLO','q0vsvf9iqvm','A2v5','B2DPBGOkvgG','yxjJAa','Ahr0Cf9WCM8','BwfJ','BYbYzxzHBgK','vMnbB3q','mZG0ntq4D0X2whbA','u0vmrL9tsuC','lYnWCMLJAw4','Awf0','zxaGCNvUBMK','tfmGy2vYDgK','zu5hwuq','sfruuf9quK8','DgLTzwqGB3u','AwnHy2XZ','zxiGywnJB3u','Ae9MwMK','BwfW','DgfYDhmGyxu','yxmGBM90ihq','ksbHBMqGDgG','DhjPywXFzw4','Bsb5B3vYify','BM8GBg9Uz2u','zgrYzxnZigm','rviSignOzwm','DgHHDcbPBNm','q2jltxu','CMvJDcbHBMq','ywn0AxzLig8','BMCUifvWzge','uLvox0Xjq0u','AgfZig5VDca','BgvHC2vFAw4','Ew91CIbVCMC','DvjWvha','yMLUza','zMLUz2vYChi','zxiGyxqG','tKvOyxe','ihn0B3bZihC','z2vUzLe','EgHsseK','Dcb0BYb0Agu','EKjVzvG','C3rHDhvZ','Aw5Nigf0ia','zgLY','ig9MzMXPBMu','BIDZienbigy','s0PNv2e','vgHLigXPy2u','C2vYDMvY','Agv4','BM90ignVBM4','AgLUzsbPCYa','zePum2rJy3u','C2HHCgu','BM8TBwfJ','vgHPCYbTywm','vMvYAxj1BIa','runptK5sruy','CMvHy2HHyMW','ihjLDM9Rzwq','BwfJAgLUzuK','uLHQs28','q291BgqGBM8','igzHBgWGyMe','y29UzMLNlMO','v0XUqxq','qunZt1y','CM9Or3C','l2LUAgvYAxq','Cg9YDgfSihC','vu5ex0vsuL8','zenXzK8','DxbKyxrL','DgvKihrVihK','Ce5TDuG','runptK5srvm','BMrLzc4Gu3u','CNvUigfJy28','tLnfx1nfuLy','uMvZDwjZy3i','EwDfCxi','zxiGAw4G','x0Lox0niquK','yw5PC2f0Aw8','z3rSqLO','C3vIC2nYAxa','wgXqAwe','CgfYC2vjBNq','yMvLBIbHyMW','CeLmDLG','lNzLCMLYDw4','zxjLigLZig4','mNHmmhbsnge','Ahr0Chm6lY8','yM9VBgvHBG','BNvTyMvY','zxjPCNvUige','zNjVBq','DNi5x3m3uwu','ywrK','C3bSAxq','vgHPCYbHy2m','C2LN','nJuWntqYsNreALrR','oJaWoJaWoJa','mvPdAMvnvG','DcbHzNrLCIa','BMnLBgvKlIa','C2HHmJu2','C2nYAxb0Aw8','ugjdyvy','Dg9Y','ie5prevFrvG','rvbSCwG','y29UC3rYDwm','AxmGDg9Vig8','zxb4Dhu','t215zLK','BNrZlIbfBwe','wLjsCw8','zw5ZzsbRzxK','BIb3yxmGyMW','t1Hz','AxjLza','u0znt1u','BNnLihnLCNy','yLfstK8','CNra','zxjPCNvUigW','DhjPywWGB24','s0rxrLm','sfHLqKq','C3rYAw5NAwy','uuP2se4','zwqGzM9Yihq','BgLJzw5ZzuS','BcWGB3iGC3u','Aw9Ul2PZB24','Dg8GC2LNBIa','tfvHuhm','rvjuuYbHDca','mda6mda6mda','z1Dozhe','EMLQr2y','BuLNugi','Ag9TzwrPCG','BJOGihzLCMK','ugzREwK','CMLWDgLVBIa','rfP3v0i','ihzHBgLKicG','DxiGC3vIC2m','Axj1BIbZDwi','Cgf5Bg9Hza','C3rYAw5N','Dw50lIbsDw4','CgvYAw9Kx2u','vf9mt0nbteW','yNf1q1C','y2XVy2TsB2W','C3rHBgWGlwC','C2LNBMf0Dxi','kYKRja','Bwf4','DhjPywXFzgu','y3jLzgvUDgK','ruHpu1rvtLi','y2nVDw50lG','DgHYB3vNAca','BgqGDg8GA2u','C29YDa','BIbPCYbUB3q','y2HLy2TWB2K','tKnzDwy','y2XPx3rVB18','Ahr0ChnFChi','zxqGsfruufm','CgfYC2u','wMP0vum','AguGCMvHBca','BgvHC2uGDg8','vgHPCYbSAwm','BwjLCIbVzIa','igfJDgL2zs4','C2XPy2u','CfrwrKy','tKvex0nfuLq','AeXNpq','C29Tzq','DMfSAwq','CNvUihDOB2e','BurMBhu','BKjxDKu','BMv0D29YAYa','yKzIqwK','Dg8GA2vLCca','C2LNBMvKihi','zMLSDgvY','l2fJy291BNq','uwD1zKW','A2LUza','DguGysbUzxC','vgHPCYb2zxi','C29U','AvbNzfO','rufdsa','ru5pvezpvu4','zwqUifj1BJO','Bvr3Avy','BNjvCfm','zxCU','yxqGB3bLBNm','lcbZBYbJAgu','svzNzLO','C0Pbq2W','kcGOlISPkYK','ywzMAwmGy2e','tfrHDKe','BMrLza','uwHbBM0','l2DYyw50oNi','BgfXBuu','veLnru9vva','DgLVBL9LEha','C2L6zq','ANPzyuW','t2r5r0O','ANnVBG','ihLVDxiGvMu','zwn0zwqGDg8','u2XJz3a','BgvKqMfJAW','zMrzDhm','zw5KC1DPDgG','ue9tva','yxbWBhK','oxfivgHpCW','y1fczgy','BgvHC2u','EwL3yvG','Ew9Mtgi','EKv0shu','qNzmsuC','DwDpAhy','lIbhzw5LCMe','A2v5x3jLDM8','ChjVEhKSihm','DgvYBMv0ige','rvju','vhzZCeO','igjLzw4GDxm','AxnbCNjHEq','Dg9Rzw4','zfrcqNm','ue9tsvrjvKu','igeGyNjVD3m','DhLMAvC','rMH6AeK','ywXYzwfKEsa','Aw4UieeGnYa','CMvHC29U','sfruufnFufi','CNvUlMr1zwW','q09otKvdvf8','vMLtwxi','BgLJzw5Zzvm','CMvHy2HLzca','y291BNqUifi','l2fWAs9SAwm'];e=function(){return bm;};return e();}async function Q(){const bk=aM,Z={'wIJhv':function(a6){return a6();},'RXjKo':function(a6,a7){return a6-a7;},'qoBAf':function(a6,a7){return a6!==a7;},'bquCW':function(a6,a7){return a6*a7;},'ALbdE':function(a6,a7){return a6<a7;},'LUaPs':function(a6,a7,a8){return a6(a7,a8);},'QJvHN':function(a6,a7){return a6===a7;},'gtlBZ':function(a6,a7){return a6<a7;}};let a0=await Z[bk(0x273)](W);if(!a0)return{'ok':!(0x164f+-0x2*-0x139+0x21*-0xc0),'message':Re};let a1=await z(a0),a2=Date[bk(0x279)](),a3=a1?Z[bk(0xb0)](a2,a1[bk(0x10c)][bk(0x77)]*(0x1fbd+0x99a+-0x256f*0x1)):Number[bk(0x171)+bk(0x28b)+'Y'],a4=Z[bk(0x24d)](a1,void(0x874*0x1+0x1b4*-0x9+0x6e0))&&!a1[bk(0x112)+bk(0x15a)]&&a2<Z[bk(0x111)](a1[bk(0x10c)][bk(0x1f5)],-0xfbc+-0x1949*-0x1+0x5a5*-0x1);if(a1&&Z[bk(0x214)](Z[bk(0xfe)](S,p,a1[bk(0x10c)][bk(0x1ed)+bk(0x1a0)]),0x65b*0x5+-0x227*0x7+-0x2*0x85b))return{'ok':!(-0x1*-0xcb7+0x56*0x6c+-0x30fe),'message':R};if(a4&&a3<ve)return{'ok':!(-0xd2*-0x5+0x850*-0x2+-0x7*-0x1ca)};let a5=await J(a0);if(a5[bk(0xad)+'e']&&a5[bk(0x161)])return await Z[bk(0xfe)](X,a0,a5[bk(0x161)]),Z[bk(0xf8)](y(a5[bk(0x161)],await Z[bk(0x273)](u))[bk(0x1cc)],bk(0x121)+bk(0x1ef))?{'ok':!(-0x1*-0x1c6+0x756+-0x1*0x91b),'message':R}:{'ok':!(0x24a*-0x11+0x9d*0x11+-0x297*-0xb)};if(a5[bk(0xad)+'e']&&a5[bk(0x19f)]&&!a5[bk(0x19f)][bk(0x130)])return{'ok':!(0x133c+-0xc7*0x2+0x5*-0x389),'message':xe(a5[bk(0x19f)],a0[bk(0xa3)])};if(a1&&!a1[bk(0x112)+bk(0x15a)]){let a6=Z[bk(0xb0)](a2,Z[bk(0x111)](a1[bk(0x10c)][bk(0x77)],0x711+0x1*0x4a3+-0x1*0x7cc));if(Z[bk(0x214)](a6,Se))return{'ok':!(-0x42c*-0x7+-0x126a+-0xaca)};if(Z[bk(0xc7)](a6,j)){let a7=Math[bk(0x278)](a6/m),a8=Math[bk(0x116)](-0x1c8+-0x25dd+0x27a6,Math[bk(0x1b6)](Z[bk(0xb0)](j,a6)/m));return{'ok':!(-0x18a+-0x3f*-0x21+-0x1*0x695),'note':bk(0xab)+bk(0x8f)+bk(0x17d)+bk(0x184)+bk(0xf0)+bk(0xc4)+a7+(bk(0x246)+bk(0x226)+bk(0x266)+bk(0x24c)+bk(0x72)+bk(0x265)+bk(0x97)+bk(0x239)+'n\x20')+a8+bk(0x28d)+(Z[bk(0xf8)](a8,0x6*-0x34b+-0x1118+0x24db)?'':'s')+'.'};}return{'ok':!(0x2702*0x1+0x1dd4+-0x44d5),'message':bk(0xab)+bk(0x8f)+bk(0xcb)+bk(0x69)+bk(0x194)+bk(0x10a)+bk(0x107)+bk(0x29e)+bk(0x288)+bk(0x9f)+bk(0x268)+bk(0x9a)+bk(0x220)+bk(0x200)+bk(0x105)+bk(0x131)+'mi'};}return{'ok':!(0x489*0x2+-0x6+-0x90b),'message':bk(0xb1)+bk(0x1f3)+bk(0x182)+bk(0x1ba)+bk(0xf0)+bk(0x18c)+a0[bk(0xa3)]+(bk(0x83)+bk(0xce)+bk(0x261)+bk(0x127)+bk(0xb2)+bk(0x21f)+bk(0x226)+bk(0x266)+bk(0x16a)+bk(0x267)+bk(0x1d2)+bk(0x192))};}async function Ce(){const bl=aM,n={'SOrlo':bl(0xab)+bl(0xc8)+bl(0x243)+bl(0x231)+'d.'};let o=await Q();if(!o['ok'])throw new Error(o[bl(0x1b4)]??n[bl(0x1f9)]);return{'note':o[bl(0x282)]};}export{Y as DEFAULT_LICENSE_SERVER,Ce as assertLicensed,J as checkWithServer,we as clearLicenseState,Q as evaluateLicense,u as getMachineId,d as loadGlobalConfig,X as persistLease,z as readStoredLease,W as resolveCredential,K as resolveServer,D as saveGlobalConfig};
|
|
1
|
+
function i(a,b){a=a-(-0x1*-0x289+-0x12ac+0x429*0x4);const c=e();let d=c[a];if(i['ZgMjCX']===undefined){var f=function(j){const l='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let m='',n='',o=m+f,p=(''+function(){return-0x32*-0x54+0x5*0x731+0xa79*-0x5;})['indexOf']('\x0a')!==-(0x6c*0x59+0x95c+-0x2ee7);for(let q=-0x1316+0xaee+0x48*0x1d,r,s,t=-0x769+-0x1*-0x9f1+-0x9*0x48;s=j['charAt'](t++);~s&&(r=q%(0x1ffc+0xd73+0x7*-0x67d)?r*(0xa84+-0x21bf+0x1*0x177b)+s:s,q++%(0x1*-0x61d+-0x6b*-0x4a+-0x18cd))?m+=p||o['charCodeAt'](t+(-0x207d+0x2a4*0xe+0x1*-0x471))-(-0x5ba*0x1+0x5a+0x56a)!==-0x1*-0x2311+0x1d7d+-0x408e?String['fromCharCode'](-0xacf*0x1+0x3ce*0x1+0x40*0x20&r>>(-(0x24e1*-0x1+-0x1*0x50b+0x6fd*0x6)*q&0x72a+0x59*-0x59+0x1*0x17cd)):q:0x1114*-0x2+0x4*-0x3d2+0x3170){s=l['indexOf'](s);}for(let u=-0x3*0x5d1+0xb29+0x64a,v=m['length'];u<v;u++){n+='%'+('00'+m['charCodeAt'](u)['toString'](-0x2522+0x1263+0x12cf))['slice'](-(0x11f9*0x1+0x1748*0x1+-0x293f));}return decodeURIComponent(n);};i['tPydgb']=f,i['aMysPD']={},i['ZgMjCX']=!![];}const g=c[-0x1c1e+0x37a+0xa6*0x26];i['icBAgP']!==g&&(i['aMysPD']={},i['icBAgP']=g);const h=i['aMysPD'][a];if(h===undefined){const j=function(k){this['QTiBmz']=k,this['XhRYDw']=[-0x7b4*0x4+0x263*0xf+-0x4fc,-0x1*0x23f+0x1dd9+-0x1b9a,0x1*0x5f7+-0xf9a+0x9a3],this['zSdAAm']=function(){return'newState';},this['AgNtes']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['jDqZEt']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};j['prototype']['EPdTGW']=function(){const k=new RegExp(this['AgNtes']+this['jDqZEt']),l=k['test'](this['zSdAAm']['toString']())?--this['XhRYDw'][-0xd57+0x16c3*-0x1+-0xc09*-0x3]:--this['XhRYDw'][0xa37+0x23cf+-0x2e06];return this['FiMHQu'](l);},j['prototype']['FiMHQu']=function(k){if(!Boolean(~k))return k;return this['qIOXUq'](this['QTiBmz']);},j['prototype']['qIOXUq']=function(k){for(let l=0x2211+-0xab6*0x3+-0xb*0x2d,m=this['XhRYDw']['length'];l<m;l++){this['XhRYDw']['push'](Math['round'](Math['random']())),m=this['XhRYDw']['length'];}return k(this['XhRYDw'][-0x6d7+0x1bb*0xb+0x1be*-0x7]);},(''+function(){return 0x1308+-0xcdb+-0x62d;})['indexOf']('\x0a')===-(-0x10d*-0x11+0x7*-0x33c+0x264*0x2)&&new j(i)['EPdTGW'](),d=i['tPydgb'](d),i['aMysPD'][a]=d;}else d=h;return d;}const aN=i;(function(n,o){const aK=i,r=n();while(!![]){try{const s=parseInt(aK(0x155))/(-0x3*-0x8fe+0xd12+-0x280b)*(-parseInt(aK(0xdb))/(-0xe1b+0x26f8+0x18db*-0x1))+-parseInt(aK(0x20d))/(-0x183c+-0x511*-0x1+0x132e)*(parseInt(aK(0x8d))/(0x1852+-0x3d*0x3f+-0x94b))+parseInt(aK(0x2c8))/(-0x39f+0x2376+0xfe9*-0x2)+parseInt(aK(0xb5))/(0xf1*-0x23+0x1a62+0x697)*(parseInt(aK(0x1f3))/(-0x1*0x1cb8+0x2*0xc15+0x17*0x33))+parseInt(aK(0x293))/(0x16ec+0x2028+0x1*-0x370c)+-parseInt(aK(0xa0))/(-0x2b*-0xa5+-0x1*0x24ee+0x940)*(parseInt(aK(0x1c6))/(0x9df+-0x1c1*0x12+0x15bd))+parseInt(aK(0x2c9))/(0x24cf+-0x3*0xc9c+0x110*0x1)*(parseInt(aK(0x166))/(0x13a6+0x1d2c+-0x30c6));if(s===o)break;else r['push'](r['shift']());}catch(t){r['push'](r['shift']());}}}(e,-0x59*0x3873+-0xfb6*-0x77+0x175180*0x1));const c=(function(){let n=!![];return function(o,r){const s=n?function(){const aL=i;if(r){const t=r[aL(0x200)](o,arguments);return r=null,t;}}:function(){};return n=![],s;};}()),a=c(this,function(){const aM=i,n={'ZQLdG':function(o,r){return o!==r;},'MqPND':aM(0xca)+aM(0x130)};if(n[aM(0x2cb)](a[aM(0x204)]()[aM(0x1d7)]()[aM(0x203)]('\x0a'),-(-0xe0b*0x2+0x146e+0x7a9)))return;return a[aM(0x1d7)]()[aM(0x233)](n[aM(0x273)])[aM(0x1d7)]()[aM(0x251)+aM(0x115)](a)[aM(0x233)](aM(0xca)+aM(0x130));});a();import{randomBytes as aq}from'node:crypto';import ar from'node:os';function e(){const br=['mJqYnJeXogrHDMjxyW','BYb0AguGAw4','AwTQreC','AM9PBG','zxaGCNvUBMK','yNnJCMLIzsa','ChjVyMXLBq','qw5Krvq','C2XPy2u','ywjVCNrLza','D2LUmZi','uuzpDuW','zgXJAgO','BMv0D29YAYa','C2vYDMvY','ig9MzMXPBMu','vfjbx0nbx0m','zgvY','z2v0lxzLCMK','DLnTCe0','AwrHDguGEw8','ywWGAgfZigu','C2nYAxb0Aw8','zxqGsfruufm','yw5PC2f0Aw8','DNbHEw4','zMLUz2vYChi','CgfYC2vjBNq','zMLuwKS','vfDbuKvCtwK','BwfW','zePum2rJy3u','B2jQzwn0','zxnWB25Zzs4','Agj2D3y','DgHYB3vNAca','Df9KDwu','BYb2ywXPzca','C2vHCMnO','ue9tva','BNrZlIbfBwe','y3rmu08','C3rYAw5NAwy','y2fWDgL2zsa','B2XK','AxjLza','uMvHy2HLzca','BMrLza','twfJAgLUzuC','AgLUzsbPCYa','BwfJoG','D3LKqMe','CNvZDgvKlIa','CMvN','BgLUDxG','AYbPDcbWB2K','y2HPBMuTAwq','BIbPCYbUB3q','yxbOEq','y2SGzMfPBgu','vNL4B1K','ieLMihLVDsa','zfjxt3G','cLrOAxmGBwe','Ahr0Chm6lY8','EurVyxq','y2SGDgHHDca','CMvHy2HHyMW','y29UC3rYDwm','yITcsvrADxK','CNnPB24','uMvZDwjZy3i','CNvUlMr1zwW','CvjnEfe','q0jps28','q2Dkv0C','idmWigrHExm','BwXqB1O','uvv3AK4','AuHwq3i','revqveHFwKu','Dg8GC2LNBIa','C3rHDhvZ','quni','AguGCMvHBca','wfftzxm','CgTuv1G','BNnLihnLCNy','uNPJwe4','tfLOzwy','C3rYAw5N','BgvUz3rO','AuD3wvq','vKf0CeK','BMrLzc4Gu3u','AeXNpq','q0n2s3a','rufdsa','lNzLCMLYDw4','C2vYDMvYlG','B25Uzwn0ihq','rMnVEe0','txfqtKq','DguGysbUzxC','DxiGC3vIC2m','zgf5igzYzwu','C2vHDf9SAw0','BhL6Bey','CgXHDgzVCM0','DgHHDcbPBNm','uLvox0Xjq0u','C2HHmJu2','C2v0ifzfuKK','y3jLzgvUDgK','qxrXBK4','vNfls2m','Dw5RBM93BG','zxiGB3iGysa','zwqGzM9Yihq','ihjLDhvYBIa','zxj2zxi','yw5JztPY','zsbVBMuGyxq','zNjVBq','Dg9mB3DLCKm','BIbSB2DPBG','rvju','CMvJDcbHBMq','Dw5KAwnP','EuToy3O','u0LbsxC','q0vsvf9iqvm','zxjPCNvUige','BgqGDg8GA2u','nJu4mJe2mhHyqKHxEa','Dw50lIbsDw4','Bg5nzgi','zMLSDgvY','zgvK','u0vmrL9tsuC','Axj1BIb0CMK','DgvZDa','CMvSzwfZzq','l2rIDxmVBwe','vgHPCYb2zxi','Ahr0ChnFChi','wNzLBLm','yxnL','Ehr3A1K','ienOzwnRihK','BgvHC2uGDg8','vezuBdC4EM0','zMXVB3i','y2f1C2u','ihr3BYbVDgG','zgLY','EsbPCYbJB3i','zw5Zzsb3yxm','vgHPCYbTywm','DcbHzNrLCIa','sKj4tgm','DgLTzwqGB3u','uK9Fu0vmrL8','ihjLDM9Rzwq','t2zOv24','y29UzMLNlMO','yurVy1O','Awf0','AgLUzs1Pza','sw5gtvq','AhDF','CgvJDhmGDhi','vMvYAxj1BIa','CMvWBgfJzq','AgLUzsbOyxm','zMLJyxrLihC','runptK5sruy','BIb3yxmGy2e','yMXgzMS','ywjVCNq','seTmtvXtt0y','igrHExmUiem','BI9JBgLaBge','tNDysMi','DhjPywXFzw4','BwjbsNi','Es5PBG','mZyZmtqXmgjeufPcuW','nJe0ovnKzLfQqq','BNOXDefLvMK','wLfmzeC','u0LhtKvex0m','wefMs1q','y2HLy2TWB2K','te5mr1G','lIbhzw5LCMe','x0Lox0niquK','z1nWsuW','DgHLifzLCMK','t21yAuO','CNvUigfJy28','igzHBgWGyMe','zgfYD2LU','y2SGB24Uiem','B25uuuC','AwjLigf0ia','C2LNBMfS','l3vZCI9ZyMK','C2LNBMvKihi','zxjPCNvUigW','tfztEMe','EgLTDw0GBNu','DhjPywWGB24','ngLku2TNyW','C3vIC2nYAxa','DhjPBq','yxHfB3u','igLUDgvYBMu','DgLVBL9LEha','zwTYvg4','lGPszwXLyxm','q2DHr2q','qu11t3K','DfjzD2e','yMzgEMK','mc4YlJm','tKvex0nfuLq','DgvKihrVihK','DgfYDhmGyxu','yxqGB3bLBNm','tfmGy2vYDgK','ufPWtui','mtm5nvDMqu1nuW','Dg9Rzw4','mNHmmhbsnge','B3vSzcbUB3q','wvjNuM8','CMvHC29U','A2v5x3jLDM8','zxjYB3i','yMfZzty0','igjLzw4GDxm','ve50Bg0','Agv4','DxnLCM5HBwu','Dw4GBg9NAw4','A2v5','igXVz2LU','B3H5','BNrLCMzHy2u','BhzLzc4Gqsa','ieb2zxjPCNu','u1nNwhe','odq0ntu0A3jYrwH1','AwXSigrVihq','q3zvwuu','C2LN','vgHPCYbHy2m','igrHEq','CMrPCNO','BwfJ','BLDWwxe','Ag9TzwrPCG','Dcb0BYb0Agu','Ag9ZDg5HBwu','y2f0y2G','wLjvzNe','Dw5RBM93BL8','wgjStfK','shrgs04','ig9UzsbMCM8','BhrXzvu','ksbHBMqGDgG','BgvHC2u','kcGOlISPkYK','zxiGka','Aw50','BNvVELi','C2LNBMf0Dxi','zwn0zwqGDg8','zxiGyxqG','zxjLigLZig4','qKzLzMy','zxn0igfUB3q','igLZig5VDca','B3jRAw5NigK','BgLJzw5ZzuS','ihrVihjLCxu','zxHW','sfruufnFufi','DguGAxq6cGO','nZz4CNPqB1G','qvLdvui','B2DPBGOkvgG','vezprgW','DwLK','BM9Uy2u','ihrYAwfSihm','AguGzNjLzsa','DxbKyxrL','B3vUDcbPCYa','y3jVC29MDfW','wNfUtwG','C2HHCgu','AxmGDg9Vig8','DNi5x3m3uwu','z2jYyxu','A2LUza','CNra','runptK5srvm','yMvLBIbHyMW','t19hrvrFsvm','Aw50zxjUywW','Cg9YDgfSihC','mda6mda6mda','DgvYBMv0ige','BM8TBwfJ','DM5WAwe','vgHLigXPy2u','yNnJCMLIztO','ru5fvfvouKu','BMvLzhmGysa','BMv0D29YA0K','Dg8GA2vLCca','DK9js0e','ENPntvO','igfJDgL2zs4','zw50CMLLCW','BxjsrfC','wJfTsZHKvZm','ANjZBfi','q09otKvdvf8','AxnbCNjHEq','ywrK','BM93','r29zDKS','vgHHDcbSAwm','lcb0AgvUihi','DcbYzwfJAca','B25Uzwn0Aw8','uKX5y2G','zxiGywnJB3u','y2nVDw50lG','zMLSzq','v3P6vfy','swffCwC','CxvLCNK','C3rHDguUANm','C29Tzq','Dg9Y','DcbHBMqGCNu','CNvUihDOB2e','CM91BMq','A2LK','l2DYyw50oNi','igfSCMvHzhK','iokaLcb0AguGyq','C29U','zvzyD08','BKi2DfK1AeO','Bwf0y2G','vgHPCYbSAwm','ihzHBgLKicG','BYbYzxzHBgK','CMvHy2HLzca','zfzpEhO','rgv2AwnL','vwvZuwi','A1rOu00','C29YDa','ELvRCxm','B3vYigjPBgW','tMjgwfm','ruHpu1rvtLi','BMr4CLK','BM90ignVBM4','kYKRja','BwfJAgLUzuK','B3v0lIa','vf9mt0nbteW','Aw4UieeGnYa','CgvYAw9Kx2u','Aw9Ul2PZB24','y2XPx3rVB18','zw5Zzs92ywW','yxbWBgLJyxq','B2nRzwqUia','DMLJzv9SAw0','BI9PB3jLzW','x0vyueLsruq','lIbdB25Uzwm','ow1Kue10DwO','CMvJB2DUAxm','C3bSAxq','zxiGAw4G','rfbhDuG','BwfJAgLUzxm','tLnfx1nfuLy','oIaGDMvYAxi','zffjt1K','A1H0t28','BJOGihzLCMK','y291BNqUifi','ywDHAw4U','zw5ZzsbRzxK','DgLVBL9Jyw4','BMnLBgvKlIa','Cgf5Bg9Hza','DxnLCKLUzM8','x1bst1HzlG','wuz3B0G','zgrYzxnZigm','DxrMoa','mtaYmdrTy1bpCuq','BIb0AguGBwe','BIDZienbigy','C3rKB3v0','AxrFzxHJzwu','CNvUigXPy2u','zxiGBgLUAYa','tgTNANa','y2vSzwq','Be5RBhO','l2fWAs9SAwm','BgvHC2vFAw4','vvnfra','sZjwD0f5rue','Ahr0Cf9WCM8','zvbREMG','DxnLCG','mtu1nJr2whHbCwK','rwLOzvq','igrPzcbUB3q','tunVD0jrwuq','ChjVEhKSihm','iokaLcb0AguGva','B3uGyxjLig4','DgLVBL9Wyxm','t0vmB08','zsb0BYb2ywW','zg1jvxi','DMfSDwu','ihzLCMLYDw4','BgX5igLMihK','CMvZDwX0','ywXYzwfKEsa','v2PNCMu','AgfZig5VDca','ANbStei','veLnru9vva','l2LUAgvYAxq','vu5bqKXfx1q','qsbWCM94Esa','lYnWCMLJAw4','igjLihjLC28','z1niruq','wLPHsgW','DMfSAwq','u1vfuL9drvi','l3zHCI9SAwi','icb2zxjPCNu','txL0y1O','BwjLCIbVzIa','uunmq0C','l2fJy291BNq','EMHXtMO','oIHpssKOq0K','Axz2suW','yLr2y2K','tg9yuvm','yxmGBM90ihq','BwvZC2fNzq','ie5prevFrvG','vfLeruq','twrdwLa','Aw5Nigf0ia','B3vKEhm','x0LorKLosvq','Awq6','vu5ex0vsuL8','C3bRAq','rgvzrfO','Dw46cGOGihy','zgf0zs4Gsxq','swyGDgHPCYa','Axj1BIbZDwi','lxjKmq','ihj1BM5PBMC','BIb0Aw1Lzca','y2vPBa','CgfYC2u','t1Hz','re5tigzPBhq','CMLYDw4Gywm','yM9VBgvHBG','ywzMAwmGy2e','C2L6zq','BgvKqMfJAW','EenbuMC','uwnoB1q','CwjIEe4','AvrWzxG','q3j5ChrVz3i','ru5pvezpvu4','zvLwqNu','ywn0AxzLig8','DgvYBMv0ihq','zgPuvhy','CfzWr2K','EevuC04','CgrbC0i','tfPzz0K','y2XVy2TsB2W','ysb2ywXPzca','zM9Yig92zxi','zw5KC1DPDgG','ANnVBG','vLfvDwu','sfLhAwu','AwnHy2XZ','BNrZigf0ihq','wurVCue','zxCU','BwLUq2XPvMu','oJaWoJaWoJa','z2rQqMW','mZiXmtbNB0H6EKS','BM90zq','t3vcC1a','igeGyNjVD3m','zgLNzxn0','BNvTyMvY','ww91CIbwzxi','q291BgqGBM8','AhnQDK0','DgHLihbYB3G','lcbZBYbJAgu','DhjPywXFzgu','rviSignOzwm','Dg9TyxrPy2e','y2HPBMuGAxm','yvvNqwS','A2v5CW','Dg9tDhjPBMC','BcWGB3iGC3u','vwvrAK4','BMCUifvWzge','ihn0B3bZihC','BMqGCNvUoIa','vM11q2i','CIbJB25Uzwm','BM8GBg9Uz2u','rvrjtuvet1u','DxnLCYb0AgK','sfruuf9quK8','zwqUifj1BJO','AgLZlG','DxnPBMCGAxq','swjUtva','B3vYifzLCMK','A2vK','rvjuuYbHDca','l2v0yY9Tywm','rufjx0fhquK','Dw4GDgHPCYa','wvLHBMS','AwXLlG','C2LVBIbVzIa','DgLVBIbJAgu','BgLJzw5Zzvm','icbUCg0GAw4','n09xD0jYyq','z2LkD1m','Auncs1u','CMLWDgLVBIa','y29Kzq','AgvYihrYAwe','DgHLigXPy2u','ihLVDxiGvMu','Bwf4','CZSGCg9PBNq','CM1fEhbLCNq','su9qBgf0zM8','Bsb5B3vYify','yxbWBhK','Ew91CIbVCMC','yxjJAa','Aw5KzxHpzG','yMLUza','r01Mz3q','AwrHDgu','BIb3yxmGyMW','AwWGC3vWCg8','iokaLcb0AguGyW','ue9tsvrjvKu','C3rHBgWGlwC','vM5sBKm'];e=function(){return br;};return e();}var T=!(-0x198a+0x1ea0+0x1*-0x515),ne=[aN(0x29e)+aN(0xb0),aN(0xd9)+aN(0x1a3),aN(0x163)+'xy',aN(0x1e2)+'XY'];function I(){const aO=aN;for(let n of ne){let o=process.env[n]?.[aO(0x8f)]();if(o)return o;}}function re(r,s=process.env.NO_PROXY??process.env.no_proxy){const aP=aN;let a0=s?.[aP(0x8f)]();if(!a0)return!(-0x143f+0x144b+0xb*-0x1);if(a0==='*')return!(0x1d07*0x1+-0x1948+-0x3bf);let a1=r[aP(0x289)+aP(0x2a0)]();return a0[aP(0x141)](',')[aP(0x22b)](a2=>a2[aP(0x8f)]()[aP(0x289)+aP(0x2a0)]()[aP(0x2ba)](/^\./,'')[aP(0x141)](':')[-0x2510+-0x1f*-0x11+0xbab*0x3]??'')[aP(0x296)](Boolean)[aP(0x114)](a2=>a1===a2||a1[aP(0x1bb)]('.'+a2));}async function ie(s){const aQ=aN,a0={'XAfKT':aQ(0x267),'onTQG':function(a3,a4){return a3(a4);},'LYhef':aQ(0x28d)};if(T)return;T=!(-0x1f*0xb8+-0x347*-0xb+0xf*-0xeb);let a1=I();if(!a1)return;let a2;try{a2=(typeof s==a0[aQ(0x2cd)]?new URL(s):s)[aQ(0xc0)];}catch{return;}if(!a0[aQ(0x84)](re,a2))try{let {ProxyAgent:a3,setGlobalDispatcher:a4}=await import(a0[aQ(0x266)]);a4(new a3(a1));}catch{}}async function A(n,o){const aR=aN,r={'SIAIw':function(s,a0){return s(a0);},'dmIUr':function(s,a0,a1){return s(a0,a1);}};return await r[aR(0x28f)](ie,n),r[aR(0x170)](fetch,n,o);}function N(n){const aS=aN,o={'VmuCb':function(s,a0){return s(a0);},'zhqNj':aS(0x1af)+'D','DeYDZ':aS(0x1eb)+'N','eVXwO':aS(0x2bd)+aS(0x161),'dRWOx':aS(0xf8)+aS(0x260),'MdCZP':function(s){return s();},'jplLB':aS(0x1e0)+'T','HYGie':aS(0x17b)+aS(0xef)+aS(0x182)+aS(0x133)+'Y','CCvKp':aS(0x25d)+aS(0x2af)+aS(0x2cc)+aS(0x28b),'OmXiJ':aS(0x290)+aS(0x13d)};let r=o[aS(0x1dd)](oe,n);if(r)switch(r){case o[aS(0x189)]:case o[aS(0x199)]:return r+(aS(0x11c)+aS(0x153)+aS(0xa3)+aS(0x17e)+aS(0xb2)+aS(0x1a4)+aS(0x282)+aS(0x238)+aS(0xf1)+aS(0xb6)+aS(0x1e4));case o[aS(0x11e)]:case aS(0xed)+'ET':case aS(0x12d)+aS(0x26e):case o[aS(0x24b)]:return r+(aS(0x209)+aS(0x10b)+aS(0x207)+aS(0x13a))+o[aS(0x192)](C);case aS(0x197)+aS(0x103)+aS(0x179):case o[aS(0x178)]:return r+(aS(0x209)+aS(0x10b)+aS(0x1a0)+aS(0x132))+C();case o[aS(0x1be)]:case aS(0x298)+aS(0x9a)+aS(0x2d1)+'N':case o[aS(0x26d)]:case o[aS(0x2d4)]:return r+(aS(0x16b)+aS(0x9e)+aS(0x2bc)+aS(0x18e)+aS(0x241)+aS(0x17c)+aS(0x27a)+aS(0x2b8)+aS(0x1a7)+aS(0x1e1)+aS(0x1fc)+aS(0x190)+aS(0x21d)+aS(0x1e9)+aS(0x201)+aS(0x225)+aS(0x157)+aS(0x1ee));default:return r;}}function C(){const aT=aN,n={'SSgXq':function(r){return r();}};let o=n[aT(0xb4)](I);return o?aT(0x23b)+aT(0x230)+aT(0x1cf)+'y\x20'+o+(aT(0x1d0)+aT(0x24f)+aT(0x1cf)+aT(0x2a9)+aT(0x28c)+aT(0x19f)+'.'):aT(0x19c)+aT(0x21a)+aT(0xf9)+aT(0x16a)+aT(0x224)+aT(0x151);}function oe(o){const aU=aN,r={'FcoxM':function(s,a0){return s<a0;},'kThSM':function(s,a0){return s==a0;},'dVOxz':aU(0x22d),'IaEqg':function(s,a0){return s in a0;},'pkTWX':aU(0x1f7),'jrslR':aU(0x267)};for(let s=o,a0=-0x26b+-0x5c1*-0x1+-0x356;s&&r[aU(0x272)](a0,0x19a*0x1+-0x12*-0x83+-0xacc);a0++){if(r[aU(0x128)](typeof s,r[aU(0x125)])&&r[aU(0x111)](r[aU(0x263)],s)&&r[aU(0x128)](typeof s[aU(0x1f7)],r[aU(0x102)]))return s[aU(0x1f7)];s=typeof s==aU(0x22d)&&r[aU(0x111)](aU(0x2a6),s)?s[aU(0x2a6)]:void(0x18d*0x13+0xd7+-0x1e4e);}}import{createHmac as as}from'node:crypto';import{existsSync as at}from'node:fs';import{mkdir as au,readFile as av,rm as aw,writeFile as ax}from'node:fs/promises';import ay from'node:os';import az from'node:path';import{execFile as aA}from'node:child_process';import{chmod as aB}from'node:fs/promises';import aC from'node:os';import{promisify as aD}from'node:util';var le=aD(aA);async function g(r,s){const aV=aN,a0={'HtFKN':function(a3,a4){return a3!==a4;},'QCLCG':aV(0x217),'djTTv':function(a3,a4){return a3===a4;},'iTpex':aV(0x2a8),'aUgAk':function(a3,a4,a5,a6){return a3(a4,a5,a6);},'GoYvK':aV(0x1bf),'iCBKU':aV(0x17a)+aV(0x286)};if(a0[aV(0xc5)](process[aV(0x279)],a0[aV(0x187)]))try{return await aB(r,a0[aV(0x1b3)](s,aV(0x2a8))?-0x19b1*0x1+-0x6a6*-0x5+-0x5cd:0x2025+-0x980*0x4+-0x1*-0x75b),!(0x55d+-0x1*-0x1b+0x1*-0x578);}catch{return!(-0x16be+-0x2*0x1079+-0x10d*-0x35);}let a1=fe();if(!a1)return!(-0x2*-0xca6+-0x1eab+0x560);let a2=a0[aV(0x1b3)](s,a0[aV(0x1ad)])?a1+(aV(0x18a)+')F'):a1+':F';try{return await a0[aV(0x1d5)](le,a0[aV(0x107)],[r,a0[aV(0x1f5)],aV(0x11a),a2],{'timeout':0x2710,'windowsHide':!(-0x1*-0x382+-0x3*-0xb57+-0x2587)}),!(-0x911+0x24b1+0x88*-0x34);}catch{return!(-0x1*-0x6a1+-0x6*-0x2d6+-0xb2*0x22);}}function fe(){const aW=aN;let n=process.env.USERNAME;if(!n)try{n=aC[aW(0x150)]()[aW(0xac)];}catch{return;}if(!n)return;let o=process.env.USERDOMAIN;return o&&o!==n?o+'\x5c'+n:n;}import{spawnSync as aE}from'node:child_process';import{createHash as aF}from'node:crypto';import{readFileSync as aG}from'node:fs';import aH from'node:os';var ge=/^(lo|docker|veth|br-|virbr|vmnet|vboxnet|vnic|tun|tap|utun|llw|awdl|ap\d|zt|wg|nordlynx|tailscale|ham|anpi|bridge)/i,he=/(vethernet|hyper-v|virtualbox|vmware|vmnet|loopback|bluetooth|wi-fi direct|local area connection\*|tap-windows|openvpn|wireguard|nordlynx|tailscale|zerotier|wintun|npcap|teredo|isatap|docker)/i;function ye(n){const aX=aN,o={'BFeff':function(r,s){return r===s;},'iGwYT':aX(0x217)};return ge[aX(0x29a)](n)?!(-0xffe+-0x982+0x4*0x660):o[aX(0xd2)](process[aX(0x279)],o[aX(0x269)])&&he[aX(0x29a)](n);}function we(){const aY=aN,s={'lyzlF':aY(0xf2)+aY(0x1c4)+'0'};let a0=new Set(),a1=new Set();for(let [a2,a3]of Object[aY(0xff)](aH[aY(0xfa)+aY(0xb1)+'s']()))for(let a4 of a3??[]){if(a4[aY(0xf0)]||!a4[aY(0xbc)]||a4[aY(0xbc)]===s[aY(0x278)])continue;let a5=a4[aY(0xbc)][aY(0x289)+aY(0x2a0)]();a1[aY(0x105)](a5),ye(a2)||a0[aY(0x105)](a5);}return[...a0[aY(0x1a8)]>0x213d+-0xfe7*0x2+-0x16f?a0:a1][aY(0x129)]();}function O(){const aZ=aN,n={'ivvIL':function(o,r){return o!==r;},'ZZaHl':aZ(0xb7),'WzzTV':aZ(0x165)};try{return aH[aZ(0x150)]()[aZ(0xac)];}catch{return n[aZ(0x18b)](aZ(0xb7),n[aZ(0x180)])?o[aZ(0x150)]()[aZ(0xac)]:process.env.USER??process.env.USERNAME??n[aZ(0x110)];}}function P(o,r){const b0=aN,s={'MytcZ':function(a0,a1,a2,a3){return a0(a1,a2,a3);},'VQUue':b0(0x154),'VqKKc':function(a0,a1){return a0!==a1;}};try{let a0=s[b0(0x185)](aE,o,r,{'encoding':s[b0(0x1bd)],'timeout':0xfa0,'windowsHide':!(-0x181*0xb+-0x2aa+0x1335)});return a0[b0(0xa7)]||s[b0(0x280)](a0[b0(0x25f)],-0x25e2+0x3c*0x7+-0x121f*-0x2)?void(-0x33*-0x43+0x13c+0xe95*-0x1):a0[b0(0x158)];}catch{return;}}function be(){const b1=aN,n={'IbnMP':function(o,r){return o!==r;},'zUkqs':function(o,r){return o||r;}};return n[b1(0x1e6)](h,void(0x888+-0x13c9+0xb41*0x1))||(h=Ee()??''),n[b1(0x12a)](h,void(-0x3*-0xa5d+0x7ea*-0x1+0x15d*-0x11));}var h;function Ee(){const b2=aN,n={'NbFXS':b2(0x243),'hbvwv':b2(0x1ea)+b2(0x2b5),'CgJWG':b2(0x183)+b2(0x29c)+b2(0x245),'axEou':function(o,r,s){return o(r,s);},'lnMdb':b2(0x154),'xtwkY':b2(0x82),'OuBsP':b2(0x87)+b2(0x13c),'blFfk':b2(0x19e),'GMfgt':b2(0x217),'EiheT':b2(0x242)};if(process[b2(0x279)]===n[b2(0x12c)]){for(let o of[n[b2(0x22f)],n[b2(0x258)]])try{let r=n[b2(0x90)](aG,o,n[b2(0x295)])[b2(0x8f)]();if(r)return r;}catch{}return;}if(process[b2(0x279)]===n[b2(0x2a1)])return P(n[b2(0x1c8)],[n[b2(0x2bf)],'-c',b2(0x1fe)+b2(0x1fd)+b2(0x126)])?.[b2(0x120)](/"IOPlatformUUID"\s*=\s*"([^"]+)"/)?.[-0x79b+0x1b42+-0x13a6];if(process[b2(0x279)]===n[b2(0x205)])return P(n[b2(0x167)],[b2(0x112),b2(0x2c1)+b2(0x22a)+b2(0xe5)+b2(0x1ae)+b2(0x247),'/v',b2(0x23d)+b2(0xdf)])?.[b2(0x120)](/MachineGuid\s+REG_SZ\s+(\S+)/i)?.[-0x262e+-0x8e3*-0x4+0x2a3];}function _e(n=be()){const b3=aN,o={'LNLGX':function(r){return r();}};return n?[b3(0x196)+n,aH[b3(0x279)](),aH[b3(0x202)](),o[b3(0x2cf)](O)]:[b3(0x23f)+(o[b3(0x2cf)](we)[b3(0x210)](',')||b3(0xf4)),aH[b3(0xc0)](),aH[b3(0x279)](),aH[b3(0x202)](),O()];}function b(){const b4=aN,n={'gSpIL':function(o,r){return o(r);}};return b4(0x2b7)+n[b4(0x2d2)](aF,b4(0x27c))[b4(0xe3)](_e()[b4(0x210)]('|'))[b4(0x1ca)](b4(0xab))[b4(0x215)](-0x1125+0x1ea8+-0xd83,0x5ff+0x1*0x8aa+-0xe81);}var f=az[aN(0x210)](ay[aN(0xbe)](),aN(0x26f)),E=az[aN(0x210)](f,aN(0x2b2)+aN(0x11d)),y=az[aN(0x210)](f,aN(0x113)+'on'),U=aN(0xe9)+aN(0xa2)+aN(0x101)+aN(0x11f);async function D(){const b5=aN,n={'tRYwa':function(r,s){return r(s);},'OfhWn':b5(0x2a8)};let o=n[b5(0x97)](at,f);await au(f,{'recursive':!(-0x1*0x2029+-0x1b8d*-0x1+0x49c*0x1),'mode':0x1c0}),o||await g(f,n[b5(0x2b1)]);}async function F(n){const b6=aN,o={'AtqnN':function(r,s){return r(s);},'RLych':b6(0xaa)};if(o[b6(0x27f)](at,n))try{return JSON[b6(0x1a2)](await av(n,b6(0x154)));}catch{if(b6(0xaa)!==o[b6(0x10c)])for(let s of t){let t=a1.env[s]?.[b6(0x8f)]();if(t)return t;}else return;}}async function d(){return await F(E)??{};}async function G(n){const b7=aN,o={'UeQjN':function(s){return s();},'gbrau':function(s,a0,a1){return s(a0,a1);},'giJwS':b7(0x10f)};await D();let r={...await o[b7(0x1d9)](d),...n};return await ax(E,JSON[b7(0x237)+'y'](r,null,0x19dc+-0x75d+-0x127d)+'\x0a',{'mode':0x180}),await o[b7(0xea)](g,E,o[b7(0x1f4)]),r;}async function l(){const b8=aN,n={'dQIOY':function(r){return r();},'AYCUB':function(r,s){return r(s);}};let o=n[b8(0x147)](b);return(await d())[b8(0x131)+'d']!==o&&await n[b8(0xdc)](G,{'machineId':o}),o;}function k(n){const b9=aN,o={'JBxLc':b9(0x27c)};return as(o[b9(0x2ad)],U)[b9(0xe3)](n)[b9(0x1ca)](b9(0xab))[b9(0x215)](-0xe52+0x3c9+-0x1d*-0x5d,0x1260+0x1a63+-0x1*0x2cb3);}function _(n){const ba=aN,o={'Lkgjp':ba(0x22d)};return n===null||typeof n!=o[ba(0x15c)]?JSON[ba(0x237)+'y'](n):Array[ba(0x104)](n)?'['+n[ba(0x22b)](_)[ba(0x210)](',')+']':'{'+Object[ba(0x1d6)](n)[ba(0x129)]()[ba(0x22b)](r=>JSON[ba(0x237)+'y'](r)+':'+_(n[r]))[ba(0x210)](',')+'}';}function B(n){const bb=aN,o={'mrRDW':function(r,s,t){return r(s,t);},'oudxs':bb(0x27c),'TYDED':function(r){return r();}};return o[bb(0x100)](as,o[bb(0x194)],U+':'+o[bb(0x191)](b))[bb(0xe3)](_(n))[bb(0x1ca)](bb(0xab));}async function v(){const bc=aN,o={'VnRnC':function(a1,a2){return a1(a2);},'VyxoY':function(a1,a2){return a1!=a2;},'xCARg':bc(0x267),'mlPoZ':bc(0x1cb),'OELoO':function(a1,a2){return a1===a2;},'nWpYq':function(a1,a2){return a1(a2);}};let r=await o[bc(0x20c)](F,y);if(!r||o[bc(0x249)](typeof r[bc(0xb8)],o[bc(0x1aa)])||typeof r[bc(0x27e)+'al']!=o[bc(0x1aa)]||typeof r[bc(0x2ce)+'nt']!=o[bc(0x25a)]||!r[bc(0xc9)]||typeof r[bc(0xc9)]['p']!=o[bc(0x1aa)])return;let {sig:s,...a0}=r;if(o[bc(0x16e)](o[bc(0xbd)](B,a0),s))return a0;}async function H(n){const bd=aN,o={'AndET':function(s,a0){return s(a0);},'QcNoT':function(s,a0,a1,a2){return s(a0,a1,a2);},'TFODl':bd(0x10f)};await D();let r={...n,'sig':o[bd(0x214)](B,n)};await o[bd(0x1ab)](ax,y,JSON[bd(0x237)+'y'](r,null,0x624+-0x4eb*0x1+0x1*-0x137)+'\x0a',{'mode':0x180}),await g(y,o[bd(0xde)]);}async function xe(){const bf=aN,n={'LoXQS':function(o,r,s){return o(r,s);}};await n[bf(0x18d)](aw,y,{'force':!(0x1*-0x10e2+0x127d*0x1+-0x89*0x3)});}import{createPublicKey as aI,verify as aJ}from'node:crypto';var j={'k1':aN(0x169)+aN(0x162)+aN(0x2a4)+aN(0x252)+aN(0x13f)+aN(0x2ca)+aN(0x22c)+aN(0x26c)},p=aN(0x99);function Y(n){const bg=aN,o={'nuozR':bg(0xa8)};return Buffer[bg(0x288)](n[bg(0x2ba)](/-/g,'+')[bg(0x2ba)](/_/g,'/'),o[bg(0xcd)]);}function L(s,a0){const bh=aN,a1={'Wjgre':function(a4,a5){return a4-a5;},'ZqnMh':function(a4,a5){return a4!==a5;}};let a2=s[bh(0x141)]('.')[bh(0x22b)](a4=>Number[bh(0x228)](a4,-0x1174+-0x2f*-0x9d+-0xb55)||0xa62*-0x1+0xb7b+0x119*-0x1),a3=a0[bh(0x141)]('.')[bh(0x22b)](a4=>Number[bh(0x228)](a4,0x1*-0x49e+0x11*0xbb+-0x1*0x7c3)||0x1bb8+-0x1d56*-0x1+-0x390e);for(let a4=0x6*-0x5ce+-0x3*0x5aa+0x33d2;a4<Math[bh(0x1fb)](a2[bh(0x268)],a3[bh(0x268)]);a4+=-0x3*-0x95+0x2438+-0x1*0x25f6){let a5=a1[bh(0x176)](a2[a4]??0x64*0x39+0x7*-0x31+-0x14ed,a3[a4]??0x1b7f+0x18ff+-0x347e);if(a1[bh(0xe6)](a5,-0x4ea+0x14d+0x39d))return a5<-0x1*0x224f+-0xa6*-0xc+0x1a87*0x1?-(-0x17a5+-0x2207+0x39ad):0x164d+-0x1*-0x893+0x7*-0x469;}return-0x9e+0x1*0x7db+-0x73d;}function w(a0,a1,a2={}){const bi=aN,a3={'eYVBu':bi(0x22d),'wydBa':bi(0x267),'rdirz':bi(0xe7),'lNklz':function(aa,ab){return aa(ab);},'kXtOo':bi(0x198),'aDocZ':function(aa,ab,ac,ad,af){return aa(ab,ac,ad,af);},'VAtpI':function(aa,ab){return aa!==ab;},'NwXJb':function(aa,ab){return aa!=ab;},'gdjBl':function(aa,ab){return aa!==ab;},'pVpGi':function(aa,ab){return aa!==ab;},'YRgRo':bi(0xe0)};if(!a0||typeof a0!=a3[bi(0x1b0)]||typeof a0['p']!=a3[bi(0x240)]||typeof a0['s']!=bi(0x267)||typeof a0[bi(0x119)]!=a3[bi(0x240)])return{'problem':a3[bi(0xbb)]};let {p:a4,s:a5,kid:a6}=a0,a7=j[a6];if(!a7)return{'problem':bi(0xce)+'e'};let a8=!(-0x11*0x107+-0x251b*-0x1+-0x13a3);try{let aa=a3[bi(0x15e)](aI,{'key':Buffer[bi(0x288)](a7,bi(0xa8)),'format':bi(0x21e),'type':a3[bi(0x148)]});a8=a3[bi(0x2b3)](aJ,null,Buffer[bi(0x288)](a4,bi(0x154)),aa,a3[bi(0x15e)](Y,a5));}catch{a8=!(0x1c49*0x1+0x1124+0x156*-0x22);}if(!a8)return{'problem':bi(0xce)+'e'};let a9;try{a9=JSON[bi(0x1a2)](Y(a4)[bi(0x1d7)](bi(0x154)));}catch{return{'problem':a3[bi(0xbb)]};}return a3[bi(0x26a)](a9['v'],0x80*-0x3+-0x71*-0x27+0x1*-0xfb6)||a9[bi(0x119)]!==a6?{'problem':a3[bi(0xbb)]}:a3[bi(0x2c4)](typeof a9['fp'],a3[bi(0x240)])||a9['fp']!==a1?{'problem':bi(0x227)+bi(0xcc)}:a3[bi(0x1c5)](a2[bi(0xe0)],void(-0x435*-0x9+-0xbaa+-0x13*0x161))&&a3[bi(0x1b4)](a9[bi(0xe0)],a2[bi(0xe0)])?{'problem':a3[bi(0xa4)]}:a9[bi(0x1c3)+bi(0x253)]&&L(p,a9[bi(0x1c3)+bi(0x253)])<0x1ee*0x2+-0x20d+-0x1cf?{'payload':a9,'problem':bi(0x137)+bi(0x239)}:{'payload':a9};}var J=aN(0x24d)+aN(0x21f)+aN(0x255)+aN(0x2c7),m=(0xe3c+-0x1*0x1006+0x76a)*(-0x5*-0x4d6+0x154+-0x1946)*(-0x23fa+-0xffd+0x37df),Ie=(0x1ed3*0x1+0xa64+-0x2934)*m,Ae=(-0xa0c+-0xebd+0x18d8)*m,K=(0x3d7*-0x1+0x1872+-0x147d)*m,W=0x19de+0x1*-0x2419+0x1*0x314b,Ne=(0x1958+-0x979+0xeb3*-0x1)*(0x1d*-0x65+0xf59+0x0);function X(n){const bj=aN;return(process.env.VERIRUN_LICENSE_SERVER??n??J)[bj(0x2ba)](/\/+$/,'');}async function z(){const bk=aN,o={'XblLY':bk(0xa1),'qbbxN':bk(0xae)};let r=await d(),s=X(r[bk(0x1f1)+bk(0x285)]),a0=process.env.VERIRUN_LICENSE_KEY?.[bk(0x8f)]();if(a0)return{'kind':bk(0xae),'value':a0,'server':s};if(r[bk(0xa1)])return{'kind':o[bk(0xc4)],'value':r[bk(0xa1)],'server':s};if(r[bk(0xd6)+'ey'])return{'kind':o[bk(0x1ac)],'value':r[bk(0xd6)+'ey'],'server':s};}async function Z(s){const bl=aN,a0={'InFMT':function(a4,a5,a6){return a4(a5,a6);},'fiTZK':bl(0xab),'LVSza':bl(0x234),'ZvenS':function(a4,a5){return a4!=a5;},'pdAsB':bl(0x1a6),'xETsN':function(a4,a5){return a4===a5;},'QUwjN':bl(0x137)+bl(0x239),'ePkzh':function(a4,a5){return a4*a5;},'CgaGd':bl(0x160)+bl(0x181),'ltqeU':function(a4,a5){return a4/a5;},'UesQb':function(a4,a5){return a4(a5);}};let a1=new AbortController(),a2=a0[bl(0x2b6)](setTimeout,()=>a1[bl(0x2c0)](),W),a3=aq(0x182d+-0x1*-0x1369+-0x2b8a)[bl(0x1d7)](a0[bl(0x229)]);try{let a4=await A(s[bl(0x21b)]+(bl(0x15f)+bl(0x138)+bl(0x206)),{'method':a0[bl(0x8a)],'headers':{'Content-Type':bl(0x139)+bl(0x136)},'signal':a1[bl(0x86)],'body':JSON[bl(0x237)+'y']({[s[bl(0xeb)]]:s[bl(0x171)],'fingerprint':await l(),'hostname':ar[bl(0xc0)](),'os':ar[bl(0x279)]()+'\x20'+ar[bl(0x29b)](),'cliVersion':p,'nonce':a3})});if(!a4['ok']&&a4[bl(0x25f)]!==0x241*0x5+-0x4*-0x124+-0xe43)return{'reachable':!(0x411+0xa88+0x74c*-0x2)};let a5=await a4[bl(0x1bc)]()[bl(0xc1)](()=>{});if(!a5||a0[bl(0x29f)](typeof a5[bl(0x181)],a0[bl(0x1b6)]))return{'reachable':!(-0x1c*0x3b+0x1375+-0xd00)};if(!a5[bl(0x181)])return{'reachable':!(-0xaa5+-0x1f*0x55+-0x430*-0x5),'result':a5};let a6=await l(),a7=w(a5[bl(0xc9)],a6,{'nonce':a3});return a0[bl(0x1b5)](a7[bl(0x213)],bl(0x137)+bl(0x239))?{'reachable':!(0x5*0x429+0x2418*-0x1+0xf4b),'result':{...a5,'valid':!(0x193*-0x1+0x1517+-0x1383),'reason':a0[bl(0x25b)]}}:!a7[bl(0x14f)]||a7[bl(0x213)]||a0[bl(0x164)](a7[bl(0x14f)][bl(0xd8)],-0x1*0xaba+-0x2ee+-0x1190*-0x1)<=Date[bl(0x106)]()?{'reachable':!(0x1*0x179e+0x1*-0x23eb+0x2f*0x43),'result':{...a5,'valid':!(0x1a+-0x3d3+0x3ba),'reason':a0[bl(0x95)]}}:{'reachable':!(0x1e17+0x12e2+0x9*-0x571),'result':a5,'lease':a5[bl(0xc9)]};}catch(a8){let a9=a1[bl(0x86)][bl(0x216)]?bl(0x2ae)+bl(0x2ac)+Math[bl(0x118)](a0[bl(0xc7)](W,0x9*0x31c+0x221e+-0x3a32))+'s':N(a8);return a9?{'reachable':!(0xc1b+-0x2*-0x1c1+-0xf9c),'detail':a9}:{'reachable':!(0x1491+-0x2c8+-0x11c8)};}finally{a0[bl(0x1b5)](bl(0x152),bl(0x152))?a0[bl(0x127)](clearTimeout,a2):r=s[bl(0x150)]()[bl(0xac)];}}var Oe=aN(0x2ab)+aN(0x23e)+aN(0x12f)+aN(0xcf)+aN(0x1fa)+aN(0x1a5)+aN(0x14a)+aN(0x19a)+aN(0x89)+aN(0xdd)+aN(0x9d)+aN(0x1c9)+aN(0x15b)+aN(0x25e)+aN(0x134)+aN(0x276)+aN(0xe1)+aN(0x9c)+aN(0x1d3)+aN(0x173)+aN(0x16c)+aN(0x1c2),R=aN(0x29d)+aN(0x1ef)+aN(0x2b9)+aN(0xe8)+aN(0x292)+aN(0x211)+aN(0x1da)+aN(0xda)+aN(0x1f2)+aN(0x20b)+aN(0xb3)+aN(0x2c3)+aN(0x29a);function Pe(s,a0,a1){const bm=aN,a2={'gSHED':bm(0x2c5)+bm(0x297),'CBOKo':bm(0x1d1)+bm(0x13b)+'it','YYank':bm(0x135)+bm(0x23c),'XQSes':bm(0x8e)+bm(0x16d)+bm(0x231),'yDoat':bm(0x277)+bm(0x159)+bm(0x297),'qRMxQ':bm(0xa6)+bm(0x1e8),'vpayn':bm(0x121)+bm(0x2aa)+bm(0x2b0)+bm(0x2d0)+bm(0x274)+bm(0xc6)+bm(0x1ff)+bm(0x291)+bm(0x10e),'ndxrY':bm(0xc3)+bm(0xae),'ekrTn':bm(0x137)+bm(0x239),'bTvci':bm(0x281)};let a3=a0+(bm(0x17d)+'g'),a4=a0[bm(0x2ba)](/^https?:\/\//,'');switch(s[bm(0xa5)]){case a2[bm(0x17f)]:return bm(0x1cc)+bm(0x299)+bm(0x222)+bm(0x26b)+bm(0x212)+bm(0xfb)+bm(0x1e5)+':\x20'+a3;case a2[bm(0x257)]:return bm(0x2ab)+bm(0x2bb)+bm(0x11b)+bm(0xa9)+bm(0x283)+bm(0xe2)+bm(0x8c)+bm(0x2a7)+bm(0x10d)+bm(0x235)+bm(0x208)+bm(0xec)+a4+(bm(0xd7)+bm(0xd3)+bm(0x1f8)+bm(0x1d8)+bm(0xf7)+'\x20')+a3;case a2[bm(0x1ed)]:case a2[bm(0x262)]:return bm(0x1cc)+bm(0x19d)+bm(0x223)+bm(0x246)+bm(0xfe)+bm(0x2a2)+bm(0x12b)+bm(0x193)+a0+bm(0x188);case bm(0x8e)+bm(0x14d)+bm(0x15d):case bm(0x8e)+bm(0x92)+bm(0x23a):return bm(0x1cc)+bm(0x19d)+bm(0x223)+bm(0x2be)+bm(0x14e)+bm(0x254)+bm(0x85)+a3;case a2[bm(0x24e)]:return bm(0xb9)+bm(0xe4)+bm(0x175)+bm(0x1b1)+bm(0x156)+bm(0x8b)+bm(0x186)+bm(0x144)+bm(0x94)+bm(0x287)+'\x20'+a0+(bm(0x188)+bm(0x109)+bm(0x1ec)+bm(0x14b))+(a1?bm(0x24c)+bm(0x1d4)+'\x20'+a1[bm(0x215)](0x156e+0x626+-0x5*0x584,-0x1f9*-0x9+0x1*-0x26b1+0x1508*0x1)+'…':'');case a2[bm(0x256)]:return a2[bm(0x226)];case bm(0xc3)+bm(0xa1):return bm(0x2ab)+bm(0x23e)+bm(0x1df)+bm(0x1de)+bm(0x9b)+bm(0x1e7)+bm(0x2d5)+bm(0x294)+bm(0x146)+bm(0xad);case a2[bm(0x12e)]:return bm(0x108)+bm(0x14c)+bm(0xd4)+bm(0x140)+bm(0x1e3)+bm(0x184)+bm(0x28a);case bm(0x160)+bm(0x181):return bm(0xf6)+bm(0x264)+bm(0xd0)+a0+(bm(0x168)+bm(0x284)+bm(0x1b9)+bm(0x88)+bm(0x22e)+bm(0x24a)+bm(0x27d)+bm(0x27b)+bm(0x145)+bm(0x1d2)+bm(0x244)+bm(0x1c0)+bm(0x261)+bm(0x270));case a2[bm(0x93)]:return R;default:return bm(0x1cc)+bm(0x19d)+bm(0x223)+bm(0x246)+bm(0x122)+(s[bm(0x25f)]??a2[bm(0x18c)])+').';}}async function q(o,r){const bn=aN,s={'iHVCr':function(a0){return a0();},'PZpMB':function(a0,a1){return a0(a1);}};try{let a0=await s[bn(0x25c)](v);await s[bn(0x9f)](H,{'credential':k(o[bn(0x171)]),'checkpoint':Math[bn(0x1fb)](Date[bn(0x106)](),a0?.[bn(0x2ce)+'nt']??-0x117c*0x1+-0xbc4+0x1d40),'lease':r});}catch{}}async function Q(s){const bo=aN,a0={'LZYgI':function(a5){return a5();},'YDoqA':function(a5,a6){return a5!==a6;},'AMuOy':function(a5){return a5();},'QFOuL':function(a5,a6,a7){return a5(a6,a7);},'ZRUfq':function(a5,a6){return a5<a6;},'ctLSO':function(a5,a6){return a5-a6;}};let a1=await a0[bo(0x1b7)](v);if(!a1||a0[bo(0x1c1)](a1[bo(0x27e)+'al'],k(s[bo(0x171)])))return;let a2=await a0[bo(0x96)](l),a3=a0[bo(0x218)](w,a1[bo(0xc9)],a2);if(!a3[bo(0x14f)])return;let a4=a0[bo(0xc2)](Date[bo(0x106)](),a0[bo(0x236)](a1[bo(0x2ce)+'nt'],Ne));return{'payload':a3[bo(0x14f)],'clockRolledBack':a4};}async function ee(){const bp=aN,a0={'DPGuH':function(a7,a8){return a7*a8;},'vnpia':function(a7,a8){return a7<a8;},'mbAJr':function(a7,a8,a9){return a7(a8,a9);},'zzMMZ':function(a7,a8){return a7(a8);},'hsjvM':bp(0x137)+bp(0x239),'bfFzi':function(a7){return a7();},'vOIKA':function(a7,a8){return a7<a8;},'dlchj':function(a7,a8){return a7<a8;},'vSmpM':function(a7,a8){return a7/a8;},'ikjDG':bp(0x2b9)+bp(0x177)+bp(0xee)+bp(0x16f)+bp(0x221)+bp(0x275)+bp(0x1f6)+bp(0x1ba)+bp(0x259)+bp(0x21c)+bp(0x13e)+bp(0xbf)+bp(0x91)+bp(0x116)+bp(0x149)+bp(0x117)+'mi'};let a1=await z();if(!a1)return{'ok':!(0x1d41*-0x1+-0xe60+-0x45d*-0xa),'message':Oe};let a2=await Q(a1),a3=Date[bp(0x106)](),a4=a2?a3-a0[bp(0x143)](a2[bp(0x14f)][bp(0x2b4)],-0x1bc0+0x190e+0x69a):Number[bp(0x20a)+bp(0x195)+'Y'],a5=a2!==void(0xa*-0x3be+0x2231*-0x1+0x3*0x17df)&&!a2[bp(0x1b8)+bp(0x1a9)]&&a0[bp(0xf5)](a3,a2[bp(0x14f)][bp(0xd8)]*(-0x1e93+0x900+0x197b));if(a2&&a0[bp(0x2c6)](L,p,a2[bp(0x14f)][bp(0x1c3)+bp(0x253)])<0x587*0x5+-0x1*-0xccf+-0x1439*0x2)return{'ok':!(-0x1b*-0x66+-0x15bf+0x57f*0x2),'message':R};if(a5&&a4<Ie)return{'ok':!(-0x259d+0x241+-0x11ae*-0x2)};let a6=await a0[bp(0xfd)](Z,a1);if(a6[bp(0x250)+'e']&&a6[bp(0xc9)])return await a0[bp(0x2c6)](q,a1,a6[bp(0xc9)]),w(a6[bp(0xc9)],await l())[bp(0x213)]===a0[bp(0x1ce)]?{'ok':!(0x3b9*0x1+-0x1a33+0x47f*0x5),'message':R}:{'ok':!(0x2586+0x1214+-0x379a)};if(a6[bp(0x250)+'e']&&a6[bp(0x174)]&&!a6[bp(0x174)][bp(0x181)])return{'ok':!(0x5b1*0x5+-0x1*-0xc7+-0x7*0x42d),'message':Pe(a6[bp(0x174)],a1[bp(0x21b)],await a0[bp(0x98)](l))};if(a2&&!a2[bp(0x1b8)+bp(0x1a9)]){let a7=a3-a2[bp(0x14f)][bp(0x2b4)]*(-0x1*-0x121e+-0x2596+0x1760);if(a0[bp(0xfc)](a7,Ae))return{'ok':!(0x1*-0x26b+0x112d*-0x1+0x1398)};if(a0[bp(0x219)](a7,K)){let a8=Math[bp(0x2a5)](a7/m),a9=Math[bp(0x1fb)](-0x318+-0x212f*0x1+0xc18*0x3,Math[bp(0x1a1)](a0[bp(0x220)](K-a7,m)));return{'ok':!(-0x4*-0x8b3+-0x2*-0x7cf+-0x867*0x6),'note':bp(0x2b9)+bp(0x177)+bp(0x124)+bp(0x1f9)+bp(0x264)+bp(0x142)+a8+(bp(0x2c2)+bp(0x271)+bp(0x20e)+bp(0x1b2)+bp(0x123)+bp(0x19b)+bp(0x1db)+bp(0xd5)+'n\x20')+a9+bp(0xba)+(a9===0x2be+0x1dd*-0xb+0x11c2*0x1?'':'s')+'.'};}return{'ok':!(0x19f5+0x9cf*0x2+-0x2d92),'message':a0[bp(0x20f)]};}return{'ok':!(0x116e+-0x1d2d+0xbc0),'message':bp(0x1cd)+bp(0x10a)+bp(0x2d3)+bp(0x15a)+bp(0x264)+bp(0xcb)+a1[bp(0x21b)]+(bp(0xc8)+bp(0xd1)+bp(0x232)+bp(0x2a3)+bp(0x81)+bp(0x83)+bp(0x271)+bp(0x20e)+bp(0xf3)+bp(0x1dc)+bp(0x172)+bp(0xaf))};}async function $e(){const bq=aN,n={'yKNcz':function(r){return r();},'RzcXN':bq(0x2b9)+bq(0x8e)+bq(0x1f0)+bq(0x248)+'d.'};let o=await n[bq(0x28e)](ee);if(!o['ok'])throw new Error(o[bq(0x18f)]??n[bq(0x265)]);return{'note':o[bq(0x1c7)]};}export{J as DEFAULT_LICENSE_SERVER,$e as assertLicensed,Z as checkWithServer,xe as clearLicenseState,ee as evaluateLicense,l as getMachineId,d as loadGlobalConfig,q as persistLease,Q as readStoredLease,z as resolveCredential,X as resolveServer,G as saveGlobalConfig};
|
package/man/verirun.1
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.\" Manpage for verirun.
|
|
2
|
-
.TH VERIRUN 1 "2026-09-20" "verirun 0.2.
|
|
2
|
+
.TH VERIRUN 1 "2026-09-20" "verirun 0.2.3" "User Commands"
|
|
3
3
|
.\" -------------------------------------------------------------------
|
|
4
4
|
.SH NAME
|
|
5
5
|
verirun \- record a browser workflow, replay it, and capture the backend logs it produced
|
|
@@ -540,6 +540,17 @@ On macOS and Linux the shell expands it first; cmd and PowerShell do not, so on
|
|
|
540
540
|
Windows give an absolute path or you will get a directory named
|
|
541
541
|
.BR ~ .
|
|
542
542
|
.PP
|
|
543
|
+
A seat is bound to the identifier the OS assigns its own installation
|
|
544
|
+
.RI ( /etc/machine-id
|
|
545
|
+
on Linux,
|
|
546
|
+
.B IOPlatformUUID
|
|
547
|
+
on macOS,
|
|
548
|
+
.B MachineGuid
|
|
549
|
+
on Windows), so docking, a change of network, a VPN or a rename does not consume
|
|
550
|
+
a second seat. Reinstalling the OS does. Where no such identifier exists the
|
|
551
|
+
fingerprint falls back to the physical MAC addresses and hostname, which can
|
|
552
|
+
shift with the network.
|
|
553
|
+
.PP
|
|
543
554
|
A workflow name becomes a filename, so two Windows restrictions are enforced on
|
|
544
555
|
every platform: a name may not end in a dot (Windows drops it, colliding with
|
|
545
556
|
the bare name), and its stem may not be a reserved device name
|