Lines 1-21javascript
1var Ks=Object.defineProperty;var Yt=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var ae=(o,e,t)=>()=>{if(t)throw t[0];try{return o&&(e=o(o=0)),e}catch(s){throw t=[s],s}};var Le=(o,e)=>{for(var t in e)Ks(o,t,{get:e[t],enumerable:!0})};import b from"fs";import le from"path";import Gs from"os";import q from"crypto";function ue(){b.existsSync(Y)||b.mkdirSync(Y,{recursive:!0,mode:448})}function Xt(){if(u ...
2`+p.slice(p.length-u))};c.stdout.on("data",l),c.stderr.on("data",l);let m;s>0&&(m=setTimeout(()
3`)}var J,Ft=ae(()=>{J=Rs.join(or.homedir(),".vanexa","memory.json")});import{program as E}from"commander";O();import Hs from"inquirer";import je from"os";import Vs from"crypto";import Ys from"ws";async function ts(){console.log(`\u{1F517} Vanexa Remote Agent \u2014 Device Pairing
4`),console.log(`Open the Vanexa app on your phone, go to Agent Settings, and tap "Pair Computer".
5`);let{code:o}=await Hs.prompt([{type:"input",name:"code",message:"Enter the 6-digit pairing code:",validate:s=>/^\d{6}$/.test(s)||"Please enter exactly 6 digits."}]),e=y();console.log(`
6Connecting to relay: ${e.relayUrl}...`);let t=e.relayUrl.replace(/^http/,"ws")+`/ws/daemon/${o}`;return new Promise((s,r)=>{let i=new Ys(t),n=!1;i.on("open",()=>{console.log("Connected to relay. Waiting for phone confirmation...")}),i.on("message",a=>{try{if(JSON.parse(a.toString()).type==="paired"){n=!0,console.log(`
7\u2705 Successfully paired with your phone!`);let u=je.hostname()+"-"+je.platform()+"-"+je.arch(),p=Vs.createHash("sha256").update(u).digest("hex");Zt({sessionId:o,deviceHash:p,pairedAt:Date.now()}),i.close(1e3),s(!0)}}catch(c){console.error("Error parsing message:",c)}}),i.on("error",a=>{console.error(`
8\u274C Connection error:`,a.message),r(a)}),i.on("close",(a,c)=>{n||a!==1e3&&(console.error(`
9\u274C Connection closed (${a}): ${c||"Unknown error"}`),console.error("Make sure the pairing code has not expired."),r(new Error("Connection closed")))})})}O();import dr from"ws";import Fs from"os";var pe=class{constructor(e,t=3e4){this.ws=e,this.intervalMs=t,this.pingInterval=null,this.pongTimeout=null,this.isAlive=!0}start(){this.isAlive=!0,this.pingInterval=setInterval(()=>{this.ws.readyState===1&&(this.ws.send(JSON.stringify({type:"ping",timestamp:Date.now()})),this.pongTimeout=setTimeout(()=>{this.isAlive=!1,this.ws.terminate()},15e3))},this.intervalMs)}onPong(){this.isAlive=!0,this.pong ...
MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
dist/bundle.jsView on unpkg · L1 10`;N.appendFileSync(s,r)}async getBuffer(e){let t=this.getBufferPath(e);return N.existsSync(t)?N.readFileSync(t,"utf8").split(`
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/bundle.jsView on unpkg · L1 11`).filter(r=>r.trim()).map(r=>JSON.parse(r)):[]}async clearBuffer(e){let t=this.getBufferPath(e);N.existsSync(t)&&N.unlinkSync(t)}};ze
14[WARNING: File truncated at line ${s} out of ${n}. Use { startLine: ${s+1}, endLine: ${s+800} } to read more.]`),{success:!0,output:c}}catch(e){return{success:!1,error:e.message}}}};import Je from"fs/promises";import to from"path";import so from"os";var He={schema:{name:"fs.write",description:"Create or overwrite a file with content using Zero-Corruption Atomic Swap. Guarantees safe file writing.",parameters:{type:"object",properties:{path:{type:"string"},content:{type:"string"},createDirectories:{type:"boolean"}},required:["path","content"]}},async execute(o){try{let e=o.path.replace(/^~\//,s ...
15`),c=n.searchContent.split(`
16`),u=null,p=0;for(let l=0;l<=a.length-c.length;l++){let m=a.slice(l,l+
17`),d=no(n.searchContent,m);d>p&&(p=d,u=m)}if(p>=90&&u)s=s.replace(u,n.replaceContent),r++;else return{success:!1,error:`ATOMIC ROLLBACK: Edit index ${i} failed. Exact match not found, and fuzzy match confidence was too low (${p.toFixed(2)}% < 90%). Previous edits in this batch were rolled back.`}}return await ns.writeFile(e,s,"utf8"),{success:!0,output:`Transaction Success: ${r} replacement(s) safely applied to ${o.path}`}}catch(e){return{success:!1,error:e.message}}}};import is from"fs/promises";import io from"path";async function as(o,e,t=[]){let s=await is.readdir(o,{withFileTypes:!0});for( ...
18`);for(let u=0;u<c.length&&!(i.test(c[u])&&(r.push(`${n}:${u+1}:${c[u].trim()}`),r.length>=100));
19`):"No matches found. (Semantic Search module pending activation)."}}catch(e){return{success:!1,error:e.message}}}};import ao from"fs/promises";import cs from"path"
20`,a.isDirectory()&&(r+=await ds(ps.join(o,a.name),e+1,t,p))}}catch{r+=`${s}\u2514\u2500\u2500 [Access Denied]
21`}return r}var Xe={schema:{name:"fs.list",description:"List directory contents as an interactive Tree-Map. Gives spatial awareness of a project layout.",parameters:{type:"object",properties:{path:{type:"string",description:"Directory to list"},depth:{type:"number",description:"Recursion depth (default 2)"}},required:["path"]}},async execute(o){try{let e=o.path.replace(/^~\//,po.homedir()+"/"),t=o.depth||2,s=await ds(e,1,t);return{success:!0,output:`\u{1F4C1} ${e}
Long lines were clipped for display.