@overlayed/app 0.7.0 → 0.7.1

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
@@ -379,7 +379,7 @@ declare interface RavenGame {
379
379
  version_pattern: string;
380
380
  }
381
381
 
382
- declare type RavenGameIdentifier = "siege";
382
+ declare type RavenGameIdentifier = "siege" | "valorant";
383
383
 
384
384
  export class RenderInterface {
385
385
  constructor(name: String, options?: { maxWindowCount?: number; eventQueueSize?: number; access?: AccessLevel }); // default: { maxWindowCount: 10, eventQueueSize: 200, access: AccessLevel.Default }
package/dist/index.js CHANGED
@@ -2,11 +2,11 @@ var rt = Object.defineProperty;
2
2
  var st = (s, e, t) => e in s ? rt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var l = (s, e, t) => st(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { type as L } from "arktype";
5
- import P, { mkdirSync as ce, existsSync as he, writeFileSync as ue, createWriteStream as Me, readdirSync as Oe, unlinkSync as Ae, readFileSync as $e, copyFileSync as nt } from "node:fs";
5
+ import P, { mkdirSync as ce, existsSync as he, writeFileSync as ue, createWriteStream as Me, readdirSync as Oe, unlinkSync as Ae, readFileSync as Re, copyFileSync as nt } from "node:fs";
6
6
  import y, { join as D, resolve as it } from "node:path";
7
7
  import { createRequire as Z } from "node:module";
8
8
  import w from "node:fs/promises";
9
- import Re from "jszip";
9
+ import $e from "jszip";
10
10
  import { createHash as at } from "node:crypto";
11
11
  import ot, { app as xe } from "electron";
12
12
  var lt = Object.defineProperty, ct = (s, e, t) => e in s ? lt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, b = (s, e, t) => ct(s, typeof e != "symbol" ? e + "" : e, t);
@@ -390,7 +390,7 @@ function E(s, ...e) {
390
390
  }
391
391
  }, l(r, "_instance"), r;
392
392
  }
393
- class kt extends pe {
393
+ class _t extends pe {
394
394
  destroy() {
395
395
  this.removeAllListeners();
396
396
  }
@@ -419,8 +419,8 @@ class kt extends pe {
419
419
  });
420
420
  }
421
421
  }
422
- const I = E(kt);
423
- class _t {
422
+ const I = E(_t);
423
+ class kt {
424
424
  constructor(e) {
425
425
  l(this, "data");
426
426
  l(this, "_schema");
@@ -749,7 +749,7 @@ class Ct extends Et {
749
749
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
750
750
  }
751
751
  }
752
- var O = "object", je = "function", Ve = "prototype", se = "text", be = "json", Pe = "abort", ne = "paramsSerializer", Se = "addEventListener", j = "status", _ = "headers", re = Object, K = void 0, Q = null, ie = re[Ve], J = re.keys, R = Array.isArray, Ce = "method", ze = "HEAD", ae = "GET", He = "OPTIONS", Lt = "POST", Kt = "PUT", Ft = "PATCH", Dt = "DELETE";
752
+ var O = "object", je = "function", Ve = "prototype", se = "text", be = "json", Pe = "abort", ne = "paramsSerializer", Se = "addEventListener", j = "status", k = "headers", re = Object, K = void 0, Q = null, ie = re[Ve], J = re.keys, $ = Array.isArray, Ce = "method", ze = "HEAD", ae = "GET", He = "OPTIONS", Lt = "POST", Kt = "PUT", Ft = "PATCH", Dt = "DELETE";
753
753
  function Mt(s, e) {
754
754
  let t = new AbortController();
755
755
  function r(a) {
@@ -787,14 +787,14 @@ var Le = re.getPrototypeOf, Ke = (s) => {
787
787
  }
788
788
  return !1;
789
789
  }, ve = (...s) => s.reduce((e, t) => {
790
- if (R(t)) throw new TypeError(`Arguments must be ${O}s, not arrays.`);
790
+ if ($(t)) throw new TypeError(`Arguments must be ${O}s, not arrays.`);
791
791
  return J(t).forEach((r) => {
792
- ["__proto__", "constructor", Ve].includes(r) || (R(e[r]) && R(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ke(e[r]) && Ke(t[r]) ? e[r] = ve(e[r], t[r]) : e[r] = t[r]);
792
+ ["__proto__", "constructor", Ve].includes(r) || ($(e[r]) && $(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ke(e[r]) && Ke(t[r]) ? e[r] = ve(e[r], t[r]) : e[r] = t[r]);
793
793
  }), e;
794
794
  }, {});
795
795
  function we(s, e = !0, t = Q, r) {
796
796
  if (s === K || s === Q) return "";
797
- let n = [], i = e ? encodeURIComponent : (f) => f, o = R(s), { arrayFormat: a, allowDots: c, serializeDate: u } = r || {}, d = (f) => {
797
+ let n = [], i = e ? encodeURIComponent : (f) => f, o = $(s), { arrayFormat: a, allowDots: c, serializeDate: u } = r || {}, d = (f) => {
798
798
  if (c && !o) return `.${f}`;
799
799
  if (o) {
800
800
  if (a === "brackets") return "[]";
@@ -815,7 +815,7 @@ function we(s, e = !0, t = Q, r) {
815
815
  return n.join("&");
816
816
  }
817
817
  function oe(s) {
818
- return R(s) ? s.map(oe) : (s && typeof s === O && J(s).forEach((e) => {
818
+ return $(s) ? s.map(oe) : (s && typeof s === O && J(s).forEach((e) => {
819
819
  let t = s[e];
820
820
  t === K ? delete s[e] : oe(t);
821
821
  }), s);
@@ -826,13 +826,13 @@ function Ot(s) {
826
826
  function At(s, e) {
827
827
  return s ? e ? (s.endsWith("/") ? s : s + "/") + (e[0] === "/" ? e.slice(1) : e) : s : e || "";
828
828
  }
829
- var $t = "XiorError", Rt = "XiorTimeoutError", Ue = class extends Error {
829
+ var Rt = "XiorError", $t = "XiorTimeoutError", Ue = class extends Error {
830
830
  constructor(s, e, t) {
831
- super(s), this.name = $t, this.request = e, this.config = e, this.response = t;
831
+ super(s), this.name = Rt, this.request = e, this.config = e, this.response = t;
832
832
  }
833
833
  }, xt = class extends Ue {
834
834
  constructor(e, t, r) {
835
- super(e, t, r), this.name = Rt;
835
+ super(e, t, r), this.name = $t;
836
836
  }
837
837
  }, Tt = Object.defineProperty, Gt = Object.defineProperties, Nt = Object.getOwnPropertyDescriptors, X = Object.getOwnPropertySymbols, We = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable, Fe = (s, e, t) => e in s ? Tt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, x = (s, e) => {
838
838
  for (var t in e || (e = {})) We.call(e, t) && Fe(s, t, e[t]);
@@ -865,12 +865,12 @@ function Ht(s = ae) {
865
865
  var Ut = typeof URLSearchParams != `${K}`;
866
866
  function Wt(s) {
867
867
  return T(this, null, function* () {
868
- let e = s[ne] || we, t = s.encodeURI !== !1, r = s[Ce] && s[Ce].toUpperCase(), n = s.url, i = n, o = Ut && s.data instanceof URLSearchParams, a = o ? re.fromEntries(s.data.entries()) : s.data, c = a, u = s != null && s[_] ? x({}, s[_]) : {}, d = s.params, f = Ht(r);
868
+ let e = s[ne] || we, t = s.encodeURI !== !1, r = s[Ce] && s[Ce].toUpperCase(), n = s.url, i = n, o = Ut && s.data instanceof URLSearchParams, a = o ? re.fromEntries(s.data.entries()) : s.data, c = a, u = s != null && s[k] ? x({}, s[k]) : {}, d = s.params, f = Ht(r);
869
869
  if (a && typeof a.append !== je) {
870
870
  let h = "", p = "content-type";
871
- if (s != null && s[_]) {
872
- let g = J(s[_]).find((k) => k.toLowerCase() === p);
873
- g && (p = g, h = s[_][g]);
871
+ if (s != null && s[k]) {
872
+ let g = J(s[k]).find((_) => _.toLowerCase() === p);
873
+ g && (p = g, h = s[k][g]);
874
874
  }
875
875
  (!h || o) && (h = f || o ? Qe : Vt, u[p] = h), typeof a === O && (f && d && (d = ve(a, d)), zt.test(h) ? c = JSON.stringify(oe(a)) : !f && jt.test(h) && (c = e(a)));
876
876
  }
@@ -878,7 +878,7 @@ function Wt(s) {
878
878
  let h = e(d, t);
879
879
  n += n.includes("?") ? `&${h}` : `?${h}`;
880
880
  }
881
- return W(x({}, s), { _data: c, _url: n, data: a, url: i, method: r, [_]: u, isGet: f });
881
+ return W(x({}, s), { _data: c, _url: n, data: a, url: i, method: r, [k]: u, isGet: f });
882
882
  });
883
883
  }
884
884
  var qt = typeof AbortController != `${K}`;
@@ -899,7 +899,7 @@ function Qt(s, e) {
899
899
  }
900
900
  var Jt = (s) => new M(s), M = class {
901
901
  constructor(e) {
902
- this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [_]: {} };
902
+ this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [k]: {} };
903
903
  }
904
904
  get interceptors() {
905
905
  return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
@@ -942,24 +942,24 @@ var Jt = (s) => new M(s), M = class {
942
942
  return T(this, null, function* () {
943
943
  let t = yield Wt(e), { url: r, method: n, headers: i, timeout: o, signal: a, data: c, _data: u, _url: d, isGet: f, fetch: h } = t, p = Bt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
944
944
  e._url = d;
945
- let g, k = [], N = K;
945
+ let g, _ = [], N = K;
946
946
  if (o && qt) {
947
947
  let v = new AbortController();
948
948
  N = setTimeout(() => {
949
949
  v.abort(new xt(`timeout of ${o}ms exceeded`, e));
950
- }, o), k.push(v.signal);
950
+ }, o), _.push(v.signal);
951
951
  }
952
- a && k.push(a), g = k[0], k.length > 1 && (g = Mt(k, () => {
952
+ a && _.push(a), g = _[0], _.length > 1 && (g = Mt(_, () => {
953
953
  clearTimeout(N);
954
954
  }));
955
- let B = d || r, ke = "baseURL";
956
- return e[ke] && !Ot(B) && (B = At(e[ke], B)), (h || fetch)(B, W(x({ body: f ? K : u }, p), { signal: g, method: n, headers: i })).then((v) => T(this, null, function* () {
957
- let { responseType: et } = e, _e = { data: yield Qt(v, et), response: v, config: e, request: e, [j]: v[j], statusText: v.statusText, [_]: v[_] };
955
+ let B = d || r, _e = "baseURL";
956
+ return e[_e] && !Ot(B) && (B = At(e[_e], B)), (h || fetch)(B, W(x({ body: f ? K : u }, p), { signal: g, method: n, headers: i })).then((v) => T(this, null, function* () {
957
+ let { responseType: et } = e, ke = { data: yield Qt(v, et), response: v, config: e, request: e, [j]: v[j], statusText: v.statusText, [k]: v[k] };
958
958
  if (!v.ok) {
959
- let tt = new Ue(v[j] ? `Request failed with status code ${v[j]}` : "Network error", e, _e);
959
+ let tt = new Ue(v[j] ? `Request failed with status code ${v[j]}` : "Network error", e, ke);
960
960
  return Promise.reject(tt);
961
961
  }
962
- return _e;
962
+ return ke;
963
963
  })).finally(() => {
964
964
  var v;
965
965
  N && clearTimeout(N), (v = g == null ? void 0 : g.clear) == null || v.call(g);
@@ -1085,7 +1085,7 @@ class ar extends te {
1085
1085
  async downloadAndExtractDll(t, r, n, i) {
1086
1086
  const { data: o } = await Zt(t, n), a = this.getTargetPath(t), c = this.getTargetVersionPath(t, r);
1087
1087
  await w.mkdir(c, { recursive: !0 });
1088
- const u = new Re();
1088
+ const u = new $e();
1089
1089
  await u.loadAsync(o);
1090
1090
  const d = Object.keys(u.files).map(async (h) => {
1091
1091
  const p = u.files[h];
@@ -1098,8 +1098,8 @@ class ar extends te {
1098
1098
  } catch {
1099
1099
  this.logger.warn(`${t} > File missing, re-downloading: ${g}`);
1100
1100
  }
1101
- const k = await p.async("nodebuffer");
1102
- await w.writeFile(g, k);
1101
+ const _ = await p.async("nodebuffer");
1102
+ await w.writeFile(g, _);
1103
1103
  }
1104
1104
  });
1105
1105
  await Promise.all(d);
@@ -1143,17 +1143,28 @@ class or extends te {
1143
1143
  }
1144
1144
  async fetchRavenConfig() {
1145
1145
  try {
1146
- const t = await er();
1147
- this._ravenConfig = t.data, this.resetState();
1148
- const r = /* @__PURE__ */ new Set();
1149
- for (const n of this._ravenConfig.games) {
1150
- for (const i of n.executables) {
1151
- const o = i.toLowerCase();
1152
- this._executableToGameMap.set(o, n), this._executablesArray.push(o);
1146
+ const r = {
1147
+ games: [
1148
+ ...(await er()).data.games,
1149
+ {
1150
+ name: "Valorant",
1151
+ identifier: "valorant",
1152
+ executables: ["VALORANT-Win64-Shipping.exe"],
1153
+ dlls_to_inject: [],
1154
+ version_pattern: ""
1155
+ }
1156
+ ]
1157
+ };
1158
+ this._ravenConfig = r, this.resetState();
1159
+ const n = /* @__PURE__ */ new Set();
1160
+ for (const i of this._ravenConfig.games) {
1161
+ for (const o of i.executables) {
1162
+ const a = o.toLowerCase();
1163
+ this._executableToGameMap.set(a, i), this._executablesArray.push(a);
1153
1164
  }
1154
- n.dlls_to_inject.forEach((i) => r.add(i));
1165
+ i.dlls_to_inject.forEach((o) => n.add(o));
1155
1166
  }
1156
- await Y.getInstance().initWithDlls(Array.from(r)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1167
+ await Y.getInstance().initWithDlls(Array.from(n)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1157
1168
  } catch (t) {
1158
1169
  this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
1159
1170
  }
@@ -1282,7 +1293,7 @@ class wr {
1282
1293
  }
1283
1294
  }
1284
1295
  const S = E(wr), Ir = Z(import.meta.url), Er = Ir.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1285
- class kr extends Ct {
1296
+ class _r extends Ct {
1286
1297
  constructor() {
1287
1298
  super("GameLaunchManager");
1288
1299
  l(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
@@ -1364,7 +1375,7 @@ class kr extends Ct {
1364
1375
  this.logger.debug("Copying", n, "to", o);
1365
1376
  try {
1366
1377
  he(i) || ce(i, { recursive: !0 });
1367
- const a = $e(n);
1378
+ const a = Re(n);
1368
1379
  ue(o, a), nt(n, o);
1369
1380
  } catch (a) {
1370
1381
  return a.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", a), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: o }), !1);
@@ -1395,17 +1406,17 @@ class kr extends Ct {
1395
1406
  return r;
1396
1407
  }
1397
1408
  }
1398
- const $ = E(kr);
1399
- class _r extends Be {
1409
+ const R = E(_r);
1410
+ class kr extends Be {
1400
1411
  constructor() {
1401
1412
  super("GameBuildManager");
1402
1413
  l(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
1403
1414
  }
1404
1415
  init() {
1405
- super.init(), $.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1416
+ super.init(), R.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1406
1417
  }
1407
1418
  destroy() {
1408
- $.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1419
+ R.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1409
1420
  }
1410
1421
  async onGameLaunch(t) {
1411
1422
  const { ravenGame: r, process: n } = t;
@@ -1417,7 +1428,7 @@ class _r extends Be {
1417
1428
  );
1418
1429
  return;
1419
1430
  }
1420
- const i = $e(n.path), o = at("sha256").update(i).digest("hex");
1431
+ const i = Re(n.path), o = at("sha256").update(i).digest("hex");
1421
1432
  this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", o);
1422
1433
  let a = !1;
1423
1434
  try {
@@ -1430,7 +1441,7 @@ class _r extends Be {
1430
1441
  this.logger.log("Build hash already exists, skipping upload");
1431
1442
  return;
1432
1443
  }
1433
- const c = new Re();
1444
+ const c = new $e();
1434
1445
  c.file(n.name, i);
1435
1446
  const u = await c.generateAsync({ type: "blob" });
1436
1447
  try {
@@ -1440,7 +1451,7 @@ class _r extends Be {
1440
1451
  }
1441
1452
  }
1442
1453
  }
1443
- const Ze = E(_r);
1454
+ const Ze = E(kr);
1444
1455
  function Pr(s = []) {
1445
1456
  return y.normalize(y.join(Ge(global.OVERLAYED.APP_NAME), ...s));
1446
1457
  }
@@ -1660,7 +1671,7 @@ class Lr extends te {
1660
1671
  l(this, "keybindsFile");
1661
1672
  // TODO try to figure out a better way to handle this
1662
1673
  l(this, "keybindListeningPaused", !1);
1663
- this.keybindsFile = new _t({
1674
+ this.keybindsFile = new kt({
1664
1675
  path: Pr(["keybinds.json"]),
1665
1676
  schema: Cr,
1666
1677
  default: t
@@ -1809,8 +1820,8 @@ function ms(s) {
1809
1820
  return U;
1810
1821
  function t() {
1811
1822
  Nr(s);
1812
- const r = /* @__PURE__ */ new Map(), n = Ar(s.modules, r), i = $r(), o = xr(s.keybinds), a = Tr(), c = Gr();
1813
- Mr(s), Rr(s, r), H = !0, U = {
1823
+ const r = /* @__PURE__ */ new Map(), n = Ar(s.modules, r), i = Rr(), o = xr(s.keybinds), a = Tr(), c = Gr();
1824
+ Mr(s), $r(s, r), H = !0, U = {
1814
1825
  ...n,
1815
1826
  ...i,
1816
1827
  keybinds: o,
@@ -1846,12 +1857,12 @@ function Dr(s) {
1846
1857
  }
1847
1858
  function Mr(s) {
1848
1859
  const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
1849
- $.getInstance().setSubscribedGames(e), Ze.getInstance().init(), $.getInstance().init(), C.getInstance().init(), G.getInstance().init(), xe.on("quit", () => {
1860
+ R.getInstance().setSubscribedGames(e), Ze.getInstance().init(), R.getInstance().init(), C.getInstance().init(), G.getInstance().init(), xe.on("quit", () => {
1850
1861
  Or();
1851
1862
  });
1852
1863
  }
1853
1864
  function Or() {
1854
- G.getInstance().destroy(), $.getInstance().destroy(), Ze.getInstance().destroy(), C.getInstance().destroy(), A.getInstance().getInterface("OGG_SIEGE").destroy(), fe.getInstance().destroy(), I.getInstance().destroy();
1865
+ G.getInstance().destroy(), R.getInstance().destroy(), Ze.getInstance().destroy(), C.getInstance().destroy(), A.getInstance().getInterface("OGG_SIEGE").destroy(), fe.getInstance().destroy(), I.getInstance().destroy();
1855
1866
  }
1856
1867
  function Ar(s, e) {
1857
1868
  return s.reduce((t, r) => {
@@ -1879,8 +1890,8 @@ function Ar(s, e) {
1879
1890
  }, t;
1880
1891
  }, {});
1881
1892
  }
1882
- function $r() {
1883
- const s = I.getInstance(), e = $.getInstance();
1893
+ function Rr() {
1894
+ const s = I.getInstance(), e = R.getInstance();
1884
1895
  return {
1885
1896
  on: (t, r) => {
1886
1897
  switch (t) {
@@ -1935,7 +1946,7 @@ function $r() {
1935
1946
  function F(s, e) {
1936
1947
  return `${s}:${e}`;
1937
1948
  }
1938
- function Rr(s, e) {
1949
+ function $r(s, e) {
1939
1950
  const t = fe.getInstance();
1940
1951
  function r(n) {
1941
1952
  const i = Sr(n);
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.7.0",
5
+ "version": "0.7.1",
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/events": "0.0.2",
57
58
  "@overlayed/api": "0.0.3",
58
- "@overlayed/cortex-client": "0.0.2",
59
59
  "@overlayed/native-managers": "0.0.2",
60
- "@overlayed/events": "0.0.2",
61
60
  "@overlayed/siege": "0.0.2",
61
+ "@overlayed/cortex-client": "0.0.2",
62
62
  "@overlayed/utils": "0.0.2"
63
63
  },
64
64
  "dependencies": {