@edgemodders/edgedeck-mcp 0.29.1 → 0.29.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.
Files changed (3) hide show
  1. package/dist/core.js +34 -14
  2. package/dist/mcp.js +21 -2
  3. package/package.json +1 -1
package/dist/core.js CHANGED
@@ -4330,8 +4330,8 @@ function rednodeManifest(placements) {
4330
4330
  function singleRednodeApp(paths) {
4331
4331
  const manifests = paths.filter((f) => /^red4ext\/plugins\/REDnode\/apps\/[^/]+\/rednode-app\.json$/i.test(f));
4332
4332
  if (manifests.length !== 1) return void 0;
4333
- if (paths.some((f) => /^red4ext\/plugins\/REDnode\//i.test(f) && !/^red4ext\/plugins\/REDnode\/apps\//i.test(f))) return void 0;
4334
- return manifests[0];
4333
+ const folder = manifests[0].slice(0, -"rednode-app.json".length).toLowerCase();
4334
+ return paths.every((f) => f.toLowerCase().startsWith(folder)) ? manifests[0] : void 0;
4335
4335
  }
4336
4336
  function rednodeId(manifest) {
4337
4337
  try {
@@ -5112,11 +5112,11 @@ function families(lib) {
5112
5112
  for (const [key2, mods] of byKey) {
5113
5113
  const sorted = [...mods].sort(newestFirst);
5114
5114
  const active = sorted.find((m) => m.enabled) ?? sorted[0];
5115
- const newest2 = sorted[0];
5115
+ const newest = sorted[0];
5116
5116
  let update;
5117
5117
  for (const m of mods) {
5118
5118
  const latest = m.nexus?.latestVersion;
5119
- if (latest && versionNewer(latest, newest2.version) && (!update || versionNewer(latest, update.version))) update = { version: latest, fileId: m.nexus?.latestFileId };
5119
+ if (latest && versionNewer(latest, newest.version) && (!update || versionNewer(latest, update.version))) update = { version: latest, fileId: m.nexus?.latestFileId };
5120
5120
  }
5121
5121
  out.push({ key: key2, name: active.name, nexusId: active.source.modId ?? mods.find((m) => m.source.modId)?.source.modId, mods: sorted, active, on: mods.some((m) => m.enabled), update });
5122
5122
  }
@@ -5266,8 +5266,8 @@ async function frameworkStates(lib, fetchImpl, api) {
5266
5266
  const family = frameworkFamily(lib, source);
5267
5267
  try {
5268
5268
  const release = await latestFrameworkRelease(source, fetchImpl, api);
5269
- const newest2 = family?.mods[0]?.version ?? "";
5270
- return { source, family, release, wanted: !family || !!newest2 && versionNewer(release.version, newest2) };
5269
+ const newest = family?.mods[0]?.version ?? "";
5270
+ return { source, family, release, wanted: !family || !!newest && versionNewer(release.version, newest) };
5271
5271
  } catch (err) {
5272
5272
  return { source, family, error: err instanceof Error ? err.message : String(err), wanted: !family };
5273
5273
  }
@@ -5847,6 +5847,7 @@ function describeHandler(command) {
5847
5847
  }
5848
5848
 
5849
5849
  // src/project.ts
5850
+ var import_node_crypto = require("node:crypto");
5850
5851
  var fs11 = __toESM(require("node:fs"));
5851
5852
  var path10 = __toESM(require("node:path"));
5852
5853
  function addToProject(lib, mod, files, projectFile, replace = /* @__PURE__ */ new Set()) {
@@ -5898,13 +5899,22 @@ function classifyProject(projectFile) {
5898
5899
  if (!fs11.existsSync(packed)) return { placements: [], kinds: [], unplaced: [], ignored: [] };
5899
5900
  return classify(packed, projectName(projectFile));
5900
5901
  }
5901
- function newest(dir) {
5902
- let t = 0;
5903
- for (const e of fs11.readdirSync(dir, { withFileTypes: true })) {
5904
- const p = path10.join(dir, e.name);
5905
- t = Math.max(t, e.isDirectory() ? newest(p) : fs11.statSync(p).mtimeMs);
5906
- }
5907
- return t;
5902
+ function packedState(dir) {
5903
+ let newest = 0;
5904
+ const files = [];
5905
+ const walk2 = (d, rel) => {
5906
+ for (const e of fs11.readdirSync(d, { withFileTypes: true })) {
5907
+ const p = path10.join(d, e.name);
5908
+ const r = rel ? `${rel}/${e.name}` : e.name;
5909
+ if (e.isDirectory()) walk2(p, r);
5910
+ else {
5911
+ newest = Math.max(newest, fs11.statSync(p).mtimeMs);
5912
+ files.push(r.toLowerCase());
5913
+ }
5914
+ }
5915
+ };
5916
+ walk2(dir, "");
5917
+ return { newest, list: (0, import_node_crypto.createHash)("sha1").update(files.sort().join("\n")).digest("hex").slice(0, 16) };
5908
5918
  }
5909
5919
  function syncProjects(lib) {
5910
5920
  const refreshed = [];
@@ -5919,7 +5929,15 @@ function syncProjects(lib) {
5919
5929
  return t;
5920
5930
  }
5921
5931
  }, 0);
5922
- if (newest(packed) <= libNewest + 1e3) continue;
5932
+ const state = packedState(packed);
5933
+ const listChanged = mod.packedList !== void 0 && mod.packedList !== state.list;
5934
+ if (state.newest <= libNewest + 1e3 && !listChanged) {
5935
+ if (mod.packedList === void 0) {
5936
+ mod.packedList = state.list;
5937
+ saveMod(lib, mod);
5938
+ }
5939
+ continue;
5940
+ }
5923
5941
  const c = classifyProject(mod.source.path);
5924
5942
  if (!c.placements.length) continue;
5925
5943
  const keep = /* @__PURE__ */ new Set();
@@ -5932,6 +5950,7 @@ function syncProjects(lib) {
5932
5950
  for (const f of mod.files) if (!keep.has(f)) fs11.rmSync(sourcePath(lib, mod, f), { force: true });
5933
5951
  mod.files = [...keep].sort();
5934
5952
  mod.kinds = c.kinds;
5953
+ mod.packedList = state.list;
5935
5954
  saveMod(lib, mod);
5936
5955
  refreshed.push(mod);
5937
5956
  }
@@ -5992,6 +6011,7 @@ function installProject(lib, projectFile, beside) {
5992
6011
  for (const f of existing.files) if (!keep.has(f)) fs11.rmSync(sourcePath(lib, existing, f), { force: true });
5993
6012
  existing.files = [...keep].sort();
5994
6013
  existing.kinds = c.kinds;
6014
+ existing.packedList = packedState(packedFolder(projectFile)).list;
5995
6015
  activateVersion(lib, existing);
5996
6016
  existing.enabled = true;
5997
6017
  saveMod(lib, existing);
package/dist/mcp.js CHANGED
@@ -36679,8 +36679,8 @@ function rednodeManifest(placements) {
36679
36679
  function singleRednodeApp(paths) {
36680
36680
  const manifests = paths.filter((f) => /^red4ext\/plugins\/REDnode\/apps\/[^/]+\/rednode-app\.json$/i.test(f));
36681
36681
  if (manifests.length !== 1) return void 0;
36682
- if (paths.some((f) => /^red4ext\/plugins\/REDnode\//i.test(f) && !/^red4ext\/plugins\/REDnode\/apps\//i.test(f))) return void 0;
36683
- return manifests[0];
36682
+ const folder = manifests[0].slice(0, -"rednode-app.json".length).toLowerCase();
36683
+ return paths.every((f) => f.toLowerCase().startsWith(folder)) ? manifests[0] : void 0;
36684
36684
  }
36685
36685
  function rednodeId(manifest) {
36686
36686
  try {
@@ -37719,6 +37719,7 @@ function importLoadout(lib, file2) {
37719
37719
  }
37720
37720
 
37721
37721
  // src/project.ts
37722
+ var import_node_crypto = require("node:crypto");
37722
37723
  var fs7 = __toESM(require("node:fs"));
37723
37724
  var path7 = __toESM(require("node:path"));
37724
37725
  function projectName(projectFile) {
@@ -37738,6 +37739,23 @@ function classifyProject(projectFile) {
37738
37739
  if (!fs7.existsSync(packed)) return { placements: [], kinds: [], unplaced: [], ignored: [] };
37739
37740
  return classify(packed, projectName(projectFile));
37740
37741
  }
37742
+ function packedState(dir) {
37743
+ let newest = 0;
37744
+ const files = [];
37745
+ const walk2 = (d, rel) => {
37746
+ for (const e of fs7.readdirSync(d, { withFileTypes: true })) {
37747
+ const p = path7.join(d, e.name);
37748
+ const r = rel ? `${rel}/${e.name}` : e.name;
37749
+ if (e.isDirectory()) walk2(p, r);
37750
+ else {
37751
+ newest = Math.max(newest, fs7.statSync(p).mtimeMs);
37752
+ files.push(r.toLowerCase());
37753
+ }
37754
+ }
37755
+ };
37756
+ walk2(dir, "");
37757
+ return { newest, list: (0, import_node_crypto.createHash)("sha1").update(files.sort().join("\n")).digest("hex").slice(0, 16) };
37758
+ }
37741
37759
  function projectMod(lib, projectFile) {
37742
37760
  return lib.mods.find((m) => m.source.type === "project" && m.source.path?.toLowerCase() === projectFile.toLowerCase());
37743
37761
  }
@@ -37793,6 +37811,7 @@ function installProject(lib, projectFile, beside) {
37793
37811
  for (const f of existing.files) if (!keep.has(f)) fs7.rmSync(sourcePath(lib, existing, f), { force: true });
37794
37812
  existing.files = [...keep].sort();
37795
37813
  existing.kinds = c.kinds;
37814
+ existing.packedList = packedState(packedFolder(projectFile)).list;
37796
37815
  activateVersion(lib, existing);
37797
37816
  existing.enabled = true;
37798
37817
  saveMod(lib, existing);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgemodders/edgedeck-mcp",
3
- "version": "0.29.1",
3
+ "version": "0.29.2",
4
4
  "description": "EDGEdeck's MCP server and command line: manage Cyberpunk 2077 mods (add, turn on or off, order, deploy, undo, conflicts, loadouts) from an AI assistant or a script.",
5
5
  "license": "MIT",
6
6
  "author": "Edgemodders",