@overlayed/app 0.4.0 → 0.4.2

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/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- var Ue = Object.defineProperty;
2
- var ze = (n, e, t) => e in n ? Ue(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
1
+ var He = Object.defineProperty;
2
+ var ze = (n, e, t) => e in n ? He(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var c = (n, e, t) => ze(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { type as K } from "arktype";
5
- import { createRequire as oe } from "node:module";
5
+ import { createRequire as Y } from "node:module";
6
6
  import k, { existsSync as qe, mkdirSync as We, readFileSync as _e, writeFileSync as Qe, copyFileSync as Xe } from "node:fs";
7
7
  import m, { resolve as Je } from "node:path";
8
8
  import v from "node:fs/promises";
9
9
  import ke from "jszip";
10
10
  import { createHash as Ye } from "node:crypto";
11
11
  import Ze, { app as Pe } from "electron";
12
- var et = Object.defineProperty, tt = (n, e, t) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, F = (n, e, t) => tt(n, typeof e != "symbol" ? e + "" : e, t);
12
+ var et = Object.defineProperty, tt = (n, e, t) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, R = (n, e, t) => tt(n, typeof e != "symbol" ? e + "" : e, t);
13
13
  function nt(n) {
14
14
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
15
15
  var r = n.get(e);
@@ -28,7 +28,7 @@ function nt(n) {
28
28
  }
29
29
  let Ce = class {
30
30
  constructor() {
31
- F(this, "emitter"), this.emitter = nt();
31
+ R(this, "emitter"), this.emitter = nt();
32
32
  }
33
33
  on(e, t) {
34
34
  this.emitter.on(e, t);
@@ -59,7 +59,7 @@ function Ke(n, ...e) {
59
59
  static clearInstance() {
60
60
  this._instance = void 0;
61
61
  }
62
- }, F(t, "_instance"), t;
62
+ }, R(t, "_instance"), t;
63
63
  }
64
64
  class rt extends Ce {
65
65
  destroy() {
@@ -91,19 +91,19 @@ class rt extends Ce {
91
91
  }
92
92
  }
93
93
  Ke(rt);
94
- const st = oe(import.meta.url), {
94
+ const st = Y(import.meta.url), {
95
95
  PipeEventServer: it,
96
- PipeEventClient: Fn,
97
- PipeEventBase: xn,
96
+ PipeEventClient: xn,
97
+ PipeEventBase: $n,
98
98
  ProcessMonitor: Dn,
99
- Process: $n,
100
- InjectionMethod: Tn,
101
- AccessLevel: Bn,
102
- HardwareInterface: Gn
103
- } = st("./build/overlayed_native_interface_x64.node");
99
+ Process: Tn,
100
+ InjectionMethod: Bn,
101
+ AccessLevel: Gn,
102
+ HardwareInterface: jn
103
+ } = st("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
104
104
  let at = class extends Ce {
105
105
  constructor(e) {
106
- super(), F(this, "server", null), F(this, "_hasConnection", !1), F(this, "pipeId"), this.pipeId = e, this.init();
106
+ super(), R(this, "server", null), R(this, "_hasConnection", !1), R(this, "pipeId"), this.pipeId = e, this.init();
107
107
  }
108
108
  get hasConnection() {
109
109
  return this._hasConnection;
@@ -129,7 +129,7 @@ let at = class extends Ce {
129
129
  });
130
130
  }
131
131
  };
132
- const le = Ke(at, "stats-cc");
132
+ const oe = Ke(at, "stats-cc");
133
133
  function ot(n) {
134
134
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
135
135
  var r = n.get(e);
@@ -211,7 +211,7 @@ class lt extends Se {
211
211
  });
212
212
  }
213
213
  }
214
- const E = _(lt);
214
+ const I = _(lt);
215
215
  class ct {
216
216
  constructor(e) {
217
217
  c(this, "data");
@@ -302,7 +302,7 @@ class ct {
302
302
  return r;
303
303
  }
304
304
  reportInvalidConfigFile(e) {
305
- E.getInstance().error("Invalid config file", "INVALID_CONFIG_FILE", {
305
+ I.getInstance().error("Invalid config file", "INVALID_CONFIG_FILE", {
306
306
  issues: e.map((t) => t.message),
307
307
  filePath: this._path,
308
308
  data: this.data
@@ -366,14 +366,11 @@ const Me = {
366
366
  sentryInfo: (...n) => {
367
367
  console.info(name, ...n);
368
368
  }
369
- }, Y = () => m.join(process.env.APPDATA ?? "", "overlayed");
370
- function ut() {
371
- return m.normalize(Y());
369
+ }, le = () => m.join(process.env.APPDATA ?? "", "overlayed");
370
+ function ut(n = []) {
371
+ return m.normalize(m.join(le(), global.OVERLAYED.APP_NAME, ...n));
372
372
  }
373
- function dt(n = []) {
374
- return m.normalize(m.join(Y(), global.OVERLAYED.APP_NAME, ...n));
375
- }
376
- const ht = K({
373
+ const dt = K({
377
374
  game: "string",
378
375
  type: "string",
379
376
  creation_time: "number"
@@ -405,11 +402,11 @@ class G extends Se {
405
402
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
406
403
  }
407
404
  }
408
- var L = "object", Le = "function", Oe = "prototype", ee = "text", ce = "json", ye = "abort", ne = "paramsSerializer", me = "addEventListener", V = "status", w = "headers", Z = Object, S = void 0, W = null, re = Z[Oe], Q = Z.keys, x = Array.isArray, be = "method", Re = "HEAD", se = "GET", Fe = "OPTIONS", gt = "POST", ft = "PUT", pt = "PATCH", yt = "DELETE";
409
- function mt(n, e) {
405
+ var L = "object", Le = "function", Oe = "prototype", ee = "text", ce = "json", ye = "abort", ne = "paramsSerializer", me = "addEventListener", V = "status", w = "headers", Z = Object, S = void 0, W = null, re = Z[Oe], Q = Z.keys, x = Array.isArray, be = "method", Fe = "HEAD", se = "GET", Re = "OPTIONS", ht = "POST", gt = "PUT", ft = "PATCH", pt = "DELETE";
406
+ function yt(n, e) {
410
407
  let t = new AbortController();
411
408
  function r(o) {
412
- t.abort(o), i();
409
+ t.abort(o), a();
413
410
  }
414
411
  let s = [];
415
412
  for (let o of n) {
@@ -427,13 +424,13 @@ function mt(n, e) {
427
424
  }), o[me](ye, l);
428
425
  }
429
426
  }
430
- function i() {
427
+ function a() {
431
428
  s.forEach((o) => o()), e == null || e();
432
429
  }
433
- let a = t.signal;
434
- return a.clear = i, a;
430
+ let i = t.signal;
431
+ return i.clear = a, i;
435
432
  }
436
- var ve = Z.getPrototypeOf, Ee = (n) => {
433
+ var ve = Z.getPrototypeOf, Ie = (n) => {
437
434
  if (n !== W && typeof n === L) {
438
435
  if (typeof ve === Le) {
439
436
  let e = ve(n);
@@ -445,14 +442,14 @@ var ve = Z.getPrototypeOf, Ee = (n) => {
445
442
  }, ue = (...n) => n.reduce((e, t) => {
446
443
  if (x(t)) throw new TypeError(`Arguments must be ${L}s, not arrays.`);
447
444
  return Q(t).forEach((r) => {
448
- ["__proto__", "constructor", Oe].includes(r) || (x(e[r]) && x(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ee(e[r]) && Ee(t[r]) ? e[r] = ue(e[r], t[r]) : e[r] = t[r]);
445
+ ["__proto__", "constructor", Oe].includes(r) || (x(e[r]) && x(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ie(e[r]) && Ie(t[r]) ? e[r] = ue(e[r], t[r]) : e[r] = t[r]);
449
446
  }), e;
450
447
  }, {});
451
448
  function de(n, e = !0, t = W, r) {
452
449
  if (n === S || n === W) return "";
453
- let s = [], i = e ? encodeURIComponent : (g) => g, a = x(n), { arrayFormat: o, allowDots: l, serializeDate: d } = r || {}, h = (g) => {
454
- if (l && !a) return `.${g}`;
455
- if (a) {
450
+ let s = [], a = e ? encodeURIComponent : (g) => g, i = x(n), { arrayFormat: o, allowDots: l, serializeDate: d } = r || {}, h = (g) => {
451
+ if (l && !i) return `.${g}`;
452
+ if (i) {
456
453
  if (o === "brackets") return "[]";
457
454
  if (o === "repeat") return "";
458
455
  }
@@ -461,11 +458,11 @@ function de(n, e = !0, t = W, r) {
461
458
  for (let g in n) if (re.hasOwnProperty.call(n, g)) {
462
459
  let u = n[g];
463
460
  if (u !== S) {
464
- let p = t ? `${t}${h(g)}` : i(g);
461
+ let p = t ? `${t}${h(g)}` : a(g);
465
462
  if (!isNaN(u) && u instanceof Date && (u = d ? d(u) : u.toISOString()), typeof u === L) {
466
463
  let f = de(u, e, p, r);
467
464
  f !== "" && s.push(f);
468
- } else s.push(`${i(p)}=${i(u)}`);
465
+ } else s.push(`${a(p)}=${a(u)}`);
469
466
  }
470
467
  }
471
468
  return s.join("&");
@@ -476,70 +473,70 @@ function ie(n) {
476
473
  t === S ? delete n[e] : ie(t);
477
474
  }), n);
478
475
  }
479
- function bt(n) {
476
+ function mt(n) {
480
477
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(n);
481
478
  }
482
- function vt(n, e) {
479
+ function bt(n, e) {
483
480
  return n ? e ? (n.endsWith("/") ? n : n + "/") + (e[0] === "/" ? e.slice(1) : e) : n : e || "";
484
481
  }
485
- var Et = "XiorError", It = "XiorTimeoutError", xe = class extends Error {
482
+ var vt = "XiorError", It = "XiorTimeoutError", xe = class extends Error {
486
483
  constructor(n, e, t) {
487
- super(n), this.name = Et, this.request = e, this.config = e, this.response = t;
484
+ super(n), this.name = vt, this.request = e, this.config = e, this.response = t;
488
485
  }
489
- }, wt = class extends xe {
486
+ }, Et = class extends xe {
490
487
  constructor(e, t, r) {
491
488
  super(e, t, r), this.name = It;
492
489
  }
493
- }, _t = Object.defineProperty, kt = Object.defineProperties, Pt = Object.getOwnPropertyDescriptors, X = Object.getOwnPropertySymbols, De = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable, Ie = (n, e, t) => e in n ? _t(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, D = (n, e) => {
494
- for (var t in e || (e = {})) De.call(e, t) && Ie(n, t, e[t]);
495
- if (X) for (var t of X(e)) $e.call(e, t) && Ie(n, t, e[t]);
490
+ }, wt = Object.defineProperty, _t = Object.defineProperties, kt = Object.getOwnPropertyDescriptors, X = Object.getOwnPropertySymbols, $e = Object.prototype.hasOwnProperty, De = Object.prototype.propertyIsEnumerable, Ee = (n, e, t) => e in n ? wt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, $ = (n, e) => {
491
+ for (var t in e || (e = {})) $e.call(e, t) && Ee(n, t, e[t]);
492
+ if (X) for (var t of X(e)) De.call(e, t) && Ee(n, t, e[t]);
496
493
  return n;
497
- }, z = (n, e) => kt(n, Pt(e)), Ct = (n, e) => {
494
+ }, z = (n, e) => _t(n, kt(e)), Pt = (n, e) => {
498
495
  var t = {};
499
- for (var r in n) De.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
500
- if (n != null && X) for (var r of X(n)) e.indexOf(r) < 0 && $e.call(n, r) && (t[r] = n[r]);
496
+ for (var r in n) $e.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
497
+ if (n != null && X) for (var r of X(n)) e.indexOf(r) < 0 && De.call(n, r) && (t[r] = n[r]);
501
498
  return t;
502
- }, $ = (n, e, t) => new Promise((r, s) => {
503
- var i = (l) => {
499
+ }, D = (n, e, t) => new Promise((r, s) => {
500
+ var a = (l) => {
504
501
  try {
505
502
  o(t.next(l));
506
503
  } catch (d) {
507
504
  s(d);
508
505
  }
509
- }, a = (l) => {
506
+ }, i = (l) => {
510
507
  try {
511
508
  o(t.throw(l));
512
509
  } catch (d) {
513
510
  s(d);
514
511
  }
515
- }, o = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(i, a);
512
+ }, o = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, i);
516
513
  o((t = t.apply(n, e)).next());
517
- }), he = "application/", Te = `${he}x-www-form-urlencoded`, Be = RegExp, Kt = new Be(`^${Te}`, "i"), St = `${he}${ce}`, Mt = new Be(`^${he}.*${ce}.*`, "i");
518
- function At(n = se) {
519
- return [Re, se, Fe].includes(n);
514
+ }), he = "application/", Te = `${he}x-www-form-urlencoded`, Be = RegExp, Ct = new Be(`^${Te}`, "i"), Kt = `${he}${ce}`, St = new Be(`^${he}.*${ce}.*`, "i");
515
+ function Mt(n = se) {
516
+ return [Fe, se, Re].includes(n);
520
517
  }
521
- var Lt = typeof URLSearchParams != `${S}`;
522
- function Ot(n) {
523
- return $(this, null, function* () {
524
- let e = n[ne] || de, t = n.encodeURI !== !1, r = n[be] && n[be].toUpperCase(), s = n.url, i = s, a = Lt && n.data instanceof URLSearchParams, o = a ? Z.fromEntries(n.data.entries()) : n.data, l = o, d = n != null && n[w] ? D({}, n[w]) : {}, h = n.params, g = At(r);
518
+ var At = typeof URLSearchParams != `${S}`;
519
+ function Lt(n) {
520
+ return D(this, null, function* () {
521
+ let e = n[ne] || de, t = n.encodeURI !== !1, r = n[be] && n[be].toUpperCase(), s = n.url, a = s, i = At && n.data instanceof URLSearchParams, o = i ? Z.fromEntries(n.data.entries()) : n.data, l = o, d = n != null && n[w] ? $({}, n[w]) : {}, h = n.params, g = Mt(r);
525
522
  if (o && typeof o.append !== Le) {
526
523
  let u = "", p = "content-type";
527
524
  if (n != null && n[w]) {
528
- let f = Q(n[w]).find((I) => I.toLowerCase() === p);
525
+ let f = Q(n[w]).find((E) => E.toLowerCase() === p);
529
526
  f && (p = f, u = n[w][f]);
530
527
  }
531
- (!u || a) && (u = g || a ? Te : St, d[p] = u), typeof o === L && (g && h && (h = ue(o, h)), Mt.test(u) ? l = JSON.stringify(ie(o)) : !g && Kt.test(u) && (l = e(o)));
528
+ (!u || i) && (u = g || i ? Te : Kt, d[p] = u), typeof o === L && (g && h && (h = ue(o, h)), St.test(u) ? l = JSON.stringify(ie(o)) : !g && Ct.test(u) && (l = e(o)));
532
529
  }
533
530
  if (h && Q(h).length > 0) {
534
531
  let u = e(h, t);
535
532
  s += s.includes("?") ? `&${u}` : `?${u}`;
536
533
  }
537
- return z(D({}, n), { _data: l, _url: s, data: o, url: i, method: r, [w]: d, isGet: g });
534
+ return z($({}, n), { _data: l, _url: s, data: o, url: a, method: r, [w]: d, isGet: g });
538
535
  });
539
536
  }
540
- var Rt = typeof AbortController != `${S}`;
537
+ var Ot = typeof AbortController != `${S}`;
541
538
  function Ft(n, e) {
542
- return $(this, null, function* () {
539
+ return D(this, null, function* () {
543
540
  let t;
544
541
  if (!e || !n.ok || [ee, ce].includes(e)) {
545
542
  if (t = yield n[ee](), t && e !== ee) try {
@@ -553,7 +550,7 @@ function Ft(n, e) {
553
550
  return t;
554
551
  });
555
552
  }
556
- var xt = (n) => new A(n), A = class {
553
+ var Rt = (n) => new A(n), A = class {
557
554
  constructor(e) {
558
555
  this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [w]: {} };
559
556
  }
@@ -576,44 +573,44 @@ var xt = (n) => new A(n), A = class {
576
573
  } };
577
574
  }
578
575
  request(e) {
579
- return $(this, null, function* () {
576
+ return D(this, null, function* () {
580
577
  let t = ue(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
581
578
  t.withCredentials && !t[r] && (t[r] = "include"), t[ne] || (t[ne] = de);
582
- for (let a of this.REQI) t = yield a(t);
579
+ for (let i of this.REQI) t = yield i(t);
583
580
  let s = this._.bind(this);
584
- this.P.forEach((a) => {
585
- s = a(s, this);
581
+ this.P.forEach((i) => {
582
+ s = i(s, this);
586
583
  });
587
- let i = s(t);
584
+ let a = s(t);
588
585
  if (!t._did) {
589
- let a = 0, o = [];
586
+ let i = 0, o = [];
590
587
  for (this.RESI.forEach(function(l) {
591
588
  o.push(l.fn, l.onRejected);
592
- }); o.length > a; ) i = i.then(o[a++], o[a++]);
589
+ }); o.length > i; ) a = a.then(o[i++], o[i++]);
593
590
  }
594
- return i;
591
+ return a;
595
592
  });
596
593
  }
597
594
  _(e) {
598
- return $(this, null, function* () {
599
- let t = yield Ot(e), { url: r, method: s, headers: i, timeout: a, signal: o, data: l, _data: d, _url: h, isGet: g, fetch: u } = t, p = Ct(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
595
+ return D(this, null, function* () {
596
+ let t = yield Lt(e), { url: r, method: s, headers: a, timeout: i, signal: o, data: l, _data: d, _url: h, isGet: g, fetch: u } = t, p = Pt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
600
597
  e._url = h;
601
- let f, I = [], j = S;
602
- if (a && Rt) {
598
+ let f, E = [], j = S;
599
+ if (i && Ot) {
603
600
  let b = new AbortController();
604
601
  j = setTimeout(() => {
605
- b.abort(new wt(`timeout of ${a}ms exceeded`, e));
606
- }, a), I.push(b.signal);
602
+ b.abort(new Et(`timeout of ${i}ms exceeded`, e));
603
+ }, i), E.push(b.signal);
607
604
  }
608
- o && I.push(o), f = I[0], I.length > 1 && (f = mt(I, () => {
605
+ o && E.push(o), f = E[0], E.length > 1 && (f = yt(E, () => {
609
606
  clearTimeout(j);
610
607
  }));
611
608
  let N = h || r, fe = "baseURL";
612
- return e[fe] && !bt(N) && (N = vt(e[fe], N)), (u || fetch)(N, z(D({ body: g ? S : d }, p), { signal: f, method: s, headers: i })).then((b) => $(this, null, function* () {
609
+ return e[fe] && !mt(N) && (N = bt(e[fe], N)), (u || fetch)(N, z($({ body: g ? S : d }, p), { signal: f, method: s, headers: a })).then((b) => D(this, null, function* () {
613
610
  let { responseType: Ve } = e, pe = { data: yield Ft(b, Ve), response: b, config: e, request: e, [V]: b[V], statusText: b.statusText, [w]: b[w] };
614
611
  if (!b.ok) {
615
- let He = new xe(b[V] ? `Request failed with status code ${b[V]}` : "Network error", e, pe);
616
- return Promise.reject(He);
612
+ let Ue = new xe(b[V] ? `Request failed with status code ${b[V]}` : "Network error", e, pe);
613
+ return Promise.reject(Ue);
617
614
  }
618
615
  return pe;
619
616
  })).finally(() => {
@@ -623,35 +620,35 @@ var xt = (n) => new A(n), A = class {
623
620
  });
624
621
  }
625
622
  cG(e) {
626
- return (t, r) => this.request(r ? z(D({}, r), { method: e, url: t }) : { method: e, url: t });
623
+ return (t, r) => this.request(r ? z($({}, r), { method: e, url: t }) : { method: e, url: t });
627
624
  }
628
625
  cP(e) {
629
- return (t, r, s) => this.request(s ? z(D({}, s), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
626
+ return (t, r, s) => this.request(s ? z($({}, s), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
630
627
  }
631
628
  get(e, t) {
632
629
  return this.cG(se)(e, t);
633
630
  }
634
631
  head(e, t) {
635
- return this.cG(Re)(e, t);
632
+ return this.cG(Fe)(e, t);
636
633
  }
637
634
  post(e, t, r) {
638
- return this.cP(gt)(e, t, r);
635
+ return this.cP(ht)(e, t, r);
639
636
  }
640
637
  put(e, t, r) {
641
- return this.cP(ft)(e, t, r);
638
+ return this.cP(gt)(e, t, r);
642
639
  }
643
640
  patch(e, t, r) {
644
- return this.cP(pt)(e, t, r);
641
+ return this.cP(ft)(e, t, r);
645
642
  }
646
643
  delete(e, t) {
647
- return this.cG(yt)(e, t);
644
+ return this.cG(pt)(e, t);
648
645
  }
649
646
  options(e, t) {
650
- return this.cG(Fe)(e, t);
647
+ return this.cG(Re)(e, t);
651
648
  }
652
649
  };
653
- A.create = xt, A.VERSION = "0.7.7";
654
- var Dt = Object.assign(A.create(), { create: A.create, VERSION: A.VERSION }), Ge = Dt;
650
+ A.create = Rt, A.VERSION = "0.7.7";
651
+ var xt = Object.assign(A.create(), { create: A.create, VERSION: A.VERSION }), Ge = xt;
655
652
  const je = Ge.create({
656
653
  baseURL: "https://updater.stats.cc",
657
654
  headers: {
@@ -671,29 +668,29 @@ function $t(n, e) {
671
668
  responseType: "text"
672
669
  });
673
670
  }
674
- function Tt(n, e) {
671
+ function Dt(n, e) {
675
672
  return je.get(`/v1/native/${n}/files`, {
676
673
  params: { channel: e },
677
674
  responseType: "arraybuffer"
678
675
  });
679
676
  }
680
- function Bt() {
677
+ function Tt() {
681
678
  return ge.get("/v1/raven/config");
682
679
  }
683
- function Gt(n, e) {
680
+ function Bt(n, e) {
684
681
  return ge.get(`/v1/raven/games/${n}/builds/${e}/check`);
685
682
  }
686
- function jt(n, e) {
683
+ function Gt(n, e) {
687
684
  const t = new FormData();
688
685
  return t.append("file", e), ge.post(`/v1/raven/games/${n}/builds/upload`, t, {});
689
686
  }
690
- function Nt(n) {
687
+ function jt(n) {
691
688
  return n instanceof Error && (n.name === "XiorError" || n.name === "XiorTimeoutError");
692
689
  }
693
- function Vt(n) {
690
+ function Nt(n) {
694
691
  return !!(n && "kind" in n.data && "message" in n.data);
695
692
  }
696
- const Ht = {
693
+ const Vt = {
697
694
  buildChannel: "alpha"
698
695
  };
699
696
  class Ut extends G {
@@ -703,7 +700,7 @@ class Ut extends G {
703
700
  // 5 minutes
704
701
  c(this, "targetDir");
705
702
  c(this, "updateInterval");
706
- this.targetDir = m.join(Y(), "resources"), this.logger.log("Target directory", this.targetDir);
703
+ this.targetDir = m.join(le(), "resources"), this.logger.log("Target directory", this.targetDir);
707
704
  }
708
705
  async initWithDlls(t) {
709
706
  super.init(), await v.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
@@ -726,36 +723,36 @@ class Ut extends G {
726
723
  return m.join(this.getTargetPath(t), r);
727
724
  }
728
725
  async checkForUpdates(t) {
729
- const r = Ht.buildChannel;
726
+ const r = Vt.buildChannel;
730
727
  this.logger.log("Checking for updates");
731
728
  for (const s of t)
732
729
  try {
733
- const { data: i } = await $t(s, r), a = await this.getCurrentVersion(s);
734
- this.logger.log(`${s} > Update Check. current: ${a}, latest: ${i}`);
735
- const o = i !== a;
736
- this.logger.log(`${s} > Update found: ${a} -> ${i}`), await this.downloadAndExtractDll(s, i, r, o), this.logger.log(`${s} > Downloaded and extracted`), o && (this.logger.log(`${s} > Cleaning up versions older than ${i}`), await this.cleanupOldVersions(s, i)), this.emit("dllUpdated", { identifier: s, version: i });
737
- } catch (i) {
738
- this.logger.captureSentryException(`${s} > Error checking/updating`, i);
730
+ const { data: a } = await $t(s, r), i = await this.getCurrentVersion(s);
731
+ this.logger.log(`${s} > Update Check. current: ${i}, latest: ${a}`);
732
+ const o = a !== i;
733
+ this.logger.log(`${s} > Update found: ${i} -> ${a}`), await this.downloadAndExtractDll(s, a, r, o), this.logger.log(`${s} > Downloaded and extracted`), o && (this.logger.log(`${s} > Cleaning up versions older than ${a}`), await this.cleanupOldVersions(s, a)), this.emit("dllUpdated", { identifier: s, version: a });
734
+ } catch (a) {
735
+ this.logger.captureSentryException(`${s} > Error checking/updating`, a);
739
736
  }
740
737
  }
741
- async downloadAndExtractDll(t, r, s, i) {
742
- const { data: a } = await Tt(t, s), o = this.getTargetPath(t), l = this.getTargetVersionPath(t, r);
738
+ async downloadAndExtractDll(t, r, s, a) {
739
+ const { data: i } = await Dt(t, s), o = this.getTargetPath(t), l = this.getTargetVersionPath(t, r);
743
740
  await v.mkdir(l, { recursive: !0 });
744
741
  const d = new ke();
745
- await d.loadAsync(a);
742
+ await d.loadAsync(i);
746
743
  const h = Object.keys(d.files).map(async (u) => {
747
744
  const p = d.files[u];
748
745
  if (p && !p.dir) {
749
746
  const f = m.join(l, u);
750
- if (!i)
747
+ if (!a)
751
748
  try {
752
749
  await v.access(f, v.constants.F_OK);
753
750
  return;
754
751
  } catch {
755
752
  this.logger.warn(`${t} > File missing, re-downloading: ${f}`);
756
753
  }
757
- const I = await p.async("nodebuffer");
758
- await v.writeFile(f, I);
754
+ const E = await p.async("nodebuffer");
755
+ await v.writeFile(f, E);
759
756
  }
760
757
  });
761
758
  await Promise.all(h);
@@ -763,13 +760,13 @@ class Ut extends G {
763
760
  this.logger.log("Saving version file", g), await v.writeFile(g, r);
764
761
  }
765
762
  async cleanupOldVersions(t, r) {
766
- const s = m.join(this.targetDir, t), i = await v.readdir(s, { withFileTypes: !0 });
767
- for (const a of i)
768
- a.isDirectory() && a.name !== r && await v.rm(m.join(s, a.name), { recursive: !0, force: !0 });
763
+ const s = m.join(this.targetDir, t), a = await v.readdir(s, { withFileTypes: !0 });
764
+ for (const i of a)
765
+ i.isDirectory() && i.name !== r && await v.rm(m.join(s, i.name), { recursive: !0, force: !0 });
769
766
  }
770
767
  }
771
768
  const J = _(Ut);
772
- class zt extends G {
769
+ class Ht extends G {
773
770
  constructor() {
774
771
  super("RavenManager");
775
772
  c(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
@@ -799,15 +796,15 @@ class zt extends G {
799
796
  }
800
797
  async fetchRavenConfig() {
801
798
  try {
802
- const t = await Bt();
799
+ const t = await Tt();
803
800
  this._ravenConfig = t.data, this.resetState();
804
801
  const r = /* @__PURE__ */ new Set();
805
802
  for (const s of this._ravenConfig.games) {
806
- for (const i of s.executables) {
807
- const a = i.toLowerCase();
808
- this._executableToGameMap.set(a, s), this._executablesArray.push(a);
803
+ for (const a of s.executables) {
804
+ const i = a.toLowerCase();
805
+ this._executableToGameMap.set(i, s), this._executablesArray.push(i);
809
806
  }
810
- s.dlls_to_inject.forEach((i) => r.add(i));
807
+ s.dlls_to_inject.forEach((a) => r.add(a));
811
808
  }
812
809
  await J.getInstance().initWithDlls(Array.from(r)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
813
810
  } catch (t) {
@@ -818,23 +815,23 @@ class zt extends G {
818
815
  this._executableToGameMap.clear(), this._executablesArray = [];
819
816
  }
820
817
  }
821
- const T = _(zt), qt = oe(import.meta.url), {
818
+ const T = _(Ht), zt = Y(import.meta.url), {
822
819
  PipeEventServer: Hn,
823
- PipeEventClient: Un,
824
- PipeEventBase: zn,
825
- ProcessMonitor: Wt,
826
- Process: H,
827
- InjectionMethod: qn,
828
- AccessLevel: Wn,
829
- HardwareInterface: Qt
830
- } = qt("./build/overlayed_native_interface_x64.node");
831
- class Xt extends G {
820
+ PipeEventClient: zn,
821
+ PipeEventBase: qn,
822
+ ProcessMonitor: qt,
823
+ Process: U,
824
+ InjectionMethod: Wn,
825
+ AccessLevel: Qn,
826
+ HardwareInterface: Wt
827
+ } = zt("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
828
+ class Qt extends G {
832
829
  constructor() {
833
830
  super("ProcessManager");
834
831
  c(this, "_processMonitor");
835
832
  c(this, "_processes", /* @__PURE__ */ new Map());
836
833
  c(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
837
- this._processMonitor = new Wt();
834
+ this._processMonitor = new qt();
838
835
  }
839
836
  get hasAnyActiveProcesses() {
840
837
  return this.activeProcesses.length > 0;
@@ -874,13 +871,13 @@ class Xt extends G {
874
871
  deleteProcess(t) {
875
872
  if (!t.name)
876
873
  return;
877
- const r = this._processes.get(t.name), s = (r == null ? void 0 : r.filter((i) => i.id !== t.id)) ?? [];
874
+ const r = this._processes.get(t.name), s = (r == null ? void 0 : r.filter((a) => a.id !== t.id)) ?? [];
878
875
  s.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, s);
879
876
  }
880
877
  }
881
- const C = _(Xt), Jt = oe(import.meta.url), { RenderInterface: Yt, renderHookPath: Qn } = Jt("./build/overlayed_render_interface_x64.node");
882
- var Zt = Object.defineProperty, en = (n, e, t) => e in n ? Zt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, q = (n, e, t) => en(n, typeof e != "symbol" ? e + "" : e, t);
883
- class tn {
878
+ const C = _(Qt), Xt = Y(import.meta.url), { RenderInterface: Jt, renderHookPath: Xn } = Xt("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
879
+ var Yt = Object.defineProperty, Zt = (n, e, t) => e in n ? Yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, q = (n, e, t) => Zt(n, typeof e != "symbol" ? e + "" : e, t);
880
+ class en {
884
881
  constructor(e) {
885
882
  q(this, "_instance"), q(this, "_resolution"), q(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
886
883
  }
@@ -897,22 +894,22 @@ class tn {
897
894
  this._resolution = { width: e, height: t };
898
895
  }
899
896
  }
900
- let nn = class {
897
+ let tn = class {
901
898
  constructor() {
902
899
  q(this, "interfaces", {});
903
900
  }
904
901
  createInterface(e) {
905
- return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new tn(new Yt(e, { access: 1 })), this.interfaces[e]);
902
+ return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new en(new Jt(e, { access: 1 })), this.interfaces[e]);
906
903
  }
907
904
  getInterface(e) {
908
905
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
909
906
  }
910
907
  };
911
- const O = _(nn);
912
- var rn = Object.defineProperty, sn = (n, e, t) => e in n ? rn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, R = (n, e, t) => sn(n, typeof e != "symbol" ? e + "" : e, t);
913
- class an {
908
+ const O = _(tn);
909
+ var nn = Object.defineProperty, rn = (n, e, t) => e in n ? nn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, F = (n, e, t) => rn(n, typeof e != "symbol" ? e + "" : e, t);
910
+ class sn {
914
911
  constructor() {
915
- R(this, "data", []);
912
+ F(this, "data", []);
916
913
  }
917
914
  get size() {
918
915
  return this.data.length;
@@ -933,9 +930,9 @@ class an {
933
930
  }
934
931
  }
935
932
  }
936
- class on {
933
+ class an {
937
934
  constructor(e) {
938
- R(this, "_clientId", null), R(this, "_userId", null), R(this, "options"), R(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new an(), this.setupFlushInterval();
935
+ F(this, "_clientId", null), F(this, "_userId", null), F(this, "options"), F(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new sn(), this.setupFlushInterval();
939
936
  }
940
937
  set clientId(e) {
941
938
  this._clientId = e;
@@ -960,11 +957,10 @@ class on {
960
957
  };
961
958
  }
962
959
  }
963
- const P = _(on);
964
- class ln extends G {
960
+ const P = _(an), on = Y(import.meta.url), ln = on.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
961
+ class cn extends G {
965
962
  constructor() {
966
963
  super("GameLaunchManager");
967
- c(this, "RENDER_INTERFACE_PATH", "node_modules/@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
968
964
  c(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
969
965
  c(this, "boundOnProcessDestroy", this.onProcessDestroy.bind(this));
970
966
  }
@@ -978,30 +974,30 @@ class ln extends G {
978
974
  const r = this.getRavenGame(t);
979
975
  if (!r)
980
976
  return;
981
- if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", H.currentProcess.isElevated), t.isElevated && !H.currentProcess.isElevated) {
982
- E.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
983
- appElevated: !!H.currentProcess.isElevated,
977
+ if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", U.currentProcess.isElevated), t.isElevated && !U.currentProcess.isElevated) {
978
+ I.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
979
+ appElevated: !!U.currentProcess.isElevated,
984
980
  gameElevated: !!t.isElevated
985
981
  }), this.logger.sentryLog("Game elevated but App is not", {
986
- appElevated: H.currentProcess.isElevated,
982
+ appElevated: U.currentProcess.isElevated,
987
983
  gameElevated: t.isElevated
988
984
  });
989
985
  return;
990
986
  }
991
- const s = this.copyDll(this.RENDER_INTERFACE_PATH);
987
+ const s = this.copyDll(ln);
992
988
  if (s)
993
989
  try {
994
990
  await t.injectDll(s), this.logger.log("Render Interface Injection Successful", s);
995
- } catch (a) {
996
- this.logger.captureSentryException("Render Interface Injection Failed", a), this.logger.sentryError("Render Interface Injection Failed", {
991
+ } catch (i) {
992
+ this.logger.captureSentryException("Render Interface Injection Failed", i), this.logger.sentryError("Render Interface Injection Failed", {
997
993
  renderInterfacePath: s
998
994
  });
999
995
  }
1000
- const i = r == null ? void 0 : r.dlls_to_inject.map(async (a) => {
1001
- const o = await J.getInstance().getCurrentVersion(a);
996
+ const a = r == null ? void 0 : r.dlls_to_inject.map(async (i) => {
997
+ const o = await J.getInstance().getCurrentVersion(i);
1002
998
  if (!o)
1003
- return this.logger.sentryError("No version found for DLL", { identifier: a }), Promise.resolve();
1004
- const l = J.getInstance().getTargetVersionPath(a, o);
999
+ return this.logger.sentryError("No version found for DLL", { identifier: i }), Promise.resolve();
1000
+ const l = J.getInstance().getTargetVersionPath(i, o);
1005
1001
  this.logger.log("DLL Path", l);
1006
1002
  const d = await this.getDllFiles(l);
1007
1003
  return this.logger.log("DLL Files", d), Promise.all(
@@ -1022,28 +1018,21 @@ class ln extends G {
1022
1018
  })
1023
1019
  );
1024
1020
  });
1025
- await Promise.allSettled(i), this.emit("gameLaunchInternal", { ravenGame: r, process: t }), this.emit("gameLaunch", { game: r.identifier }), P.getInstance().track("game_launch", {
1021
+ await Promise.allSettled(a), this.emit("gameLaunchInternal", { ravenGame: r, process: t }), this.emit("gameLaunch", { game: r.identifier }), P.getInstance().track("game_launch", {
1026
1022
  game: r.identifier
1027
1023
  });
1028
1024
  }
1029
1025
  copyDll(t) {
1030
- this.logger.log(ut());
1031
- const r = t.split("/");
1032
- if (r.length < 2)
1033
- return this.logger.sentryError("Path is invalid", { dllPath: t }), !1;
1034
- const s = r.at(-1);
1035
- if (!s)
1036
- return this.logger.sentryError("Dll name is invalid", { dllPath: t }), !1;
1037
- const i = Je(t), a = m.join(Y(), "resources"), o = m.join(a, s);
1038
- this.logger.debug("Copying", i, "to", o);
1026
+ const r = m.basename(t), s = Je(t), a = m.join(le(), "resources"), i = m.join(a, r);
1027
+ this.logger.debug("Copying", s, "to", i);
1039
1028
  try {
1040
1029
  qe(a) || We(a, { recursive: !0 });
1041
- const l = _e(i);
1042
- Qe(o, l), Xe(i, o);
1043
- } catch (l) {
1044
- return l.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", l), this.logger.sentryError("Failed to copy", { originalPath: i, targetPath: o }), !1);
1030
+ const o = _e(s);
1031
+ Qe(i, o), Xe(s, i);
1032
+ } catch (o) {
1033
+ return o.code === "EBUSY" ? i : (this.logger.captureSentryException("Failed to copy", o), this.logger.sentryError("Failed to copy", { originalPath: s, targetPath: i }), !1);
1045
1034
  }
1046
- return o;
1035
+ return i;
1047
1036
  }
1048
1037
  async getDllFiles(t) {
1049
1038
  try {
@@ -1069,8 +1058,8 @@ class ln extends G {
1069
1058
  return r;
1070
1059
  }
1071
1060
  }
1072
- const B = _(ln);
1073
- class cn extends Ae {
1061
+ const B = _(cn);
1062
+ class un extends Ae {
1074
1063
  constructor() {
1075
1064
  super("GameBuildManager");
1076
1065
  c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
@@ -1091,11 +1080,11 @@ class cn extends Ae {
1091
1080
  );
1092
1081
  return;
1093
1082
  }
1094
- const i = _e(s.path), a = Ye("sha256").update(i).digest("hex");
1095
- this.logger.log("Process Path", s.path), this.logger.log("Process Name", s.name), this.logger.log("Build Hash", a);
1083
+ const a = _e(s.path), i = Ye("sha256").update(a).digest("hex");
1084
+ this.logger.log("Process Path", s.path), this.logger.log("Process Name", s.name), this.logger.log("Build Hash", i);
1096
1085
  let o = !1;
1097
1086
  try {
1098
- o = (await Gt(r.identifier, a)).data.upload;
1087
+ o = (await Bt(r.identifier, i)).data.upload;
1099
1088
  } catch (h) {
1100
1089
  this.logger.captureSentryException("Error checking game build hash", h);
1101
1090
  return;
@@ -1105,16 +1094,16 @@ class cn extends Ae {
1105
1094
  return;
1106
1095
  }
1107
1096
  const l = new ke();
1108
- l.file(s.name, i);
1097
+ l.file(s.name, a);
1109
1098
  const d = await l.generateAsync({ type: "blob" });
1110
1099
  try {
1111
- this.logger.log("Uploading build (size: ", d.size, " bytes)"), await jt(r.identifier, d), this.logger.log("Build uploaded successfully");
1100
+ this.logger.log("Uploading build (size: ", d.size, " bytes)"), await Gt(r.identifier, d), this.logger.log("Build uploaded successfully");
1112
1101
  } catch (h) {
1113
- Nt(h) ? Vt(h.response) ? this.logger.captureSentryException("Error uploading build hash, api error", h) : this.logger.captureSentryException("Error uploading build hash, request error", h) : this.logger.captureSentryException("Error uploading build hash, unknown error", h);
1102
+ jt(h) ? Nt(h.response) ? this.logger.captureSentryException("Error uploading build hash, api error", h) : this.logger.captureSentryException("Error uploading build hash, request error", h) : this.logger.captureSentryException("Error uploading build hash, unknown error", h);
1114
1103
  }
1115
1104
  }
1116
1105
  }
1117
- const Ne = _(cn), ae = /* @__PURE__ */ new Map([
1106
+ const Ne = _(un), ae = /* @__PURE__ */ new Map([
1118
1107
  [1, "LeftButton"],
1119
1108
  [2, "RightButton"],
1120
1109
  [3, "Cancel"],
@@ -1307,13 +1296,13 @@ const Ne = _(cn), ae = /* @__PURE__ */ new Map([
1307
1296
  [252, "Noname"],
1308
1297
  [253, "PA1"],
1309
1298
  [254, "OEM_Clear"]
1310
- ]), we = new Map(ae.entries().map(([n, e]) => [e, n])), un = K({
1299
+ ]), we = new Map(ae.entries().map(([n, e]) => [e, n])), dn = K({
1311
1300
  "[string]": {
1312
1301
  keys: "string[]",
1313
1302
  mode: K("'toggle' | 'hold'").pipe((n) => n ?? "toggle")
1314
1303
  }
1315
1304
  });
1316
- class dn extends G {
1305
+ class hn extends G {
1317
1306
  constructor(t) {
1318
1307
  super("KeybindManager");
1319
1308
  c(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
@@ -1327,8 +1316,8 @@ class dn extends G {
1327
1316
  // TODO try to figure out a better way to handle this
1328
1317
  c(this, "keybindListeningPaused", !1);
1329
1318
  this.keybindsFile = new ct({
1330
- path: dt(["keybinds.json"]),
1331
- schema: un,
1319
+ path: ut(["keybinds.json"]),
1320
+ schema: dn,
1332
1321
  default: t
1333
1322
  });
1334
1323
  }
@@ -1357,7 +1346,7 @@ class dn extends G {
1357
1346
  }
1358
1347
  async updateKeybinds(t) {
1359
1348
  const r = Object.fromEntries(
1360
- Object.entries(t).filter(([s, i]) => i !== void 0)
1349
+ Object.entries(t).filter(([s, a]) => a !== void 0)
1361
1350
  );
1362
1351
  this.keybindsFile.set({
1363
1352
  ...this.keybindsFile.get(),
@@ -1392,51 +1381,51 @@ class dn extends G {
1392
1381
  return;
1393
1382
  this.pressedKeys.delete(r);
1394
1383
  const s = this.keybindsFile.get();
1395
- for (const [i] of this.preferencesKeybindToCallbacks.entries())
1396
- s[i].keys.includes(r) && this.triggeredToggleKeybinds.delete(i);
1384
+ for (const [a] of this.preferencesKeybindToCallbacks.entries())
1385
+ s[a].keys.includes(r) && this.triggeredToggleKeybinds.delete(a);
1397
1386
  this.checkKeybindUps();
1398
1387
  }
1399
1388
  async checkKeybindUps() {
1400
1389
  const t = this.keybindsFile.get();
1401
1390
  for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
1402
1391
  if (!s.up) continue;
1403
- const i = t[r];
1404
- this.activeKeybinds.has(r) && i.keys.some((a) => !this.pressedKeys.has(a)) && (this.activeKeybinds.delete(r), s.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(i)));
1392
+ const a = t[r];
1393
+ this.activeKeybinds.has(r) && a.keys.some((i) => !this.pressedKeys.has(i)) && (this.activeKeybinds.delete(r), s.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(a)));
1405
1394
  }
1406
1395
  }
1407
1396
  async checkKeybindings() {
1408
1397
  const t = this.keybindsFile.get();
1409
1398
  for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
1410
- const i = t[r];
1411
- if (i.keys.length === this.pressedKeys.size && i.keys.every((o) => we.has(o) ? this.pressedKeys.has(o) : !1)) {
1412
- this.triggerKeybind(i, s, r);
1399
+ const a = t[r];
1400
+ if (a.keys.length === this.pressedKeys.size && a.keys.every((o) => we.has(o) ? this.pressedKeys.has(o) : !1)) {
1401
+ this.triggerKeybind(a, s, r);
1413
1402
  return;
1414
1403
  }
1415
1404
  }
1416
1405
  for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
1417
- const i = t[r];
1418
- i.keys.every((o) => we.has(o) ? this.pressedKeys.has(o) : (this.logger.error("Unknown key", o, i), !1)) && this.triggerKeybind(i, s, r);
1406
+ const a = t[r];
1407
+ a.keys.every((o) => we.has(o) ? this.pressedKeys.has(o) : (this.logger.error("Unknown key", o, a), !1)) && this.triggerKeybind(a, s, r);
1419
1408
  }
1420
1409
  }
1421
1410
  triggerKeybind(t, r, s) {
1422
- const i = t.mode;
1423
- if (i === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(s)) {
1424
- const a = r.toggle();
1411
+ const a = t.mode;
1412
+ if (a === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(s)) {
1413
+ const i = r.toggle();
1425
1414
  this.triggeredToggleKeybinds.add(s), this.logger.log(
1426
- a ? `Keybind pressed rejected: ${a}` : "Keybind pressed accepted",
1415
+ i ? `Keybind pressed rejected: ${i}` : "Keybind pressed accepted",
1427
1416
  this.getKeybindToString(t)
1428
1417
  );
1429
1418
  }
1430
- if (i === "hold" && r.down && !this.activeKeybinds.has(s)) {
1431
- const a = r.down();
1432
- a ? this.logger.log(`Keybind down rejected: ${a}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(s), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
1419
+ if (a === "hold" && r.down && !this.activeKeybinds.has(s)) {
1420
+ const i = r.down();
1421
+ i ? this.logger.log(`Keybind down rejected: ${i}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(s), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
1433
1422
  }
1434
1423
  }
1435
1424
  getKeybindToString(t) {
1436
1425
  return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
1437
1426
  }
1438
1427
  }
1439
- class hn extends Ae {
1428
+ class gn extends Ae {
1440
1429
  constructor(t) {
1441
1430
  super("OverridesManager");
1442
1431
  c(this, "renderInterface");
@@ -1467,26 +1456,26 @@ class hn extends Ae {
1467
1456
  this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), s ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), s && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !s && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
1468
1457
  }
1469
1458
  }
1470
- const gn = _(hn, "OGG_SIEGE");
1471
- let te = !1, U;
1472
- function Jn(n) {
1459
+ const fn = _(gn, "OGG_SIEGE");
1460
+ let te = !1, H;
1461
+ function Yn(n) {
1473
1462
  const { init: e = !0 } = n;
1474
- if (fn(n), te)
1475
- return U;
1463
+ if (pn(n), te)
1464
+ return H;
1476
1465
  function t() {
1477
- _n(n);
1478
- const r = /* @__PURE__ */ new Map(), s = mn(n.modules, r), i = bn(), a = En(n.keybinds), o = In(), l = wn();
1479
- pn(), vn(n, r), te = !0, U = {
1466
+ kn(n);
1467
+ const r = /* @__PURE__ */ new Map(), s = bn(n.modules, r), a = vn(), i = En(n.keybinds), o = wn(), l = _n();
1468
+ yn(), In(n, r), te = !0, H = {
1480
1469
  ...s,
1481
- ...i,
1482
- keybinds: a,
1470
+ ...a,
1471
+ keybinds: i,
1483
1472
  windows: o,
1484
1473
  input: l,
1485
1474
  hasAnyActiveProcesses: () => C.getInstance().hasAnyActiveProcesses,
1486
1475
  init: t
1487
1476
  };
1488
1477
  }
1489
- return e ? (t(), U) : new Proxy(
1478
+ return e ? (t(), H) : new Proxy(
1490
1479
  {
1491
1480
  init: t
1492
1481
  },
@@ -1494,7 +1483,7 @@ function Jn(n) {
1494
1483
  get: (r, s) => {
1495
1484
  if (s !== "init" && !te)
1496
1485
  throw new Error("overlayed was called before initialized");
1497
- return s === "init" ? r[s] : U[s];
1486
+ return s === "init" ? r[s] : H[s];
1498
1487
  }
1499
1488
  }
1500
1489
  );
@@ -1504,47 +1493,47 @@ global.OVERLAYED = new Proxy({}, {
1504
1493
  throw new Error("function overlayed was not called");
1505
1494
  }
1506
1495
  });
1507
- function fn(n) {
1496
+ function pn(n) {
1508
1497
  global.OVERLAYED = {
1509
1498
  APP_NAME: n.appName
1510
1499
  };
1511
1500
  }
1512
- function pn() {
1501
+ function yn() {
1513
1502
  Ne.getInstance().init(), B.getInstance().init(), C.getInstance().init(), T.getInstance().init(), Pe.on("quit", () => {
1514
- yn();
1503
+ mn();
1515
1504
  });
1516
1505
  }
1517
- function yn() {
1518
- T.getInstance().destroy(), B.getInstance().destroy(), Ne.getInstance().destroy(), C.getInstance().destroy(), O.getInstance().getInterface("OGG_SIEGE").destroy(), le.getInstance().destroy(), E.getInstance().destroy();
1506
+ function mn() {
1507
+ T.getInstance().destroy(), B.getInstance().destroy(), Ne.getInstance().destroy(), C.getInstance().destroy(), O.getInstance().getInterface("OGG_SIEGE").destroy(), oe.getInstance().destroy(), I.getInstance().destroy();
1519
1508
  }
1520
- function mn(n, e) {
1509
+ function bn(n, e) {
1521
1510
  return n.reduce((t, r) => {
1522
1511
  const s = r.key;
1523
1512
  return t[s] = {
1524
1513
  // prettier-ignore
1525
- on(i, a) {
1526
- const o = M(s, i), l = e.get(o) ?? /* @__PURE__ */ new Set();
1527
- l.add(a), e.set(o, l);
1514
+ on(a, i) {
1515
+ const o = M(s, a), l = e.get(o) ?? /* @__PURE__ */ new Set();
1516
+ l.add(i), e.set(o, l);
1528
1517
  },
1529
- onAny(i) {
1530
- const a = M(s, "*"), o = e.get(a) ?? /* @__PURE__ */ new Set();
1531
- o.add(i), e.set(a, o);
1518
+ onAny(a) {
1519
+ const i = M(s, "*"), o = e.get(i) ?? /* @__PURE__ */ new Set();
1520
+ o.add(a), e.set(i, o);
1532
1521
  },
1533
1522
  // prettier-ignore
1534
- off(i, a) {
1535
- const o = M(s, i), l = e.get(o) ?? /* @__PURE__ */ new Set();
1536
- l.delete(a), e.set(o, l);
1523
+ off(a, i) {
1524
+ const o = M(s, a), l = e.get(o) ?? /* @__PURE__ */ new Set();
1525
+ l.delete(i), e.set(o, l);
1537
1526
  },
1538
1527
  // prettier-ignore
1539
- offAny(i) {
1540
- const a = M(s, "*"), o = e.get(a) ?? /* @__PURE__ */ new Set();
1541
- o.delete(i), e.set(a, o);
1528
+ offAny(a) {
1529
+ const i = M(s, "*"), o = e.get(i) ?? /* @__PURE__ */ new Set();
1530
+ o.delete(a), e.set(i, o);
1542
1531
  }
1543
1532
  }, t;
1544
1533
  }, {});
1545
1534
  }
1546
- function bn() {
1547
- const n = E.getInstance(), e = B.getInstance();
1535
+ function vn() {
1536
+ const n = I.getInstance(), e = B.getInstance();
1548
1537
  return {
1549
1538
  on: (t, r) => {
1550
1539
  switch (t) {
@@ -1593,54 +1582,54 @@ function bn() {
1593
1582
  function M(n, e) {
1594
1583
  return `${n}:${e}`;
1595
1584
  }
1596
- function vn(n, e) {
1597
- const t = le.getInstance();
1585
+ function In(n, e) {
1586
+ const t = oe.getInstance();
1598
1587
  function r(s) {
1599
- const i = ht(s);
1600
- if (i instanceof K.errors) {
1601
- E.getInstance().warn("Invalid event", "INVALID_EVENT", {
1602
- summary: i.summary
1588
+ const a = dt(s);
1589
+ if (a instanceof K.errors) {
1590
+ I.getInstance().warn("Invalid event", "INVALID_EVENT", {
1591
+ summary: a.summary
1603
1592
  });
1604
1593
  return;
1605
1594
  }
1606
- const a = n.modules.find((f) => f.key === i.game), o = a == null ? void 0 : a.events.event;
1595
+ const i = n.modules.find((f) => f.key === a.game), o = i == null ? void 0 : i.events.event;
1607
1596
  if (!o)
1608
1597
  return;
1609
1598
  const l = o(s);
1610
1599
  if (l instanceof K.errors) {
1611
- E.getInstance().warn("Invalid event", "INVALID_EVENT", {
1600
+ I.getInstance().warn("Invalid event", "INVALID_EVENT", {
1612
1601
  summary: l.summary
1613
1602
  });
1614
1603
  return;
1615
1604
  }
1616
- const d = M(a.key, l.type), h = M(a.key, "*"), g = e.get(d), u = e.get(h), p = [...Array.from(g ?? []), ...Array.from(u ?? [])];
1605
+ const d = M(i.key, l.type), h = M(i.key, "*"), g = e.get(d), u = e.get(h), p = [...Array.from(g ?? []), ...Array.from(u ?? [])];
1617
1606
  p.length !== 0 && p.forEach((f) => {
1618
1607
  f(l);
1619
1608
  });
1620
1609
  }
1621
1610
  return t.on("data", (s) => s.forEach(r)), t.on("error", (s) => {
1622
- E.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
1611
+ I.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
1623
1612
  error: s
1624
1613
  });
1625
1614
  }), t;
1626
1615
  }
1627
1616
  function En(n) {
1628
- const e = new dn(n), t = {};
1617
+ const e = new hn(n), t = {};
1629
1618
  for (const s in n)
1630
1619
  t[s] = {
1631
- on: (i, a) => {
1632
- switch (i) {
1620
+ on: (a, i) => {
1621
+ switch (a) {
1633
1622
  case "down":
1634
- e.onKeybindDown(s, a);
1623
+ e.onKeybindDown(s, i);
1635
1624
  break;
1636
1625
  case "up":
1637
- e.onKeybindUp(s, a);
1626
+ e.onKeybindUp(s, i);
1638
1627
  break;
1639
1628
  case "toggle":
1640
- e.onKeybindToggled(s, a);
1629
+ e.onKeybindToggled(s, i);
1641
1630
  break;
1642
1631
  default:
1643
- throw new Error(`Event type not implemented ${i}`, { cause: [i, a] });
1632
+ throw new Error(`Event type not implemented ${a}`, { cause: [a, i] });
1644
1633
  }
1645
1634
  }
1646
1635
  };
@@ -1653,8 +1642,8 @@ function En(n) {
1653
1642
  resumeKeybindListening: () => {
1654
1643
  e.keybindListeningPaused = !1;
1655
1644
  },
1656
- updateKeybind: (s, i) => {
1657
- e.updateKeybind(s, i);
1645
+ updateKeybind: (s, a) => {
1646
+ e.updateKeybind(s, a);
1658
1647
  },
1659
1648
  updateKeybinds: (s) => {
1660
1649
  e.updateKeybinds(s);
@@ -1664,7 +1653,7 @@ function En(n) {
1664
1653
  e.destroy();
1665
1654
  }), r;
1666
1655
  }
1667
- function In() {
1656
+ function wn() {
1668
1657
  return {
1669
1658
  createWindow: (n) => y().instance.newWindowInternal(Ze.BrowserWindow, n),
1670
1659
  on: (n, e) => y().instance.on(n, e),
@@ -1676,7 +1665,7 @@ function In() {
1676
1665
  prependListener: (n, e) => y().instance.prependListener(n, e),
1677
1666
  prependOnceListener: (n, e) => y().instance.prependOnceListener(n, e),
1678
1667
  getActiveGameInfo: () => {
1679
- const n = y(), e = le.getInstance();
1668
+ const n = y(), e = oe.getInstance();
1680
1669
  return {
1681
1670
  resolution: n.resolution,
1682
1671
  isConnected: e.hasConnection
@@ -1684,9 +1673,9 @@ function In() {
1684
1673
  }
1685
1674
  };
1686
1675
  }
1687
- function wn() {
1676
+ function _n() {
1688
1677
  return {
1689
- scope: (n) => gn.getInstance().scope(n),
1678
+ scope: (n) => fn.getInstance().scope(n),
1690
1679
  raw: {
1691
1680
  setGlobalMouseBlock: (n) => y().instance.setGlobalMouseBlock(n),
1692
1681
  setGlobalKeyboardBlock: (n) => y().instance.setGlobalKeyboardBlock(n),
@@ -1699,20 +1688,20 @@ function wn() {
1699
1688
  }
1700
1689
  };
1701
1690
  }
1702
- function _n(n) {
1703
- P.getInstance().clientId = n.appName, P.getInstance().userId = Qt.generateUniqueIdentifier(), E.getInstance().on("fatal", (e) => {
1691
+ function kn(n) {
1692
+ P.getInstance().clientId = n.appName, P.getInstance().userId = Wt.generateUniqueIdentifier(), I.getInstance().on("fatal", (e) => {
1704
1693
  P.getInstance().track("fatal", {
1705
1694
  message: e.message,
1706
1695
  code: e.code,
1707
1696
  data: e.data
1708
1697
  });
1709
- }), E.getInstance().on("error", (e) => {
1698
+ }), I.getInstance().on("error", (e) => {
1710
1699
  P.getInstance().track("error", {
1711
1700
  message: e.message,
1712
1701
  code: e.code,
1713
1702
  data: e.data
1714
1703
  });
1715
- }), E.getInstance().on("warning", (e) => {
1704
+ }), I.getInstance().on("warning", (e) => {
1716
1705
  P.getInstance().track("warning", {
1717
1706
  message: e.message,
1718
1707
  code: e.code,
@@ -1724,5 +1713,5 @@ function y() {
1724
1713
  return O.getInstance().getInterface("OGG_SIEGE");
1725
1714
  }
1726
1715
  export {
1727
- Jn as overlayed
1716
+ Yn as overlayed
1728
1717
  };
@@ -10,4 +10,4 @@ export const {
10
10
  InjectionMethod,
11
11
  AccessLevel,
12
12
  HardwareInterface,
13
- } = require("./build/overlayed_native_interface_x64.node");
13
+ } = require("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module";
2
2
 
3
3
  const require = createRequire(import.meta.url);
4
- export const { RenderInterface, renderHookPath } = require("./build/overlayed_render_interface_x64.node");
4
+ export const { RenderInterface, renderHookPath } = require("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@overlayed/app",
3
3
  "author": "overlayed.gg",
4
4
  "homepage": "https://overlayed.gg",
5
- "version": "0.4.0",
5
+ "version": "0.4.2",
6
6
  "description": "Overlayed app",
7
7
  "license": "BSD-3-Clause",
8
8
  "repository": {
@@ -26,7 +26,9 @@
26
26
  "types": "./dist/siege.d.ts",
27
27
  "import": "./dist/siege.js",
28
28
  "default": "./dist/siege.js"
29
- }
29
+ },
30
+ "./dist/render-interface/build/*": "./dist/render-interface/build/*",
31
+ "./dist/native-interface/build/*": "./dist/native-interface/build/*"
30
32
  },
31
33
  "files": [
32
34
  "dist/**/*"
@@ -44,15 +46,15 @@
44
46
  },
45
47
  "devDependencies": {
46
48
  "@ark/attest": "^0.45.0",
47
- "@overlayed-gg/native-interface": "0.1.6",
48
- "@overlayed-gg/render-interface": "0.1.6",
49
+ "@overlayed-gg/native-interface": "0.1.7",
50
+ "@overlayed-gg/render-interface": "0.1.7",
49
51
  "rollup-plugin-node-externals": "^8.0.0",
50
52
  "typescript": "^5.8.2",
51
53
  "vite": "^6.2.6",
52
54
  "vite-plugin-dts": "^4.5.3",
53
55
  "vite-plugin-static-copy": "^2.3.1",
54
56
  "vitest": "^3.0.9",
55
- "@overlayed/api": "0.0.2",
57
+ "@overlayed/api": "0.0.3",
56
58
  "@overlayed/cortex-client": "0.0.2",
57
59
  "@overlayed/events": "0.0.2",
58
60
  "@overlayed/native-managers": "0.0.2",