@overlayed/app 0.8.2 → 0.8.4

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.d.ts CHANGED
@@ -386,6 +386,10 @@ declare interface OverlayedOptions<TModule extends GameModule, TKeybind extends
386
386
  * @default false
387
387
  */
388
388
  universal?: boolean;
389
+ /**
390
+ * @deprecated
391
+ */
392
+ channel?: string;
389
393
  }
390
394
 
391
395
  declare class OverridesManager extends Manager {
@@ -754,3 +758,12 @@ export interface WindowEvent {
754
758
  }
755
759
 
756
760
  export { }
761
+
762
+ declare global {
763
+ namespace Electron {
764
+ interface BrowserWindow {
765
+ isShown(): boolean;
766
+ }
767
+ }
768
+ }
769
+
package/dist/index.js CHANGED
@@ -2,14 +2,14 @@ var it = Object.defineProperty;
2
2
  var at = (s, e, t) => e in s ? it(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var l = (s, e, t) => at(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { type as L } from "arktype";
5
- import _, { mkdirSync as ge, existsSync as fe, writeFileSync as pe, createWriteStream as Oe, readdirSync as Re, unlinkSync as xe, readFileSync as Te, copyFileSync as ot } from "node:fs";
6
- import y, { join as A, resolve as lt } from "node:path";
5
+ import S, { mkdirSync as ge, existsSync as fe, writeFileSync as pe, createWriteStream as Oe, readdirSync as Re, unlinkSync as xe, readFileSync as Te, copyFileSync as ot } from "node:fs";
6
+ import y, { join as $, resolve as lt } from "node:path";
7
7
  import { createRequire as te } from "node:module";
8
8
  import E from "node:fs/promises";
9
- import Ge from "jszip";
9
+ import Ne from "jszip";
10
10
  import { createHash as ct } from "node:crypto";
11
11
  import ht from "node:events";
12
- import ut, { app as Ne } from "electron";
12
+ import ut, { app as Ge } from "electron";
13
13
  var dt = Object.defineProperty, gt = (s, e, t) => e in s ? dt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, b = (s, e, t) => gt(s, typeof e != "symbol" ? e + "" : e, t);
14
14
  function ft(s) {
15
15
  return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
@@ -132,7 +132,7 @@ let yt = class Be extends ye {
132
132
  }
133
133
  }
134
134
  ensureLogFile() {
135
- const e = A(this.logPath, this.getFileName(this.currentDate));
135
+ const e = $(this.logPath, this.getFileName(this.currentDate));
136
136
  if (!fe(e))
137
137
  try {
138
138
  pe(e, "", "utf8");
@@ -144,7 +144,7 @@ let yt = class Be extends ye {
144
144
  return e.toISOString().split("T")[0];
145
145
  }
146
146
  createStream() {
147
- const e = A(this.logPath, this.getFileName(this.currentDate));
147
+ const e = $(this.logPath, this.getFileName(this.currentDate));
148
148
  return Oe(e, {
149
149
  flags: "a",
150
150
  encoding: "utf8"
@@ -170,7 +170,7 @@ let yt = class Be extends ye {
170
170
  return new Date(n) < t;
171
171
  }).forEach((r) => {
172
172
  try {
173
- xe(A(this.logPath, r));
173
+ xe($(this.logPath, r));
174
174
  } catch (n) {
175
175
  console.error(`Failed to delete old log file ${r}:`, n);
176
176
  }
@@ -272,15 +272,15 @@ let wt = class {
272
272
  me(Et);
273
273
  const It = te(import.meta.url), {
274
274
  PipeEventServer: kt,
275
- PipeEventClient: cs,
276
- PipeEventBase: hs,
277
- ProcessMonitor: us,
278
- Process: ds,
279
- InjectionMethod: gs,
280
- AccessLevel: fs,
281
- HardwareInterface: ps
275
+ PipeEventClient: ls,
276
+ PipeEventBase: cs,
277
+ ProcessMonitor: hs,
278
+ Process: us,
279
+ InjectionMethod: ds,
280
+ AccessLevel: gs,
281
+ HardwareInterface: fs
282
282
  } = It("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
283
- let St = class extends ye {
283
+ let _t = class extends ye {
284
284
  constructor(e) {
285
285
  super(), b(this, "server", null), b(this, "_hasConnection", !1), b(this, "pipeId"), this.pipeId = e, this.init();
286
286
  }
@@ -308,8 +308,8 @@ let St = class extends ye {
308
308
  });
309
309
  }
310
310
  };
311
- const be = me(St, "stats-cc");
312
- function _t(s) {
311
+ const be = me(_t, "stats-cc");
312
+ function St(s) {
313
313
  return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
314
314
  var r = s.get(e);
315
315
  r ? r.push(t) : s.set(e, [t]);
@@ -328,7 +328,7 @@ function _t(s) {
328
328
  class ve {
329
329
  constructor() {
330
330
  l(this, "emitter");
331
- this.emitter = _t();
331
+ this.emitter = St();
332
332
  }
333
333
  on(e, t) {
334
334
  this.emitter.on(e, t);
@@ -449,7 +449,7 @@ class Lt {
449
449
  save(e) {
450
450
  const t = this.onBeforeSave(e);
451
451
  try {
452
- _.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
452
+ S.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
453
453
  } catch {
454
454
  return;
455
455
  }
@@ -462,7 +462,7 @@ class Lt {
462
462
  return this.data = e, e;
463
463
  }
464
464
  try {
465
- const e = _.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
465
+ const e = S.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
466
466
  return this.data = t, t;
467
467
  } catch {
468
468
  return this.data = this._defaultValue;
@@ -492,14 +492,14 @@ class Lt {
492
492
  }
493
493
  canReadWriteFile(e) {
494
494
  try {
495
- return _.accessSync(e, _.constants.R_OK | _.constants.W_OK), !0;
495
+ return S.accessSync(e, S.constants.R_OK | S.constants.W_OK), !0;
496
496
  } catch {
497
497
  return !1;
498
498
  }
499
499
  }
500
500
  fileExists(e) {
501
501
  try {
502
- return _.accessSync(e, _.constants.F_OK), !0;
502
+ return S.accessSync(e, S.constants.F_OK), !0;
503
503
  } catch {
504
504
  return !1;
505
505
  }
@@ -566,7 +566,7 @@ class we extends ve {
566
566
  }
567
567
  }
568
568
  ensureLogFile() {
569
- const t = A(this.logPath, this.getFileName(this.currentDate));
569
+ const t = $(this.logPath, this.getFileName(this.currentDate));
570
570
  if (!fe(t))
571
571
  try {
572
572
  pe(t, "", "utf8");
@@ -578,7 +578,7 @@ class we extends ve {
578
578
  return t.toISOString().split("T")[0];
579
579
  }
580
580
  createStream() {
581
- const t = A(this.logPath, this.getFileName(this.currentDate));
581
+ const t = $(this.logPath, this.getFileName(this.currentDate));
582
582
  return Oe(t, {
583
583
  flags: "a",
584
584
  encoding: "utf8"
@@ -604,7 +604,7 @@ class we extends ve {
604
604
  return new Date(a) < r;
605
605
  }).forEach((n) => {
606
606
  try {
607
- xe(A(this.logPath, n));
607
+ xe($(this.logPath, n));
608
608
  } catch (a) {
609
609
  console.error(`Failed to delete old log file ${n}:`, a);
610
610
  }
@@ -715,7 +715,7 @@ function Mt(s) {
715
715
  function Dt(s) {
716
716
  return Mt;
717
717
  }
718
- class $t extends ht {
718
+ class At extends ht {
719
719
  constructor(t, r) {
720
720
  super();
721
721
  l(this, "blob");
@@ -783,7 +783,7 @@ class se extends ve {
783
783
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
784
784
  }
785
785
  }
786
- class At extends Pt {
786
+ class $t extends Pt {
787
787
  constructor(t) {
788
788
  super();
789
789
  l(this, "logger");
@@ -797,8 +797,8 @@ class At extends Pt {
797
797
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
798
798
  }
799
799
  }
800
- var R = "object", Ue = "function", He = "prototype", ae = "text", Ie = "json", Le = "abort", oe = "paramsSerializer", Ke = "addEventListener", z = "status", S = "headers", ne = Object, K = void 0, X = null, le = ne[He], Y = ne.keys, G = Array.isArray, Fe = "method", We = "HEAD", ce = "GET", Qe = "OPTIONS", Ot = "POST", Rt = "PUT", xt = "PATCH", Tt = "DELETE";
801
- function Gt(s, e) {
800
+ var R = "object", Ue = "function", He = "prototype", ae = "text", Ie = "json", Le = "abort", oe = "paramsSerializer", Ke = "addEventListener", z = "status", _ = "headers", ne = Object, K = void 0, X = null, le = ne[He], Y = ne.keys, N = Array.isArray, Fe = "method", We = "HEAD", ce = "GET", Qe = "OPTIONS", Ot = "POST", Rt = "PUT", xt = "PATCH", Tt = "DELETE";
801
+ function Nt(s, e) {
802
802
  let t = new AbortController();
803
803
  function r(i) {
804
804
  t.abort(i), a();
@@ -835,14 +835,14 @@ var Me = ne.getPrototypeOf, De = (s) => {
835
835
  }
836
836
  return !1;
837
837
  }, ke = (...s) => s.reduce((e, t) => {
838
- if (G(t)) throw new TypeError(`Arguments must be ${R}s, not arrays.`);
838
+ if (N(t)) throw new TypeError(`Arguments must be ${R}s, not arrays.`);
839
839
  return Y(t).forEach((r) => {
840
- ["__proto__", "constructor", He].includes(r) || (G(e[r]) && G(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : De(e[r]) && De(t[r]) ? e[r] = ke(e[r], t[r]) : e[r] = t[r]);
840
+ ["__proto__", "constructor", He].includes(r) || (N(e[r]) && N(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : De(e[r]) && De(t[r]) ? e[r] = ke(e[r], t[r]) : e[r] = t[r]);
841
841
  }), e;
842
842
  }, {});
843
- function Se(s, e = !0, t = X, r) {
843
+ function _e(s, e = !0, t = X, r) {
844
844
  if (s === K || s === X) return "";
845
- let n = [], a = e ? encodeURIComponent : (p) => p, o = G(s), { arrayFormat: i, allowDots: c, serializeDate: u } = r || {}, d = (p) => {
845
+ let n = [], a = e ? encodeURIComponent : (p) => p, o = N(s), { arrayFormat: i, allowDots: c, serializeDate: u } = r || {}, d = (p) => {
846
846
  if (c && !o) return `.${p}`;
847
847
  if (o) {
848
848
  if (i === "brackets") return "[]";
@@ -855,7 +855,7 @@ function Se(s, e = !0, t = X, r) {
855
855
  if (g !== K) {
856
856
  let h = t ? `${t}${d(p)}` : a(p);
857
857
  if (!isNaN(g) && g instanceof Date && (g = u ? u(g) : g.toISOString()), typeof g === R) {
858
- let f = Se(g, e, h, r);
858
+ let f = _e(g, e, h, r);
859
859
  f !== "" && n.push(f);
860
860
  } else n.push(`${a(h)}=${a(g)}`);
861
861
  }
@@ -863,12 +863,12 @@ function Se(s, e = !0, t = X, r) {
863
863
  return n.join("&");
864
864
  }
865
865
  function he(s) {
866
- return G(s) ? s.map(he) : (s && typeof s === R && Y(s).forEach((e) => {
866
+ return N(s) ? s.map(he) : (s && typeof s === R && Y(s).forEach((e) => {
867
867
  let t = s[e];
868
868
  t === K ? delete s[e] : he(t);
869
869
  }), s);
870
870
  }
871
- function Nt(s) {
871
+ function Gt(s) {
872
872
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
873
873
  }
874
874
  function Bt(s, e) {
@@ -882,9 +882,9 @@ var jt = "XiorError", zt = "XiorTimeoutError", qe = class extends Error {
882
882
  constructor(e, t, r) {
883
883
  super(e, t, r), this.name = zt;
884
884
  }
885
- }, Ut = Object.defineProperty, Ht = Object.defineProperties, Wt = Object.getOwnPropertyDescriptors, Z = Object.getOwnPropertySymbols, Je = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable, $e = (s, e, t) => e in s ? Ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, N = (s, e) => {
886
- for (var t in e || (e = {})) Je.call(e, t) && $e(s, t, e[t]);
887
- if (Z) for (var t of Z(e)) Xe.call(e, t) && $e(s, t, e[t]);
885
+ }, Ut = Object.defineProperty, Ht = Object.defineProperties, Wt = Object.getOwnPropertyDescriptors, Z = Object.getOwnPropertySymbols, Je = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable, Ae = (s, e, t) => e in s ? Ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, G = (s, e) => {
886
+ for (var t in e || (e = {})) Je.call(e, t) && Ae(s, t, e[t]);
887
+ if (Z) for (var t of Z(e)) Xe.call(e, t) && Ae(s, t, e[t]);
888
888
  return s;
889
889
  }, Q = (s, e) => Ht(s, Wt(e)), Qt = (s, e) => {
890
890
  var t = {};
@@ -906,19 +906,19 @@ var jt = "XiorError", zt = "XiorTimeoutError", qe = class extends Error {
906
906
  }
907
907
  }, i = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(a, o);
908
908
  i((t = t.apply(s, e)).next());
909
- }), _e = "application/", Ye = `${_e}x-www-form-urlencoded`, Ze = RegExp, qt = new Ze(`^${Ye}`, "i"), Jt = `${_e}${Ie}`, Xt = new Ze(`^${_e}.*${Ie}.*`, "i");
909
+ }), Se = "application/", Ye = `${Se}x-www-form-urlencoded`, Ze = RegExp, qt = new Ze(`^${Ye}`, "i"), Jt = `${Se}${Ie}`, Xt = new Ze(`^${Se}.*${Ie}.*`, "i");
910
910
  function Yt(s = ce) {
911
911
  return [We, ce, Qe].includes(s);
912
912
  }
913
913
  var Zt = typeof URLSearchParams != `${K}`;
914
914
  function er(s) {
915
915
  return B(this, null, function* () {
916
- let e = s[oe] || Se, t = s.encodeURI !== !1, r = s[Fe] && s[Fe].toUpperCase(), n = s.url, a = n, o = Zt && s.data instanceof URLSearchParams, i = o ? ne.fromEntries(s.data.entries()) : s.data, c = i, u = s != null && s[S] ? N({}, s[S]) : {}, d = s.params, p = Yt(r);
916
+ let e = s[oe] || _e, t = s.encodeURI !== !1, r = s[Fe] && s[Fe].toUpperCase(), n = s.url, a = n, o = Zt && s.data instanceof URLSearchParams, i = o ? ne.fromEntries(s.data.entries()) : s.data, c = i, u = s != null && s[_] ? G({}, s[_]) : {}, d = s.params, p = Yt(r);
917
917
  if (i && typeof i.append !== Ue) {
918
918
  let g = "", h = "content-type";
919
- if (s != null && s[S]) {
920
- let f = Y(s[S]).find((w) => w.toLowerCase() === h);
921
- f && (h = f, g = s[S][f]);
919
+ if (s != null && s[_]) {
920
+ let f = Y(s[_]).find((w) => w.toLowerCase() === h);
921
+ f && (h = f, g = s[_][f]);
922
922
  }
923
923
  (!g || o) && (g = p || o ? Ye : Jt, u[h] = g), typeof i === R && (p && d && (d = ke(i, d)), Xt.test(g) ? c = JSON.stringify(he(i)) : !p && qt.test(g) && (c = e(i)));
924
924
  }
@@ -926,7 +926,7 @@ function er(s) {
926
926
  let g = e(d, t);
927
927
  n += n.includes("?") ? `&${g}` : `?${g}`;
928
928
  }
929
- return Q(N({}, s), { _data: c, _url: n, data: i, url: a, method: r, [S]: u, isGet: p });
929
+ return Q(G({}, s), { _data: c, _url: n, data: i, url: a, method: r, [_]: u, isGet: p });
930
930
  });
931
931
  }
932
932
  var tr = typeof AbortController != `${K}`;
@@ -947,7 +947,7 @@ function rr(s, e) {
947
947
  }
948
948
  var sr = (s) => new O(s), O = class {
949
949
  constructor(e) {
950
- this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [S]: {} };
950
+ this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [_]: {} };
951
951
  }
952
952
  get interceptors() {
953
953
  return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
@@ -970,7 +970,7 @@ var sr = (s) => new O(s), O = class {
970
970
  request(e) {
971
971
  return B(this, null, function* () {
972
972
  let t = ke(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
973
- t.withCredentials && !t[r] && (t[r] = "include"), t[oe] || (t[oe] = Se);
973
+ t.withCredentials && !t[r] && (t[r] = "include"), t[oe] || (t[oe] = _e);
974
974
  for (let o of this.REQI) t = yield o(t);
975
975
  let n = this._.bind(this);
976
976
  this.P.forEach((o) => {
@@ -997,12 +997,12 @@ var sr = (s) => new O(s), O = class {
997
997
  v.abort(new Vt(`timeout of ${o}ms exceeded`, e));
998
998
  }, o), w.push(v.signal);
999
999
  }
1000
- i && w.push(i), f = w[0], w.length > 1 && (f = Gt(w, () => {
1000
+ i && w.push(i), f = w[0], w.length > 1 && (f = Nt(w, () => {
1001
1001
  clearTimeout(F);
1002
1002
  }));
1003
1003
  let M = d || r, D = "baseURL";
1004
- return e[D] && !Nt(M) && (M = Bt(e[D], M)), (g || fetch)(M, Q(N({ body: p ? K : u }, h), { signal: f, method: n, headers: a })).then((v) => B(this, null, function* () {
1005
- let { responseType: st } = e, Ce = { data: yield rr(v, st), response: v, config: e, request: e, [z]: v[z], statusText: v.statusText, [S]: v[S] };
1004
+ return e[D] && !Gt(M) && (M = Bt(e[D], M)), (g || fetch)(M, Q(G({ body: p ? K : u }, h), { signal: f, method: n, headers: a })).then((v) => B(this, null, function* () {
1005
+ let { responseType: st } = e, Ce = { data: yield rr(v, st), response: v, config: e, request: e, [z]: v[z], statusText: v.statusText, [_]: v[_] };
1006
1006
  if (!v.ok) {
1007
1007
  let nt = new qe(v[z] ? `Request failed with status code ${v[z]}` : "Network error", e, Ce);
1008
1008
  return Promise.reject(nt);
@@ -1015,10 +1015,10 @@ var sr = (s) => new O(s), O = class {
1015
1015
  });
1016
1016
  }
1017
1017
  cG(e) {
1018
- return (t, r) => this.request(r ? Q(N({}, r), { method: e, url: t }) : { method: e, url: t });
1018
+ return (t, r) => this.request(r ? Q(G({}, r), { method: e, url: t }) : { method: e, url: t });
1019
1019
  }
1020
1020
  cP(e) {
1021
- return (t, r, n) => this.request(n ? Q(N({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1021
+ return (t, r, n) => this.request(n ? Q(G({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1022
1022
  }
1023
1023
  get(e, t) {
1024
1024
  return this.cG(ce)(e, t);
@@ -1052,11 +1052,11 @@ const Pe = et.create({
1052
1052
  }
1053
1053
  });
1054
1054
  let ue;
1055
- function vs(s) {
1055
+ function bs(s) {
1056
1056
  ue = s;
1057
1057
  }
1058
1058
  const ie = et.create({
1059
- baseURL: "https://api-dev.overlayed.gg",
1059
+ baseURL: "https://api.overlayed.gg",
1060
1060
  headers: {
1061
1061
  Accept: "application/json",
1062
1062
  "Accept-Encoding": "gzip, deflate, br"
@@ -1105,14 +1105,11 @@ function dr(s) {
1105
1105
  function gr(s) {
1106
1106
  return !!(s && "kind" in s.data && "message" in s.data);
1107
1107
  }
1108
- const fr = {
1109
- buildChannel: "alpha"
1110
- };
1111
1108
  let q;
1112
- function ws(s) {
1109
+ function vs(s) {
1113
1110
  q = s;
1114
1111
  }
1115
- class pr extends se {
1112
+ class fr extends se {
1116
1113
  constructor() {
1117
1114
  super("NativeModuleManager");
1118
1115
  l(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
@@ -1142,8 +1139,12 @@ class pr extends se {
1142
1139
  return y.join(this.getTargetPath(t), r);
1143
1140
  }
1144
1141
  async checkForUpdates(t) {
1145
- const r = fr.buildChannel;
1146
- this.logger.log("Checking for updates"), await (q == null ? void 0 : q());
1142
+ const r = global.OVERLAYED.APP_BUILD_CHANNEL;
1143
+ if (this.logger.log("Checking for updates"), !r) {
1144
+ this.logger.sentryError("Invalid VITE_BUILD_CHANNEL");
1145
+ return;
1146
+ }
1147
+ await (q == null ? void 0 : q());
1147
1148
  for (const n of t)
1148
1149
  try {
1149
1150
  const { data: a } = await ir(n, r), o = await this.getCurrentVersion(n);
@@ -1157,7 +1158,7 @@ class pr extends se {
1157
1158
  async downloadAndExtractDll(t, r, n, a) {
1158
1159
  const { data: o } = await ar(t, n), i = this.getTargetPath(t), c = this.getTargetVersionPath(t, r);
1159
1160
  await E.mkdir(c, { recursive: !0 });
1160
- const u = new Ge();
1161
+ const u = new Ne();
1161
1162
  await u.loadAsync(o);
1162
1163
  const d = Object.keys(u.files).map(async (g) => {
1163
1164
  const h = u.files[g];
@@ -1184,8 +1185,8 @@ class pr extends se {
1184
1185
  o.isDirectory() && o.name !== r && await E.rm(y.join(n, o.name), { recursive: !0, force: !0 });
1185
1186
  }
1186
1187
  }
1187
- const ee = k(pr);
1188
- class yr extends se {
1188
+ const ee = k(fr);
1189
+ class pr extends se {
1189
1190
  constructor() {
1190
1191
  super("RavenManager");
1191
1192
  l(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
@@ -1244,23 +1245,23 @@ class yr extends se {
1244
1245
  this._executableToGameMap.clear(), this._executablesArray = [];
1245
1246
  }
1246
1247
  }
1247
- const j = k(yr), mr = te(import.meta.url), {
1248
- PipeEventServer: Es,
1249
- PipeEventClient: Is,
1250
- PipeEventBase: ks,
1251
- ProcessMonitor: br,
1248
+ const j = k(pr), yr = te(import.meta.url), {
1249
+ PipeEventServer: ws,
1250
+ PipeEventClient: Es,
1251
+ PipeEventBase: Is,
1252
+ ProcessMonitor: mr,
1252
1253
  Process: V,
1253
- InjectionMethod: Ss,
1254
+ InjectionMethod: ks,
1254
1255
  AccessLevel: _s,
1255
- HardwareInterface: vr
1256
- } = mr("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1257
- class wr extends se {
1256
+ HardwareInterface: br
1257
+ } = yr("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1258
+ class vr extends se {
1258
1259
  constructor() {
1259
1260
  super("ProcessManager");
1260
1261
  l(this, "_processMonitor");
1261
1262
  l(this, "_processes", /* @__PURE__ */ new Map());
1262
1263
  l(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
1263
- this._processMonitor = new br();
1264
+ this._processMonitor = new mr();
1264
1265
  }
1265
1266
  get hasAnyActiveProcesses() {
1266
1267
  return this.activeProcesses.length > 0;
@@ -1304,8 +1305,8 @@ class wr extends se {
1304
1305
  n.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, n);
1305
1306
  }
1306
1307
  }
1307
- const C = k(wr), Er = te(import.meta.url), { RenderInterface: Ir, renderHookPath: Ps } = Er("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1308
- var kr = Object.defineProperty, Sr = (s, e, t) => e in s ? kr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, J = (s, e, t) => Sr(s, typeof e != "symbol" ? e + "" : e, t);
1308
+ const C = k(vr), wr = te(import.meta.url), { RenderInterface: Er, renderHookPath: Ss } = wr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1309
+ var Ir = Object.defineProperty, kr = (s, e, t) => e in s ? Ir(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, J = (s, e, t) => kr(s, typeof e != "symbol" ? e + "" : e, t);
1309
1310
  let _r = class {
1310
1311
  constructor(e) {
1311
1312
  J(this, "_instance"), J(this, "_resolution"), J(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
@@ -1323,20 +1324,20 @@ let _r = class {
1323
1324
  this._resolution = { width: e, height: t };
1324
1325
  }
1325
1326
  };
1326
- class Pr {
1327
+ class Sr {
1327
1328
  constructor() {
1328
1329
  J(this, "interfaces", {});
1329
1330
  }
1330
1331
  createInterface(e) {
1331
- return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new _r(new Ir(e, { access: 1 })), this.interfaces[e]);
1332
+ return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new _r(new Er(e, { access: 1 })), this.interfaces[e]);
1332
1333
  }
1333
1334
  getInterface(e) {
1334
1335
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
1335
1336
  }
1336
1337
  }
1337
- const x = k(Pr);
1338
- var Cr = Object.defineProperty, Lr = (s, e, t) => e in s ? Cr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e, t) => Lr(s, typeof e != "symbol" ? e + "" : e, t);
1339
- class Kr {
1338
+ const x = k(Sr);
1339
+ var Pr = Object.defineProperty, Cr = (s, e, t) => e in s ? Pr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e, t) => Cr(s, typeof e != "symbol" ? e + "" : e, t);
1340
+ class Lr {
1340
1341
  constructor(e) {
1341
1342
  U(this, "_clientId", null), U(this, "_userId", null), U(this, "options"), U(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new ze(), this.setupFlushInterval();
1342
1343
  }
@@ -1363,8 +1364,8 @@ class Kr {
1363
1364
  };
1364
1365
  }
1365
1366
  }
1366
- const P = k(Kr), Fr = te(import.meta.url), Mr = Fr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1367
- class Dr extends At {
1367
+ const P = k(Lr), Kr = te(import.meta.url), Fr = Kr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1368
+ class Mr extends $t {
1368
1369
  constructor() {
1369
1370
  super("GameLaunchManager");
1370
1371
  l(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
@@ -1403,7 +1404,7 @@ class Dr extends At {
1403
1404
  });
1404
1405
  return;
1405
1406
  }
1406
- const a = this.copyDll(Mr);
1407
+ const a = this.copyDll(Fr);
1407
1408
  if (a)
1408
1409
  try {
1409
1410
  await t.injectDll(a), this.logger.log("Render Interface Injection Successful", a);
@@ -1477,8 +1478,8 @@ class Dr extends At {
1477
1478
  return r;
1478
1479
  }
1479
1480
  }
1480
- const T = k(Dr);
1481
- class $r extends Ve {
1481
+ const T = k(Mr);
1482
+ class Dr extends Ve {
1482
1483
  constructor() {
1483
1484
  super("GameBuildManager");
1484
1485
  l(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
@@ -1512,12 +1513,12 @@ class $r extends Ve {
1512
1513
  this.logger.log("Build hash already exists, skipping upload");
1513
1514
  return;
1514
1515
  }
1515
- const c = new Ge();
1516
+ const c = new Ne();
1516
1517
  c.file(n.name, a);
1517
1518
  const u = await c.generateAsync({ type: "blob" });
1518
1519
  try {
1519
1520
  this.logger.log("Uploading build (size: ", u.size, " bytes)");
1520
- const d = new $t(u, {
1521
+ const d = new At(u, {
1521
1522
  chunkSizeMb: 25,
1522
1523
  maxConcurrent: 1
1523
1524
  }), p = await hr(r.identifier, {
@@ -1538,11 +1539,11 @@ class $r extends Ve {
1538
1539
  }
1539
1540
  }
1540
1541
  }
1541
- const rt = k($r);
1542
+ const rt = k(Dr);
1542
1543
  function Ar(s = []) {
1543
1544
  return y.normalize(y.join(je(global.OVERLAYED.APP_NAME), ...s));
1544
1545
  }
1545
- const Or = L({
1546
+ const $r = L({
1546
1547
  game: "string",
1547
1548
  type: "string",
1548
1549
  creation_time: "number"
@@ -1739,13 +1740,13 @@ const Or = L({
1739
1740
  [252, "Noname"],
1740
1741
  [253, "PA1"],
1741
1742
  [254, "OEM_Clear"]
1742
- ]), Ae = new Map(de.entries().map(([s, e]) => [e, s])), Rr = L({
1743
+ ]), $e = new Map(de.entries().map(([s, e]) => [e, s])), Or = L({
1743
1744
  "[string]": {
1744
1745
  keys: "string[]",
1745
1746
  mode: L("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1746
1747
  }
1747
1748
  });
1748
- class xr extends se {
1749
+ class Rr extends se {
1749
1750
  constructor(t) {
1750
1751
  super("KeybindManager");
1751
1752
  l(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
@@ -1760,7 +1761,7 @@ class xr extends se {
1760
1761
  l(this, "keybindListeningPaused", !1);
1761
1762
  this.keybindsFile = new Lt({
1762
1763
  path: Ar(["keybinds.json"]),
1763
- schema: Rr,
1764
+ schema: Or,
1764
1765
  default: t
1765
1766
  });
1766
1767
  }
@@ -1840,14 +1841,14 @@ class xr extends se {
1840
1841
  const t = this.keybindsFile.get();
1841
1842
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1842
1843
  const a = t[r];
1843
- if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => Ae.has(i) ? this.pressedKeys.has(i) : !1)) {
1844
+ if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => $e.has(i) ? this.pressedKeys.has(i) : !1)) {
1844
1845
  this.triggerKeybind(a, n, r);
1845
1846
  return;
1846
1847
  }
1847
1848
  }
1848
1849
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1849
1850
  const a = t[r];
1850
- a.keys.every((i) => Ae.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, n, r);
1851
+ a.keys.every((i) => $e.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, n, r);
1851
1852
  }
1852
1853
  }
1853
1854
  triggerKeybind(t, r, n) {
@@ -1868,7 +1869,7 @@ class xr extends se {
1868
1869
  return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
1869
1870
  }
1870
1871
  }
1871
- class Tr extends Ve {
1872
+ class xr extends Ve {
1872
1873
  constructor(t) {
1873
1874
  super("OverridesManager");
1874
1875
  l(this, "renderInterface");
@@ -1899,16 +1900,16 @@ class Tr extends Ve {
1899
1900
  this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), n ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), n && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !n && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
1900
1901
  }
1901
1902
  }
1902
- const Gr = k(Tr, "OGG_SIEGE");
1903
+ const Tr = k(xr, "OGG_SIEGE");
1903
1904
  let H = !1, W;
1904
- function Ls(s) {
1905
+ function Cs(s) {
1905
1906
  const { init: e = !0 } = s;
1906
1907
  if (Nr(s), re.getInstance().init(s.appName), H)
1907
1908
  return W;
1908
1909
  function t() {
1909
- qr(s);
1910
- const r = /* @__PURE__ */ new Map(), n = zr(s.modules, r), a = Vr(), o = Hr(s.keybinds), i = Wr(), c = Qr();
1911
- Br(s), Ur(s, r), H = !0, W = {
1910
+ Qr(s);
1911
+ const r = /* @__PURE__ */ new Map(), n = jr(s.modules, r), a = zr(), o = Ur(s.keybinds), i = Hr(), c = Wr();
1912
+ Gr(s), Vr(s, r), H = !0, W = {
1912
1913
  ...n,
1913
1914
  ...a,
1914
1915
  keybinds: o,
@@ -1939,45 +1940,46 @@ global.OVERLAYED = new Proxy({}, {
1939
1940
  });
1940
1941
  function Nr(s) {
1941
1942
  global.OVERLAYED = {
1942
- APP_NAME: s.appName
1943
+ APP_NAME: s.appName,
1944
+ APP_BUILD_CHANNEL: s.channel ?? "alpha"
1943
1945
  };
1944
1946
  }
1945
- function Br(s) {
1947
+ function Gr(s) {
1946
1948
  const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
1947
- T.getInstance().setSubscribedGames(e), rt.getInstance().init(), T.getInstance().init(), C.getInstance().init(), j.getInstance().init(), Ne.on("quit", () => {
1948
- jr();
1949
+ T.getInstance().setSubscribedGames(e), rt.getInstance().init(), T.getInstance().init(), C.getInstance().init(), j.getInstance().init(), Ge.on("quit", () => {
1950
+ Br();
1949
1951
  });
1950
1952
  }
1951
- function jr() {
1953
+ function Br() {
1952
1954
  j.getInstance().destroy(), T.getInstance().destroy(), rt.getInstance().destroy(), C.getInstance().destroy(), x.getInstance().getInterface("OGG_SIEGE").destroy(), be.getInstance().destroy(), I.getInstance().destroy();
1953
1955
  }
1954
- function zr(s, e) {
1956
+ function jr(s, e) {
1955
1957
  return s.reduce((t, r) => {
1956
1958
  const n = r.key;
1957
1959
  return t[n] = {
1958
1960
  // prettier-ignore
1959
1961
  on(a, o) {
1960
- const i = $(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
1962
+ const i = A(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
1961
1963
  c.add(o), e.set(i, c);
1962
1964
  },
1963
1965
  onAny(a) {
1964
- const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
1966
+ const o = A(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
1965
1967
  i.add(a), e.set(o, i);
1966
1968
  },
1967
1969
  // prettier-ignore
1968
1970
  off(a, o) {
1969
- const i = $(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
1971
+ const i = A(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
1970
1972
  c.delete(o), e.set(i, c);
1971
1973
  },
1972
1974
  // prettier-ignore
1973
1975
  offAny(a) {
1974
- const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
1976
+ const o = A(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
1975
1977
  i.delete(a), e.set(o, i);
1976
1978
  }
1977
1979
  }, t;
1978
1980
  }, {});
1979
1981
  }
1980
- function Vr() {
1982
+ function zr() {
1981
1983
  const s = I.getInstance(), e = T.getInstance();
1982
1984
  return {
1983
1985
  on: (t, r) => {
@@ -2030,13 +2032,13 @@ function Vr() {
2030
2032
  }
2031
2033
  };
2032
2034
  }
2033
- function $(s, e) {
2035
+ function A(s, e) {
2034
2036
  return `${s}:${e}`;
2035
2037
  }
2036
- function Ur(s, e) {
2038
+ function Vr(s, e) {
2037
2039
  const t = be.getInstance();
2038
2040
  function r(n) {
2039
- const a = Or(n);
2041
+ const a = $r(n);
2040
2042
  if (a instanceof L.errors) {
2041
2043
  I.getInstance().warn("Invalid event", "INVALID_EVENT", {
2042
2044
  summary: a.summary
@@ -2053,7 +2055,7 @@ function Ur(s, e) {
2053
2055
  });
2054
2056
  return;
2055
2057
  }
2056
- const u = $(o.key, c.type), d = $(o.key, "*"), p = e.get(u), g = e.get(d), h = [...Array.from(p ?? []), ...Array.from(g ?? [])];
2058
+ const u = A(o.key, c.type), d = A(o.key, "*"), p = e.get(u), g = e.get(d), h = [...Array.from(p ?? []), ...Array.from(g ?? [])];
2057
2059
  h.length !== 0 && h.forEach((f) => {
2058
2060
  f(c);
2059
2061
  });
@@ -2064,8 +2066,8 @@ function Ur(s, e) {
2064
2066
  });
2065
2067
  }), t;
2066
2068
  }
2067
- function Hr(s) {
2068
- const e = new xr(s), t = {};
2069
+ function Ur(s) {
2070
+ const e = new Rr(s), t = {};
2069
2071
  for (const n in s)
2070
2072
  t[n] = {
2071
2073
  on: (a, o) => {
@@ -2100,11 +2102,11 @@ function Hr(s) {
2100
2102
  e.updateKeybinds(n);
2101
2103
  }
2102
2104
  };
2103
- return e.init(), Ne.on("quit", () => {
2105
+ return e.init(), Ge.on("quit", () => {
2104
2106
  e.destroy();
2105
2107
  }), r;
2106
2108
  }
2107
- function Wr() {
2109
+ function Hr() {
2108
2110
  return {
2109
2111
  createWindow: (s) => m().instance.newWindowInternal(ut.BrowserWindow, s),
2110
2112
  on: (s, e) => m().instance.on(s, e),
@@ -2124,9 +2126,9 @@ function Wr() {
2124
2126
  }
2125
2127
  };
2126
2128
  }
2127
- function Qr() {
2129
+ function Wr() {
2128
2130
  return {
2129
- scope: (s) => Gr.getInstance().scope(s),
2131
+ scope: (s) => Tr.getInstance().scope(s),
2130
2132
  raw: {
2131
2133
  setGlobalMouseBlock: (s) => m().instance.setGlobalMouseBlock(s),
2132
2134
  setGlobalKeyboardBlock: (s) => m().instance.setGlobalKeyboardBlock(s),
@@ -2139,8 +2141,8 @@ function Qr() {
2139
2141
  }
2140
2142
  };
2141
2143
  }
2142
- function qr(s) {
2143
- P.getInstance().clientId = s.appName, P.getInstance().userId = vr.generateUniqueIdentifier(), I.getInstance().on("fatal", (e) => {
2144
+ function Qr(s) {
2145
+ P.getInstance().clientId = s.appName, P.getInstance().userId = br.generateUniqueIdentifier(), I.getInstance().on("fatal", (e) => {
2144
2146
  P.getInstance().track("fatal", {
2145
2147
  message: e.message,
2146
2148
  code: e.code,
@@ -2164,7 +2166,7 @@ function m() {
2164
2166
  return x.getInstance().getInterface("OGG_SIEGE");
2165
2167
  }
2166
2168
  export {
2167
- Ls as overlayed,
2168
- ws as setFetchLatestTokenCallback,
2169
- vs as setUpdaterTokenResolver
2169
+ Cs as overlayed,
2170
+ vs as setFetchLatestTokenCallback,
2171
+ bs as setUpdaterTokenResolver
2170
2172
  };
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.8.2",
5
+ "version": "0.8.4",
6
6
  "description": "Overlayed app",
7
7
  "license": "BSD-3-Clause",
8
8
  "repository": {
@@ -54,11 +54,11 @@
54
54
  "vite-plugin-dts": "^4.5.3",
55
55
  "vite-plugin-static-copy": "^2.3.1",
56
56
  "vitest": "^3.0.9",
57
+ "@overlayed/api": "0.0.3",
58
+ "@overlayed/cortex-client": "0.0.2",
59
+ "@overlayed/events": "0.0.2",
57
60
  "@overlayed/native-managers": "0.0.2",
58
61
  "@overlayed/siege": "0.0.2",
59
- "@overlayed/events": "0.0.2",
60
- "@overlayed/cortex-client": "0.0.2",
61
- "@overlayed/api": "0.0.3",
62
62
  "@overlayed/utils": "0.0.2"
63
63
  },
64
64
  "dependencies": {