mcp-efficiency-engine 0.1.2 → 0.1.3

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.
@@ -30,6 +30,55 @@ jobs:
30
30
  run: py -3 -m scripts.wiki.wiki_compiler
31
31
  shell: pwsh
32
32
 
33
+ - name: Ensure npm README is updated when package surface changes
34
+ shell: pwsh
35
+ env:
36
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
37
+ run: |
38
+ $script = @'
39
+ const fs = require("node:fs");
40
+ const { execSync } = require("node:child_process");
41
+
42
+ const baseSha = process.env.BASE_SHA;
43
+ if (!baseSha) {
44
+ console.log("BASE_SHA is not available; skipping npm README check.");
45
+ process.exit(0);
46
+ }
47
+
48
+ const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
49
+ const publishEntries = (pkg.files || []).map((entry) =>
50
+ entry.startsWith("./") ? entry.slice(2) : entry
51
+ );
52
+
53
+ const changed = execSync("git diff --name-only " + baseSha + "...HEAD", { encoding: "utf8" })
54
+ .split(/\r?\n/)
55
+ .map((line) => line.trim())
56
+ .filter(Boolean);
57
+
58
+ const readmeChanged = changed.includes("README.md");
59
+ const isNpmRelevant = (file) =>
60
+ file === "package.json" ||
61
+ file === "package-lock.json" ||
62
+ publishEntries.some((entry) => (entry.endsWith("/") ? file.startsWith(entry) : file === entry));
63
+
64
+ const npmRelevantChanges = changed.filter((file) => file !== "README.md" && isNpmRelevant(file));
65
+ if (npmRelevantChanges.length > 0 && !readmeChanged) {
66
+ console.error("Detected npm-impacting changes without README.md update.");
67
+ console.error("npm-impacting files:");
68
+ for (const file of npmRelevantChanges) console.error("- " + file);
69
+ console.error("Please update README.md (npm docs) in the same PR.");
70
+ process.exit(1);
71
+ }
72
+
73
+ if (npmRelevantChanges.length > 0) {
74
+ console.log("npm-impacting changes detected and README.md was updated.");
75
+ } else {
76
+ console.log("No npm-impacting changes detected.");
77
+ }
78
+ '@
79
+
80
+ node -e $script
81
+
33
82
  - name: Validate generated artifacts are committed
34
83
  shell: pwsh
35
84
  run: |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-efficiency-engine",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Motor de orquestacion para agentes MCP con routing por dominio y bootstrap portable.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",