Lines 1-21javascript
2var Yt=Object.defineProperty;var l=(o,e)=>Yt(o,"name",{value:e,configurable:!0}),Xt=(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 Ne=(o,e)=>{for(var t in e)Yt(o,t,{get:e[t],enumerable:!0})};import _ from"fs";import Le from"path";import zs from"os";import Qt from"crypto";function Fe(){_.existsSync(ce)||_.mkdir ...
3`+d.slice(d.length-p))},"appendToBuffer");a.stdout.on("data",u),a.stderr.on("data",u);let f;s>0&&(f
4`)}var K,Lt=ae(()=>{K=Rs.join(er.homedir(),".vanexa","memory.json");l(Mt,"initMemory");l(Ut,"getMemory");l(Ds,"saveMemory");l(tr,"addFact");l(sr,"clearMemory");l(Nt,"getMemoryContextString")});import{program as E}from"commander";O();import Gs from"inquirer";import je from"os";import Js from"crypto";import Ks from"ws";async function ts(){console.log(`\u{1F517} Vanexa Remote Agent \u2014 Device Pairing
5`),console.log(`Open the Vanexa app on your phone, go to Agent Settings, and tap "Pair Computer".
6`);let{code:o}=await Gs.prompt([{type:"input",name:"code",message:"Enter the 6-digit pairing code:",validate:l(s=>/^\d{6}$/.test(s)||"Please enter exactly 6 digits.","validate")}]),e=w();console.log(`
7Connecting to relay: ${e.relayUrl}...`);let t=e.relayUrl.replace(/^http/,"ws")+`/ws/daemon/${o}`;return new Promise((s,r)=>{let i=new Ks(t),n=!1;i.on("open",()=>{console.log("Connected to relay. Waiting for phone confirmation...")}),i.on("message",c=>{try{if(JSON.parse(c.toString()).type==="paired"){n=!0,console.log(`
8\u2705 Successfully paired with your phone!`);let p=je.hostname()+"-"+je.platform()+"-"+je.arch(),d=Js.createHash("sha256").update(p).digest("hex");Zt({sessionId:o,deviceHash:d,pairedAt:Date.now()}),i.close(1e3),s(!0)}}catch(a){console.error("Error parsing message:",a)}}),i.on("error",c=>{console.error(`
9\u274C Connection error:`,c.message),r(c)}),i.on("close",(c,a)=>{n||c!==1e3&&(console.error(`
10\u274C Connection closed (${c}): ${a||"Unknown error"}`),console.error("Make sure the pairing code has not expired."),r(new Error("Connection closed")))})})}l(ts,"pairDevice");O();import ar from"ws";import Ls from"os";var ue=class{static{l(this,"Heartbeat")}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. ...
MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
dist/bundle.jsView on unpkg · L1 11`;L.appendFileSync(s,r)}async getBuffer(e){let t=this.getBufferPath(e);return L.existsSync(t)?L.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 12`).filter(r=>r.trim()).map(r=>JSON.parse(r)):[]}async clearBuffer(e){let t=this.getBufferPath(e);L.existsSync(t)&&L.unlinkSync(t)}};ze
15[WARNING: File truncated at line ${s} out of ${n}. Use { startLine: ${s+1}, endLine: ${s+800} } to read more.]`),{success:!0,output:a}}catch(e){return{success:!1,error:e.message}}}};import Ke from"fs/promises";import Qs from"path";import Zs 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(/^~\//,Z ...
16`),a=n.searchContent.split(`
17`),p=null,d=0;for(let u=0;u<=c.length-a.length;u++){let f=c.slice(u,u+
18`),m=so(n.searchContent,f);m>d&&(d=m,p=f)}if(d>=90&&p)s=s.replace(p,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 (${d.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 oo from"path";async function as(o,e,t=[]){let s=await is.readdir(o,{withFileTypes:!0});for( ...
19`);for(let p=0;p<a.length&&!(i.test(a[p])&&(r.push(`${n}:${p+1}:${a[p].trim()}`),r.length>=100));
20`):"No matches found. (Semantic Search module pending activation)."}}catch(e){return{success:!1,error:e.message}}}};import ro from"fs/promises";import cs from"path"
21`,c.isDirectory()&&(r+=await ds(ps.join(o,c.name),e+1,t,d))}}catch{r+=`${s}\u2514\u2500\u2500 [Access Denied]
Long lines were clipped for display.